aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 12:25:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 12:25:16 -0400
commitbe90a49ca22a95f184d9f32d35b5247b44032849 (patch)
treed3c2edc18c003c384366f57901616ac29c80bc27 /drivers/net
parent1f0918d03ff4b5c94540c71ce889672abdbc2f4a (diff)
parenta87371b477774b290c27bc5cb7f4ccc5379574a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (142 commits) USB: Fix sysfs paths in documentation USB: skeleton: fix coding style issues. USB: O_NONBLOCK in read path of skeleton USB: make usb-skeleton honor O_NONBLOCK in write path USB: skel_read really sucks royally USB: Add hub descriptor update hook for xHCI USB: xhci: Support USB hubs. USB: xhci: Set multi-TT field for LS/FS devices under hubs. USB: xhci: Set route string for all devices. USB: xhci: Fix command wait list handling. USB: xhci: Change how xHCI commands are handled. USB: xhci: Refactor input device context setup. USB: xhci: Endpoint representation refactoring. USB: gadget: ether needs to select CRC32 USB: fix USBTMC get_capabilities success handling USB: fix missing error check in probing USB: usbfs: add USBDEVFS_URB_BULK_CONTINUATION flag USB: support for autosuspend in sierra while online USB: ehci-dbgp,ehci: Allow dbpg to work with suspend/resume USB: ehci-dbgp,documentation: Documentation updates for ehci-dbgp ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/cdc_eem.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 45cebfb302cf..23300656c266 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -300,20 +300,23 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
300 return 0; 300 return 0;
301 } 301 }
302 302
303 crc = get_unaligned_le32(skb2->data
304 + len - ETH_FCS_LEN);
305 skb_trim(skb2, len - ETH_FCS_LEN);
306
307 /* 303 /*
308 * The bmCRC helps to denote when the CRC field in 304 * The bmCRC helps to denote when the CRC field in
309 * the Ethernet frame contains a calculated CRC: 305 * the Ethernet frame contains a calculated CRC:
310 * bmCRC = 1 : CRC is calculated 306 * bmCRC = 1 : CRC is calculated
311 * bmCRC = 0 : CRC = 0xDEADBEEF 307 * bmCRC = 0 : CRC = 0xDEADBEEF
312 */ 308 */
313 if (header & BIT(14)) 309 if (header & BIT(14)) {
314 crc2 = ~crc32_le(~0, skb2->data, skb2->len); 310 crc = get_unaligned_le32(skb2->data
315 else 311 + len - ETH_FCS_LEN);
312 crc2 = ~crc32_le(~0, skb2->data, skb2->len
313 - ETH_FCS_LEN);
314 } else {
315 crc = get_unaligned_be32(skb2->data
316 + len - ETH_FCS_LEN);
316 crc2 = 0xdeadbeef; 317 crc2 = 0xdeadbeef;
318 }
319 skb_trim(skb2, len - ETH_FCS_LEN);
317 320
318 if (is_last) 321 if (is_last)
319 return crc == crc2; 322 return crc == crc2;