summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2013-10-24 23:50:42 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2013-10-29 21:37:09 +0100
commit3d0682d10f44ed81a77066e972111e856e72e916 (patch)
treecae292ae6980b04c0c50666b66635895f7d22ee3
parent4497e80ca2e37db6e7e73a95a437d238359baf14 (diff)
backports: fix usb-sg for usbnet
Upstream commit: ba0cdc6fb4891c9efc91f627698c8203583f0e52 This adapts the changes from: commit 60e453a940ac678565b6641d65f8c18541bb9f28 Author: Ming Lei <ming.lei@canonical.com> Date: Mon Sep 23 20:59:35 2013 +0800 USBNET: fix handling padding packet Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--patches/collateral-evolutions/network/78-usb-sg/usbnet.patch28
1 files changed, 24 insertions, 4 deletions
diff --git a/patches/collateral-evolutions/network/78-usb-sg/usbnet.patch b/patches/collateral-evolutions/network/78-usb-sg/usbnet.patch
index 07d9d962..08499d8b 100644
--- a/patches/collateral-evolutions/network/78-usb-sg/usbnet.patch
+++ b/patches/collateral-evolutions/network/78-usb-sg/usbnet.patch
@@ -8,7 +8,7 @@
static int build_dma_sg(const struct sk_buff *skb, struct urb *urb)
{
unsigned num_sgs, total_len = 0;
-@@ -1264,6 +1265,12 @@ static int build_dma_sg(const struct sk_
+@@ -1266,6 +1267,12 @@ static int build_dma_sg(const struct sk_
return 1;
}
@@ -21,7 +21,27 @@
netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
struct net_device *net)
-@@ -1377,7 +1384,9 @@ not_drop:
+@@ -1322,12 +1329,19 @@ netdev_tx_t usbnet_start_xmit (struct sk
+ if (!(info->flags & FLAG_SEND_ZLP)) {
+ if (!(info->flags & FLAG_MULTI_PACKET)) {
+ length++;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,35,0)
+ if (skb_tailroom(skb) && !urb->num_sgs) {
+ skb->data[skb->len] = 0;
+ __skb_put(skb, 1);
+ } else if (urb->num_sgs)
+ sg_set_buf(&urb->sg[urb->num_sgs++],
+ dev->padding_pkt, 1);
++#else
++ if (skb_tailroom(skb)) {
++ skb->data[skb->len] = 0;
++ __skb_put(skb, 1);
++ }
++#endif
+ }
+ } else
+ urb->transfer_flags |= URB_ZERO_PACKET;
+@@ -1382,7 +1396,9 @@ not_drop:
if (skb)
dev_kfree_skb_any (skb);
if (urb) {
@@ -31,7 +51,7 @@
usb_free_urb(urb);
}
} else
-@@ -1430,7 +1439,9 @@ static void usbnet_bh (unsigned long par
+@@ -1435,7 +1451,9 @@ static void usbnet_bh (unsigned long par
rx_process (dev, skb);
continue;
case tx_done:
@@ -41,7 +61,7 @@
case rx_cleanup:
usb_free_urb (entry->urb);
dev_kfree_skb (skb);
-@@ -1773,7 +1784,9 @@ int usbnet_resume (struct usb_interface
+@@ -1790,7 +1808,9 @@ int usbnet_resume (struct usb_interface
retval = usb_submit_urb(res, GFP_ATOMIC);
if (retval < 0) {
dev_kfree_skb_any(skb);