Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253862
b: refs/heads/master
c: 2331038
h: refs/heads/master
v: v3
  • Loading branch information
Richard Cochran authored and David S. Miller committed Jun 17, 2011
1 parent 7809911 commit 5630867
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1dc045e685ea5424b3445c1ccaa0a25b3d661ec
refs/heads/master: 2331038a96ecdad76c50ab223fd48d656d8a1184
20 changes: 15 additions & 5 deletions trunk/drivers/net/phy/dp83640.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,20 @@ static void recalibrate(struct dp83640_clock *clock)

/* time stamping methods */

static void decode_evnt(struct dp83640_private *dp83640,
struct phy_txts *phy_txts, u16 ests)
static int decode_evnt(struct dp83640_private *dp83640,
void *data, u16 ests)
{
struct phy_txts *phy_txts;
struct ptp_clock_event event;
int words = (ests >> EVNT_TS_LEN_SHIFT) & EVNT_TS_LEN_MASK;
u16 ext_status = 0;

if (ests & MULT_EVNT) {
ext_status = *(u16 *) data;
data += sizeof(ext_status);
}

phy_txts = data;

switch (words) { /* fall through in every case */
case 3:
Expand All @@ -565,6 +574,9 @@ static void decode_evnt(struct dp83640_private *dp83640,
event.timestamp = phy2txts(&dp83640->edata);

ptp_clock_event(dp83640->clock->ptp_clock, &event);

words = ext_status ? words + 2 : words + 1;
return words * sizeof(u16);
}

static void decode_rxts(struct dp83640_private *dp83640,
Expand Down Expand Up @@ -643,9 +655,7 @@ static void decode_status_frame(struct dp83640_private *dp83640,

} else if (PSF_EVNT == type && len >= sizeof(*phy_txts)) {

phy_txts = (struct phy_txts *) ptr;
decode_evnt(dp83640, phy_txts, ests);
size = sizeof(*phy_txts);
size = decode_evnt(dp83640, ptr, ests);

} else {
size = 0;
Expand Down

0 comments on commit 5630867

Please sign in to comment.