aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2020-03-19 19:21:44 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2020-04-19 18:48:30 +0200
commit36f913ed11340ae517af3883f70a43f41b5011d4 (patch)
tree06a8d96eed651032183f28b9edc3327871e73412
parent02abf863922a6b69bbcfb6fd9fe40075cfb7c208 (diff)
downloadbackports-36f913ed11340ae517af3883f70a43f41b5011d4.tar.gz
backports: patches: handle txqueue parameter in ndo_tx_timeout
In upstream commit 0290bd291cc0 ("netdev: pass the stuck queue to the timeout handler") the ndo_tx_timeout callback in the net_device_ops structure got a new parameter txqueue. This patch changes the code to also work with the older interface where no txqueue was provided. The functions are sometimes used by other modules so add an EXPORT_SYMBOL_GPL to the spatch. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--patches/0094-ndo-tx-timeout.cocci28
-rw-r--r--patches/0094-ndo-tx-timeout/orinoco.patch10
-rw-r--r--patches/0094-ndo-tx-timeout/prism54.patch23
-rw-r--r--patches/0094-ndo-tx-timeout/usbnet.patch10
4 files changed, 71 insertions, 0 deletions
diff --git a/patches/0094-ndo-tx-timeout.cocci b/patches/0094-ndo-tx-timeout.cocci
new file mode 100644
index 00000000..34904994
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout.cocci
@@ -0,0 +1,28 @@
+@r@
+identifier OPS;
+identifier tx_timeout_fn;
+fresh identifier tx_timeout_fn_wrap = "bp_" ## tx_timeout_fn;
+position p;
+@@
+struct net_device_ops OPS@p = {
++#if LINUX_VERSION_IS_GEQ(5,6,0)
+ .ndo_tx_timeout = tx_timeout_fn,
++#else
++ .ndo_tx_timeout = tx_timeout_fn_wrap,
++#endif
+};
+
+@@
+identifier r.tx_timeout_fn_wrap;
+identifier r.tx_timeout_fn;
+@@
+void tx_timeout_fn(...) {...}
++#if LINUX_VERSION_IS_LESS(5,6,0)
++/* Just declare it here to keep sparse happy */
++void tx_timeout_fn_wrap(struct net_device *dev);
++void tx_timeout_fn_wrap(struct net_device *dev)
++{
++ tx_timeout_fn(dev, 0);
++}
++EXPORT_SYMBOL_GPL(tx_timeout_fn_wrap);
++#endif
diff --git a/patches/0094-ndo-tx-timeout/orinoco.patch b/patches/0094-ndo-tx-timeout/orinoco.patch
new file mode 100644
index 00000000..bda0a6da
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout/orinoco.patch
@@ -0,0 +1,10 @@
+--- a/drivers/net/wireless/intersil/orinoco/orinoco.h
++++ b/drivers/net/wireless/intersil/orinoco/orinoco.h
+@@ -208,6 +208,7 @@ int orinoco_stop(struct net_device *dev)
+ void orinoco_set_multicast_list(struct net_device *dev);
+ int orinoco_change_mtu(struct net_device *dev, int new_mtu);
+ void orinoco_tx_timeout(struct net_device *dev, unsigned int txqueue);
++void bp_orinoco_tx_timeout(struct net_device *dev);
+
+ /********************************************************************/
+ /* Locking and synchronization functions */
diff --git a/patches/0094-ndo-tx-timeout/prism54.patch b/patches/0094-ndo-tx-timeout/prism54.patch
new file mode 100644
index 00000000..d61d3402
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout/prism54.patch
@@ -0,0 +1,23 @@
+--- a/drivers/net/wireless/intersil/prism54/islpci_eth.h
++++ b/drivers/net/wireless/intersil/prism54/islpci_eth.h
+@@ -54,6 +54,7 @@ void islpci_eth_cleanup_transmit(islpci_
+ netdev_tx_t islpci_eth_transmit(struct sk_buff *, struct net_device *);
+ int islpci_eth_receive(islpci_private *);
+ void islpci_eth_tx_timeout(struct net_device *, unsigned int txqueue);
++void bp_islpci_eth_tx_timeout(struct net_device *);
+ void islpci_do_reset_and_wake(struct work_struct *);
+
+ #endif /* _ISL_GEN_H */
+--- a/drivers/net/wireless/intersil/prism54/islpci_eth.c
++++ b/drivers/net/wireless/intersil/prism54/islpci_eth.c
+@@ -491,3 +491,10 @@ islpci_eth_tx_timeout(struct net_device
+ "%s: tx_timeout, waiting for reset", ndev->name);
+ }
+ }
++
++#if LINUX_VERSION_IS_LESS(5,6,0)
++void bp_islpci_eth_tx_timeout(struct net_device *dev) {
++ islpci_eth_tx_timeout(dev, 0);
++}
++EXPORT_SYMBOL_GPL(bp_islpci_eth_tx_timeout);
++#endif
diff --git a/patches/0094-ndo-tx-timeout/usbnet.patch b/patches/0094-ndo-tx-timeout/usbnet.patch
new file mode 100644
index 00000000..3bd1facd
--- /dev/null
+++ b/patches/0094-ndo-tx-timeout/usbnet.patch
@@ -0,0 +1,10 @@
+--- a/include/linux/usb/usbnet.h
++++ b/include/linux/usb/usbnet.h
+@@ -254,6 +254,7 @@ extern int usbnet_stop(struct net_device
+ extern netdev_tx_t usbnet_start_xmit(struct sk_buff *skb,
+ struct net_device *net);
+ extern void usbnet_tx_timeout(struct net_device *net, unsigned int txqueue);
++extern void bp_usbnet_tx_timeout(struct net_device *net);
+ extern int usbnet_change_mtu(struct net_device *net, int new_mtu);
+
+ extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *);