[][MAC80211][Rebase Patches][Fix WiFi6 build error]
[Description]
Fix build fail
[Release-log]
N/A
Change-Id: I59e88e1b39fc9e950a75c0ecae7f42a5e08b1516
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7806254
diff --git a/autobuild_mac80211_release/package/kernel/mac80211/patches/subsys/mtk-9903-mac80211-mtk-add-per-bss-flag-to-support-vendors-cou.patch b/autobuild_mac80211_release/package/kernel/mac80211/patches/subsys/mtk-9903-mac80211-mtk-add-per-bss-flag-to-support-vendors-cou.patch
new file mode 100644
index 0000000..cefbd2c
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mac80211/patches/subsys/mtk-9903-mac80211-mtk-add-per-bss-flag-to-support-vendors-cou.patch
@@ -0,0 +1,92 @@
+From 26b093ef1b3bcbd168216ea4d94baedfb1dd5366 Mon Sep 17 00:00:00 2001
+From: "sujuan.chen" <sujuan.chen@mediatek.com>
+Date: Tue, 30 May 2023 15:36:33 +0800
+Subject: [PATCH 9903/9903] mac80211: mtk: add per-bss flag to support vendors
+ counter
+
+Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
+---
+ include/uapi/linux/nl80211.h | 1 +
+ net/mac80211/rx.c | 8 ++++++--
+ net/mac80211/tx.c | 13 ++++++++++---
+ 3 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
+index 3e348a5..659ae8d 100644
+--- a/include/uapi/linux/nl80211.h
++++ b/include/uapi/linux/nl80211.h
+@@ -6102,6 +6102,7 @@ enum nl80211_ext_feature_index {
+ NL80211_EXT_FEATURE_BSS_COLOR,
+ NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
+ NL80211_EXT_FEATURE_RADAR_BACKGROUND,
++ NL80211_EXT_FEATURE_STAS_COUNT,
+
+ /* add new features before the definition below */
+ NUM_NL80211_EXT_FEATURES,
+diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
+index a9fcc7a..7304dbd 100644
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2641,7 +2641,9 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
+ skb = rx->skb;
+ xmit_skb = NULL;
+
+- dev_sw_netstats_rx_add(dev, skb->len);
++ if (!wiphy_ext_feature_isset(sdata->local->hw.wiphy,
++ NL80211_EXT_FEATURE_STAS_COUNT) || !rx->sta)
++ dev_sw_netstats_rx_add(dev, skb->len);
+
+ if (rx->sta) {
+ /* The seqno index has the same property as needed
+@@ -4545,7 +4547,9 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
+
+ skb->dev = fast_rx->dev;
+
+- dev_sw_netstats_rx_add(fast_rx->dev, skb->len);
++ if (!wiphy_ext_feature_isset(sta->local->hw.wiphy,
++ NL80211_EXT_FEATURE_STAS_COUNT))
++ dev_sw_netstats_rx_add(fast_rx->dev, skb->len);
+
+ /* The seqno index has the same property as needed
+ * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
+diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
+index 50ba10c..e071130 100644
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -3454,7 +3454,9 @@ ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
+ if (key)
+ info->control.hw_key = &key->conf;
+
+- dev_sw_netstats_tx_add(skb->dev, 1, skb->len);
++ if (!wiphy_ext_feature_isset(sta->local->hw.wiphy,
++ NL80211_EXT_FEATURE_STAS_COUNT))
++ dev_sw_netstats_tx_add(skb->dev, 1, skb->len);
+
+ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
+ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+@@ -4219,7 +4221,9 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
+ goto out;
+ }
+
+- dev_sw_netstats_tx_add(dev, 1, skb->len);
++ if (!wiphy_ext_feature_isset(sdata->local->hw.wiphy,
++ NL80211_EXT_FEATURE_STAS_COUNT) || !sta)
++ dev_sw_netstats_tx_add(dev, 1, skb->len);
+
+ ieee80211_xmit(sdata, sta, skb);
+ }
+@@ -4497,7 +4501,10 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
+ info->ack_frame_id = ieee80211_store_ack_skb(local, skb,
+ &info->flags, NULL);
+
+- dev_sw_netstats_tx_add(dev, skbs, len);
++ if (!wiphy_ext_feature_isset(sta->local->hw.wiphy,
++ NL80211_EXT_FEATURE_STAS_COUNT))
++ dev_sw_netstats_tx_add(dev, skbs, len);
++
+ sta->tx_stats.packets[queue] += skbs;
+ sta->tx_stats.bytes[queue] += len;
+
+--
+2.18.0
+