summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0010-asix-Fix-tx-transfer-padding-for-full-speed-USB.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0010-asix-Fix-tx-transfer-padding-for-full-speed-USB.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0010-asix-Fix-tx-transfer-padding-for-full-speed-USB.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0010-asix-Fix-tx-transfer-padding-for-full-speed-USB.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0010-asix-Fix-tx-transfer-padding-for-full-speed-USB.patch
new file mode 100644
index 00000000..c08dcb32
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0010-asix-Fix-tx-transfer-padding-for-full-speed-USB.patch
@@ -0,0 +1,45 @@
1From ccd532b836540eb1f0e1d9eee4a87b8403d729c1 Mon Sep 17 00:00:00 2001
2From: Ingo van Lil <inguin@gmx.de>
3Date: Mon, 23 Apr 2012 22:05:38 +0000
4Subject: [PATCH 10/56] asix: Fix tx transfer padding for full-speed USB
5
6[ Upstream commit 2a5809499e35b53a6044fd34e72b242688b7a862 ]
7
8The asix.c USB Ethernet driver avoids ending a tx transfer with a zero-
9length packet by appending a four-byte padding to transfers whose length
10is a multiple of maxpacket. However, the hard-coded 512 byte maxpacket
11length is valid for high-speed USB only; full-speed USB uses 64 byte
12packets.
13
14Signed-off-by: Ingo van Lil <inguin@gmx.de>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 drivers/net/usb/asix.c | 4 ++--
19 1 files changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
22index fda4be2..a9abee8 100644
23--- a/drivers/net/usb/asix.c
24+++ b/drivers/net/usb/asix.c
25@@ -403,7 +403,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
26 u32 packet_len;
27 u32 padbytes = 0xffff0000;
28
29- padlen = ((skb->len + 4) % 512) ? 0 : 4;
30+ padlen = ((skb->len + 4) & (dev->maxpacket - 1)) ? 0 : 4;
31
32 if ((!skb_cloned(skb)) &&
33 ((headroom + tailroom) >= (4 + padlen))) {
34@@ -425,7 +425,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
35 cpu_to_le32s(&packet_len);
36 skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len));
37
38- if ((skb->len % 512) == 0) {
39+ if (padlen) {
40 cpu_to_le32s(&padbytes);
41 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
42 skb_put(skb, sizeof(padbytes));
43--
441.7.7.6
45