diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-09-08 18:02:37 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2013-10-21 23:58:37 +0200 |
commit | d03553a54cdc782f8ae0f95e23674e2ed9b473d3 (patch) | |
tree | 921e686531a3a633acc86d420d13649f376cff47 | |
parent | 7ce655474ab7a3898bef8a37f8f98c26301672d5 (diff) |
backports: do not use DMA SG on old kernel versions
the usb net driver now uses the dma sg api which is not available on
old kernels, this patch removed the usage of the dma sg api for old
kernel versions.
This backports the following upstream commit:
commit 638c5115a794981441246fa8fa5d95c1875af5ba
Author: Ming Lei <ming.lei@canonical.com>
Date: Thu Aug 8 21:48:24 2013 +0800
USBNET: support DMA SG
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | patches/collateral-evolutions/network/78-usb-sg/INFO | 12 | ||||
-rw-r--r-- | patches/collateral-evolutions/network/78-usb-sg/usbnet.patch | 53 |
2 files changed, 65 insertions, 0 deletions
diff --git a/patches/collateral-evolutions/network/78-usb-sg/INFO b/patches/collateral-evolutions/network/78-usb-sg/INFO new file mode 100644 index 00000000..2277f825 --- /dev/null +++ b/patches/collateral-evolutions/network/78-usb-sg/INFO @@ -0,0 +1,12 @@ +backports: do not use DMA SG on old kernel versions + +the usb net driver now uses the dma sg api which is not available on +old kernels, this patch removed the usage of the dma sg api for old +kernel versions. + +This backports the following upstream commit: +commit 638c5115a794981441246fa8fa5d95c1875af5ba +Author: Ming Lei <ming.lei@canonical.com> +Date: Thu Aug 8 21:48:24 2013 +0800 + + USBNET: support DMA SG diff --git a/patches/collateral-evolutions/network/78-usb-sg/usbnet.patch b/patches/collateral-evolutions/network/78-usb-sg/usbnet.patch new file mode 100644 index 00000000..e7c841c8 --- /dev/null +++ b/patches/collateral-evolutions/network/78-usb-sg/usbnet.patch @@ -0,0 +1,53 @@ +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1234,6 +1234,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; +@@ -1264,6 +1265,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) +@@ -1377,7 +1384,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 +@@ -1430,7 +1439,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); +@@ -1767,7 +1778,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 { |