From c6734e6cdb8216beb125e00789f2ff6d44dc6286 Mon Sep 17 00:00:00 2001 From: lean Date: Sat, 9 Jul 2022 19:19:54 +0800 Subject: [PATCH] mac80211: backport APIs to support kernel 5.18 --- .../patches/build/882-use-netif_rx.patch | 14 +++++++++ .../subsys/800-ethtool_ringparam.patch | 31 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 package/kernel/mac80211/patches/build/882-use-netif_rx.patch create mode 100644 package/kernel/mac80211/patches/subsys/800-ethtool_ringparam.patch diff --git a/package/kernel/mac80211/patches/build/882-use-netif_rx.patch b/package/kernel/mac80211/patches/build/882-use-netif_rx.patch new file mode 100644 index 000000000..a6148d886 --- /dev/null +++ b/package/kernel/mac80211/patches/build/882-use-netif_rx.patch @@ -0,0 +1,14 @@ +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -2149,7 +2149,11 @@ + skb->dev = dev; + skb->protocol = eth_type_trans(skb, dev); + memset(skb->cb, 0, sizeof(skb->cb)); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) + netif_rx_ni(skb); ++#else ++ netif_rx(skb); ++#endif + } + EXPORT_SYMBOL(cfg80211_send_layer2_update); + \ No newline at end of file diff --git a/package/kernel/mac80211/patches/subsys/800-ethtool_ringparam.patch b/package/kernel/mac80211/patches/subsys/800-ethtool_ringparam.patch new file mode 100644 index 000000000..45d9e7e46 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/800-ethtool_ringparam.patch @@ -0,0 +1,31 @@ +diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c +index 99a2e30b3833a6..b2253df54413fb 100644 +--- a/net/mac80211/ethtool.c ++++ b/net/mac80211/ethtool.c +@@ -14,7 +14,13 @@ + #include "driver-ops.h" + + static int ieee80211_set_ringparam(struct net_device *dev, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) + struct ethtool_ringparam *rp) ++#else ++ struct ethtool_ringparam *rp, ++ struct kernel_ethtool_ringparam *kernel_rp, ++ struct netlink_ext_ack *extack) ++#endif + { + struct ieee80211_local *local = wiphy_priv(dev->ieee80211_ptr->wiphy); + +@@ -25,7 +31,13 @@ + } + + static void ieee80211_get_ringparam(struct net_device *dev, ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) + struct ethtool_ringparam *rp) ++#else ++ struct ethtool_ringparam *rp, ++ struct kernel_ethtool_ringparam *kernel_rp, ++ struct netlink_ext_ack *extack) ++#endif + { + struct ieee80211_local *local = wiphy_priv(dev->ieee80211_ptr->wiphy);