diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2007-06-27 02:14:50 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-02 08:24:51 -0400 |
commit | 23de559b8d3537f972f325e7e015c18aa2e4d987 (patch) | |
tree | c4af26b642ede3383b5d814c14e7094ce1fb600c /drivers | |
parent | 983b7dc07f083d7d78f408a6f841b399b954767d (diff) |
dm9601: HW header size shouldn't be included in packet length
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/dm9601.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index a67638601477..ac200b0f6a92 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -489,6 +489,8 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
489 | b3..n: packet data | 489 | b3..n: packet data |
490 | */ | 490 | */ |
491 | 491 | ||
492 | len = skb->len; | ||
493 | |||
492 | if (skb_headroom(skb) < DM_TX_OVERHEAD) { | 494 | if (skb_headroom(skb) < DM_TX_OVERHEAD) { |
493 | struct sk_buff *skb2; | 495 | struct sk_buff *skb2; |
494 | 496 | ||
@@ -501,10 +503,9 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
501 | 503 | ||
502 | __skb_push(skb, DM_TX_OVERHEAD); | 504 | __skb_push(skb, DM_TX_OVERHEAD); |
503 | 505 | ||
504 | len = skb->len; | ||
505 | /* usbnet adds padding if length is a multiple of packet size | 506 | /* usbnet adds padding if length is a multiple of packet size |
506 | if so, adjust length value in header */ | 507 | if so, adjust length value in header */ |
507 | if ((len % dev->maxpacket) == 0) | 508 | if ((skb->len % dev->maxpacket) == 0) |
508 | len++; | 509 | len++; |
509 | 510 | ||
510 | skb->data[0] = len; | 511 | skb->data[0] = len; |