Skip to content

Commit

Permalink
dm9601: HW header size shouldn't be included in packet length
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Korsgaard authored and Jeff Garzik committed Jul 2, 2007
1 parent 983b7dc commit 23de559
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 23de559

Please sign in to comment.