summaryrefslogtreecommitdiff
path: root/patches
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-25 23:52:51 +0200
commitba0cdc6fb4891c9efc91f627698c8203583f0e52 (patch)
tree44563d55cc3b8ed7a48ee41bdec7fc247982fb60 /patches
parent4f168a811ad5f88c30f6586478a58996b1df3e28 (diff)
backports: fix usb-sg for usbnet
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>
Diffstat (limited to 'patches')
-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..afea0cb0 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
+@@ -1788,7 +1806,9 @@ int usbnet_resume (struct usb_interface
retval = usb_submit_urb(res, GFP_ATOMIC);
if (retval < 0) {
dev_kfree_skb_any(skb);