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

[Description]
387b6ecf [MAC80211][WiFi6][core][Add exported function for SoftMAC driver to get QoS map]
4e3cb5c0 [MAC80211][Rebase Patch][Fix inconsistent QoS mapping between SW and HW]
03f284d9 [MAC80211][WiFi6][mt76][Fix inconsistent QoS mapping between SW and HW]
cdd2ea74 [MAC80211][WiFi6][mt76][Fix rcu stall issue in testmode]
8f684af1 [MAC80211][Release][Add commit revision for Filogic 880/860 release]
bf9808d3 [MAC80211][WiFi6][mt76][Refactor add dummy HW offload of IEEE 802.11 fragmentation]
00b8ee9c [MAC80211][misc][Update Release Information v2]
efcc36f2 [MAC80211][misc][Update Release Information]
8249196d [MAC80211][WiFi7][misc][Add UCI radio disabled for testmode]

[Release-log]

Change-Id: I0e39f84703dc98e6f25cf7d59e98729d33cc6f12
diff --git a/recipes-wifi/linux-mt76/files/patches/0016-wifi-mt76-mt7915-add-dummy-HW-offload-of-IEEE-802.11.patch b/recipes-wifi/linux-mt76/files/patches/0016-wifi-mt76-mt7915-add-dummy-HW-offload-of-IEEE-802.11.patch
index ac40da9..b062d40 100644
--- a/recipes-wifi/linux-mt76/files/patches/0016-wifi-mt76-mt7915-add-dummy-HW-offload-of-IEEE-802.11.patch
+++ b/recipes-wifi/linux-mt76/files/patches/0016-wifi-mt76-mt7915-add-dummy-HW-offload-of-IEEE-802.11.patch
@@ -36,7 +36,7 @@
 +static int
 +mt7915_set_frag_threshold(struct ieee80211_hw *hw, u32 val)
 +{
-+	return -EOPNOTSUPP;
++	return 0;
 +}
 +
  static int
diff --git a/recipes-wifi/linux-mt76/files/patches/0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch b/recipes-wifi/linux-mt76/files/patches/0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch
new file mode 100644
index 0000000..d4d3d2e
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.patch
@@ -0,0 +1,103 @@
+From 9c6e5082d5552ac2cefe5b4857da4b29b0c76685 Mon Sep 17 00:00:00 2001
+From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+Date: Thu, 25 Apr 2024 17:17:13 +0800
+Subject: [PATCH] wifi: mt76: mt7915: fix inconsistent QoS mapping between SW
+ and HW
+
+The mapping from IP DSCP to IEEE 802.11 user priority may be customized.
+Therefore, driver needs to pass the mapping to HW, so that the QoS type of traffic can be mapped in a consistent manner for both SW and HW paths.
+
+Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
+---
+ mt76_connac_mcu.h |  1 +
+ mt7915/main.c     |  3 +++
+ mt7915/mcu.c      | 37 +++++++++++++++++++++++++++++++++++++
+ mt7915/mt7915.h   |  1 +
+ 4 files changed, 42 insertions(+)
+
+diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
+index 1dd8244..0936c1c 100644
+--- a/mt76_connac_mcu.h
++++ b/mt76_connac_mcu.h
+@@ -1236,6 +1236,7 @@ enum {
+ 	MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
+ 	MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
+ 	MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
++	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
+ };
+ 
+ enum {
+diff --git a/mt7915/main.c b/mt7915/main.c
+index 5ed84bc..26f9a5a 100644
+--- a/mt7915/main.c
++++ b/mt7915/main.c
+@@ -646,6 +646,9 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
+ 		}
+ 	}
+ 
++	if (changed & BSS_CHANGED_QOS)
++		mt7915_mcu_set_qos_map(dev, vif);
++
+ 	/* ensure that enable txcmd_mode after bss_info */
+ 	if (changed & (BSS_CHANGED_QOS | BSS_CHANGED_BEACON_ENABLED))
+ 		mt7915_mcu_set_tx(dev, vif);
+diff --git a/mt7915/mcu.c b/mt7915/mcu.c
+index 446c512..3d7fc6d 100644
+--- a/mt7915/mcu.c
++++ b/mt7915/mcu.c
+@@ -4212,3 +4212,40 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
+ 
+ 	return 0;
+ }
++
++int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
++{
++#define IP_DSCP_NUM	64
++	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
++	struct {
++		u8 bss_idx;
++		u8 qos_map_enable;
++		u8 __rsv[2];
++		s8 qos_map[IP_DSCP_NUM];
++	} __packed req = {
++		.bss_idx = mvif->mt76.idx,
++		.qos_map_enable = false,
++	};
++	struct cfg80211_qos_map *qos_map;
++
++	rcu_read_lock();
++	qos_map = ieee80211_get_qos_map(vif);
++	if (qos_map) {
++		struct cfg80211_dscp_range *dscp_range = qos_map->up;
++		s8 up;
++
++		req.qos_map_enable = true;
++		for (up = 0; up < IEEE80211_NUM_UPS; ++up) {
++			u8 low = dscp_range[up].low, high = dscp_range[up].high;
++
++			if (low >= IP_DSCP_NUM || high >= IP_DSCP_NUM || low > high)
++				continue;
++
++			memset(req.qos_map + low, up, high - low + 1);
++		}
++	}
++	rcu_read_unlock();
++
++	return mt76_mcu_send_msg(&dev->mt76, MCU_WA_EXT_CMD(SET_QOS_MAP), &req,
++				 sizeof(req), true);
++}
+diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
+index 74cd8ca..66d87d7 100644
+--- a/mt7915/mt7915.h
++++ b/mt7915/mt7915.h
+@@ -521,6 +521,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
+ void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
+ void mt7915_mcu_exit(struct mt7915_dev *dev);
+ void mt7915_mcu_wmm_pbc_work(struct work_struct *work);
++int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif);
+ 
+ static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
+ {
+-- 
+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 22f88f4..a03665b 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,8 +1,7 @@
-From 9cbf64d8b75c4d6f988ac10f8654b640bec98320 Mon Sep 17 00:00:00 2001
+From ae5f0852b50290e0aaf2ff9d5dd8f9bd2b97bbb6 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 1000/1053] wifi: mt76: mt7915: add mtk internal debug tools
- for mt76
+Subject: [PATCH] wifi: mt76: mt7915: add mtk internal debug tools for mt76
 
 ---
  mt76_connac_mcu.h     |    6 +
@@ -24,7 +23,7 @@
  create mode 100644 mt7915/mtk_mcu.c
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 61ca241..ac524fe 100644
+index 99cdd1b..a8690cd 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1195,6 +1195,7 @@ enum {
@@ -272,7 +271,7 @@
  }
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 407da07..e7166c6 100644
+index e10cdb3..3ac3df3 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -73,7 +73,11 @@ int mt7915_run(struct ieee80211_hw *hw)
@@ -296,7 +295,7 @@
  	mt7915_mac_wtbl_update(dev, idx,
  			       MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 8f6bc6e..321a839 100644
+index 3e3d57c..1a3647a 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -205,6 +205,11 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
@@ -356,11 +355,10 @@
  int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
  {
  	struct {
-@@ -4213,3 +4240,22 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
- 
+@@ -4214,6 +4241,25 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
  	return 0;
  }
-+
+ 
 +#ifdef MTK_DEBUG
 +int mt7915_mcu_set_amsdu_algo(struct mt7915_dev *dev, u16 wcid, u8 enable)
 +{
@@ -379,6 +377,10 @@
 +	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MEC_CTRL), &req, sizeof(req), true);
 +}
 +#endif
++
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
+ {
+ #define IP_DSCP_NUM	64
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
 index fa0847d..9ae0f07 100644
 --- a/mt7915/mcu.h
@@ -395,7 +397,7 @@
  	MCU_WA_PARAM_RED_SETTING = 0x40,
  };
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 74cd8ca..58c0bf9 100644
+index 66d87d7..398f851 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -9,6 +9,7 @@
@@ -455,7 +457,7 @@
  	bool wmm_pbc_enable;
  	struct work_struct wmm_pbc_work;
  	u32 adie_type;
-@@ -610,4 +646,24 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+@@ -611,4 +647,24 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
  			 bool pci, int *irq);
  
@@ -1930,7 +1932,7 @@
 +#endif
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
 new file mode 100644
-index 0000000..d2b5b7d
+index 0000000..62d3a99
 --- /dev/null
 +++ b/mt7915/mtk_debugfs.c
 @@ -0,0 +1,3750 @@
diff --git a/recipes-wifi/linux-mt76/files/patches/1001-wifi-mt76-mt7915-csi-implement-csi-support.patch b/recipes-wifi/linux-mt76/files/patches/1001-wifi-mt76-mt7915-csi-implement-csi-support.patch
index 2601a42..75db3ee 100644
--- a/recipes-wifi/linux-mt76/files/patches/1001-wifi-mt76-mt7915-csi-implement-csi-support.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1001-wifi-mt76-mt7915-csi-implement-csi-support.patch
@@ -1,7 +1,7 @@
-From cc11be422d2f3fe469a756754def0b54b23289b2 Mon Sep 17 00:00:00 2001
+From b50df1502bddba9963eadba8d69e6b95a9b87337 Mon Sep 17 00:00:00 2001
 From: Bo Jiao <Bo.Jiao@mediatek.com>
 Date: Mon, 6 Jun 2022 20:13:02 +0800
-Subject: [PATCH 1001/1053] wifi: mt76: mt7915: csi: implement csi support
+Subject: [PATCH] wifi: mt76: mt7915: csi: implement csi support
 
 ---
  mt76_connac_mcu.h |   2 +
@@ -18,7 +18,7 @@
  create mode 100644 mt7915/vendor.h
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index ac524fe..2ffe1c9 100644
+index a8690cd..cda7559 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1029,6 +1029,7 @@ enum {
@@ -29,10 +29,10 @@
  };
  
  /* unified event table */
-@@ -1242,6 +1243,7 @@ enum {
- 	MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
+@@ -1243,6 +1244,7 @@ enum {
  	MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
  	MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
+ 	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
 +	MCU_EXT_CMD_CSI_CTRL = 0xc2,
  };
  
@@ -55,10 +55,10 @@
  mt7915e-$(CONFIG_NL80211_TESTMODE) += testmode.o
  mt7915e-$(CONFIG_MT798X_WMAC) += soc.o
 diff --git a/mt7915/init.c b/mt7915/init.c
-index 3ec9eab..6d23dfd 100644
+index 19a68c5..c504ebf 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
-@@ -696,6 +696,12 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
+@@ -697,6 +697,12 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
  	/* init wiphy according to mphy and phy */
  	mt7915_init_wiphy(phy);
  
@@ -71,7 +71,7 @@
  	ret = mt76_register_phy(mphy, true, mt76_rates,
  				ARRAY_SIZE(mt76_rates));
  	if (ret)
-@@ -1177,6 +1183,24 @@ void mt7915_set_stream_he_caps(struct mt7915_phy *phy)
+@@ -1178,6 +1184,24 @@ void mt7915_set_stream_he_caps(struct mt7915_phy *phy)
  	}
  }
  
@@ -96,7 +96,7 @@
  static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
  {
  	struct mt7915_phy *phy = mt7915_ext_phy(dev);
-@@ -1185,6 +1209,10 @@ static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
+@@ -1186,6 +1210,10 @@ static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
  	if (!phy)
  		return;
  
@@ -107,7 +107,7 @@
  	mt7915_unregister_thermal(phy);
  	mt76_unregister_phy(mphy);
  	ieee80211_free_hw(mphy->hw);
-@@ -1197,6 +1225,10 @@ static void mt7915_stop_hardware(struct mt7915_dev *dev)
+@@ -1198,6 +1226,10 @@ static void mt7915_stop_hardware(struct mt7915_dev *dev)
  	mt7915_dma_cleanup(dev);
  	tasklet_disable(&dev->mt76.irq_tasklet);
  
@@ -118,7 +118,7 @@
  	if (is_mt798x(&dev->mt76))
  		mt7986_wmac_disable(dev);
  }
-@@ -1241,6 +1273,12 @@ int mt7915_register_device(struct mt7915_dev *dev)
+@@ -1242,6 +1274,12 @@ int mt7915_register_device(struct mt7915_dev *dev)
  	dev->mt76.test_ops = &mt7915_testmode_ops;
  #endif
  
@@ -132,10 +132,10 @@
  				   ARRAY_SIZE(mt76_rates));
  	if (ret)
 diff --git a/mt7915/main.c b/mt7915/main.c
-index e7166c6..4aa1b6d 100644
+index 3ac3df3..4edb11a 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -809,6 +809,10 @@ void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+@@ -811,6 +811,10 @@ void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
  	struct mt7915_phy *phy = msta->vif->phy;
  	int i;
  
@@ -147,7 +147,7 @@
  
  	mt7915_mac_wtbl_update(dev, msta->wcid.idx,
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 321a839..9baf52b 100644
+index 1a3647a..65609b4 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -40,6 +40,10 @@ static bool sr_scene_detect = true;
@@ -458,7 +458,7 @@
 +
  #endif
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 58c0bf9..4617c59 100644
+index 398f851..5a26335 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -195,6 +195,45 @@ struct mt7915_hif {
@@ -529,7 +529,7 @@
  };
  
  #ifdef MTK_DEBUG
-@@ -646,6 +700,12 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+@@ -647,6 +701,12 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
  			 bool pci, int *irq);
  
diff --git a/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch b/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch
index baa3a93..b2156ed 100644
--- a/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1002-wifi-mt76-mt7915-air-monitor-support.patch
@@ -1,7 +1,7 @@
-From c77d92fc916236853e030c21b0a89da7b226609f Mon Sep 17 00:00:00 2001
+From 1a63c07be0a813d1342346c937cd2f949439b837 Mon Sep 17 00:00:00 2001
 From: Bo Jiao <Bo.Jiao@mediatek.com>
 Date: Tue, 11 Jan 2022 12:03:23 +0800
-Subject: [PATCH 1002/1053] wifi: mt76: mt7915: air monitor support
+Subject: [PATCH] wifi: mt76: mt7915: air monitor support
 
 ---
  mt76_connac_mcu.h |   2 +
@@ -13,7 +13,7 @@
  6 files changed, 440 insertions(+)
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 2ffe1c9..4172946 100644
+index cda7559..3aa4e59 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1243,6 +1243,8 @@ enum {
@@ -22,9 +22,9 @@
  	MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
 +	/* for vendor csi and air monitor */
 +	MCU_EXT_CMD_SMESH_CTRL = 0xae,
+ 	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
  };
- 
 diff --git a/mt7915/mac.c b/mt7915/mac.c
 index d99864f..e38905a 100644
 --- a/mt7915/mac.c
@@ -41,10 +41,10 @@
  		status->flag |= RX_FLAG_8023;
  		mt7915_wed_check_ppe(dev, &dev->mt76.q_rx[q], msta, skb,
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 4aa1b6d..19719b3 100644
+index 4edb11a..847c74b 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -798,6 +798,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+@@ -800,6 +800,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
  	addr = mt7915_mac_wtbl_lmac_addr(dev, msta->wcid.idx, 30);
  	mt76_rmw_field(dev, addr, GENMASK(7, 0), 0xa0);
  
@@ -55,7 +55,7 @@
  }
  
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 4617c59..35ccfa3 100644
+index 5a26335..576e70a 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -232,6 +232,33 @@ struct csi_data {
@@ -101,7 +101,7 @@
  #endif
  };
  
-@@ -704,6 +733,9 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
+@@ -705,6 +734,9 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
  void mt7915_vendor_register(struct mt7915_phy *phy);
  int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
  		       u8 cfg, u8 v1, u32 v2, u8 *mac_addr, u32 sta_interval);
diff --git a/recipes-wifi/linux-mt76/files/patches/1004-wifi-mt76-mt7915-certification-patches.patch b/recipes-wifi/linux-mt76/files/patches/1004-wifi-mt76-mt7915-certification-patches.patch
index 710b973..6f8ce96 100644
--- a/recipes-wifi/linux-mt76/files/patches/1004-wifi-mt76-mt7915-certification-patches.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1004-wifi-mt76-mt7915-certification-patches.patch
@@ -1,7 +1,7 @@
-From 8d5f43f16dd3b85a455edd54e440555a96668183 Mon Sep 17 00:00:00 2001
+From e98f4b4ccc941705436b9cdfbd22b2e72b2ef055 Mon Sep 17 00:00:00 2001
 From: MeiChia Chiu <meichia.chiu@mediatek.com>
 Date: Mon, 6 Jun 2022 20:15:51 +0800
-Subject: [PATCH 1004/1053] wifi: mt76: mt7915: certification patches
+Subject: [PATCH] wifi: mt76: mt7915: certification patches
 
 ---
  mt76_connac_mcu.h    |   1 +
@@ -16,13 +16,13 @@
  9 files changed, 955 insertions(+), 5 deletions(-)
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 4172946..53262ce 100644
+index 3aa4e59..d62b7df 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
-@@ -1245,6 +1245,7 @@ enum {
- 	MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
+@@ -1246,6 +1246,7 @@ enum {
  	/* for vendor csi and air monitor */
  	MCU_EXT_CMD_SMESH_CTRL = 0xae,
+ 	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
 +	MCU_EXT_CMD_CERT_CFG = 0xb7,
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
  };
@@ -76,10 +76,10 @@
  			       IEEE80211_RC_NSS_CHANGED |
  			       IEEE80211_RC_BW_CHANGED))
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 19719b3..f698b24 100644
+index 847c74b..8835cda 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -769,6 +769,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+@@ -771,6 +771,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
  	struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
  	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
  	bool ext_phy = mvif->phy != &dev->phy;
@@ -89,7 +89,7 @@
  	int ret, idx;
  	u32 addr;
  
-@@ -801,7 +804,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+@@ -803,7 +806,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
  #ifdef CONFIG_MTK_VENDOR
  	mt7915_vendor_amnt_sta_remove(mvif->phy, sta);
  #endif
@@ -107,7 +107,7 @@
  
  void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 6f73a7b..cd533ae 100644
+index b38c3d1..b50a2c2 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -4402,6 +4402,472 @@ mt7915_mcu_report_csi(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -818,10 +818,10 @@
  
  #endif
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index e21a101..0eca040 100644
+index 30fb064..136e89f 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -732,6 +732,19 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
+@@ -733,6 +733,19 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
  			 bool pci, int *irq);
  
  #ifdef CONFIG_MTK_VENDOR
@@ -842,7 +842,7 @@
  int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
  		       u8 cfg, u8 v1, u32 v2, u8 *mac_addr, u32 sta_interval);
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index f521740..1ed40ba 100644
+index 2f55a84..84f8fae 100644
 --- a/mt7915/mtk_debugfs.c
 +++ b/mt7915/mtk_debugfs.c
 @@ -2560,7 +2560,8 @@ static int mt7915_muru_onoff_get(void *data, u64 *val)
diff --git a/recipes-wifi/linux-mt76/files/patches/1008-wifi-mt76-testmode-additional-supports.patch b/recipes-wifi/linux-mt76/files/patches/1008-wifi-mt76-testmode-additional-supports.patch
index cb4e57b..fa6094e 100644
--- a/recipes-wifi/linux-mt76/files/patches/1008-wifi-mt76-testmode-additional-supports.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1008-wifi-mt76-testmode-additional-supports.patch
@@ -1,14 +1,14 @@
-From 4f2e94943abd5d7e9d70cd54a265d6031a0a7f98 Mon Sep 17 00:00:00 2001
+From e6c4c7343a54ef607d8ceafa4615a32165c121fd Mon Sep 17 00:00:00 2001
 From: Shayne Chen <shayne.chen@mediatek.com>
 Date: Thu, 21 Apr 2022 15:43:19 +0800
-Subject: [PATCH 1008/1053] wifi: mt76: testmode: additional supports
+Subject: [PATCH] wifi: mt76: testmode: additional supports
 
 Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
  dma.c             |    3 +-
  mac80211.c        |   12 +
- mt76.h            |  110 +++-
+ mt76.h            |  119 ++++-
  mt76_connac_mcu.c |    4 +
  mt76_connac_mcu.h |    2 +
  mt7915/eeprom.c   |    2 +-
@@ -26,7 +26,7 @@
  testmode.h        |   79 +++
  tools/fields.c    |   90 +++-
  tx.c              |    3 +-
- 20 files changed, 2064 insertions(+), 169 deletions(-)
+ 20 files changed, 2073 insertions(+), 169 deletions(-)
 
 diff --git a/dma.c b/dma.c
 index ccdd564..bc8afcf 100644
@@ -73,7 +73,7 @@
  
  static const struct ieee80211_channel mt76_channels_6ghz[] = {
 diff --git a/mt76.h b/mt76.h
-index fe5b136..3fe18cd 100644
+index fe5b136..a7d424f 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -707,6 +707,21 @@ struct mt76_testmode_ops {
@@ -156,7 +156,7 @@
  	u32 tx_pending;
  	u32 tx_queued;
  	u16 tx_queued_limit;
-@@ -1348,6 +1387,59 @@ static inline bool mt76_testmode_enabled(struct mt76_phy *phy)
+@@ -1348,6 +1387,68 @@ static inline bool mt76_testmode_enabled(struct mt76_phy *phy)
  #endif
  }
  
@@ -172,6 +172,15 @@
 +				list);
 +}
 +
++static inline struct mt76_wcid *
++mt76_testmode_next_entry(struct mt76_phy *phy, struct mt76_wcid *wcid)
++{
++	if (wcid == &phy->dev->global_wcid)
++		return NULL;
++
++	return list_next_entry(wcid, list);
++}
++
 +static inline struct mt76_testmode_entry_data *
 +mt76_testmode_entry_data(struct mt76_phy *phy, struct mt76_wcid *wcid)
 +{
@@ -184,13 +193,13 @@
 +						   phy->hw->sta_data_size);
 +}
 +
-+#define mt76_tm_for_each_entry(phy, wcid, ed)				\
-+	for (wcid = mt76_testmode_first_entry(phy),			\
-+	     ed = mt76_testmode_entry_data(phy, wcid);			\
-+	     ((phy->test.aid &&						\
++#define mt76_tm_for_each_entry(phy, wcid, ed)					\
++	for (wcid = mt76_testmode_first_entry(phy),				\
++	     ed = mt76_testmode_entry_data(phy, wcid);				\
++	     ((phy->test.aid &&							\
 +	       !list_entry_is_head(wcid, &phy->test.tm_entry_list, list)) ||	\
 +	      (!phy->test.aid && wcid == &phy->dev->global_wcid)) && ed;	\
-+	     wcid = list_next_entry(wcid, list),			\
++	     wcid = mt76_testmode_next_entry(phy, wcid),			\
 +	     ed = mt76_testmode_entry_data(phy, wcid))
 +#endif
 +
@@ -216,7 +225,7 @@
  static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
  					struct sk_buff *skb,
  					struct ieee80211_hw **hw)
-@@ -1358,7 +1450,8 @@ static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
+@@ -1358,7 +1459,8 @@ static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
  	for (i = 0; i < ARRAY_SIZE(dev->phys); i++) {
  		struct mt76_phy *phy = dev->phys[i];
  
@@ -226,7 +235,7 @@
  			*hw = dev->phys[i]->hw;
  			return true;
  		}
-@@ -1460,7 +1553,8 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+@@ -1460,7 +1562,8 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
  int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,
  		       struct netlink_callback *cb, void *data, int len);
  int mt76_testmode_set_state(struct mt76_phy *phy, enum mt76_testmode_state state);
@@ -259,7 +268,7 @@
  		return;
  
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 75cb4e9..0972010 100644
+index 22d477f..0f408d9 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1023,6 +1023,7 @@ enum {
@@ -275,9 +284,9 @@
  	/* for vendor csi and air monitor */
  	MCU_EXT_CMD_SMESH_CTRL = 0xae,
 +	MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
+ 	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
  	MCU_EXT_CMD_CERT_CFG = 0xb7,
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
- };
 diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
 index bfdbc15..f4876fe 100644
 --- a/mt7915/eeprom.c
@@ -292,10 +301,10 @@
  				return ret;
  		}
 diff --git a/mt7915/init.c b/mt7915/init.c
-index fc42974..439403f 100644
+index 0350250..5c4aa1e 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
-@@ -726,7 +726,7 @@ static void mt7915_init_work(struct work_struct *work)
+@@ -727,7 +727,7 @@ static void mt7915_init_work(struct work_struct *work)
  	struct mt7915_dev *dev = container_of(work, struct mt7915_dev,
  				 init_work);
  
@@ -395,7 +404,7 @@
  		goto out;
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index f698b24..6415e84 100644
+index 8835cda..e53754c 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -238,7 +238,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
@@ -408,7 +417,7 @@
  		mvif->mt76.wmm_idx += 2;
  
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 63fb826..233411c 100644
+index 0d1bab1..05919e9 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -478,6 +478,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -567,7 +576,7 @@
  	[AGG_PCR0]		= 0x040,
  	[AGG_ACR0]		= 0x054,
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 0eca040..1846e2f 100644
+index 136e89f..37abf56 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -304,11 +304,15 @@ struct mt7915_phy {
@@ -618,8 +627,8 @@
  void mt7915_mcu_exit(struct mt7915_dev *dev);
 +int mt7915_tm_txbf_status_read(struct mt7915_dev *dev, struct sk_buff *skb);
  void mt7915_mcu_wmm_pbc_work(struct work_struct *work);
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif);
  
- static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
 diff --git a/mt7915/regs.h b/mt7915/regs.h
 index 8bb6a9f..1236da9 100644
 --- a/mt7915/regs.h
diff --git a/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-ZWDFS-test-mode-support.patch b/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-ZWDFS-test-mode-support.patch
index d80efec..b42e141 100644
--- a/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-ZWDFS-test-mode-support.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1011-wifi-mt76-testmode-add-ZWDFS-test-mode-support.patch
@@ -1,7 +1,7 @@
-From b80b70aa0c7d3c1ecd2a1f7151c16660233464b2 Mon Sep 17 00:00:00 2001
+From 460f28c1cba4632a4bd046d0a93d1569f69acea0 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Thu, 27 Oct 2022 17:42:07 +0800
-Subject: [PATCH 1011/1053] wifi: mt76: testmode: add ZWDFS test mode support
+Subject: [PATCH] wifi: mt76: testmode: add ZWDFS test mode support
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
@@ -18,7 +18,7 @@
  10 files changed, 508 insertions(+), 1 deletion(-)
 
 diff --git a/mt76.h b/mt76.h
-index 22d76bb..9320c52 100644
+index 20577af..53b0964 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -793,6 +793,15 @@ struct mt76_testmode_data {
@@ -38,7 +38,7 @@
  
  struct mt76_vif {
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index b75d340..69ca57a 100644
+index 6511060..9ac1c46 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1241,6 +1241,7 @@ enum {
@@ -49,8 +49,8 @@
  	MCU_EXT_CMD_RX_STAT = 0xa4,
  	MCU_EXT_CMD_SET_SPR = 0xa8,
  	MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
-@@ -1251,6 +1252,7 @@ enum {
- 	MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
+@@ -1252,6 +1253,7 @@ enum {
+ 	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
  	MCU_EXT_CMD_CERT_CFG = 0xb7,
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
 +	MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
@@ -58,7 +58,7 @@
  
  enum {
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index ad58e3b..573f1e8 100644
+index 5f3fec8..2025ef3 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -2759,6 +2759,7 @@ mt7915_mcu_background_chain_ctrl(struct mt7915_phy *phy,
@@ -69,11 +69,10 @@
  		req.band_idx = phy->mt76->band_idx;
  		req.scan_mode = 2;
  		break;
-@@ -4954,3 +4955,68 @@ int mt7915_mcu_set_amsdu_algo(struct mt7915_dev *dev, u16 wcid, u8 enable)
- 	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MEC_CTRL), &req, sizeof(req), true);
+@@ -4955,6 +4956,71 @@ int mt7915_mcu_set_amsdu_algo(struct mt7915_dev *dev, u16 wcid, u8 enable)
  }
  #endif
-+
+ 
 +int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp)
 +{
 +	struct mt7915_dev *dev = phy->dev;
@@ -138,6 +137,10 @@
 +
 +	return 0;
 +}
++
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
+ {
+ #define IP_DSCP_NUM	64
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
 index c791c7f..066246b 100644
 --- a/mt7915/mcu.h
@@ -196,7 +199,7 @@
  #define OFDMA_DL                       BIT(0)
  #define OFDMA_UL                       BIT(1)
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index dd2e80b..1644a46 100644
+index b716b57..ec33afd 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -293,6 +293,7 @@ struct mt7915_phy {
@@ -207,7 +210,7 @@
  
  	u8 stats_work_count;
  	struct list_head stats_list;
-@@ -767,6 +768,9 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
+@@ -768,6 +769,9 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
  				  struct ieee80211_sta *sta);
  #endif
  
diff --git a/recipes-wifi/linux-mt76/files/patches/1012-wifi-mt76-testmode-add-iBF-eBF-cal-and-cert-commands.patch b/recipes-wifi/linux-mt76/files/patches/1012-wifi-mt76-testmode-add-iBF-eBF-cal-and-cert-commands.patch
index e7fe869..289bbe4 100644
--- a/recipes-wifi/linux-mt76/files/patches/1012-wifi-mt76-testmode-add-iBF-eBF-cal-and-cert-commands.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1012-wifi-mt76-testmode-add-iBF-eBF-cal-and-cert-commands.patch
@@ -1,8 +1,8 @@
-From 4c178c7d253c546ed19f99e8de51423df9fed9de Mon Sep 17 00:00:00 2001
+From 2a34bd2105e5021dacaf30c90bb6816f107cabd4 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Thu, 15 Dec 2022 19:45:18 +0800
-Subject: [PATCH 1012/1053] wifi: mt76: testmode: add iBF/eBF cal and cert
- commands with golden
+Subject: [PATCH] wifi: mt76: testmode: add iBF/eBF cal and cert commands with
+ golden
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
@@ -25,7 +25,7 @@
  16 files changed, 859 insertions(+), 325 deletions(-)
 
 diff --git a/mt76.h b/mt76.h
-index 9320c52..8025e04 100644
+index 53b0964..1455144 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -755,6 +755,7 @@ struct mt76_testmode_data {
@@ -84,7 +84,7 @@
  	txwi[6] |= cpu_to_le32(val);
  #endif
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 6415e84..c6eca6f 100644
+index e53754c..69477f1 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -205,46 +205,37 @@ static void mt7915_init_bitrate_mask(struct ieee80211_vif *vif)
@@ -175,7 +175,7 @@
  
  	return ret;
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 573f1e8..9dd4b77 100644
+index 2025ef3..f5042ae 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -199,6 +199,7 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
@@ -468,7 +468,7 @@
  	[AGG_AALCR0]		= 0x028,
  	[AGG_AWSCR0]		= 0x030,
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 1644a46..b06e5ca 100644
+index ec33afd..700efaf 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -312,7 +312,6 @@ struct mt7915_phy {
@@ -496,13 +496,14 @@
  void mt7915_reset(struct mt7915_dev *dev);
  int mt7915_run(struct ieee80211_hw *hw);
  int mt7915_mcu_init(struct mt7915_dev *dev);
-@@ -654,10 +654,12 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
+@@ -654,11 +654,13 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
  int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
  void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
  void mt7915_mcu_exit(struct mt7915_dev *dev);
 -int mt7915_tm_txbf_status_read(struct mt7915_dev *dev, struct sk_buff *skb);
 -void mt7915_tm_rf_test_event(struct mt7915_dev *dev, struct sk_buff *skb);
  void mt7915_mcu_wmm_pbc_work(struct work_struct *work);
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif);
  
 +#ifdef CONFIG_NL80211_TESTMODE
 +void mt7915_tm_rf_test_event(struct mt7915_dev *dev, struct sk_buff *skb);
@@ -511,7 +512,7 @@
  static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
  {
  	return is_mt7915(&dev->mt76) ? MT7915_WTBL_SIZE : MT7916_WTBL_SIZE;
-@@ -791,4 +793,10 @@ enum {
+@@ -792,4 +794,10 @@ enum {
  
  #endif
  
@@ -523,7 +524,7 @@
 +
  #endif
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index 1ed40ba..30c5f68 100644
+index 84f8fae..9e490ad 100644
 --- a/mt7915/mtk_debugfs.c
 +++ b/mt7915/mtk_debugfs.c
 @@ -2888,6 +2888,36 @@ mt7915_txpower_level_set(void *data, u64 val)
diff --git a/recipes-wifi/linux-mt76/files/patches/1015-wifi-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl-enable.patch b/recipes-wifi/linux-mt76/files/patches/1015-wifi-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl-enable.patch
index 91e392f..14f77a5 100644
--- a/recipes-wifi/linux-mt76/files/patches/1015-wifi-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl-enable.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1015-wifi-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl-enable.patch
@@ -1,33 +1,33 @@
-From ef07367ab6f484383d0616953254276b31719a21 Mon Sep 17 00:00:00 2001
+From 7f9793b9c724014e9993091b47566cd9bf3cec06 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Fri, 24 Jun 2022 11:15:45 +0800
-Subject: [PATCH 1015/1053] wifi: mt76: mt7915: add vendor subcmd EDCCA ctrl
+Subject: [PATCH] wifi: mt76: mt7915: add vendor subcmd EDCCA ctrl
  enable/threshold/compensation
 
 ---
  mt76_connac_mcu.h |   1 +
  mt7915/main.c     |   3 ++
- mt7915/mcu.c      |  73 +++++++++++++++++++++++++
+ mt7915/mcu.c      |  72 +++++++++++++++++++++++++
  mt7915/mcu.h      |  21 ++++++++
  mt7915/mt7915.h   |   3 +-
  mt7915/vendor.c   | 132 ++++++++++++++++++++++++++++++++++++++++++++++
  mt7915/vendor.h   |  33 ++++++++++++
- 7 files changed, 265 insertions(+), 1 deletion(-)
+ 7 files changed, 264 insertions(+), 1 deletion(-)
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 69ca57a..b2b7095 100644
+index 9ac1c46..012f9be 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
-@@ -1251,6 +1251,7 @@ enum {
- 	MCU_EXT_CMD_SMESH_CTRL = 0xae,
+@@ -1252,6 +1252,7 @@ enum {
  	MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
+ 	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
  	MCU_EXT_CMD_CERT_CFG = 0xb7,
 +	MCU_EXT_CMD_EDCCA = 0xba,
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
  	MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
  };
 diff --git a/mt7915/main.c b/mt7915/main.c
-index c6eca6f..9fafa16 100644
+index 69477f1..d0ba4b7 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -479,6 +479,9 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
@@ -41,14 +41,13 @@
  		ret = mt7915_set_channel(phy);
  		if (ret)
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 9dd4b77..1e84236 100644
+index f5042ae..20395e9 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -5037,3 +5037,76 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
- 
+@@ -5038,6 +5038,78 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
  	return 0;
  }
-+
+ 
 +int mt7915_mcu_set_edcca(struct mt7915_phy *phy, int mode, u8 *value, s8 compensation)
 +{
 +	static const u8 ch_band[] = {
@@ -88,7 +87,6 @@
 +	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(EDCCA), &req, sizeof(req), true);
 +}
 +
-+
 +int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value)
 +{
 +	struct mt7915_dev *dev = phy->dev;
@@ -121,6 +119,10 @@
 +
 +	return 0;
 +}
++
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
+ {
+ #define IP_DSCP_NUM	64
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
 index de17c57..1682c11 100644
 --- a/mt7915/mcu.h
@@ -154,10 +156,10 @@
  
  #endif
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index d21b843..000751b 100644
+index d4a3467..8da1d1b 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -770,7 +770,8 @@ void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
+@@ -771,7 +771,8 @@ void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
  int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
  				  struct ieee80211_sta *sta);
  #endif
diff --git a/recipes-wifi/linux-mt76/files/patches/1018-wifi-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ct.patch b/recipes-wifi/linux-mt76/files/patches/1018-wifi-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ct.patch
index 14378c2..6718ab8 100644
--- a/recipes-wifi/linux-mt76/files/patches/1018-wifi-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ct.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1018-wifi-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ct.patch
@@ -1,8 +1,7 @@
-From 385b5303f5e3142d87bdb6a2e5c55ccb7f2fdd9c Mon Sep 17 00:00:00 2001
+From 35c3c602288b8c1a11b9c1ca4e1b0182d451d15e Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Fri, 28 Oct 2022 10:15:56 +0800
-Subject: [PATCH 1018/1053] wifi: mt76: mt7915: add vendor subcmd three wire
- (PTA) ctrl
+Subject: [PATCH] wifi: mt76: mt7915: add vendor subcmd three wire (PTA) ctrl
 
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
@@ -15,20 +14,20 @@
  6 files changed, 111 insertions(+), 29 deletions(-)
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index b2b7095..109462a 100644
+index 012f9be..7e12c05 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
-@@ -1250,7 +1250,7 @@ enum {
- 	/* for vendor csi and air monitor */
+@@ -1251,7 +1251,7 @@ enum {
  	MCU_EXT_CMD_SMESH_CTRL = 0xae,
  	MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
+ 	MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
 -	MCU_EXT_CMD_CERT_CFG = 0xb7,
 +	MCU_EXT_CMD_SET_CFG = 0xb7,
  	MCU_EXT_CMD_EDCCA = 0xba,
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
  	MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 1e84236..072185f 100644
+index 20395e9..8f5fcbb 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -4736,37 +4736,33 @@ void mt7915_mcu_set_dynalgo(struct mt7915_phy *phy, u8 enable)
@@ -133,10 +132,10 @@
  #define OFDMA_DL                       BIT(0)
  #define OFDMA_UL                       BIT(1)
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index a06a46e..00d2b35 100644
+index 27b007b..f9ca9d5 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -764,6 +764,7 @@ void mt7915_mcu_set_mimo(struct mt7915_phy *phy, u8 direction);
+@@ -765,6 +765,7 @@ void mt7915_mcu_set_mimo(struct mt7915_phy *phy, u8 direction);
  void mt7915_mcu_set_dynalgo(struct mt7915_phy *phy, u8 enable);
  int mt7915_mcu_set_mu_edca(struct mt7915_phy *phy, u8 val);
  void mt7915_mcu_set_cert(struct mt7915_phy *phy, u8 type);
diff --git a/recipes-wifi/linux-mt76/files/patches/1026-wifi-mt76-mt7915-disable-SW-ACI-by-default.patch b/recipes-wifi/linux-mt76/files/patches/1026-wifi-mt76-mt7915-disable-SW-ACI-by-default.patch
index 402eab4..a6b71d5 100644
--- a/recipes-wifi/linux-mt76/files/patches/1026-wifi-mt76-mt7915-disable-SW-ACI-by-default.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1026-wifi-mt76-mt7915-disable-SW-ACI-by-default.patch
@@ -1,7 +1,7 @@
-From 4d3d3743e0e97b65c132cda36b4af0532a102607 Mon Sep 17 00:00:00 2001
+From 0df14b3d2578681009ca9be604e98bb94ee1186a Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Fri, 24 Feb 2023 16:29:42 +0800
-Subject: [PATCH 1026/1053] wifi: mt76: mt7915: disable SW-ACI by default
+Subject: [PATCH] wifi: mt76: mt7915: disable SW-ACI by default
 
 Support to enable/disable SW-ACI by module parameter "sw_aci_enable".
 SW-ACI feature is disable by default.
@@ -13,7 +13,7 @@
  4 files changed, 29 insertions(+), 9 deletions(-)
 
 diff --git a/mt7915/main.c b/mt7915/main.c
-index da7a87b..69c4a41 100644
+index b80d6fd..2ff7667 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -8,6 +8,10 @@
@@ -39,14 +39,13 @@
  
  	if (phy != &dev->phy) {
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 8e9b801..45b0907 100644
+index 5534603..e95a5d7 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -5223,3 +5223,18 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value)
- 
+@@ -5223,6 +5223,21 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value)
  	return 0;
  }
-+
+ 
 +int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val)
 +{
 +#define SWLNA_ENABLE 6
@@ -61,11 +60,15 @@
 +	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req,
 +				 sizeof(req), NULL);
 +}
++
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
+ {
+ #define IP_DSCP_NUM	64
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index fe7c211..44dd0f4 100644
+index 9e7183c..c8b697c 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -782,6 +782,7 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
+@@ -783,6 +783,7 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
  #endif
  int mt7915_mcu_set_edcca(struct mt7915_phy *phy, int mode, u8 *value, s8 compensation);
  int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
@@ -74,7 +77,7 @@
  int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
  
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index a433e67..f00ac10 100644
+index 8f2f496..ad7abda 100644
 --- a/mt7915/mtk_debugfs.c
 +++ b/mt7915/mtk_debugfs.c
 @@ -3773,16 +3773,12 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)
diff --git a/recipes-wifi/linux-mt76/files/patches/1041-wifi-mt76-mt7915-support-scs-feature.patch b/recipes-wifi/linux-mt76/files/patches/1041-wifi-mt76-mt7915-support-scs-feature.patch
index 263dbd8..aa6ba21 100644
--- a/recipes-wifi/linux-mt76/files/patches/1041-wifi-mt76-mt7915-support-scs-feature.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1041-wifi-mt76-mt7915-support-scs-feature.patch
@@ -1,7 +1,7 @@
-From d1b12ab78d487e08945ec6a92b744af342505fd2 Mon Sep 17 00:00:00 2001
+From 9c8dcebc80801b77b23b0a2af28a3d51662c164f Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Wed, 6 Dec 2023 08:53:03 +0800
-Subject: [PATCH 1041/1053] wifi: mt76: mt7915: support scs feature
+Subject: [PATCH] wifi: mt76: mt7915: support scs feature
 
 Add support scs feature for connac2 codebase. This commit includes three
 parts.
@@ -29,7 +29,7 @@
  9 files changed, 188 insertions(+)
 
 diff --git a/mt76.h b/mt76.h
-index 6f78c07..c011812 100644
+index cff22f5..7ffba7d 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -311,6 +311,7 @@ struct mt76_sta_stats {
@@ -49,7 +49,7 @@
  
  enum mt76_wcid_flags {
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index c6a43dd..1bc32da 100644
+index 94fcf32..247b520 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1236,6 +1236,7 @@ enum {
@@ -61,10 +61,10 @@
  	MCU_EXT_CMD_FW_DBG_CTRL = 0x95,
  	MCU_EXT_CMD_OFFCH_SCAN_CTRL = 0x9a,
 diff --git a/mt7915/init.c b/mt7915/init.c
-index b2e613c..373f4f5 100644
+index 545afe7..074f247 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
-@@ -1247,6 +1247,7 @@ int mt7915_register_device(struct mt7915_dev *dev)
+@@ -1248,6 +1248,7 @@ int mt7915_register_device(struct mt7915_dev *dev)
  	spin_lock_init(&dev->phy.stats_lock);
  	INIT_WORK(&dev->rc_work, mt7915_mac_sta_rc_work);
  	INIT_DELAYED_WORK(&dev->mphy.mac_work, mt7915_mac_work);
@@ -116,7 +116,7 @@
  		 wiphy_name(dev->mt76.hw->wiphy));
  }
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 69c4a41..69fcf4c 100644
+index 2ff7667..2750e60 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -89,12 +89,24 @@ int mt7915_run(struct ieee80211_hw *hw)
@@ -153,14 +153,13 @@
  		mt7915_mcu_set_mac(dev, dev->phy.mt76->band_idx, false, false);
  	}
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 4b5fb53..5e1fd3b 100644
+index 1af6dac..aa3f9ad 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -5239,3 +5239,121 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val)
- 	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req,
+@@ -5239,6 +5239,124 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val)
  				 sizeof(req), NULL);
  }
-+
+ 
 +int mt7915_mcu_set_scs_en(struct mt7915_phy *phy, u8 enable)
 +{
 +	struct mt7915_dev *dev = phy->dev;
@@ -278,6 +277,10 @@
 +	if (scs_enable_flag)
 +		ieee80211_queue_delayed_work(mt76_hw(dev), &dev->scs_work, HZ);
 +}
++
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
+ {
+ #define IP_DSCP_NUM	64
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
 index 3089fb6..742a785 100644
 --- a/mt7915/mcu.h
@@ -292,7 +295,7 @@
 +};
  #endif
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index c6150c8..3c04936 100644
+index 03ec7e2..3daec29 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -270,6 +270,15 @@ struct mt7915_air_monitor_ctrl {
@@ -328,7 +331,7 @@
  	bool wmm_pbc_enable;
  	struct work_struct wmm_pbc_work;
  	u32 adie_type;
-@@ -802,6 +814,8 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val);
+@@ -803,6 +815,8 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val);
  int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp);
  int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
  int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val);
@@ -338,7 +341,7 @@
  #ifdef MTK_DEBUG
  int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index 2b59e35..081cf46 100644
+index dad5ed7..0953223 100644
 --- a/mt7915/mtk_debugfs.c
 +++ b/mt7915/mtk_debugfs.c
 @@ -3820,6 +3820,29 @@ mt7915_sr_enable_set(void *data, u64 val)
diff --git a/recipes-wifi/linux-mt76/files/patches/1042-wifi-mt76-mt7915-support-thermal-recal-debug-commnad.patch b/recipes-wifi/linux-mt76/files/patches/1042-wifi-mt76-mt7915-support-thermal-recal-debug-commnad.patch
index 2a5892a..7358d27 100644
--- a/recipes-wifi/linux-mt76/files/patches/1042-wifi-mt76-mt7915-support-thermal-recal-debug-commnad.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1042-wifi-mt76-mt7915-support-thermal-recal-debug-commnad.patch
@@ -1,8 +1,7 @@
-From 4cd1771d44ebb238474b85c09d0ef7a8f77c477f Mon Sep 17 00:00:00 2001
+From e9f5c9f345503c5653d1a5fd5bedd69cd1bc48f1 Mon Sep 17 00:00:00 2001
 From: Howard Hsu <howard-yh.hsu@mediatek.com>
 Date: Thu, 21 Dec 2023 20:35:36 +0800
-Subject: [PATCH 1042/1053] wifi: mt76: mt7915: support thermal recal debug
- commnad
+Subject: [PATCH] wifi: mt76: mt7915: support thermal recal debug commnad
 
 Add thermal recal debug command:
 $ echo val > debugfs/thermal_recal
@@ -21,7 +20,7 @@
  4 files changed, 35 insertions(+)
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 1bc32da..cbe8da5 100644
+index 247b520..e445046 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -1232,6 +1232,7 @@ enum {
@@ -33,14 +32,13 @@
  	MCU_EXT_CMD_SET_RDD_PATTERN = 0x7d,
  	MCU_EXT_CMD_MWDS_SUPPORT = 0x80,
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 5e1fd3b..c5f60c0 100644
+index aa3f9ad..2417251 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -5357,3 +5357,18 @@ void mt7915_mcu_scs_sta_poll(struct work_struct *work)
- 	if (scs_enable_flag)
+@@ -5357,6 +5357,21 @@ void mt7915_mcu_scs_sta_poll(struct work_struct *work)
  		ieee80211_queue_delayed_work(mt76_hw(dev), &dev->scs_work, HZ);
  }
-+
+ 
 +int mt7915_mcu_thermal_debug(struct mt7915_dev *dev, u8 mode, u8 action)
 +{
 +	struct {
@@ -55,11 +53,15 @@
 +	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(THERMAL_DEBUG), &req,
 +				 sizeof(req), true);
 +}
++
+ int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
+ {
+ #define IP_DSCP_NUM	64
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 3c04936..1b2f584 100644
+index 3daec29..9b52ec4 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -816,6 +816,7 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
+@@ -817,6 +817,7 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
  int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val);
  int mt7915_mcu_set_scs_en(struct mt7915_phy *phy, u8 enable);
  void mt7915_mcu_scs_sta_poll(struct work_struct *work);
@@ -68,7 +70,7 @@
  #ifdef MTK_DEBUG
  int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
 diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index 081cf46..2d6e166 100644
+index 0953223..53294c1 100644
 --- a/mt7915/mtk_debugfs.c
 +++ b/mt7915/mtk_debugfs.c
 @@ -3843,6 +3843,22 @@ mt7915_scs_enable_set(void *data, u64 val)
diff --git a/recipes-wifi/linux-mt76/files/patches/patches.inc b/recipes-wifi/linux-mt76/files/patches/patches.inc
index eca405a..a8fea12 100644
--- a/recipes-wifi/linux-mt76/files/patches/patches.inc
+++ b/recipes-wifi/linux-mt76/files/patches/patches.inc
@@ -17,6 +17,7 @@
     file://0015-wifi-mt76-mt7915-add-support-for-IEEE-802.11-fragmen.patch \
     file://0016-wifi-mt76-mt7915-add-dummy-HW-offload-of-IEEE-802.11.patch \
     file://0016-wifi-mt76-mt7915-fix-rx-filter-setting-for-bfee-func.patch \
+    file://0017-wifi-mt76-mt7915-fix-inconsistent-QoS-mapping-betwee.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 \