Commit 23de559b authored by Peter Korsgaard's avatar Peter Korsgaard Committed by Jeff Garzik

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: default avatarPeter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 983b7dc0
...@@ -489,6 +489,8 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb, ...@@ -489,6 +489,8 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
b3..n: packet data b3..n: packet data
*/ */
len = skb->len;
if (skb_headroom(skb) < DM_TX_OVERHEAD) { if (skb_headroom(skb) < DM_TX_OVERHEAD) {
struct sk_buff *skb2; struct sk_buff *skb2;
...@@ -501,10 +503,9 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb, ...@@ -501,10 +503,9 @@ static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
__skb_push(skb, DM_TX_OVERHEAD); __skb_push(skb, DM_TX_OVERHEAD);
len = skb->len;
/* usbnet adds padding if length is a multiple of packet size /* usbnet adds padding if length is a multiple of packet size
if so, adjust length value in header */ if so, adjust length value in header */
if ((len % dev->maxpacket) == 0) if ((skb->len % dev->maxpacket) == 0)
len++; len++;
skb->data[0] = len; skb->data[0] = len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment