diff options
Diffstat (limited to 'patches/0025-usb-sg/usbnet.patch')
-rw-r--r-- | patches/0025-usb-sg/usbnet.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/patches/0025-usb-sg/usbnet.patch b/patches/0025-usb-sg/usbnet.patch new file mode 100644 index 00000000..e9c204d9 --- /dev/null +++ b/patches/0025-usb-sg/usbnet.patch @@ -0,0 +1,73 @@ +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1270,6 +1270,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; +@@ -1302,6 +1303,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) +@@ -1358,12 +1365,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; +@@ -1430,7 +1444,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 +@@ -1483,7 +1499,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); +@@ -1840,7 +1858,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 { |