Skip to contentSkip to conversation

ASIX: Simplify condition in rx_fixup()

PATCH Applied Marek Vasut 3 participants 7 messages Jul 27, 2011 – Jul 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASIX: Simplify condition in rx_fixup()

---
 drivers/net/usb/asix.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/usb/asix.c +2 -3
index 5250288..d5b62a4 100644
@@ -314,10 +314,9 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 	skb_pull(skb, 4);
 
 	while (skb->len > 0) {
-		if ((short)(header & 0x0000ffff) !=
-		    ~((short)((header & 0xffff0000) >> 16))) {
+		if ((header & 0xffff) != ((~header >> 16) & 0xffff))
 			netdev_err(dev->net, "asix_rx_fixup() Bad Header Length\n");
-		}
+
 		/* get the packet length */
 		size = (u16) (header & 0x0000ffff);
 
Signature · 1 line
1.7.5.3
#1 lore raw

PATCH 2/2 ASIX: Use only 11 bits of header for data size

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.

---
 drivers/net/usb/asix.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

NOTE: If possible, can someone test/verify this patch with other ASIX chips ?
NOTE2: If Ack-ed, Greg, can you get this into -stable?

drivers/net/usb/asix.c +2 -2
index d5b62a4..c5c4b4d 100644
@@ -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;
Signature · 1 line
1.7.5.3
maintainer Applied
#2 lore raw

Re: [PATCH 2/2] ASIX: Use only 11 bits of header for data size

From: Marek Vasut <[email protected]>
Date: Wed, 27 Jul 2011 04:44:47 +0200

Quoted 9 lines

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.

Applied.

#3 lore raw

Re: [PATCH 2/2] ASIX: Use only 11 bits of header for data size

Quoted 9 lines · David Miller

From: Marek Vasut <[email protected]>
Date: Wed, 27 Jul 2011 04:44:47 +0200

Quoted 6 lines

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

Quoted 6 lines
Quoted 4 lines

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

Applied.

Hi, did you test it ?

I left NOTEs outside the commit message:

NOTE: If possible, can someone test/verify this patch with other ASIX chips ?
NOTE2: If Ack-ed, Greg, can you get this into -stable?

I hope I won't have a horde of angry people at my door soon ;-) --
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Re: [PATCH 2/2] ASIX: Use only 11 bits of header for data size

Quoted 15 lines · Marek Vasut
Quoted 14 lines · David Miller

From: Marek Vasut <[email protected]>
Date: Wed, 27 Jul 2011 04:44:47 +0200

Quoted 10 lines

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.

Quoted 8 lines
Quoted 1 line

Applied.

Hi, did you test it ?

I left NOTEs outside the commit message:

NOTE: If possible, can someone test/verify this patch with other ASIX chips ?
NOTE2: If Ack-ed, Greg, can you get this into -stable?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

</formletter>

#5 lore raw

Re: [PATCH 2/2] ASIX: Use only 11 bits of header for data size

Quoted 22 lines · Greg KH
Quoted 21 lines · Marek Vasut
Quoted 9 lines · David Miller

From: Marek Vasut <[email protected]>
Date: Wed, 27 Jul 2011 04:44:47 +0200

Quoted 6 lines

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

Quoted 6 lines
Quoted 4 lines

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

Applied.

Hi, did you test it ?

I left NOTEs outside the commit message:

Quoted 8 lines
Quoted 2 lines

NOTE: If possible, can someone test/verify this patch with other ASIX chips ? NOTE2: If Ack-ed, Greg, can you get this into -stable?

<formletter>

This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.

Yea I know ... I'm just so very tired (read dead). Sorry

Quoted 2 lines

</formletter>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html