Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165001
b: refs/heads/master
c: 9ca33a0
h: refs/heads/master
i:
  164999: 3e69782
v: v3
  • Loading branch information
Brian Niebuhr authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent 9476bed commit 1d2b089
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 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: 5429c7316577fcd859f6b53e10884bb8e1e3bcef
refs/heads/master: 9ca33a0f1abdefea3811666d9e87af11fd0af6c6
17 changes: 10 additions & 7 deletions trunk/drivers/net/usb/cdc_eem.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,20 +300,23 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
return 0;
}

crc = get_unaligned_le32(skb2->data
+ len - ETH_FCS_LEN);
skb_trim(skb2, len - ETH_FCS_LEN);

/*
* The bmCRC helps to denote when the CRC field in
* the Ethernet frame contains a calculated CRC:
* bmCRC = 1 : CRC is calculated
* bmCRC = 0 : CRC = 0xDEADBEEF
*/
if (header & BIT(14))
crc2 = ~crc32_le(~0, skb2->data, skb2->len);
else
if (header & BIT(14)) {
crc = get_unaligned_le32(skb2->data
+ len - ETH_FCS_LEN);
crc2 = ~crc32_le(~0, skb2->data, skb2->len
- ETH_FCS_LEN);
} else {
crc = get_unaligned_be32(skb2->data
+ len - ETH_FCS_LEN);
crc2 = 0xdeadbeef;
}
skb_trim(skb2, len - ETH_FCS_LEN);

if (is_last)
return crc == crc2;
Expand Down

0 comments on commit 1d2b089

Please sign in to comment.