[][MAC80211][WiFi7][misc][fix mt7988-mt7996-mac980211 release build fail]

[Description]
Fix mt7988-mt7996-mac980211 release build fail

[Release-log]
N/A

Change-Id: I4e247202ad308ed70e7ed59f8a21d62fddfbac9f
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8041650
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1000-mac80211-mtk-add-EHT-BA1024-support.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1000-mac80211-mtk-add-EHT-BA1024-support.patch
index fe7b1af..41d3d2f 100644
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1000-mac80211-mtk-add-EHT-BA1024-support.patch
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1000-mac80211-mtk-add-EHT-BA1024-support.patch
@@ -1,7 +1,7 @@
-From 5a82834ed7eb4cbf0f4f5abc8665eeef023b67ff Mon Sep 17 00:00:00 2001
+From 1a54516b2d934f80a80c6e1bb0fe824ceb63cd3b Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Sun, 25 Dec 2022 22:43:46 +0800
-Subject: [PATCH 1000/1003] mac80211: mtk: add EHT BA1024 support
+Subject: [PATCH 1000/1006] mac80211: mtk: add EHT BA1024 support
 
 ---
  include/linux/ieee80211.h |  2 ++
@@ -9,10 +9,10 @@
  2 files changed, 45 insertions(+), 2 deletions(-)
 
 diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
-index 00d381e..0781b76 100644
+index 7aaae32..3308e85 100644
 --- a/include/linux/ieee80211.h
 +++ b/include/linux/ieee80211.h
-@@ -1256,6 +1256,8 @@ struct ieee80211_mgmt {
+@@ -1267,6 +1267,8 @@ struct ieee80211_mgmt {
  					__le16 status;
  					__le16 capab;
  					__le16 timeout;
@@ -22,10 +22,10 @@
  				struct{
  					u8 action_code;
 diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
-index 752ad09..7f0e72a 100644
+index 7f66e69..b8b8e22 100644
 --- a/net/mac80211/agg-tx.c
 +++ b/net/mac80211/agg-tx.c
-@@ -66,10 +66,17 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
+@@ -72,10 +72,17 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
  	struct ieee80211_local *local = sdata->local;
  	struct sk_buff *skb;
  	struct ieee80211_mgmt *mgmt;
@@ -44,7 +44,7 @@
  
  	if (!skb)
  		return;
-@@ -108,6 +115,15 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
+@@ -114,6 +121,15 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
  	mgmt->u.action.u.addba_req.start_seq_num =
  					cpu_to_le16(start_seq_num << 4);
  
@@ -60,7 +60,7 @@
  	ieee80211_tx_skb_tid(sdata, skb, tid, -1);
  }
  
-@@ -469,8 +485,11 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta,
+@@ -481,8 +497,11 @@ static void ieee80211_send_addba_with_timeout(struct sta_info *sta,
  	sta->ampdu_mlme.addba_req_num[tid]++;
  	spin_unlock_bh(&sta->lock);
  
@@ -73,7 +73,7 @@
  	} else {
  		/*
  		 * We really should use what the driver told us it will
-@@ -980,13 +999,35 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
+@@ -998,13 +1017,35 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local,
  {
  	struct tid_ampdu_tx *tid_tx;
  	struct ieee80211_txq *txq;
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1001-mac80211-mtk-add-rate-duration-for-EHT-rate.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1001-mac80211-mtk-add-rate-duration-for-EHT-rate.patch
index f20cb61..d94b942 100644
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1001-mac80211-mtk-add-rate-duration-for-EHT-rate.patch
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1001-mac80211-mtk-add-rate-duration-for-EHT-rate.patch
@@ -1,7 +1,7 @@
-From 857debd24af093da4e85f148767fd16fb9eaf975 Mon Sep 17 00:00:00 2001
+From 732eee694af50c9854755e4bcecf3a37f762a932 Mon Sep 17 00:00:00 2001
 From: Bo Jiao <Bo.Jiao@mediatek.com>
 Date: Sun, 25 Dec 2022 22:43:46 +0800
-Subject: [PATCH 1001/1003] mac80211: mtk: add rate duration for EHT rate.
+Subject: [PATCH 1001/1006] mac80211: mtk: add rate duration for EHT rate.
 
 ---
  net/mac80211/airtime.c | 349 ++++++++++++++++++++++++++++++++++++++++-
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1002-mac80211-mtk-add-send-bar-action-when-recieve-addba-.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1002-mac80211-mtk-add-send-bar-action-when-recieve-addba-.patch
index 099071c..a8ecdb7 100644
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1002-mac80211-mtk-add-send-bar-action-when-recieve-addba-.patch
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1002-mac80211-mtk-add-send-bar-action-when-recieve-addba-.patch
@@ -1,7 +1,7 @@
-From a9b8e0e62b19fbd7c1dd865330ceb5a943e5cbb2 Mon Sep 17 00:00:00 2001
+From 962ea174654c240aacc4e83b2000846c796cf1fc Mon Sep 17 00:00:00 2001
 From: ye he <ye.he@mediatek.com>
 Date: Wed, 22 Feb 2023 16:09:32 +0800
-Subject: [PATCH 1002/1003] mac80211: mtk: add send bar action when recieve
+Subject: [PATCH 1002/1006] mac80211: mtk: add send bar action when recieve
  addba rsp
 
 Signed-off-by: ye he <ye.he@mediatek.com>
@@ -10,10 +10,10 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
-index 7f0e72a..3ce2226 100644
+index b8b8e22..285433a 100644
 --- a/net/mac80211/agg-tx.c
 +++ b/net/mac80211/agg-tx.c
-@@ -1080,7 +1080,8 @@ next:
+@@ -1098,7 +1098,8 @@ next:
  
  		tid_tx->buf_size = buf_size;
  		tid_tx->amsdu = amsdu;
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1003-mac80211-mtk-inrease-beacon-loss-count.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1003-mac80211-mtk-inrease-beacon-loss-count.patch
index 1def860..559b91d 100644
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1003-mac80211-mtk-inrease-beacon-loss-count.patch
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1003-mac80211-mtk-inrease-beacon-loss-count.patch
@@ -1,7 +1,7 @@
-From 8175f5cdf45728cdfcf34893696f994c6f1e6cc1 Mon Sep 17 00:00:00 2001
+From 6e12a9af43178a46e573e8ee92520ec502562bb5 Mon Sep 17 00:00:00 2001
 From: Amit Khatri <amit.khatri@mediatek.com>
 Date: Thu, 6 Apr 2023 21:37:33 +0800
-Subject: [PATCH 1003/1003] mac80211: mtk: inrease beacon loss count
+Subject: [PATCH 1003/1006] mac80211: mtk: inrease beacon loss count
 
 as per eagle code beacone loss time out is
 4 seconds.
@@ -16,7 +16,7 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
-index 72d153f..458609c 100644
+index df39a8b..ccc72da 100644
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
 @@ -61,7 +61,7 @@ MODULE_PARM_DESC(max_probe_tries,
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1004-cfg80211-mtk-add-support-for-updating-background-cha.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1004-cfg80211-mtk-add-support-for-updating-background-cha.patch
new file mode 100644
index 0000000..b52511a
--- /dev/null
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1004-cfg80211-mtk-add-support-for-updating-background-cha.patch
@@ -0,0 +1,88 @@
+From f0e42c5a5ea3491be2d7c61c798dffe126eabd2b Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Wed, 5 Jul 2023 09:49:02 +0800
+Subject: [PATCH 1004/1006] cfg80211: mtk: add support for updating background
+ channel
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+---
+ include/net/cfg80211.h       | 14 ++++++++++++++
+ include/uapi/linux/nl80211.h |  6 ++++++
+ net/wireless/mlme.c          | 12 ++++++++++++
+ 3 files changed, 32 insertions(+)
+
+diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
+index 2c51c3e..46c477a 100644
+--- a/include/net/cfg80211.h
++++ b/include/net/cfg80211.h
+@@ -8444,6 +8444,20 @@ void cfg80211_sta_update_dfs_state(struct wireless_dev *wdev,
+ 				   const struct cfg80211_chan_def *csa_chandef,
+ 				   bool associated);
+ 
++/**
++ * cfg80211_background_radar_update_channel - notify background chandef has been updated
++ * @wiphy: the wiphy
++ * @chandef: the updated chandef
++ * @expand: whether or not the operating channel should expand its width
++ * after offchan CAC
++ *
++ * Update the background chandef based on driver's decision, and notify the userspace
++ * that the current channel of background chain should be updated.
++ */
++void cfg80211_background_radar_update_channel(struct wiphy *wiphy,
++					      const struct cfg80211_chan_def *chandef,
++					      bool expand);
++
+ /**
+  * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
+  * @wiphy: the wiphy
+diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
+index 60c6f79..6e96ad9 100644
+--- a/include/uapi/linux/nl80211.h
++++ b/include/uapi/linux/nl80211.h
+@@ -6671,6 +6671,10 @@ enum nl80211_smps_mode {
+  *	applicable for ETSI dfs domain where pre-CAC is valid for ever.
+  * @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started,
+  *	should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled.
++ * @NL80211_RADAR_BACKGROUND_CHAN_UPDATE: background channel is updated by the
++ *	driver.
++ * @NL80211_RADAR_BACKGROUND_CHAN_EXPAND: background channel is updated by the
++ *	driver and required to expand main operating channel.
+  * @NL80211_RADAR_STA_CAC_SKIPPED: STA set the DFS state to available
+  *	when receiving CSA/assoc resp
+  * @NL80211_RADAR_STA_CAC_EXPIRED: STA set the DFS state to usable
+@@ -6683,6 +6687,8 @@ enum nl80211_radar_event {
+ 	NL80211_RADAR_NOP_FINISHED,
+ 	NL80211_RADAR_PRE_CAC_EXPIRED,
+ 	NL80211_RADAR_CAC_STARTED,
++	NL80211_RADAR_BACKGROUND_CHAN_UPDATE,
++	NL80211_RADAR_BACKGROUND_CHAN_EXPAND,
+ 	NL80211_RADAR_STA_CAC_SKIPPED,
+ 	NL80211_RADAR_STA_CAC_EXPIRED,
+ };
+diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
+index d345c72..5510d77 100644
+--- a/net/wireless/mlme.c
++++ b/net/wireless/mlme.c
+@@ -1158,6 +1158,18 @@ cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rde
+ 	return 0;
+ }
+ 
++void cfg80211_background_radar_update_channel(struct wiphy *wiphy,
++					      const struct cfg80211_chan_def *chandef,
++					      bool expand)
++{
++	enum nl80211_radar_event event;
++
++	event = expand ? NL80211_RADAR_BACKGROUND_CHAN_EXPAND :
++			 NL80211_RADAR_BACKGROUND_CHAN_UPDATE;
++	nl80211_radar_notify(wiphy_to_rdev(wiphy), chandef, event, NULL, GFP_ATOMIC);
++}
++EXPORT_SYMBOL(cfg80211_background_radar_update_channel);
++
+ void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev)
+ {
+ 	struct wiphy *wiphy = wdev->wiphy;
+-- 
+2.39.2
+
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1004-mac80211-mtk-add-disabling-cca-when-stopping-AP.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1004-mac80211-mtk-add-disabling-cca-when-stopping-AP.patch
deleted file mode 100644
index c8fc398..0000000
--- a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1004-mac80211-mtk-add-disabling-cca-when-stopping-AP.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 79837bcb22a80a4c95cbba77b23f16352d4e791d Mon Sep 17 00:00:00 2001
-From: Michael Lee <michael-cy.lee@mediatek.com>
-Date: Mon, 24 Apr 2023 09:59:24 +0800
-Subject: [PATCH] mac80211: mtk: add disabling cca when stopping AP.
-
----
- net/mac80211/cfg.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
-index 343ce2b..611c29e 100644
---- a/net/mac80211/cfg.c
-+++ b/net/mac80211/cfg.c
-@@ -1540,6 +1540,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
- 	/* abort any running channel switch */
- 	mutex_lock(&local->mtx);
- 	link_conf->csa_active = false;
-+	link_conf->color_change_active = false;
- 	if (link->csa_block_tx) {
- 		ieee80211_wake_vif_queues(local, sdata,
- 					  IEEE80211_QUEUE_STOP_REASON_CSA);
--- 
-2.25.1
-
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1005-mac80211-mtk-Allow-STA-interface-to-set-TX-queue-par.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1005-mac80211-mtk-Allow-STA-interface-to-set-TX-queue-par.patch
new file mode 100644
index 0000000..83fb948
--- /dev/null
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1005-mac80211-mtk-Allow-STA-interface-to-set-TX-queue-par.patch
@@ -0,0 +1,26 @@
+From 345695bc97c9a69aa9717e2fceb2e42701a63486 Mon Sep 17 00:00:00 2001
+From: Michael Lee <michael-cy.lee@mediatek.com>
+Date: Fri, 7 Jul 2023 17:17:30 +0800
+Subject: [PATCH 1005/1006] mac80211: mtk: Allow STA interface to set TX queue
+ parameters
+
+Signed-off-by: Michael Lee <michael-cy.lee@mediatek.com>
+---
+ net/wireless/nl80211.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
+index 4692480..e098263 100644
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -3497,6 +3497,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
+ 		}
+ 
+ 		if (netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP &&
++		    netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_STATION &&
+ 		    netdev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) {
+ 			result = -EINVAL;
+ 			goto out;
+-- 
+2.39.2
+
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1006-mac80211-mtk-export-ieee80211_tpt_led_trig_tx-rx-for.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1006-mac80211-mtk-export-ieee80211_tpt_led_trig_tx-rx-for.patch
new file mode 100644
index 0000000..825a8dc
--- /dev/null
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1006-mac80211-mtk-export-ieee80211_tpt_led_trig_tx-rx-for.patch
@@ -0,0 +1,150 @@
+From 8fb30028bd630b37840d023029aa6aa4791f7697 Mon Sep 17 00:00:00 2001
+From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
+Date: Fri, 23 Jun 2023 05:53:50 +0800
+Subject: [PATCH 1006/1006] mac80211: mtk: export ieee80211_tpt_led_trig_tx/rx
+ for driver
+
+Whenever the H/W path is enabled and traffic is in the binding state,
+mac80211 is not aware of the traffic. Consequently, the LED does not
+blink for that reason.
+
+The ieee80211_tpt_led_trig_tx/rx functions are exported for the driver
+so that we can report the tx and rx bytes from the driver when
+the H/W path is being used.
+
+Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
+---
+ include/net/mac80211.h | 17 +++++++++++++++++
+ net/mac80211/led.c     | 16 ++++++++++++++++
+ net/mac80211/led.h     | 17 -----------------
+ net/mac80211/rx.c      |  2 +-
+ net/mac80211/tx.c      |  4 ++--
+ 5 files changed, 36 insertions(+), 20 deletions(-)
+
+diff --git a/include/net/mac80211.h b/include/net/mac80211.h
+index 6ff6d3a..345c323 100644
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -4744,6 +4744,8 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
+ 				   unsigned int flags,
+ 				   const struct ieee80211_tpt_blink *blink_table,
+ 				   unsigned int blink_table_len);
++void __ieee80211_tpt_led_trig_tx(struct ieee80211_hw *hw, int bytes);
++void __ieee80211_tpt_led_trig_rx(struct ieee80211_hw *hw, int bytes);
+ #endif
+ /**
+  * ieee80211_get_tx_led_name - get name of TX LED
+@@ -4854,6 +4856,21 @@ ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags,
+ #endif
+ }
+ 
++static inline void
++ieee80211_tpt_led_trig_tx(struct ieee80211_hw *hw, int bytes)
++{
++#ifdef CPTCFG_MAC80211_LEDS
++	__ieee80211_tpt_led_trig_tx(hw, bytes);
++#endif
++}
++
++static inline void
++ieee80211_tpt_led_trig_rx(struct ieee80211_hw *hw, int bytes)
++{
++#ifdef CPTCFG_MAC80211_LEDS
++	__ieee80211_tpt_led_trig_rx(hw, bytes);
++#endif
++}
+ /**
+  * ieee80211_unregister_hw - Unregister a hardware device
+  *
+diff --git a/net/mac80211/led.c b/net/mac80211/led.c
+index b992430..3109501 100644
+--- a/net/mac80211/led.c
++++ b/net/mac80211/led.c
+@@ -364,6 +364,22 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
+ }
+ EXPORT_SYMBOL(__ieee80211_create_tpt_led_trigger);
+ 
++void __ieee80211_tpt_led_trig_tx(struct ieee80211_hw *hw, int bytes)
++{
++	struct ieee80211_local *local = hw_to_local(hw);
++	if (atomic_read(&local->tpt_led_active))
++		local->tpt_led_trigger->tx_bytes += bytes;
++}
++EXPORT_SYMBOL(__ieee80211_tpt_led_trig_tx);
++
++void __ieee80211_tpt_led_trig_rx(struct ieee80211_hw *hw, int bytes)
++{
++	struct ieee80211_local *local = hw_to_local(hw);
++	if (atomic_read(&local->tpt_led_active))
++		local->tpt_led_trigger->rx_bytes += bytes;
++}
++EXPORT_SYMBOL(__ieee80211_tpt_led_trig_rx);
++
+ static void ieee80211_start_tpt_led_trig(struct ieee80211_local *local)
+ {
+ 	struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger;
+diff --git a/net/mac80211/led.h b/net/mac80211/led.h
+index 59f5a83..f381790 100644
+--- a/net/mac80211/led.h
++++ b/net/mac80211/led.h
+@@ -65,22 +65,5 @@ static inline void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local,
+ 					      unsigned int types_off)
+ {
+ }
+-#endif
+ 
+-static inline void
+-ieee80211_tpt_led_trig_tx(struct ieee80211_local *local, int bytes)
+-{
+-#ifdef CPTCFG_MAC80211_LEDS
+-	if (atomic_read(&local->tpt_led_active))
+-		local->tpt_led_trigger->tx_bytes += bytes;
+ #endif
+-}
+-
+-static inline void
+-ieee80211_tpt_led_trig_rx(struct ieee80211_local *local, int bytes)
+-{
+-#ifdef CPTCFG_MAC80211_LEDS
+-	if (atomic_read(&local->tpt_led_active))
+-		local->tpt_led_trigger->rx_bytes += bytes;
+-#endif
+-}
+diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
+index e245f31..a44381b 100644
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -5394,7 +5394,7 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
+ 	if (skb) {
+ 		if ((status->flag & RX_FLAG_8023) ||
+ 			ieee80211_is_data_present(hdr->frame_control))
+-			ieee80211_tpt_led_trig_rx(local, skb->len);
++			ieee80211_tpt_led_trig_rx(&local->hw, skb->len);
+ 
+ 		if (status->flag & RX_FLAG_8023)
+ 			__ieee80211_rx_handle_8023(hw, pubsta, skb, list);
+diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
+index d816c36..4925fab 100644
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -4320,7 +4320,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
+ 	len = 0;
+  out:
+ 	if (len)
+-		ieee80211_tpt_led_trig_tx(local, len);
++		ieee80211_tpt_led_trig_tx(&local->hw, len);
+ 	rcu_read_unlock();
+ }
+ 
+@@ -4646,7 +4646,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
+ 	sta->deflink.tx_stats.packets[queue] += skbs;
+ 	sta->deflink.tx_stats.bytes[queue] += len;
+ 
+-	ieee80211_tpt_led_trig_tx(local, len);
++	ieee80211_tpt_led_trig_tx(&local->hw, len);
+ 
+ 	ieee80211_tx_8023(sdata, skb, sta, false);
+ 
+-- 
+2.39.2
+
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1007-mac80211-mtk-add-packet-count-input-for-dev_sw_netst.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1007-mac80211-mtk-add-packet-count-input-for-dev_sw_netst.patch
new file mode 100644
index 0000000..9a4f9ce
--- /dev/null
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1007-mac80211-mtk-add-packet-count-input-for-dev_sw_netst.patch
@@ -0,0 +1,136 @@
+From 26a73e67325cd28ff295afacfb875c14ea8e1988 Mon Sep 17 00:00:00 2001
+From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
+Date: Tue, 22 Aug 2023 05:02:53 +0800
+Subject: [PATCH 1/2] mac80211: mtk: add packet count input for
+ dev_sw_netstat_rx_add
+
+---
+ backport-include/linux/netdevice.h                   | 12 ++++++++----
+ drivers/net/usb/qmi_wwan.c                           |  2 +-
+ .../net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c |  2 +-
+ .../net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c |  2 +-
+ net/mac80211/rx.c                                    |  8 ++++----
+ 5 files changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/backport-include/linux/netdevice.h b/backport-include/linux/netdevice.h
+index 1d2ac66..04d76d7 100644
+--- a/backport-include/linux/netdevice.h
++++ b/backport-include/linux/netdevice.h
+@@ -112,13 +112,15 @@ void dev_fetch_sw_netstats(struct rtnl_link_stats64 *s,
+ #define netif_rx_any_context LINUX_BACKPORT(netif_rx_any_context)
+ int netif_rx_any_context(struct sk_buff *skb);
+ 
+-static inline void dev_sw_netstats_rx_add(struct net_device *dev, unsigned int len)
++static inline void dev_sw_netstats_rx_add(struct net_device *dev,
++					  unsigned int packets,
++					  unsigned int len)
+ {
+ 	struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
+ 
+ 	u64_stats_update_begin(&tstats->syncp);
+ 	tstats->rx_bytes += len;
+-	tstats->rx_packets++;
++	tstats->rx_packets += packets;
+ 	u64_stats_update_end(&tstats->syncp);
+ }
+ 
+@@ -140,13 +142,15 @@ static inline void dev_sw_netstats_tx_add(struct net_device *dev,
+ 
+ #if LINUX_VERSION_IS_LESS(5,10,0)
+ #define dev_sw_netstats_rx_add LINUX_BACKPORT(dev_sw_netstats_rx_add)
+-static inline void dev_sw_netstats_rx_add(struct net_device *dev, unsigned int len)
++static inline void dev_sw_netstats_rx_add(struct net_device *dev,
++					  unsigned int packets,
++					  unsigned int len)
+ {
+ 	struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
+ 
+ 	u64_stats_update_begin(&tstats->syncp);
+ 	tstats->rx_bytes += len;
+-	tstats->rx_packets++;
++	tstats->rx_packets += packets;
+ 	u64_stats_update_end(&tstats->syncp);
+ }
+ #endif /* < 5.10 */
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
+index adbcfdf..f93359a 100644
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -210,7 +210,7 @@ static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
+ 			net->stats.rx_errors++;
+ 			return 0;
+ 		} else {
+-			dev_sw_netstats_rx_add(net, pkt_len);
++			dev_sw_netstats_rx_add(net, 1, pkt_len);
+ 		}
+ 
+ skip:
+diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
+index 8c23a77..8f201ea 100644
+--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
++++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
+@@ -756,7 +756,7 @@ static int qtnf_pcie_pearl_rx_poll(struct napi_struct *napi, int budget)
+ 			skb_put(skb, psize);
+ 			ndev = qtnf_classify_skb(bus, skb);
+ 			if (likely(ndev)) {
+-				dev_sw_netstats_rx_add(ndev, skb->len);
++				dev_sw_netstats_rx_add(ndev, 1, skb->len);
+ 				skb->protocol = eth_type_trans(skb, ndev);
+ 				napi_gro_receive(napi, skb);
+ 			} else {
+diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
+index d833625..0a7bb97 100644
+--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
++++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
+@@ -662,7 +662,7 @@ static int qtnf_topaz_rx_poll(struct napi_struct *napi, int budget)
+ 			skb_put(skb, psize);
+ 			ndev = qtnf_classify_skb(bus, skb);
+ 			if (likely(ndev)) {
+-				dev_sw_netstats_rx_add(ndev, skb->len);
++				dev_sw_netstats_rx_add(ndev, 1, skb->len);
+ 				skb->protocol = eth_type_trans(skb, ndev);
+ 				netif_receive_skb(skb);
+ 			} else {
+diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
+index fb3d2e4..347867c 100644
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -853,7 +853,7 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb,
+ 
+ 			if (skb) {
+ 				skb->dev = sdata->dev;
+-				dev_sw_netstats_rx_add(skb->dev, skb->len);
++				dev_sw_netstats_rx_add(skb->dev, 1, skb->len);
+ 				netif_receive_skb(skb);
+ 			}
+ 		}
+@@ -2632,7 +2632,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
+ 	skb = rx->skb;
+ 	xmit_skb = NULL;
+ 
+-	dev_sw_netstats_rx_add(dev, skb->len);
++	dev_sw_netstats_rx_add(dev, 1, skb->len);
+ 
+ 	if (rx->sta) {
+ 		/* The seqno index has the same property as needed
+@@ -4050,7 +4050,7 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx,
+ 		}
+ 
+ 		prev_dev = sdata->dev;
+-		dev_sw_netstats_rx_add(sdata->dev, skb->len);
++		dev_sw_netstats_rx_add(sdata->dev, 1, skb->len);
+ 	}
+ 
+ 	if (prev_dev) {
+@@ -4762,7 +4762,7 @@ 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);
++	dev_sw_netstats_rx_add(fast_rx->dev, 1, skb->len);
+ 
+ 	/* The seqno index has the same property as needed
+ 	 * for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
+-- 
+2.18.0
+
diff --git a/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1008-mac80211-mtk-add-per-bss-flag-to-support-vendors-cou.patch b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1008-mac80211-mtk-add-per-bss-flag-to-support-vendors-cou.patch
new file mode 100644
index 0000000..4cb182c
--- /dev/null
+++ b/autobuild_mac80211_release/mt7988_mt7996_mac80211/package/kernel/mac80211/patches/subsys/mtk-1008-mac80211-mtk-add-per-bss-flag-to-support-vendors-cou.patch
@@ -0,0 +1,91 @@
+From 7ef885cff2d628c84b83eb4b697106b781495fa5 Mon Sep 17 00:00:00 2001
+From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
+Date: Wed, 16 Aug 2023 07:23:34 +0800
+Subject: [PATCH 2/2] mac80211: mtk: add per-bss flag to support vendors
+ counter
+
+---
+ 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 6e96ad9..b1555bb 100644
+--- a/include/uapi/linux/nl80211.h
++++ b/include/uapi/linux/nl80211.h
+@@ -6471,6 +6471,7 @@ enum nl80211_ext_feature_index {
+ 	NL80211_EXT_FEATURE_PUNCT,
+ 	NL80211_EXT_FEATURE_SECURE_NAN,
+ 	NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
++	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 347867c..07dddcd 100644
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2632,7 +2632,9 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
+ 	skb = rx->skb;
+ 	xmit_skb = NULL;
+ 
+-	dev_sw_netstats_rx_add(dev, 1, skb->len);
++	if (!wiphy_ext_feature_isset(sdata->local->hw.wiphy,
++	    NL80211_EXT_FEATURE_STAS_COUNT) || !rx->sta)
++		dev_sw_netstats_rx_add(dev, 1, skb->len);
+ 
+ 	if (rx->sta) {
+ 		/* The seqno index has the same property as needed
+@@ -4762,7 +4764,9 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
+ 
+ 	skb->dev = fast_rx->dev;
+ 
+-	dev_sw_netstats_rx_add(fast_rx->dev, 1, skb->len);
++	if (!wiphy_ext_feature_isset(sta->local->hw.wiphy,
++	    NL80211_EXT_FEATURE_STAS_COUNT))
++		dev_sw_netstats_rx_add(fast_rx->dev, 1, 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 0ed18d5..c6eec00 100644
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -3540,7 +3540,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;
+@@ -4311,7 +4313,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);
+ 	}
+@@ -4643,7 +4647,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->deflink.tx_stats.packets[queue] += skbs;
+ 	sta->deflink.tx_stats.bytes[queue] += len;
+ 
+-- 
+2.18.0
+