Skip to content

Commit

Permalink
ASIX: Use only 11 bits of header for data size
Browse files Browse the repository at this point in the history
The AX88772B uses only 11 bits of the header for the actual size. The other bits
are used for something else. This causes dmesg full of messages:

	asix_rx_fixup() Bad Header Length

This patch trims the check to only 11 bits. I believe on older chips, the
remaining 5 top bits are unused.

Signed-off-by: Marek Vasut <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
marex authored and davem330 committed Jul 28, 2011
1 parent bc466e6 commit bca0beb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
skb_pull(skb, 4);

while (skb->len > 0) {
if ((header & 0xffff) != ((~header >> 16) & 0xffff))
if ((header & 0x07ff) != ((~header >> 16) & 0x07ff))
netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n");

/* get the packet length */
size = (u16) (header & 0x0000ffff);
size = (u16) (header & 0x000007ff);

if ((skb->len) - ((size + 1) & 0xfffe) == 0) {
u8 alignment = (unsigned long)skb->data & 0x3;
Expand Down

0 comments on commit bca0beb

Please sign in to comment.