mac80211: backport APIs to support kernel 5.18

This commit is contained in:
lean 2022-07-09 19:19:54 +08:00
parent a46ef13742
commit c6734e6cdb
2 changed files with 45 additions and 0 deletions

View File

@ -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);

View File

@ -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);