[rdkb][common][bsp][Refactor and sync wifi from openwrt]

[Description]
272d2eb6 [MAC80211][misc][Add Filogic Filogic 830 MP2.2 external reference release information]
389df5e2 [MAC80211][WiFi6/7][Misc][Fix STA group_cipher get non-initailized value]
6a1bd468 [MAC80211][wed][change wed token to 7K for mt7915]
fad8704c [MAC80211][wifi6][Release][Update Filogic 630/830/820/615 Firmwares]
c256e18f [mac80211][wifi6][mt76][wifi: mt76: revert patches to prevent station connection issue]
348bf60a [MAC80211][WiFi6/7][iw][Add support for 5G U-NII-3 & 4 setting without specifying center]
0a16e549 [MAC80211][WiFi7][Misc][Support backport source folder copy]
3ebd1ba5 [MAC80211][WiFi7][mt76][Add Kite default bin for different fem type]
221efcb8 [mac80211][wifi6][mt76][Update power on sequence for new chip version]
3a4d45a8 [mac80211][wifi6][mt76][Fix pleinfo to show PLE PAUSE]
30644444 [MAC80211][WiFi7][app][Add Kite support in atenl]
d698e4d9 [mac80211][wifi6][mt76][Update MT76 smp.sh and Makefile for Cheetah]
cc3c51c7 [MAC80211][wifi6][Release][Update MT7986 Firmware]
b3f7f9ba [Kernel][mt7988][hnat][Fix WAN->1G_LAN HNAT entry bind wrong in MAPE]
ea393925 [MAC80211[WiFi6/7]][hostapd][Avoid unnecessary beacon update]
6763be22 [MAC80211][wifi7][Misc][Sync Internal patches to External Release Folder]
d3ed9bc8 [mac80211][wifi7][mt76][Rebase WED patch due to Cheetah MT76 modifications]
2f4b03c3 [mac80211][wifi6][mt76][Bring-up hardware path for Cheetah MT76]

[Release-log]

Change-Id: I94ac3e2c4e78931c7552abdba582c4348faeee27
diff --git a/recipes-wifi/linux-mt76/files/patches/0008-wifi-mt76-mt7915-add-new-chip-version-in-power-on-se.patch b/recipes-wifi/linux-mt76/files/patches/0008-wifi-mt76-mt7915-add-new-chip-version-in-power-on-se.patch
new file mode 100644
index 0000000..1a02626
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/0008-wifi-mt76-mt7915-add-new-chip-version-in-power-on-se.patch
@@ -0,0 +1,27 @@
+From 46622d363ac9ad1a45ab3447eccf76f1fda9dc7e Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Tue, 17 Oct 2023 16:32:51 +0800
+Subject: [PATCH] wifi: mt76: mt7915: add new chip version in power on sequence
+
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+---
+ mt7915/soc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/mt7915/soc.c b/mt7915/soc.c
+index d8c80de6..b2916b02 100644
+--- a/mt7915/soc.c
++++ b/mt7915/soc.c
+@@ -517,7 +517,8 @@ static int mt798x_wmac_adie_patch_7976(struct mt7915_dev *dev, u8 adie)
+ 	if (ret)
+ 		return ret;
+ 
+-	if (version == 0x8a00 || version == 0x8a10 || version == 0x8b00) {
++	if (version == 0x8a00 || version == 0x8a10 ||
++	    version == 0x8b00 || version == 0x8c10) {
+ 		rg_xo_01 = 0x1d59080f;
+ 		rg_xo_03 = 0x34c00fe0;
+ 	} else {
+-- 
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/1000-wifi-mt76-mt7915-add-mtk-internal-debug-tools-for-mt.patch b/recipes-wifi/linux-mt76/files/patches/1000-wifi-mt76-mt7915-add-mtk-internal-debug-tools-for-mt.patch
index 096309d..ba96f5f 100644
--- a/recipes-wifi/linux-mt76/files/patches/1000-wifi-mt76-mt7915-add-mtk-internal-debug-tools-for-mt.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1000-wifi-mt76-mt7915-add-mtk-internal-debug-tools-for-mt.patch
@@ -1,4 +1,4 @@
-From f2346c4a30dd7be798f2a9d8575f8edce64ff8eb Mon Sep 17 00:00:00 2001
+From 09961de38c33d2cf5ba12679862726e6937e5c58 Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Wed, 22 Jun 2022 10:39:47 +0800
 Subject: [PATCH] wifi: mt76: mt7915: add mtk internal debug tools for mt76
@@ -1884,7 +1884,7 @@
 +#endif
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
 new file mode 100644
-index 00000000..772adbb3
+index 00000000..d7bbc598
 --- /dev/null
 +++ b/mt7915/mtk_debugfs.c
 @@ -0,0 +1,3622 @@
@@ -3306,10 +3306,10 @@
 +				seq_printf(s, "tail/head fid = 0x%03x/0x%03x, pkt cnt = 0x%03x",
 +						  tfid, hfid, pktcnt);
 +
-+				if (((sta_pause[j % 6] & 0x1 << i) >> i) == 1)
++				if (((sta_pause[j % ac_num] & 0x1 << i) >> i) == 1)
 +					ctrl = 2;
 +
-+				if (((dis_sta_map[j % 6] & 0x1 << i) >> i) == 1)
++				if (((dis_sta_map[j % ac_num] & 0x1 << i) >> i) == 1)
 +					ctrl = 1;
 +
 +				seq_printf(s, " ctrl = %s", sta_ctrl_reg[ctrl]);
diff --git a/recipes-wifi/linux-mt76/files/patches/2004-wifi-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch b/recipes-wifi/linux-mt76/files/patches/2004-wifi-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch
index a083852..4c9198f 100644
--- a/recipes-wifi/linux-mt76/files/patches/2004-wifi-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch
+++ b/recipes-wifi/linux-mt76/files/patches/2004-wifi-mt76-mt7915-wed-HW-ATF-support-for-mt7986.patch
@@ -1,4 +1,4 @@
-From 9c5767343f681ede3166f07b3051ab69cf75305a Mon Sep 17 00:00:00 2001
+From 125ddf12e213498dbddda005b1b84587bc1f1a46 Mon Sep 17 00:00:00 2001
 From: Lian Chen <lian.chen@mediatek.com>
 Date: Mon, 7 Nov 2022 14:47:44 +0800
 Subject: [PATCH] wifi: mt76: mt7915: wed: HW ATF support for mt7986
@@ -903,7 +903,7 @@
  int mt7915_mcu_set_txpower_sku(struct mt7915_phy *phy);
  int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len,
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index a9570ced..e90a928f 100644
+index 9fe7dcb1..9ff4c5cd 100644
 --- a/mt7915/mtk_debugfs.c
 +++ b/mt7915/mtk_debugfs.c
 @@ -1368,7 +1368,6 @@ static EMPTY_QUEUE_INFO_T ple_txcmd_queue_empty_info[] = {
@@ -967,10 +967,10 @@
 +				dev_info(dev->mt76.dev, "tail/head fid = 0x%03x/0x%03x, pkt cnt = 0x%03x",
 +					 tfid, hfid, pktcnt);
 +
-+				if (((sta_pause[j % 6] & 0x1 << i) >> i) == 1)
++				if (((sta_pause[j % ac_num] & 0x1 << i) >> i) == 1)
 +					ctrl = 2;
 +
-+				if (((dis_sta_map[j % 6] & 0x1 << i) >> i) == 1)
++				if (((dis_sta_map[j % ac_num] & 0x1 << i) >> i) == 1)
 +					ctrl = 1;
 +
 +				dev_info(dev->mt76.dev, " ctrl = %s", sta_ctrl_reg[ctrl]);
diff --git a/recipes-wifi/linux-mt76/files/patches/2011-mt76-wifi-mt7915-wed-setting-wed-hw-tx-token-to-8192.patch b/recipes-wifi/linux-mt76/files/patches/2011-mt76-wifi-mt7915-wed-setting-wed-hw-tx-token-to-8192.patch
deleted file mode 100644
index 13d1f48..0000000
--- a/recipes-wifi/linux-mt76/files/patches/2011-mt76-wifi-mt7915-wed-setting-wed-hw-tx-token-to-8192.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From 467bdd35a3ec4603761f1a7e2281a78a3776a0bb Mon Sep 17 00:00:00 2001
-From: "sujuan.chen" <sujuan.chen@mediatek.com>
-Date: Mon, 11 Sep 2023 17:57:32 +0800
-Subject: [PATCH 2011/2011] mt76: wifi: mt7915: wed: setting wed hw tx token to
- 8192
-
-Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
----
- mt7915/mmio.c   |  8 ++++----
- mt7915/mt7915.h |  4 ++--
- tx.c            | 26 ++++++++------------------
- 3 files changed, 14 insertions(+), 24 deletions(-)
-
-diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index aa5c5dd..b677947 100644
---- a/mt7915/mmio.c
-+++ b/mt7915/mmio.c
-@@ -593,7 +593,7 @@ static int mt7915_mmio_wed_offload_enable(struct mtk_wed_device *wed)
- 	dev = container_of(wed, struct mt7915_dev, mt76.mmio.wed);
- 
- 	spin_lock_bh(&dev->mt76.token_lock);
--	dev->mt76.token_size = wed->wlan.token_start;
-+	dev->mt76.token_size = MT7915_TOKEN_SIZE - MT7915_HW_TOKEN_SIZE;
- 	spin_unlock_bh(&dev->mt76.token_lock);
- 
- 	return !wait_event_timeout(dev->mt76.tx_wait,
-@@ -607,7 +607,7 @@ static void mt7915_mmio_wed_offload_disable(struct mtk_wed_device *wed)
- 	dev = container_of(wed, struct mt7915_dev, mt76.mmio.wed);
- 
- 	spin_lock_bh(&dev->mt76.token_lock);
--	dev->mt76.token_size = wed->wlan.token_start;//MT7915_TOKEN_SIZE
-+	dev->mt76.token_size = MT7915_TOKEN_SIZE - MT7915_HW_TOKEN_SIZE;
- 	spin_unlock_bh(&dev->mt76.token_lock);
- }
- 
-@@ -841,7 +841,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
- 	wed->wlan.tx_tbit[0] = is_mt7915(&dev->mt76) ? 4 : 30;
- 	wed->wlan.tx_tbit[1] = is_mt7915(&dev->mt76) ? 5 : 31;
- 	wed->wlan.txfree_tbit = is_mt798x(&dev->mt76) ? 2 : 1;
--	wed->wlan.token_start = MT7915_TOKEN_SIZE - wed->wlan.nbuf;
-+	wed->wlan.token_start = 0;
- 	wed->wlan.wcid_512 = !is_mt7915(&dev->mt76);
- 
- 	wed->wlan.rx_nbuf = 65536;
-@@ -874,7 +874,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
- 
- 	*irq = wed->irq;
- 	dev->mt76.dma_dev = wed->dev;
--	dev->mt76.token_size = wed->wlan.token_start;
-+	dev->mt76.token_size = MT7915_TOKEN_SIZE - MT7915_HW_TOKEN_SIZE;
- 
- 	ret = dma_set_mask(wed->dev, DMA_BIT_MASK(32));
- 	if (ret)
-diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index d47abcf..5f3b84e 100644
---- a/mt7915/mt7915.h
-+++ b/mt7915/mt7915.h
-@@ -62,8 +62,8 @@
- #define MT7916_EEPROM_SIZE		4096
- 
- #define MT7915_EEPROM_BLOCK_SIZE	16
--#define MT7915_HW_TOKEN_SIZE		7168
--#define MT7915_TOKEN_SIZE		8192
-+#define MT7915_HW_TOKEN_SIZE		8192
-+#define MT7915_TOKEN_SIZE		9216
- #define MT7915_RX_TOKEN_SIZE		4096
- 
- #define MT7915_CFEND_RATE_DEFAULT	0x49	/* OFDM 24M */
-diff --git a/tx.c b/tx.c
-index e290aef..96f9009 100644
---- a/tx.c
-+++ b/tx.c
-@@ -818,20 +818,18 @@ EXPORT_SYMBOL_GPL(__mt76_set_tx_blocked);
- 
- int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi)
- {
--	int token;
-+	int token, start = 0;
-+
-+	if (mtk_wed_device_active(&dev->mmio.wed))
-+		start = dev->mmio.wed.wlan.nbuf;
- 
- 	spin_lock_bh(&dev->token_lock);
- 
--	token = idr_alloc(&dev->token, *ptxwi, 0, dev->token_size, GFP_ATOMIC);
--	if (token >= 0)
-+	token = idr_alloc(&dev->token, *ptxwi, start, start + dev->token_size,
-+			  GFP_ATOMIC);
-+	if (token >= start)
- 		dev->token_count++;
- 
--#ifdef CONFIG_NET_MEDIATEK_SOC_WED
--	if (mtk_wed_device_active(&dev->mmio.wed) &&
--	    token >= dev->mmio.wed.wlan.token_start)
--		dev->wed_token_count++;
--#endif
--
- 	if (dev->token_count >= dev->token_size - MT76_TOKEN_FREE_THR)
- 		__mt76_set_tx_blocked(dev, true);
- 
-@@ -867,17 +865,9 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake)
- 	spin_lock_bh(&dev->token_lock);
- 
- 	txwi = idr_remove(&dev->token, token);
--	if (txwi) {
-+	if (txwi)
- 		dev->token_count--;
- 
--#ifdef CONFIG_NET_MEDIATEK_SOC_WED
--		if (mtk_wed_device_active(&dev->mmio.wed) &&
--		    token >= dev->mmio.wed.wlan.token_start &&
--		    --dev->wed_token_count == 0)
--			wake_up(&dev->tx_wait);
--#endif
--	}
--
- 	if (dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR &&
- 	    dev->phy.q_tx[0]->blocked)
- 		*wake = true;
--- 
-2.18.0
-
diff --git a/recipes-wifi/linux-mt76/files/patches/2011-wifi-mt76-mt7915-wed-change-wed-token-init-size-to-a.patch b/recipes-wifi/linux-mt76/files/patches/2011-wifi-mt76-mt7915-wed-change-wed-token-init-size-to-a.patch
new file mode 100644
index 0000000..49870b2
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/2011-wifi-mt76-mt7915-wed-change-wed-token-init-size-to-a.patch
@@ -0,0 +1,192 @@
+From 98e230f53b3e81ec9fc216054ebcf567c5e73406 Mon Sep 17 00:00:00 2001
+From: "sujuan.chen" <sujuan.chen@mediatek.com>
+Date: Mon, 11 Sep 2023 17:57:32 +0800
+Subject: [PATCH 20/25] wifi: mt76: mt7915: wed: change wed token init size to
+ adapt wed version
+
+Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
+---
+ mt7915/mac.c    | 10 ++++++++--
+ mt7915/mcu.c    |  7 +++++--
+ mt7915/mmio.c   | 13 ++++++++-----
+ mt7915/mt7915.h |  4 +++-
+ tx.c            | 26 ++++++++------------------
+ 5 files changed, 32 insertions(+), 28 deletions(-)
+
+diff --git a/mt7915/mac.c b/mt7915/mac.c
+index 59cc1fd7..a473fc61 100644
+--- a/mt7915/mac.c
++++ b/mt7915/mac.c
+@@ -932,7 +932,7 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
+ 	v3 = (FIELD_GET(MT_TX_FREE_VER, txd) == 0x4);
+ 
+ 	for (cur_info = tx_info; count < total; cur_info++) {
+-		u32 msdu, info;
++		u32 msdu, info, max_token_size = MT7915_TOKEN_SIZE;
+ 		u8 i;
+ 
+ 		if (WARN_ON_ONCE((void *)cur_info >= end))
+@@ -988,6 +988,12 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
+ 			wcid->stats.tx_failed += tx_failed;
+ 		}
+ 
++		if (mtk_wed_device_active(&mdev->mmio.wed))
++			max_token_size = (is_mt7915(&dev->mt76) ?
++					  MT7915_WED_TOKEN_SIZE_V0 :
++					  MT7915_WED_TOKEN_SIZE) +
++					 MT7915_WED_SW_TOKEN_SIZE;
++
+ 		if (v3 && (info & MT_TX_FREE_MPDU_HEADER_V3))
+ 			continue;
+ 
+@@ -1001,7 +1007,7 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
+ 			}
+ 
+ 			/* Todo: check if msdu is sw token */
+-			if (msdu > MT7915_TOKEN_SIZE)
++			if (msdu > max_token_size)
+ 				dev_err(mdev->dev, "Receive invalid token id(%d)\n",
+ 					msdu);
+ 
+diff --git a/mt7915/mcu.c b/mt7915/mcu.c
+index ebacfd27..b42f7be9 100644
+--- a/mt7915/mcu.c
++++ b/mt7915/mcu.c
+@@ -2318,6 +2318,9 @@ mt7915_mcu_init_rx_airtime(struct mt7915_dev *dev)
+ static int mt7915_red_set_watermark(struct mt7915_dev *dev)
+ {
+ #define RED_GLOBAL_TOKEN_WATERMARK 2
++	u16 token_size = is_mt7915(&dev->mt76) ?
++			 MT7915_WED_TOKEN_SIZE_V0 :
++			 MT7915_WED_TOKEN_SIZE;
+ 	struct {
+ 		__le32 args[3];
+ 		u8 cmd;
+@@ -2331,8 +2334,8 @@ static int mt7915_red_set_watermark(struct mt7915_dev *dev)
+ 		.args[0] = cpu_to_le32(MCU_WA_PARAM_RED_SETTING),
+ 		.cmd = RED_GLOBAL_TOKEN_WATERMARK,
+ 		.len = cpu_to_le16(sizeof(req) - sizeof(req.args)),
+-		.high_mark = cpu_to_le16(MT7915_HW_TOKEN_SIZE - 256),
+-		.low_mark = cpu_to_le16(MT7915_HW_TOKEN_SIZE - 256 - 1536),
++		.high_mark = cpu_to_le16(token_size - 256),
++		.low_mark = cpu_to_le16(token_size - 256 - 1536),
+ 	};
+ 
+ 	return mt76_mcu_send_msg(&dev->mt76, MCU_WA_PARAM_CMD(SET), &req,
+diff --git a/mt7915/mmio.c b/mt7915/mmio.c
+index aa5c5dd6..2ad7ba4a 100644
+--- a/mt7915/mmio.c
++++ b/mt7915/mmio.c
+@@ -593,7 +593,7 @@ static int mt7915_mmio_wed_offload_enable(struct mtk_wed_device *wed)
+ 	dev = container_of(wed, struct mt7915_dev, mt76.mmio.wed);
+ 
+ 	spin_lock_bh(&dev->mt76.token_lock);
+-	dev->mt76.token_size = wed->wlan.token_start;
++	dev->mt76.token_size = MT7915_WED_SW_TOKEN_SIZE;
+ 	spin_unlock_bh(&dev->mt76.token_lock);
+ 
+ 	return !wait_event_timeout(dev->mt76.tx_wait,
+@@ -607,7 +607,7 @@ static void mt7915_mmio_wed_offload_disable(struct mtk_wed_device *wed)
+ 	dev = container_of(wed, struct mt7915_dev, mt76.mmio.wed);
+ 
+ 	spin_lock_bh(&dev->mt76.token_lock);
+-	dev->mt76.token_size = wed->wlan.token_start;//MT7915_TOKEN_SIZE
++	dev->mt76.token_size = MT7915_WED_SW_TOKEN_SIZE;
+ 	spin_unlock_bh(&dev->mt76.token_lock);
+ }
+ 
+@@ -837,11 +837,14 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
+ 		wed->wlan.wpdma_rx_glo = res->start + MT_WPDMA_GLO_CFG;
+ 		wed->wlan.wpdma_rx = res->start + MT_RXQ_WED_DATA_RING_BASE;
+ 	}
+-	wed->wlan.nbuf = MT7915_HW_TOKEN_SIZE;
++
++	wed->wlan.nbuf = is_mt7915(&dev->mt76) ?
++			 MT7915_WED_TOKEN_SIZE_V0 :
++			 MT7915_WED_TOKEN_SIZE;
+ 	wed->wlan.tx_tbit[0] = is_mt7915(&dev->mt76) ? 4 : 30;
+ 	wed->wlan.tx_tbit[1] = is_mt7915(&dev->mt76) ? 5 : 31;
+ 	wed->wlan.txfree_tbit = is_mt798x(&dev->mt76) ? 2 : 1;
+-	wed->wlan.token_start = MT7915_TOKEN_SIZE - wed->wlan.nbuf;
++	wed->wlan.token_start = 0;
+ 	wed->wlan.wcid_512 = !is_mt7915(&dev->mt76);
+ 
+ 	wed->wlan.rx_nbuf = 65536;
+@@ -874,7 +877,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
+ 
+ 	*irq = wed->irq;
+ 	dev->mt76.dma_dev = wed->dev;
+-	dev->mt76.token_size = wed->wlan.token_start;
++	dev->mt76.token_size = MT7915_WED_SW_TOKEN_SIZE;
+ 
+ 	ret = dma_set_mask(wed->dev, DMA_BIT_MASK(32));
+ 	if (ret)
+diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
+index 6156850b..6a175374 100644
+--- a/mt7915/mt7915.h
++++ b/mt7915/mt7915.h
+@@ -62,7 +62,9 @@
+ #define MT7916_EEPROM_SIZE		4096
+ 
+ #define MT7915_EEPROM_BLOCK_SIZE	16
+-#define MT7915_HW_TOKEN_SIZE		7168
++#define MT7915_WED_TOKEN_SIZE		8192
++#define MT7915_WED_TOKEN_SIZE_V0	7168
++#define MT7915_WED_SW_TOKEN_SIZE	1024
+ #define MT7915_TOKEN_SIZE		8192
+ #define MT7915_RX_TOKEN_SIZE		4096
+ 
+diff --git a/tx.c b/tx.c
+index e290aef3..96f9009b 100644
+--- a/tx.c
++++ b/tx.c
+@@ -818,20 +818,18 @@ EXPORT_SYMBOL_GPL(__mt76_set_tx_blocked);
+ 
+ int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi)
+ {
+-	int token;
++	int token, start = 0;
++
++	if (mtk_wed_device_active(&dev->mmio.wed))
++		start = dev->mmio.wed.wlan.nbuf;
+ 
+ 	spin_lock_bh(&dev->token_lock);
+ 
+-	token = idr_alloc(&dev->token, *ptxwi, 0, dev->token_size, GFP_ATOMIC);
+-	if (token >= 0)
++	token = idr_alloc(&dev->token, *ptxwi, start, start + dev->token_size,
++			  GFP_ATOMIC);
++	if (token >= start)
+ 		dev->token_count++;
+ 
+-#ifdef CONFIG_NET_MEDIATEK_SOC_WED
+-	if (mtk_wed_device_active(&dev->mmio.wed) &&
+-	    token >= dev->mmio.wed.wlan.token_start)
+-		dev->wed_token_count++;
+-#endif
+-
+ 	if (dev->token_count >= dev->token_size - MT76_TOKEN_FREE_THR)
+ 		__mt76_set_tx_blocked(dev, true);
+ 
+@@ -867,17 +865,9 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake)
+ 	spin_lock_bh(&dev->token_lock);
+ 
+ 	txwi = idr_remove(&dev->token, token);
+-	if (txwi) {
++	if (txwi)
+ 		dev->token_count--;
+ 
+-#ifdef CONFIG_NET_MEDIATEK_SOC_WED
+-		if (mtk_wed_device_active(&dev->mmio.wed) &&
+-		    token >= dev->mmio.wed.wlan.token_start &&
+-		    --dev->wed_token_count == 0)
+-			wake_up(&dev->tx_wait);
+-#endif
+-	}
+-
+ 	if (dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR &&
+ 	    dev->phy.q_tx[0]->blocked)
+ 		*wake = true;
+-- 
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/2012-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-selected-.patch b/recipes-wifi/linux-mt76/files/patches/2012-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-selected-.patch
new file mode 100644
index 0000000..aea2ccd
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/2012-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-selected-.patch
@@ -0,0 +1,41 @@
+From 5959391d31be290f08b6614c178231a298b4b91e Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Mon, 23 Oct 2023 10:25:13 +0800
+Subject: [PATCH 2012/2015] Revert "wifi: mt76: mt7921: fix the wrong rate
+ selected in fw for the chanctx driver"
+
+This reverts commit 9fc37b0ac5467cfe5e3d2ad8a29e9a7646ece2be.
+---
+ mt76_connac_mcu.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
+index aa99bd78..3a6404a7 100644
+--- a/mt76_connac_mcu.c
++++ b/mt76_connac_mcu.c
+@@ -837,9 +837,7 @@ void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb,
+ 			     struct ieee80211_vif *vif,
+ 			     u8 rcpi, u8 sta_state)
+ {
+-	struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
+-	struct cfg80211_chan_def *chandef = mvif->ctx ?
+-					    &mvif->ctx->def : &mphy->chandef;
++	struct cfg80211_chan_def *chandef = &mphy->chandef;
+ 	enum nl80211_band band = chandef->chan->band;
+ 	struct mt76_dev *dev = mphy->dev;
+ 	struct sta_rec_ra_info *ra_info;
+@@ -1345,10 +1343,7 @@ EXPORT_SYMBOL_GPL(mt76_connac_get_phy_mode);
+ const struct ieee80211_sta_he_cap *
+ mt76_connac_get_he_phy_cap(struct mt76_phy *phy, struct ieee80211_vif *vif)
+ {
+-	struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
+-	struct cfg80211_chan_def *chandef = mvif->ctx ?
+-					    &mvif->ctx->def : &phy->chandef;
+-	enum nl80211_band band = chandef->chan->band;
++	enum nl80211_band band = phy->chandef.chan->band;
+ 	struct ieee80211_supported_band *sband;
+ 
+ 	sband = phy->hw->wiphy->bands[band];
+-- 
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/2013-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-pickup-fo.patch b/recipes-wifi/linux-mt76/files/patches/2013-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-pickup-fo.patch
new file mode 100644
index 0000000..4997109
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/2013-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-pickup-fo.patch
@@ -0,0 +1,78 @@
+From b5cc571132a848d5daa3bec3ee07274205a98df0 Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Mon, 23 Oct 2023 10:25:18 +0800
+Subject: [PATCH 2013/2015] Revert "wifi: mt76: mt7921: fix the wrong rate
+ pickup for the chanctx driver"
+
+This reverts commit 66d5694e1898c5584a83c60876bec16909ebe2b0.
+---
+ mac80211.c        | 9 ++-------
+ mt76.h            | 3 +--
+ mt76_connac_mac.c | 7 ++-----
+ 3 files changed, 5 insertions(+), 14 deletions(-)
+
+diff --git a/mac80211.c b/mac80211.c
+index 137c5204..37e6a627 100644
+--- a/mac80211.c
++++ b/mac80211.c
+@@ -1710,16 +1710,11 @@ mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
+ }
+ EXPORT_SYMBOL_GPL(mt76_init_queue);
+ 
+-u16 mt76_calculate_default_rate(struct mt76_phy *phy,
+-				struct ieee80211_vif *vif, int rateidx)
++u16 mt76_calculate_default_rate(struct mt76_phy *phy, int rateidx)
+ {
+-	struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
+-	struct cfg80211_chan_def *chandef = mvif->ctx ?
+-					    &mvif->ctx->def :
+-					    &phy->chandef;
+ 	int offset = 0;
+ 
+-	if (chandef->chan->band != NL80211_BAND_2GHZ)
++	if (phy->chandef.chan->band != NL80211_BAND_2GHZ)
+ 		offset = 4;
+ 
+ 	/* pick the lowest rate for hidden nodes */
+diff --git a/mt76.h b/mt76.h
+index 0a7f4f14..05144b2c 100644
+--- a/mt76.h
++++ b/mt76.h
+@@ -1207,8 +1207,7 @@ bool mt76_check_bin_file_mode(struct mt76_dev *dev);
+ struct mt76_queue *
+ mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
+ 		int ring_base, u32 flags);
+-u16 mt76_calculate_default_rate(struct mt76_phy *phy,
+-				struct ieee80211_vif *vif, int rateidx);
++u16 mt76_calculate_default_rate(struct mt76_phy *phy, int rateidx);
+ static inline int mt76_init_tx_queue(struct mt76_phy *phy, int qid, int idx,
+ 				     int n_desc, int ring_base, u32 flags)
+ {
+diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
+index faeae26d..431d60d3 100644
+--- a/mt76_connac_mac.c
++++ b/mt76_connac_mac.c
+@@ -293,10 +293,7 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
+ 				 struct ieee80211_vif *vif,
+ 				 bool beacon, bool mcast)
+ {
+-	struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
+-	struct cfg80211_chan_def *chandef = mvif->ctx ?
+-					    &mvif->ctx->def : &mphy->chandef;
+-	u8 nss = 0, mode = 0, band = chandef->chan->band;
++	u8 nss = 0, mode = 0, band = mphy->chandef.chan->band;
+ 	int rateidx = 0, mcast_rate;
+ 
+ 	if (!vif)
+@@ -329,7 +326,7 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
+ 		rateidx = ffs(vif->bss_conf.basic_rates) - 1;
+ 
+ legacy:
+-	rateidx = mt76_calculate_default_rate(mphy, vif, rateidx);
++	rateidx = mt76_calculate_default_rate(mphy, rateidx);
+ 	mode = rateidx >> 8;
+ 	rateidx &= GENMASK(7, 0);
+ out:
+-- 
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/2014-Revert-wifi-mt76-move-struct-ieee80211_chanctx_conf-.patch b/recipes-wifi/linux-mt76/files/patches/2014-Revert-wifi-mt76-move-struct-ieee80211_chanctx_conf-.patch
new file mode 100644
index 0000000..27dc9f6
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/2014-Revert-wifi-mt76-move-struct-ieee80211_chanctx_conf-.patch
@@ -0,0 +1,121 @@
+From ae8181c30d187de764055ab15fd7f3efd8aa736c Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Mon, 23 Oct 2023 10:25:25 +0800
+Subject: [PATCH 2014/2015] Revert "wifi: mt76: move struct
+ ieee80211_chanctx_conf up to struct mt76_vif"
+
+This reverts commit d1881b1b2bf6018d1cb1b91e4301a60021cacaa3.
+---
+ mt76.h        |  1 -
+ mt7921/main.c | 12 ++++++------
+ mt792x.h      |  1 +
+ mt792x_core.c |  4 ++--
+ 4 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/mt76.h b/mt76.h
+index 05144b2c..3ff348f2 100644
+--- a/mt76.h
++++ b/mt76.h
+@@ -798,7 +798,6 @@ struct mt76_vif {
+ 	u8 basic_rates_idx;
+ 	u8 mcast_rates_idx;
+ 	u8 beacon_rates_idx;
+-	struct ieee80211_chanctx_conf *ctx;
+ };
+ 
+ struct mt76_phy {
+diff --git a/mt7921/main.c b/mt7921/main.c
+index 6a5c2cae..28c7e04b 100644
+--- a/mt7921/main.c
++++ b/mt7921/main.c
+@@ -756,7 +756,7 @@ void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+ 
+ 	if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
+ 		mt76_connac_mcu_uni_add_bss(&dev->mphy, vif, &mvif->sta.wcid,
+-					    true, mvif->mt76.ctx);
++					    true, mvif->ctx);
+ 
+ 	ewma_avg_signal_init(&msta->avg_ack_signal);
+ 
+@@ -791,7 +791,7 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+ 		if (!sta->tdls)
+ 			mt76_connac_mcu_uni_add_bss(&dev->mphy, vif,
+ 						    &mvif->sta.wcid, false,
+-						    mvif->mt76.ctx);
++						    mvif->ctx);
+ 	}
+ 
+ 	spin_lock_bh(&dev->mt76.sta_poll_lock);
+@@ -1208,7 +1208,7 @@ mt7921_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ 	mt792x_mutex_acquire(dev);
+ 
+ 	err = mt76_connac_mcu_uni_add_bss(phy->mt76, vif, &mvif->sta.wcid,
+-					  true, mvif->mt76.ctx);
++					  true, mvif->ctx);
+ 	if (err)
+ 		goto out;
+ 
+@@ -1240,7 +1240,7 @@ mt7921_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ 		goto out;
+ 
+ 	mt76_connac_mcu_uni_add_bss(phy->mt76, vif, &mvif->sta.wcid, false,
+-				    mvif->mt76.ctx);
++				    mvif->ctx);
+ 
+ out:
+ 	mt792x_mutex_release(dev);
+@@ -1265,7 +1265,7 @@ static void mt7921_ctx_iter(void *priv, u8 *mac,
+ 	struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+ 	struct ieee80211_chanctx_conf *ctx = priv;
+ 
+-	if (ctx != mvif->mt76.ctx)
++	if (ctx != mvif->ctx)
+ 		return;
+ 
+ 	if (vif->type == NL80211_IFTYPE_MONITOR)
+@@ -1298,7 +1298,7 @@ static void mt7921_mgd_prepare_tx(struct ieee80211_hw *hw,
+ 		       jiffies_to_msecs(HZ);
+ 
+ 	mt792x_mutex_acquire(dev);
+-	mt7921_set_roc(mvif->phy, mvif, mvif->mt76.ctx->def.chan, duration,
++	mt7921_set_roc(mvif->phy, mvif, mvif->ctx->def.chan, duration,
+ 		       MT7921_ROC_REQ_JOIN);
+ 	mt792x_mutex_release(dev);
+ }
+diff --git a/mt792x.h b/mt792x.h
+index 548e89fa..39cbd139 100644
+--- a/mt792x.h
++++ b/mt792x.h
+@@ -93,6 +93,7 @@ struct mt792x_vif {
+ 	struct ewma_rssi rssi;
+ 
+ 	struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS];
++	struct ieee80211_chanctx_conf *ctx;
+ };
+ 
+ struct mt792x_phy {
+diff --git a/mt792x_core.c b/mt792x_core.c
+index 7c4a74fb..8c97ac00 100644
+--- a/mt792x_core.c
++++ b/mt792x_core.c
+@@ -243,7 +243,7 @@ int mt792x_assign_vif_chanctx(struct ieee80211_hw *hw,
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 
+ 	mutex_lock(&dev->mt76.mutex);
+-	mvif->mt76.ctx = ctx;
++	mvif->ctx = ctx;
+ 	mutex_unlock(&dev->mt76.mutex);
+ 
+ 	return 0;
+@@ -259,7 +259,7 @@ void mt792x_unassign_vif_chanctx(struct ieee80211_hw *hw,
+ 	struct mt792x_dev *dev = mt792x_hw_dev(hw);
+ 
+ 	mutex_lock(&dev->mt76.mutex);
+-	mvif->mt76.ctx = NULL;
++	mvif->ctx = NULL;
+ 	mutex_unlock(&dev->mt76.mutex);
+ }
+ EXPORT_SYMBOL_GPL(mt792x_unassign_vif_chanctx);
+-- 
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/2015-Revert-wifi-mt76-fix-race-condition-related-to-check.patch b/recipes-wifi/linux-mt76/files/patches/2015-Revert-wifi-mt76-fix-race-condition-related-to-check.patch
new file mode 100644
index 0000000..91507f4
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/2015-Revert-wifi-mt76-fix-race-condition-related-to-check.patch
@@ -0,0 +1,256 @@
+From 20d498a3d24a4c20a421bc6bc19a058620aa86ec Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Mon, 23 Oct 2023 10:26:01 +0800
+Subject: [PATCH 2015/2015] Revert "wifi: mt76: fix race condition related to
+ checking tx queue fill status"
+
+This reverts commit f1e1e67d97d1e9a8bb01b59ab20c45ebc985a958.
+---
+ mac80211.c |  27 --------------
+ mt76.h     |   5 ---
+ tx.c       | 108 ++++++++++-------------------------------------------
+ 3 files changed, 20 insertions(+), 120 deletions(-)
+
+diff --git a/mac80211.c b/mac80211.c
+index 37e6a627..923c6a31 100644
+--- a/mac80211.c
++++ b/mac80211.c
+@@ -427,9 +427,6 @@ mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)
+ 	struct mt76_dev *dev = phy->dev;
+ 	struct wiphy *wiphy = hw->wiphy;
+ 
+-	INIT_LIST_HEAD(&phy->tx_list);
+-	spin_lock_init(&phy->tx_lock);
+-
+ 	SET_IEEE80211_DEV(hw, dev->dev);
+ 	SET_IEEE80211_PERM_ADDR(hw, phy->macaddr);
+ 
+@@ -662,7 +659,6 @@ int mt76_register_device(struct mt76_dev *dev, bool vht,
+ 	int ret;
+ 
+ 	dev_set_drvdata(dev->dev, dev);
+-	mt76_wcid_init(&dev->global_wcid);
+ 	ret = mt76_phy_init(phy, hw);
+ 	if (ret)
+ 		return ret;
+@@ -718,7 +714,6 @@ void mt76_unregister_device(struct mt76_dev *dev)
+ 	if (IS_ENABLED(CONFIG_MT76_LEDS))
+ 		mt76_led_cleanup(&dev->phy);
+ 	mt76_tx_status_check(dev, true);
+-	mt76_wcid_cleanup(dev, &dev->global_wcid);
+ 	ieee80211_unregister_hw(hw);
+ }
+ EXPORT_SYMBOL_GPL(mt76_unregister_device);
+@@ -1460,9 +1455,6 @@ EXPORT_SYMBOL_GPL(mt76_sta_pre_rcu_remove);
+ 
+ void mt76_wcid_init(struct mt76_wcid *wcid)
+ {
+-	INIT_LIST_HEAD(&wcid->tx_list);
+-	skb_queue_head_init(&wcid->tx_pending);
+-
+ 	INIT_LIST_HEAD(&wcid->list);
+ 	idr_init(&wcid->pktid);
+ }
+@@ -1470,32 +1462,13 @@ EXPORT_SYMBOL_GPL(mt76_wcid_init);
+ 
+ void mt76_wcid_cleanup(struct mt76_dev *dev, struct mt76_wcid *wcid)
+ {
+-	struct mt76_phy *phy = dev->phys[wcid->phy_idx];
+-	struct ieee80211_hw *hw;
+ 	struct sk_buff_head list;
+-	struct sk_buff *skb;
+ 
+ 	mt76_tx_status_lock(dev, &list);
+ 	mt76_tx_status_skb_get(dev, wcid, -1, &list);
+ 	mt76_tx_status_unlock(dev, &list);
+ 
+ 	idr_destroy(&wcid->pktid);
+-
+-	spin_lock_bh(&phy->tx_lock);
+-
+-	if (!list_empty(&wcid->tx_list))
+-		list_del_init(&wcid->tx_list);
+-
+-	spin_lock(&wcid->tx_pending.lock);
+-	skb_queue_splice_tail_init(&wcid->tx_pending, &list);
+-	spin_unlock(&wcid->tx_pending.lock);
+-
+-	spin_unlock_bh(&phy->tx_lock);
+-
+-	while ((skb = __skb_dequeue(&list)) != NULL) {
+-		hw = mt76_tx_status_get_hw(dev, skb);
+-		ieee80211_free_txskb(hw, skb);
+-	}
+ }
+ EXPORT_SYMBOL_GPL(mt76_wcid_cleanup);
+ 
+diff --git a/mt76.h b/mt76.h
+index 3ff348f2..5eb571ef 100644
+--- a/mt76.h
++++ b/mt76.h
+@@ -354,9 +354,6 @@ struct mt76_wcid {
+ 	u32 tx_info;
+ 	bool sw_iv;
+ 
+-	struct list_head tx_list;
+-	struct sk_buff_head tx_pending;
+-
+ 	struct list_head list;
+ 	struct idr pktid;
+ 
+@@ -808,8 +805,6 @@ struct mt76_phy {
+ 	unsigned long state;
+ 	u8 band_idx;
+ 
+-	spinlock_t tx_lock;
+-	struct list_head tx_list;
+ 	struct mt76_queue *q_tx[__MT_TXQ_MAX];
+ 
+ 	struct cfg80211_chan_def chandef;
+diff --git a/tx.c b/tx.c
+index 23a1e4e2..9dfc2890 100644
+--- a/tx.c
++++ b/tx.c
+@@ -322,32 +322,40 @@ void
+ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
+ 	struct mt76_wcid *wcid, struct sk_buff *skb)
+ {
++	struct mt76_dev *dev = phy->dev;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct mt76_queue *q;
++	int qid = skb_get_queue_mapping(skb);
+ 
+ 	if (mt76_testmode_enabled(phy)) {
+ 		ieee80211_free_txskb(phy->hw, skb);
+ 		return;
+ 	}
+ 
+-	if (WARN_ON(skb_get_queue_mapping(skb) >= MT_TXQ_PSD))
+-		skb_set_queue_mapping(skb, MT_TXQ_BE);
++	if (WARN_ON(qid >= MT_TXQ_PSD)) {
++		qid = MT_TXQ_BE;
++		skb_set_queue_mapping(skb, qid);
++	}
++
++	if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) &&
++	    !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
++	    !ieee80211_is_data(hdr->frame_control) &&
++	    !ieee80211_is_bufferable_mmpdu(skb)) {
++		qid = MT_TXQ_PSD;
++	}
+ 
+ 	if (wcid && !(wcid->tx_info & MT_WCID_TX_INFO_SET))
+ 		ieee80211_get_tx_rates(info->control.vif, sta, skb,
+ 				       info->control.rates, 1);
+ 
+ 	info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->band_idx);
++	q = phy->q_tx[qid];
+ 
+-	spin_lock_bh(&wcid->tx_pending.lock);
+-	__skb_queue_tail(&wcid->tx_pending, skb);
+-	spin_unlock_bh(&wcid->tx_pending.lock);
+-
+-	spin_lock_bh(&phy->tx_lock);
+-	if (list_empty(&wcid->tx_list))
+-		list_add_tail(&wcid->tx_list, &phy->tx_list);
+-	spin_unlock_bh(&phy->tx_lock);
+-
+-	mt76_worker_schedule(&phy->dev->tx_worker);
++	spin_lock_bh(&q->lock);
++	__mt76_tx_queue_skb(phy, qid, skb, wcid, sta, NULL);
++	dev->queue_ops->kick(dev, q);
++	spin_unlock_bh(&q->lock);
+ }
+ EXPORT_SYMBOL_GPL(mt76_tx);
+ 
+@@ -578,86 +586,10 @@ void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid)
+ }
+ EXPORT_SYMBOL_GPL(mt76_txq_schedule);
+ 
+-static int
+-mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid)
+-{
+-	struct mt76_dev *dev = phy->dev;
+-	struct ieee80211_sta *sta;
+-	struct mt76_queue *q;
+-	struct sk_buff *skb;
+-	int ret = 0;
+-
+-	spin_lock(&wcid->tx_pending.lock);
+-	while ((skb = skb_peek(&wcid->tx_pending)) != NULL) {
+-		struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+-		struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+-		int qid = skb_get_queue_mapping(skb);
+-
+-		if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) &&
+-		    !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
+-		    !ieee80211_is_data(hdr->frame_control) &&
+-		    !ieee80211_is_bufferable_mmpdu(skb))
+-			qid = MT_TXQ_PSD;
+-
+-		q = phy->q_tx[qid];
+-		if (mt76_txq_stopped(q)) {
+-			ret = -1;
+-			break;
+-		}
+-
+-		__skb_unlink(skb, &wcid->tx_pending);
+-		spin_unlock(&wcid->tx_pending.lock);
+-
+-		sta = wcid_to_sta(wcid);
+-		spin_lock(&q->lock);
+-		__mt76_tx_queue_skb(phy, qid, skb, wcid, sta, NULL);
+-		dev->queue_ops->kick(dev, q);
+-		spin_unlock(&q->lock);
+-
+-		spin_lock(&wcid->tx_pending.lock);
+-	}
+-	spin_unlock(&wcid->tx_pending.lock);
+-
+-	return ret;
+-}
+-
+-static void mt76_txq_schedule_pending(struct mt76_phy *phy)
+-{
+-	if (list_empty(&phy->tx_list))
+-		return;
+-
+-	local_bh_disable();
+-	rcu_read_lock();
+-
+-	spin_lock(&phy->tx_lock);
+-	while (!list_empty(&phy->tx_list)) {
+-		struct mt76_wcid *wcid = NULL;
+-		int ret;
+-
+-		wcid = list_first_entry(&phy->tx_list, struct mt76_wcid, tx_list);
+-		list_del_init(&wcid->tx_list);
+-
+-		spin_unlock(&phy->tx_lock);
+-		ret = mt76_txq_schedule_pending_wcid(phy, wcid);
+-		spin_lock(&phy->tx_lock);
+-
+-		if (ret) {
+-			if (list_empty(&wcid->tx_list))
+-				list_add_tail(&wcid->tx_list, &phy->tx_list);
+-			break;
+-		}
+-	}
+-	spin_unlock(&phy->tx_lock);
+-
+-	rcu_read_unlock();
+-	local_bh_enable();
+-}
+-
+ void mt76_txq_schedule_all(struct mt76_phy *phy)
+ {
+ 	int i;
+ 
+-	mt76_txq_schedule_pending(phy);
+ 	for (i = 0; i <= MT_TXQ_BK; i++)
+ 		mt76_txq_schedule(phy, i);
+ }
+-- 
+2.18.0
+
diff --git a/recipes-wifi/linux-mt76/files/patches/patches.inc b/recipes-wifi/linux-mt76/files/patches/patches.inc
index 4abe720..9219623 100644
--- a/recipes-wifi/linux-mt76/files/patches/patches.inc
+++ b/recipes-wifi/linux-mt76/files/patches/patches.inc
@@ -7,6 +7,7 @@
     file://0005-wifi-mt76-mt7915-rework-init-txpower.patch \
     file://0006-wifi-mt76-mt7915-rework-mmio-access-flow.patch \
     file://0007-wifi-mt76-disable-HW-AMSDU-when-using-fixed-rate.patch \
+    file://0008-wifi-mt76-mt7915-add-new-chip-version-in-power-on-se.patch \
     file://0999-wifi-mt76-mt7915-build-pass-for-Linux-Kernel-5.4-fix.patch \
     file://1000-wifi-mt76-mt7915-add-mtk-internal-debug-tools-for-mt.patch \
     file://1001-wifi-mt76-mt7915-csi-implement-csi-support.patch \
@@ -62,6 +63,10 @@
     file://2008-wifi-mt76-connac-wed-add-wed-rx-copy-skb.patch \
     file://2009-wifi-mt76-mt7915-enable-wa-log-to-uart.patch \
     file://2010-wifi-mt76-mt7915-add-error-message-when-driver-recei.patch \
-    file://2011-mt76-wifi-mt7915-wed-setting-wed-hw-tx-token-to-8192.patch;apply=no  \
+    file://2011-wifi-mt76-mt7915-wed-change-wed-token-init-size-to-a.patch \
+    file://2012-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-selected-.patch \
+    file://2013-Revert-wifi-mt76-mt7921-fix-the-wrong-rate-pickup-fo.patch \
+    file://2014-Revert-wifi-mt76-move-struct-ieee80211_chanctx_conf-.patch \
+    file://2015-Revert-wifi-mt76-fix-race-condition-related-to-check.patch \
     file://9999-mt76-revert-for-backports-5.15-wireless-stack.patch \
     "