diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-04-11 01:45:20 +0000 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2014-04-17 16:23:08 -0700 |
commit | be4a0f9ad7e17670d7a30c9e94d5dd918425f90a (patch) | |
tree | e357fbef6a8bd452136a59c59a0b654d666d38a8 /patches/collateral-evolutions/network/0025-usb-sg/usbnet.patch | |
parent | 0429914b5f1cb02830dbc4200d615abd9b3f2f7c (diff) |
backports: nuke support for kernels < 3.0
mcgrof@drvbp1 ~/backports (git::master)$ time ./gentree.py --clean
/home/mcgrof/linux-next /home/mcgrof/build/next-20140409
Copy original source files ...
Apply patches ...
Modify Kconfig tree ...
Rewrite Makefiles and Kconfig files ...
Done!
real 1m30.186s
user 9m25.180s
sys 0m24.428s
mcgrof@drvbp1 ~/build/next-20140409 $ time ckmake --allyesconfig
1 3.0.101 [ OK ]
2 3.1.10 [ OK ]
3 3.2.54 [ OK ]
4 3.3.8 [ OK ]
5 3.4.79 [ OK ]
6 3.5.7 [ OK ]
7 3.6.11 [ OK ]
8 3.7.10 [ OK ]
9 3.8.13 [ OK ]
10 3.9.11 [ OK ]
11 3.10.29 [ OK ]
12 3.11.10 [ OK ]
13 3.12.10 [ OK ]
14 3.13.2 [ OK ]
15 3.14-rc1 [ OK ]
real 26m54.859s
user 744m15.764s
sys 83m47.440s
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Diffstat (limited to 'patches/collateral-evolutions/network/0025-usb-sg/usbnet.patch')
-rw-r--r-- | patches/collateral-evolutions/network/0025-usb-sg/usbnet.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/patches/collateral-evolutions/network/0025-usb-sg/usbnet.patch b/patches/collateral-evolutions/network/0025-usb-sg/usbnet.patch new file mode 100644 index 00000000..9aaf5819 --- /dev/null +++ b/patches/collateral-evolutions/network/0025-usb-sg/usbnet.patch @@ -0,0 +1,73 @@ +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1225,6 +1225,7 @@ EXPORT_SYMBOL_GPL(usbnet_tx_timeout); + + /*-------------------------------------------------------------------------*/ + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,35,0) + static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) + { + unsigned num_sgs, total_len = 0; +@@ -1257,6 +1258,12 @@ static int build_dma_sg(const struct sk_ + + return 1; + } ++#else ++static int build_dma_sg(const struct sk_buff *skb, struct urb *urb) ++{ ++ return -ENXIO; ++} ++#endif + + netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, + struct net_device *net) +@@ -1313,12 +1320,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; +@@ -1373,7 +1387,9 @@ not_drop: + if (skb) + dev_kfree_skb_any (skb); + if (urb) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,35,0) + kfree(urb->sg); ++#endif + usb_free_urb(urb); + } + } else +@@ -1426,7 +1442,9 @@ static void usbnet_bh (unsigned long par + rx_process (dev, skb); + continue; + case tx_done: ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,35,0) + kfree(entry->urb->sg); ++#endif + case rx_cleanup: + usb_free_urb (entry->urb); + dev_kfree_skb (skb); +@@ -1781,7 +1799,9 @@ int usbnet_resume (struct usb_interface + retval = usb_submit_urb(res, GFP_ATOMIC); + if (retval < 0) { + dev_kfree_skb_any(skb); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,35,0) + kfree(res->sg); ++#endif + usb_free_urb(res); + usb_autopm_put_interface_async(dev->intf); + } else { |