From: Philipp Zabel <philipp.zabel@gmail.com>
To: barebox@lists.infradead.org
Cc: Marek Vasut <marek.vasut@gmail.com>
Subject: [PATCH 2/4] net usb asix: Use only 11 bits of header for data size
Date: Wed, 22 Jan 2014 23:50:47 +0100 [thread overview]
Message-ID: <1390431049-4236-3-git-send-email-philipp.zabel@gmail.com> (raw)
In-Reply-To: <1390431049-4236-1-git-send-email-philipp.zabel@gmail.com>
From: Marek Vasut <marek.vasut@gmail.com>
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 <marek.vasut@gmail.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
---
drivers/net/usb/asix.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 8b73bf9..003ebba 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -408,11 +408,11 @@ static int asix_rx_fixup(struct usbnet *dev, void *buf, int len)
len -= 4;
while (len > 0) {
- if ((header & 0xffff) != ((~header >> 16) & 0xffff))
+ if ((header & 0x07ff) != ((~header >> 16) & 0x07ff))
dev_err(&dev->edev.dev, "asix_rx_fixup() Bad Header Length\n");
/* get the packet length */
- size = (unsigned short) (header & 0x0000ffff);
+ size = (unsigned short) (header & 0x07ff);
if (size > 1514) {
dev_err(&dev->edev.dev, "asix_rx_fixup() Bad RX Length %d\n", size);
--
1.8.5.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-01-22 22:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-22 22:50 [PATCH 0/4] Asix AX88772B support Philipp Zabel
2014-01-22 22:50 ` [PATCH 1/4] net usb asix: Simplify condition in rx_fixup() Philipp Zabel
2014-01-22 22:50 ` Philipp Zabel [this message]
2014-01-23 1:14 ` [PATCH 0/4] Asix AX88772B support Marek Vasut
2014-01-23 9:30 ` Sascha Hauer
2014-01-27 8:34 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1390431049-4236-3-git-send-email-philipp.zabel@gmail.com \
--to=philipp.zabel@gmail.com \
--cc=barebox@lists.infradead.org \
--cc=marek.vasut@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.