]> err.no Git - linux-2.6/commitdiff
dm9601: HW header size shouldn't be included in packet length
authorPeter Korsgaard <jacmet@sunsite.dk>
Wed, 27 Jun 2007 06:14:50 +0000 (08:14 +0200)
committerJeff Garzik <jeff@garzik.org>
Mon, 2 Jul 2007 12:24:51 +0000 (08:24 -0400)
The dm9601 driver was including the 2 byte hardware header in the
packet length, causing the HW to send 2 extra bytes of garbage on tx.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/usb/dm9601.c

index a67638601477f8801dbf8e5c18ea35e5f476a86a..ac200b0f6a923d124f31d80ced0b07ddfaeba129 100644 (file)
@@ -489,6 +489,8 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
           b3..n: packet data
        */
 
+       len = skb->len;
+
        if (skb_headroom(skb) < DM_TX_OVERHEAD) {
                struct sk_buff *skb2;
 
@@ -501,10 +503,9 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
 
        __skb_push(skb, DM_TX_OVERHEAD);
 
-       len = skb->len;
        /* usbnet adds padding if length is a multiple of packet size
           if so, adjust length value in header */
-       if ((len % dev->maxpacket) == 0)
+       if ((skb->len % dev->maxpacket) == 0)
                len++;
 
        skb->data[0] = len;