aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2020-11-08 17:15:02 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2020-12-05 21:24:57 +0100
commitc9b7156421cae96cda5b6a2c4a1dfd57b5db780e (patch)
treee4e8dedeec38d809888e8251c9711d82bedda48d
parent433f51a0ce14ad0b4f6b2c0897f5cc8c7f7709ed (diff)
downloadbackports-c9b7156421cae96cda5b6a2c4a1dfd57b5db780e.tar.gz
backports: Add netif_rx_any_context()
Add the netif_rx_any_context which was added in commit c11171a41338 ("net: Add netif_rx_any_context()") in kernel 5.10. This is used by libertas and mwifiex. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--backport/backport-include/linux/netdevice.h5
-rw-r--r--backport/compat/Makefile1
-rw-r--r--backport/compat/backport-5.10.c20
3 files changed, 26 insertions, 0 deletions
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 7646d6e2..411757d2 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -400,4 +400,9 @@ static inline bool netif_is_bridge_port(const struct net_device *dev)
}
#endif
+#if LINUX_VERSION_IS_LESS(5,10,0)
+#define netif_rx_any_context LINUX_BACKPORT(netif_rx_any_context)
+int netif_rx_any_context(struct sk_buff *skb);
+#endif /* < 5.10 */
+
#endif /* __BACKPORT_NETDEVICE_H */
diff --git a/backport/compat/Makefile b/backport/compat/Makefile
index 8d917622..b67ebc27 100644
--- a/backport/compat/Makefile
+++ b/backport/compat/Makefile
@@ -40,6 +40,7 @@ compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
compat-$(CPTCFG_KERNEL_5_2) += backport-5.2.o backport-genetlink.o
compat-$(CPTCFG_KERNEL_5_3) += backport-5.3.o
compat-$(CPTCFG_KERNEL_5_5) += backport-5.5.o
+compat-$(CPTCFG_KERNEL_5_10) += backport-5.10.o
compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o
compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/pkcs7.asn1.o
diff --git a/backport/compat/backport-5.10.c b/backport/compat/backport-5.10.c
new file mode 100644
index 00000000..a83907f4
--- /dev/null
+++ b/backport/compat/backport-5.10.c
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <linux/kernel.h>
+#include <linux/netdevice.h>
+
+int netif_rx_any_context(struct sk_buff *skb)
+{
+ /*
+ * If invoked from contexts which do not invoke bottom half
+ * processing either at return from interrupt or when softrqs are
+ * reenabled, use netif_rx_ni() which invokes bottomhalf processing
+ * directly.
+ */
+ if (in_interrupt())
+ return netif_rx(skb);
+ else
+ return netif_rx_ni(skb);
+}
+EXPORT_SYMBOL(netif_rx_any_context);