[][MAC80211][mt76][Implement pre-cal support in testmode]

[Description]
Add atenl and mt76-test commands for getting pre-cal data.

[Release-log]
N/A

Change-Id: Ib113465d0ce1c8e9c8d5461e6911ba26c0afde1c
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6365523
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1111-mt76-testmode-additional-supports.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1111-mt76-testmode-additional-supports.patch
index 3972345..c3d2569 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1111-mt76-testmode-additional-supports.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1111-mt76-testmode-additional-supports.patch
@@ -1,7 +1,7 @@
-From da1c7ada0eb6dbe66297ab71acd31395afd3bf30 Mon Sep 17 00:00:00 2001
+From 664eec54319ea56daa2743234b456a0b63d27527 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] mt76: testmode: additional supports
+Subject: [PATCH 1111/1121] mt76: testmode: additional supports
 
 Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
 ---
@@ -27,7 +27,7 @@
  19 files changed, 1961 insertions(+), 146 deletions(-)
 
 diff --git a/dma.c b/dma.c
-index 40cb9109..8ea09e6e 100644
+index 40cb910..8ea09e6 100644
 --- a/dma.c
 +++ b/dma.c
 @@ -426,8 +426,7 @@ free:
@@ -41,7 +41,7 @@
  #endif
  
 diff --git a/mac80211.c b/mac80211.c
-index d74300f3..e1c33324 100644
+index d74300f..e1c3332 100644
 --- a/mac80211.c
 +++ b/mac80211.c
 @@ -55,6 +55,13 @@ static const struct ieee80211_channel mt76_channels_5ghz[] = {
@@ -71,7 +71,7 @@
  
  static const struct ieee80211_channel mt76_channels_6ghz[] = {
 diff --git a/mt76.h b/mt76.h
-index 8e81f406..d03f312e 100644
+index 8e81f40..d03f312 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -610,6 +610,21 @@ struct mt76_testmode_ops {
@@ -233,7 +233,7 @@
  static inline void mt76_testmode_reset(struct mt76_phy *phy, bool disable)
  {
 diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
-index 47b2bce6..e701db8a 100644
+index 47b2bce..e701db8 100644
 --- a/mt76_connac_mcu.c
 +++ b/mt76_connac_mcu.c
 @@ -391,6 +391,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
@@ -255,7 +255,7 @@
  		return;
  
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 25aeedc2..cb1e94a3 100644
+index 25aeedc..cb1e94a 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
 @@ -967,6 +967,7 @@ enum {
@@ -275,7 +275,7 @@
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
  };
 diff --git a/mt7915/init.c b/mt7915/init.c
-index 141c5ad8..538ff5c3 100644
+index 141c5ad..538ff5c 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
 @@ -576,7 +576,7 @@ static void mt7915_init_work(struct work_struct *work)
@@ -288,7 +288,7 @@
  	mt7915_init_txpower(dev, &dev->mphy.sband_2g.sband);
  	mt7915_init_txpower(dev, &dev->mphy.sband_5g.sband);
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index e5409413..f0eefc6d 100644
+index e540941..f0eefc6 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
 @@ -565,16 +565,38 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
@@ -352,7 +352,7 @@
  }
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 7a7ff86a..b5c3c14e 100644
+index 7a7ff86..b5c3c14 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -224,7 +224,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
@@ -365,7 +365,7 @@
  		mvif->mt76.wmm_idx += 2;
  
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 9a7c9d3d..ecdc4fb3 100644
+index 9a7c9d3..ecdc4fb 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -434,6 +434,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -406,7 +406,7 @@
  
  	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(EFUSE_BUFFER_MODE),
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index 0a77ad0d..ad85e56c 100644
+index 0a77ad0..ad85e56 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
 @@ -8,10 +8,15 @@
@@ -463,7 +463,7 @@
  
  enum {
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 8469d8fb..8d966eff 100644
+index 8469d8f..8d966ef 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -76,6 +76,7 @@ static const u32 mt7915_offs[] = {
@@ -483,7 +483,7 @@
  	[AGG_PCR0]		= 0x040,
  	[AGG_ACR0]		= 0x054,
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index d214b181..99f364c0 100644
+index d214b18..99f364c 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -303,6 +303,9 @@ struct mt7915_phy {
@@ -529,7 +529,7 @@
  static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
  {
 diff --git a/mt7915/regs.h b/mt7915/regs.h
-index 3d2c15be..05ab6d9b 100644
+index 3d2c15b..05ab6d9 100644
 --- a/mt7915/regs.h
 +++ b/mt7915/regs.h
 @@ -45,6 +45,7 @@ enum offs_rev {
@@ -550,7 +550,7 @@
  							  (_n) * 4))
  #define MT_AGG_PCR0(_band, _n)		MT_WF_AGG(_band, (__OFFS(AGG_PCR0) +	\
 diff --git a/mt7915/testmode.c b/mt7915/testmode.c
-index 331d8b9d..de6e63e1 100644
+index 331d8b9..de6e63e 100644
 --- a/mt7915/testmode.c
 +++ b/mt7915/testmode.c
 @@ -9,6 +9,9 @@
@@ -1881,7 +1881,7 @@
 +	.set_eeprom = mt7915_tm_set_eeprom,
  };
 diff --git a/mt7915/testmode.h b/mt7915/testmode.h
-index a1c54c89..01b08e9e 100644
+index a1c54c8..01b08e9 100644
 --- a/mt7915/testmode.h
 +++ b/mt7915/testmode.h
 @@ -4,6 +4,8 @@
@@ -2196,7 +2196,7 @@
 +
  #endif
 diff --git a/testmode.c b/testmode.c
-index d7eb1f03..2653182a 100644
+index d7eb1f0..2653182 100644
 --- a/testmode.c
 +++ b/testmode.c
 @@ -27,28 +27,16 @@ const struct nla_policy mt76_tm_policy[NUM_MT76_TM_ATTRS] = {
@@ -2663,7 +2663,7 @@
  		a = nla_nest_start(msg, MT76_TM_ATTR_TX_POWER);
  		if (!a)
 diff --git a/testmode.h b/testmode.h
-index 89613266..57949f2b 100644
+index 8961326..57949f2 100644
 --- a/testmode.h
 +++ b/testmode.h
 @@ -6,6 +6,8 @@
@@ -2768,7 +2768,7 @@
 +
  #endif
 diff --git a/tools/fields.c b/tools/fields.c
-index e3f69089..6e36ab27 100644
+index e3f6908..6e36ab2 100644
 --- a/tools/fields.c
 +++ b/tools/fields.c
 @@ -10,6 +10,7 @@ static const char * const testmode_state[] = {
@@ -2894,7 +2894,7 @@
  };
  
 diff --git a/tx.c b/tx.c
-index 65e2b7c1..8b33186b 100644
+index 65e2b7c..8b33186 100644
 --- a/tx.c
 +++ b/tx.c
 @@ -245,8 +245,7 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-testmode-add-pre-cal-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-testmode-add-pre-cal-support.patch
new file mode 100644
index 0000000..1685acc
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-testmode-add-pre-cal-support.patch
@@ -0,0 +1,846 @@
+From 7b05ee7c55f2ac724af056e8ae16f8ca2835bc2a Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Wed, 31 Aug 2022 20:06:52 +0800
+Subject: [PATCH 1112/1121] mt76: testmode: add pre-cal support
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Change-Id: Ibfbbc3443de994eeb4daa5e364b0a90f5d7d3bcd
+---
+ eeprom.c          |   6 +-
+ mt76.h            |   1 +
+ mt76_connac_mcu.h |   1 +
+ mt7915/eeprom.h   |  34 +++-
+ mt7915/mcu.c      |  27 ++-
+ mt7915/mt7915.h   |   5 +
+ mt7915/testmode.c | 425 +++++++++++++++++++++++++++++++++++++++++++++-
+ mt7915/testmode.h |  36 ++++
+ testmode.c        |  15 +-
+ testmode.h        |  17 ++
+ tools/fields.c    |   8 +
+ 11 files changed, 562 insertions(+), 13 deletions(-)
+
+diff --git a/eeprom.c b/eeprom.c
+index 1e41b94..e083964 100644
+--- a/eeprom.c
++++ b/eeprom.c
+@@ -89,8 +89,10 @@ int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int offset, int len)
+ 	}
+ 
+ #ifdef CONFIG_NL80211_TESTMODE
+-	dev->test_mtd.name = devm_kstrdup(dev->dev, part, GFP_KERNEL);
+-	dev->test_mtd.offset = offset;
++	if (len == dev->eeprom.size) {
++		dev->test_mtd.name = devm_kstrdup(dev->dev, part, GFP_KERNEL);
++		dev->test_mtd.offset = offset;
++	}
+ #endif
+ 
+ out_put_node:
+diff --git a/mt76.h b/mt76.h
+index d03f312..0ed4188 100644
+--- a/mt76.h
++++ b/mt76.h
+@@ -611,6 +611,7 @@ struct mt76_testmode_ops {
+ 			  enum mt76_testmode_state new_state);
+ 	int (*dump_stats)(struct mt76_phy *phy, struct sk_buff *msg);
+ 	int (*set_eeprom)(struct mt76_phy *phy, u32 offset, u8 *val, u8 action);
++	int (*dump_precal)(struct mt76_phy *phy, struct sk_buff *msg, int flag, int type);
+ };
+ 
+ struct mt76_testmode_entry_data {
+diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
+index cb1e94a..9789380 100644
+--- a/mt76_connac_mcu.h
++++ b/mt76_connac_mcu.h
+@@ -963,6 +963,7 @@ enum {
+ 
+ /* ext event table */
+ enum {
++	MCU_EXT_EVENT_RF_TEST = 0x4,
+ 	MCU_EXT_EVENT_PS_SYNC = 0x5,
+ 	MCU_EXT_EVENT_FW_LOG_2_HOST = 0x13,
+ 	MCU_EXT_EVENT_THERMAL_PROTECT = 0x22,
+diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h
+index 7578ac6..b980342 100644
+--- a/mt7915/eeprom.h
++++ b/mt7915/eeprom.h
+@@ -39,10 +39,18 @@ enum mt7915_eeprom_field {
+ };
+ 
+ #define MT_EE_WIFI_CAL_GROUP			BIT(0)
+-#define MT_EE_WIFI_CAL_DPD			GENMASK(2, 1)
++#define MT_EE_WIFI_CAL_DPD_2G			BIT(2)
++#define MT_EE_WIFI_CAL_DPD_5G			BIT(1)
++#define MT_EE_WIFI_CAL_DPD_6G			BIT(3)
++#define MT_EE_WIFI_CAL_DPD			GENMASK(3, 1)
+ #define MT_EE_CAL_UNIT				1024
+-#define MT_EE_CAL_GROUP_SIZE			(49 * MT_EE_CAL_UNIT + 16)
+-#define MT_EE_CAL_DPD_SIZE			(54 * MT_EE_CAL_UNIT)
++#define MT_EE_CAL_GROUP_SIZE_7915		(49 * MT_EE_CAL_UNIT + 16)
++#define MT_EE_CAL_GROUP_SIZE_7916		(54 * MT_EE_CAL_UNIT + 16)
++#define MT_EE_CAL_GROUP_SIZE_7975		(54 * MT_EE_CAL_UNIT + 16)
++#define MT_EE_CAL_GROUP_SIZE_7976		(94 * MT_EE_CAL_UNIT + 16)
++#define MT_EE_CAL_GROUP_SIZE_7916_6G		(94 * MT_EE_CAL_UNIT + 16)
++#define MT_EE_CAL_DPD_SIZE_V1			(54 * MT_EE_CAL_UNIT)
++#define MT_EE_CAL_DPD_SIZE_V2			(300 * MT_EE_CAL_UNIT)
+ 
+ #define MT_EE_WIFI_CONF0_TX_PATH		GENMASK(2, 0)
+ #define MT_EE_WIFI_CONF0_BAND_SEL		GENMASK(7, 6)
+@@ -160,6 +168,26 @@ mt7915_tssi_enabled(struct mt7915_dev *dev, enum nl80211_band band)
+ 		return val & MT_EE_WIFI_CONF7_TSSI0_5G;
+ }
+ 
++static inline u32
++mt7915_get_cal_group_size(struct mt7915_dev *dev)
++{
++	u8 *eep = dev->mt76.eeprom.data;
++	u32 val;
++
++	if (is_mt7915(&dev->mt76)) {
++		return MT_EE_CAL_GROUP_SIZE_7915;
++	} else if (is_mt7916(&dev->mt76)) {
++		val = eep[MT_EE_WIFI_CONF + 1];
++		val = FIELD_GET(MT_EE_WIFI_CONF0_BAND_SEL, val);
++		return (val == MT_EE_V2_BAND_SEL_6GHZ) ? MT_EE_CAL_GROUP_SIZE_7916_6G :
++							 MT_EE_CAL_GROUP_SIZE_7916;
++	} else if (mt7915_check_adie(dev, false)) {
++		return MT_EE_CAL_GROUP_SIZE_7976;
++	} else {
++		return MT_EE_CAL_GROUP_SIZE_7975;
++	}
++}
++
+ extern const u8 mt7915_sku_group_len[MAX_SKU_RATE_GROUP_NUM];
+ 
+ #endif
+diff --git a/mt7915/mcu.c b/mt7915/mcu.c
+index ecdc4fb..42b1abc 100644
+--- a/mt7915/mcu.c
++++ b/mt7915/mcu.c
+@@ -438,6 +438,9 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
+ 	case MCU_EXT_EVENT_BF_STATUS_READ:
+ 		mt7915_tm_txbf_status_read(dev, skb);
+ 		break;
++	case MCU_EXT_EVENT_RF_TEST:
++		mt7915_tm_rf_test_event(dev, skb);
++		break;
+ #endif
+ 	default:
+ 		break;
+@@ -2925,7 +2928,7 @@ int mt7915_mcu_apply_group_cal(struct mt7915_dev *dev)
+ 	u8 idx = 0, *cal = dev->cal, *eep = dev->mt76.eeprom.data;
+ 	u32 total = MT_EE_CAL_GROUP_SIZE;
+ 
+-	if (1 || !(eep[MT_EE_DO_PRE_CAL] & MT_EE_WIFI_CAL_GROUP))
++	if (!(eep[offs] & MT_EE_WIFI_CAL_GROUP))
+ 		return 0;
+ 
+ 	/*
+@@ -3005,11 +3008,29 @@ int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy)
+ {
+ 	struct mt7915_dev *dev = phy->dev;
+ 	struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
+-	u16 total = 2, center_freq = chandef->center_freq1;
++	enum nl80211_band band = chandef->chan->band;
++	u32 offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
++	u16 center_freq = chandef->center_freq1;
+ 	u8 *cal = dev->cal, *eep = dev->mt76.eeprom.data;
++	u8 dpd_mask, cal_num = is_mt7915(&dev->mt76) ? 2 : 3;
+ 	int idx;
+ 
+-	if (1 || !(eep[MT_EE_DO_PRE_CAL] & MT_EE_WIFI_CAL_DPD))
++	switch (band) {
++	case NL80211_BAND_2GHZ:
++		dpd_mask = MT_EE_WIFI_CAL_DPD_2G;
++		break;
++	case NL80211_BAND_5GHZ:
++		dpd_mask = MT_EE_WIFI_CAL_DPD_5G;
++		break;
++	case NL80211_BAND_6GHZ:
++		dpd_mask = MT_EE_WIFI_CAL_DPD_6G;
++		break;
++	default:
++		dpd_mask = 0;
++		break;
++	}
++
++	if (!(eep[offs] & dpd_mask))
+ 		return 0;
+ 
+ 	idx = mt7915_dpd_freq_idx(center_freq, chandef->width);
+diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
+index 99f364c..fc0621e 100644
+--- a/mt7915/mt7915.h
++++ b/mt7915/mt7915.h
+@@ -381,6 +381,10 @@ struct mt7915_dev {
+ 	struct rchan *relay_fwlog;
+ 
+ 	void *cal;
++	u32 cur_prek_offset;
++	u8 dpd_chan_num_2g;
++	u8 dpd_chan_num_5g;
++	u8 dpd_chan_num_6g;
+ 
+ 	struct {
+ 		u8 debug_wm;
+@@ -617,6 +621,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);
+ 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);
+ 
+ static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
+ {
+diff --git a/mt7915/testmode.c b/mt7915/testmode.c
+index de6e63e..0afce0d 100644
+--- a/mt7915/testmode.c
++++ b/mt7915/testmode.c
+@@ -5,6 +5,7 @@
+ #include "mac.h"
+ #include "mcu.h"
+ #include "testmode.h"
++#include "eeprom.h"
+ 
+ enum {
+ 	TM_CHANGED_TXPOWER,
+@@ -1578,17 +1579,15 @@ mt7915_tm_rf_switch_mode(struct mt7915_dev *dev, u32 oper)
+ static int
+ mt7915_tm_set_tx_cont(struct mt7915_phy *phy, bool en)
+ {
+-#define TX_CONT_START	0x05
+-#define TX_CONT_STOP	0x06
+ 	struct mt7915_dev *dev = phy->dev;
+ 	struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
+ 	int freq1 = ieee80211_frequency_to_channel(chandef->center_freq1);
+ 	struct mt76_testmode_data *td = &phy->mt76->test;
+-	u32 func_idx = en ? TX_CONT_START : TX_CONT_STOP;
++	u32 func_idx = en ? RF_TEST_TX_CONT_START : RF_TEST_TX_CONT_STOP;
+ 	u8 rate_idx = td->tx_rate_idx, mode;
+ 	u16 rateval;
+ 	struct mt7915_tm_rf_test req = {
+-		.action = 1,
++		.action = RF_ACT_IN_RFTEST,
+ 		.icap_len = 120,
+ 		.op.rf.func_idx = cpu_to_le32(func_idx),
+ 	};
+@@ -1672,6 +1671,316 @@ out:
+ 				 sizeof(req), true);
+ }
+ 
++static int
++mt7915_tm_group_prek(struct mt7915_phy *phy, enum mt76_testmode_state state)
++{
++	u8 *eeprom;
++	u32 i, group_size, dpd_size, size, offs, *pre_cal;
++	int ret = 0;
++	struct mt7915_dev *dev = phy->dev;
++	struct mt76_dev *mdev = &dev->mt76;
++	struct mt7915_tm_rf_test req = {
++		.action = RF_ACT_IN_RFTEST,
++		.icap_len = 8,
++		.op.rf.func_idx = cpu_to_le32(RF_TEST_RE_CAL),
++	};
++
++	if (!dev->flash_mode && !dev->bin_file_mode) {
++		dev_err(dev->mt76.dev, "Currently not in FLASH or BIN MODE,return!\n");
++		return 1;
++	}
++
++	eeprom = mdev->eeprom.data;
++	dev->cur_prek_offset = 0;
++	group_size = mt7915_get_cal_group_size(dev);
++	dpd_size = is_mt7915(&dev->mt76) ? MT_EE_CAL_DPD_SIZE_V1 : MT_EE_CAL_DPD_SIZE_V2;
++	size = group_size + dpd_size;
++	offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
++
++	switch (state) {
++	case MT76_TM_STATE_GROUP_PREK:
++		req.op.rf.param.cal_param.func_data = cpu_to_le32(RF_PRE_CAL);
++
++		if (!dev->cal) {
++			dev->cal = devm_kzalloc(mdev->dev, size, GFP_KERNEL);
++			if (!dev->cal)
++				return -ENOMEM;
++		}
++
++		ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RF_TEST), &req,
++					sizeof(req), true);
++
++		if (!ret)
++			eeprom[offs] |= MT_EE_WIFI_CAL_GROUP;
++		break;
++	case MT76_TM_STATE_GROUP_PREK_DUMP:
++		pre_cal = (u32 *)dev->cal;
++		if (!pre_cal) {
++			dev_info(dev->mt76.dev, "Not group pre-cal yet!\n");
++			return ret;
++		}
++		dev_info(dev->mt76.dev, "Group Pre-Cal:\n");
++		for (i = 0; i < (group_size / sizeof(u32)); i += 4) {
++			dev_info(dev->mt76.dev, "[0x%08x] 0x%8x 0x%8x 0x%8x 0x%8x\n",
++				 i * sizeof(u32), pre_cal[i], pre_cal[i + 1],
++				 pre_cal[i + 2], pre_cal[i + 3]);
++		}
++		break;
++	case MT76_TM_STATE_GROUP_PREK_CLEAN:
++		pre_cal = (u32 *)dev->cal;
++		if (!pre_cal)
++			return ret;
++		memset(pre_cal, 0, group_size);
++		eeprom[offs] &= ~MT_EE_WIFI_CAL_GROUP;
++		break;
++	default:
++		return -EINVAL;
++	}
++	return ret;
++}
++
++static int
++mt7915_tm_dpd_prek(struct mt7915_phy *phy, enum mt76_testmode_state state)
++{
++#define DPD_2G_CH_BW20_BITMAP_0         0x444
++#define DPD_5G_CH_BW20_BITMAP_0         0xffffc0ff
++#define DPD_5G_CH_BW20_BITMAP_1         0x3
++#define DPD_5G_CH_BW20_BITMAP_7915_0    0x7dffc0ff
++#define DPD_6G_CH_BW20_BITMAP_0         0xffffffff
++#define DPD_6G_CH_BW20_BITMAP_1         0x07ffffff
++	bool is_set = false;
++	u8 band, do_precal, *eeprom;
++	u16 bw20_size, bw160_size;
++	u32 i, j, *bw160_freq, bw160_5g_freq[] = {5250, 5570, 5815};
++	u32 bw160_6g_freq[] = {6025, 6185, 6345, 6505, 6665, 6825, 6985};
++	u32 shift, freq, group_size, dpd_size, size, offs, *pre_cal, dpd_ch_bw20_bitmap[2] = {0};
++	__le32 func_data = 0;
++	int ret = 0;
++	struct mt7915_dev *dev = phy->dev;
++	struct mt76_dev *mdev = &dev->mt76;
++	struct mt76_phy *mphy = phy->mt76;
++	struct cfg80211_chan_def chandef_backup, *chandef = &mphy->chandef;
++	struct ieee80211_channel chan_backup, chan, *bw20_ch;
++	struct mt7915_tm_rf_test req = {
++		.action = RF_ACT_IN_RFTEST,
++		.icap_len = 8,
++		.op.rf.func_idx = cpu_to_le32(RF_TEST_RE_CAL),
++	};
++
++	if (!dev->flash_mode && !dev->bin_file_mode) {
++		dev_err(dev->mt76.dev, "Currently not in FLASH or BIN MODE,return!\n");
++		return -EOPNOTSUPP;
++	}
++
++	eeprom = mdev->eeprom.data;
++	dev->cur_prek_offset = 0;
++	group_size = mt7915_get_cal_group_size(dev);
++	dev->dpd_chan_num_2g = hweight32(DPD_2G_CH_BW20_BITMAP_0);
++	if (is_mt7915(&dev->mt76)) {
++		dev->dpd_chan_num_5g = hweight32(DPD_5G_CH_BW20_BITMAP_7915_0);
++		dev->dpd_chan_num_6g = 0;
++		dpd_size = MT_EE_CAL_DPD_SIZE_V1;
++		offs = MT_EE_DO_PRE_CAL;
++	} else {
++		dev->dpd_chan_num_5g = hweight32(DPD_5G_CH_BW20_BITMAP_0) +
++				       hweight32(DPD_5G_CH_BW20_BITMAP_1) +
++				       ARRAY_SIZE(bw160_5g_freq);
++		dev->dpd_chan_num_6g = hweight32(DPD_6G_CH_BW20_BITMAP_0) +
++				       hweight32(DPD_6G_CH_BW20_BITMAP_1) +
++				       ARRAY_SIZE(bw160_6g_freq);
++		dpd_size = MT_EE_CAL_DPD_SIZE_V2;
++		offs = MT_EE_DO_PRE_CAL_V2;
++	}
++	size = group_size + dpd_size;
++
++	switch (state) {
++	case MT76_TM_STATE_DPD_2G:
++		if (!is_set) {
++			func_data = cpu_to_le32(RF_DPD_FLAT_CAL);
++			dpd_ch_bw20_bitmap[0] = DPD_2G_CH_BW20_BITMAP_0;
++			bw20_ch = mphy->sband_2g.sband.channels;
++			bw160_freq = NULL;
++			bw160_size = 0;
++			band = NL80211_BAND_2GHZ;
++			do_precal = MT_EE_WIFI_CAL_DPD_2G;
++			is_set = true;
++		}
++		fallthrough;
++	case MT76_TM_STATE_DPD_5G:
++		if (!is_set) {
++			if (is_mt7915(&dev->mt76)) {
++				func_data = cpu_to_le32(RF_DPD_FLAT_CAL);
++				dpd_ch_bw20_bitmap[0] = DPD_5G_CH_BW20_BITMAP_7915_0;
++				bw160_size = 0;
++				dev->cur_prek_offset -= dev->dpd_chan_num_5g * MT_EE_CAL_UNIT * 2;
++			} else {
++				func_data = cpu_to_le32(RF_DPD_FLAT_5G_CAL);
++				dpd_ch_bw20_bitmap[0] = DPD_5G_CH_BW20_BITMAP_0;
++				dpd_ch_bw20_bitmap[1] = DPD_5G_CH_BW20_BITMAP_1;
++				bw160_size = ARRAY_SIZE(bw160_5g_freq);
++			}
++			bw20_ch = mphy->sband_5g.sband.channels;
++			bw160_freq = bw160_5g_freq;
++			band = NL80211_BAND_5GHZ;
++			do_precal = MT_EE_WIFI_CAL_DPD_5G;
++			is_set = true;
++		}
++		fallthrough;
++	case MT76_TM_STATE_DPD_6G:
++		if (!is_set) {
++			func_data = cpu_to_le32(RF_DPD_FLAT_6G_CAL);
++			dpd_ch_bw20_bitmap[0] = DPD_6G_CH_BW20_BITMAP_0;
++			dpd_ch_bw20_bitmap[1] = DPD_6G_CH_BW20_BITMAP_1;
++			bw20_ch = mphy->sband_6g.sband.channels;
++			bw160_freq = bw160_6g_freq;
++			bw160_size = ARRAY_SIZE(bw160_6g_freq);
++			band = NL80211_BAND_6GHZ;
++			do_precal = MT_EE_WIFI_CAL_DPD_6G;
++			is_set = true;
++		}
++
++		if (!bw20_ch)
++			return -EOPNOTSUPP;
++		if (!dev->cal) {
++			dev->cal = devm_kzalloc(mdev->dev, size, GFP_KERNEL);
++			if (!dev->cal)
++				return -ENOMEM;
++		}
++
++		req.op.rf.param.cal_param.func_data = func_data;
++		req.op.rf.param.cal_param.band_idx = phy->band_idx;
++
++		memcpy(&chan_backup, chandef->chan, sizeof(struct ieee80211_channel));
++		memcpy(&chandef_backup, chandef, sizeof(struct cfg80211_chan_def));
++
++		bw20_size = hweight32(dpd_ch_bw20_bitmap[0]) + hweight32(dpd_ch_bw20_bitmap[1]);
++		for (i = 0, j = 0; i < bw20_size + bw160_size; i++) {
++			if (i < bw20_size) {
++				freq = dpd_ch_bw20_bitmap[0] ? 0 : 1;
++				shift = ffs(dpd_ch_bw20_bitmap[freq]);
++				j += shift;
++				memcpy(&chan, &bw20_ch[j - 1], sizeof(struct ieee80211_channel));
++				chandef->width = NL80211_CHAN_WIDTH_20;
++				dpd_ch_bw20_bitmap[0] >>= shift;
++			} else {
++				freq = bw160_freq[i - bw20_size];
++				chan.center_freq = freq;
++				chan.hw_value = ieee80211_frequency_to_channel(freq);
++				chan.band = band;
++				chandef->width = NL80211_CHAN_WIDTH_160;
++			}
++
++			memcpy(chandef->chan, &chan, sizeof(struct ieee80211_channel));
++			if (is_mt7915(&dev->mt76))
++				mphy->hw->conf.flags &= ~IEEE80211_CONF_OFFCHANNEL;
++			else
++				mphy->hw->conf.flags |= IEEE80211_CONF_OFFCHANNEL;
++
++			mt7915_mcu_set_chan_info(phy, MCU_EXT_CMD(CHANNEL_SWITCH));
++
++			ret = mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(RF_TEST), &req,
++						sizeof(req), true);
++			if (ret) {
++				dev_err(dev->mt76.dev, "DPD Pre-cal: mcu send msg failed!\n");
++				break;
++			}
++		}
++		memcpy(chandef, &chandef_backup, sizeof(struct cfg80211_chan_def));
++		memcpy(chandef->chan, &chan_backup, sizeof(struct ieee80211_channel));
++		mt7915_mcu_set_chan_info(phy, MCU_EXT_CMD(CHANNEL_SWITCH));
++
++		if (!ret)
++			eeprom[offs] |= do_precal;
++
++		break;
++	case MT76_TM_STATE_DPD_DUMP:
++		pre_cal = (u32 *)dev->cal;
++		if (!dev->cal) {
++			dev_info(dev->mt76.dev, "Not DPD pre-cal yet!\n");
++			return ret;
++		}
++		dev_info(dev->mt76.dev, "DPD Pre-Cal:\n");
++		for (i = 0; i < dpd_size / sizeof(u32); i += 4) {
++			j = i + (group_size / sizeof(u32));
++			dev_info(dev->mt76.dev, "[0x%08x] 0x%8x 0x%8x 0x%8x 0x%8x\n",
++				 j * sizeof(u32), pre_cal[j], pre_cal[j + 1],
++				 pre_cal[j + 2], pre_cal[j + 3]);
++		}
++		break;
++	case MT76_TM_STATE_DPD_CLEAN:
++		pre_cal = (u32 *)dev->cal;
++		if (!pre_cal)
++			return ret;
++		memset(pre_cal + (group_size / sizeof(u32)), 0, dpd_size);
++		do_precal = MT_EE_WIFI_CAL_DPD;
++		eeprom[offs] &= ~do_precal;
++		break;
++	default:
++		return -EINVAL;
++	}
++	return ret;
++}
++
++void mt7915_tm_re_cal_event(struct mt7915_dev *dev, struct mt7915_tm_rf_test_result *result,
++			    struct mt7915_tm_rf_test_data *data)
++{
++#define DPD_PER_CHAN_SIZE_7915	2
++#define DPD_PER_CHAN_SIZE_7986	3
++	u32 base, dpd_offest_2g, dpd_offest_5g, cal_idx = 0, cal_type = 0, len = 0;
++	u8 *pre_cal;
++
++	pre_cal = dev->cal;
++	dpd_offest_5g = dev->dpd_chan_num_6g * DPD_PER_CHAN_SIZE_7986 * MT_EE_CAL_UNIT;
++	dpd_offest_2g = dpd_offest_5g + dev->dpd_chan_num_5g * MT_EE_CAL_UNIT *
++			(is_mt7915(&dev->mt76) ? DPD_PER_CHAN_SIZE_7915 : DPD_PER_CHAN_SIZE_7986);
++	cal_idx = le32_to_cpu(data->cal_idx);
++	cal_type = le32_to_cpu(data->cal_type);
++	len = le32_to_cpu(result->payload_len);
++	len = len - sizeof(struct mt7915_tm_rf_test_data);
++
++	switch (cal_type) {
++	case RF_PRE_CAL:
++		base = 0;
++		break;
++	case RF_DPD_FLAT_CAL:
++		base = mt7915_get_cal_group_size(dev) + dpd_offest_2g;
++		break;
++	case RF_DPD_FLAT_5G_CAL:
++		base = mt7915_get_cal_group_size(dev) + dpd_offest_5g;
++		break;
++	case RF_DPD_FLAT_6G_CAL:
++		base = mt7915_get_cal_group_size(dev);
++		break;
++	default:
++		dev_info(dev->mt76.dev, "Unknown calibration type!\n");
++		return;
++	}
++	pre_cal += (base + dev->cur_prek_offset);
++
++	memcpy(pre_cal, data->data, len);
++	dev->cur_prek_offset += len;
++}
++
++void mt7915_tm_rf_test_event(struct mt7915_dev *dev, struct sk_buff *skb)
++{
++	struct mt7915_tm_rf_test_result *result;
++	struct mt7915_tm_rf_test_data *data;
++	static u32 event_type;
++
++	result = (struct mt7915_tm_rf_test_result *)skb->data;
++	data = (struct mt7915_tm_rf_test_data *)result->event;
++
++	event_type = le32_to_cpu(result->func_idx);
++
++	switch (event_type) {
++	case RF_TEST_RE_CAL:
++		mt7915_tm_re_cal_event(dev, result, data);
++		break;
++	default:
++		break;
++	}
++}
++
+ static void
+ mt7915_tm_update_params(struct mt7915_phy *phy, u32 changed)
+ {
+@@ -1711,6 +2020,10 @@ mt7915_tm_set_state(struct mt76_phy *mphy, enum mt76_testmode_state state)
+ 	else if (prev_state == MT76_TM_STATE_OFF ||
+ 		 state == MT76_TM_STATE_OFF)
+ 		mt7915_tm_init(phy, !(state == MT76_TM_STATE_OFF));
++	else if (state >= MT76_TM_STATE_GROUP_PREK && state <= MT76_TM_STATE_GROUP_PREK_CLEAN)
++		return mt7915_tm_group_prek(phy, state);
++	else if (state >= MT76_TM_STATE_DPD_2G && state <= MT76_TM_STATE_DPD_CLEAN)
++		return mt7915_tm_dpd_prek(phy, state);
+ 
+ 	if ((state == MT76_TM_STATE_IDLE &&
+ 	     prev_state == MT76_TM_STATE_OFF) ||
+@@ -1866,9 +2179,113 @@ mt7915_tm_set_eeprom(struct mt76_phy *mphy, u32 offset, u8 *val, u8 action)
+ 	return ret;
+ }
+ 
++static int
++mt7915_tm_dump_precal(struct mt76_phy *mphy, struct sk_buff *msg, int flag, int type)
++{
++#define DPD_PER_CHAN_SIZE_MASK		GENMASK(31, 24)
++#define DPD_CHAN_NUM_2G_MASK		GENMASK(23, 16)
++#define DPD_CHAN_NUM_5G_MASK		GENMASK(15, 8)
++#define DPD_CHAN_NUM_6G_MASK		GENMASK(7, 0)
++	struct mt7915_phy *phy = mphy->priv;
++	struct mt7915_dev *dev = phy->dev;
++	u32 i, group_size, dpd_size, total_size, dpd_per_chan_size, dpd_info = 0;
++	u32 base, size, total_chan_num, offs, transmit_size = 1000;
++	u8 *pre_cal, *eeprom;
++	void *precal;
++	enum prek_ops {
++		PREK_GET_INFO,
++		PREK_SYNC_ALL,
++		PREK_SYNC_GROUP,
++		PREK_SYNC_DPD_2G,
++		PREK_SYNC_DPD_5G,
++		PREK_SYNC_DPD_6G,
++		PREK_CLEAN_GROUP,
++		PREK_CLEAN_DPD,
++	};
++
++	if (!dev->cal) {
++		dev_info(dev->mt76.dev, "Not pre-cal yet!\n");
++		return 0;
++	}
++
++	group_size = mt7915_get_cal_group_size(dev);
++	dpd_size = is_mt7915(&dev->mt76) ? MT_EE_CAL_DPD_SIZE_V1 : MT_EE_CAL_DPD_SIZE_V2;
++	dpd_per_chan_size = is_mt7915(&dev->mt76) ? 2 : 3;
++	total_size = group_size + dpd_size;
++	pre_cal = dev->cal;
++	eeprom = dev->mt76.eeprom.data;
++	offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
++
++	total_chan_num = dev->dpd_chan_num_2g + dev->dpd_chan_num_5g + dev->dpd_chan_num_6g;
++
++	switch (type) {
++	case PREK_SYNC_ALL:
++		base = 0;
++		size = total_size;
++		break;
++	case PREK_SYNC_GROUP:
++		base = 0;
++		size = group_size;
++		break;
++	case PREK_SYNC_DPD_6G:
++		base = group_size;
++		size = dpd_size * dev->dpd_chan_num_6g / total_chan_num;
++		break;
++	case PREK_SYNC_DPD_5G:
++		base = group_size + dev->dpd_chan_num_6g * dpd_per_chan_size * MT_EE_CAL_UNIT;
++		size = dpd_size * dev->dpd_chan_num_5g / total_chan_num;
++		break;
++	case PREK_SYNC_DPD_2G:
++		base = group_size + (dev->dpd_chan_num_6g + dev->dpd_chan_num_5g) *
++			   dpd_per_chan_size * MT_EE_CAL_UNIT;
++		size = dpd_size * dev->dpd_chan_num_2g / total_chan_num;
++		break;
++	case PREK_GET_INFO:
++		break;
++	default:
++		return 0;
++	}
++
++	if (!flag) {
++		if (eeprom[offs] & MT_EE_WIFI_CAL_DPD) {
++			dpd_info |= u32_encode_bits(dpd_per_chan_size, DPD_PER_CHAN_SIZE_MASK) |
++				    u32_encode_bits(dev->dpd_chan_num_2g, DPD_CHAN_NUM_2G_MASK) |
++				    u32_encode_bits(dev->dpd_chan_num_5g, DPD_CHAN_NUM_5G_MASK) |
++				    u32_encode_bits(dev->dpd_chan_num_6g, DPD_CHAN_NUM_6G_MASK);
++		}
++		dev->cur_prek_offset = 0;
++		precal = nla_nest_start(msg, MT76_TM_ATTR_PRECAL_INFO);
++		if (!precal)
++			return -ENOMEM;
++		nla_put_u32(msg, 0, group_size);
++		nla_put_u32(msg, 1, dpd_size);
++		nla_put_u32(msg, 2, dpd_info);
++		nla_put_u32(msg, 3, transmit_size);
++		nla_put_u32(msg, 4, eeprom[offs]);
++		nla_nest_end(msg, precal);
++	} else {
++		precal = nla_nest_start(msg, MT76_TM_ATTR_PRECAL);
++		if (!precal)
++			return -ENOMEM;
++
++		transmit_size = (dev->cur_prek_offset + transmit_size < size) ?
++				transmit_size : (size - dev->cur_prek_offset);
++		for (i = 0; i < transmit_size; i++) {
++			if (nla_put_u8(msg, i, pre_cal[base + dev->cur_prek_offset + i]))
++				return -ENOMEM;
++		}
++		dev->cur_prek_offset += transmit_size;
++
++		nla_nest_end(msg, precal);
++	}
++
++	return 0;
++}
++
+ const struct mt76_testmode_ops mt7915_testmode_ops = {
+ 	.set_state = mt7915_tm_set_state,
+ 	.set_params = mt7915_tm_set_params,
+ 	.dump_stats = mt7915_tm_dump_stats,
+ 	.set_eeprom = mt7915_tm_set_eeprom,
++	.dump_precal = mt7915_tm_dump_precal,
+ };
+diff --git a/mt7915/testmode.h b/mt7915/testmode.h
+index 01b08e9..d500987 100644
+--- a/mt7915/testmode.h
++++ b/mt7915/testmode.h
+@@ -81,6 +81,11 @@ struct tm_tx_cont {
+ 	u8 txfd_mode;
+ };
+ 
++struct tm_cal_param {
++	__le32 func_data;
++	u8 band_idx;
++};
++
+ struct mt7915_tm_rf_test {
+ 	u8 action;
+ 	u8 icap_len;
+@@ -96,6 +101,7 @@ struct mt7915_tm_rf_test {
+ 				__le32 cal_dump;
+ 
+ 				struct tm_tx_cont tx_cont;
++				struct tm_cal_param cal_param;
+ 
+ 				u8 _pad[80];
+ 			} param;
+@@ -103,6 +109,20 @@ struct mt7915_tm_rf_test {
+ 	} op;
+ } __packed;
+ 
++struct mt7915_tm_rf_test_result {
++	struct mt76_connac2_mcu_rxd rxd;
++
++	u32 func_idx;
++	u32 payload_len;
++	u8 event[0];
++} __packed;
++
++struct mt7915_tm_rf_test_data {
++	u32 cal_idx;
++	u32 cal_type;
++	u8 data[0];
++} __packed;
++
+ enum {
+ 	RF_OPER_NORMAL,
+ 	RF_OPER_RF_TEST,
+@@ -111,6 +131,22 @@ enum {
+ 	RF_OPER_WIFI_SPECTRUM,
+ };
+ 
++enum {
++	RF_ACT_SWITCH_MODE,
++	RF_ACT_IN_RFTEST,
++};
++
++enum {
++	RF_TEST_RE_CAL = 0x01,
++	RF_TEST_TX_CONT_START = 0x05,
++	RF_TEST_TX_CONT_STOP = 0x06,
++};
++
++#define RF_DPD_FLAT_CAL		BIT(28)
++#define RF_PRE_CAL		BIT(29)
++#define RF_DPD_FLAT_5G_CAL	GENMASK(29, 28)
++#define RF_DPD_FLAT_6G_CAL	(BIT(30) | BIT(28))
++
+ enum {
+ 	TAM_ARB_OP_MODE_NORMAL = 1,
+ 	TAM_ARB_OP_MODE_TEST,
+diff --git a/testmode.c b/testmode.c
+index 2653182..568b478 100644
+--- a/testmode.c
++++ b/testmode.c
+@@ -764,6 +764,18 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
+ 
+ 	mutex_lock(&dev->mutex);
+ 
++	if (tb[MT76_TM_ATTR_PRECAL] || tb[MT76_TM_ATTR_PRECAL_INFO]) {
++		int flag, type;
++
++		err = -EINVAL;
++		flag = tb[MT76_TM_ATTR_PRECAL] ? 1 : 0;
++		type = flag ? nla_get_u8(tb[MT76_TM_ATTR_PRECAL_INFO]) : 0;
++		if (dev->test_ops->dump_precal)
++			err = dev->test_ops->dump_precal(phy, msg, flag, type);
++
++		goto out;
++	}
++
+ 	if (tb[MT76_TM_ATTR_STATS]) {
+ 		err = -EINVAL;
+ 
+@@ -797,7 +809,8 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
+ 
+ 	if (dev->test_mtd.name &&
+ 	    (nla_put_string(msg, MT76_TM_ATTR_MTD_PART, dev->test_mtd.name) ||
+-	     nla_put_u32(msg, MT76_TM_ATTR_MTD_OFFSET, dev->test_mtd.offset)))
++	     nla_put_u32(msg, MT76_TM_ATTR_MTD_OFFSET, dev->test_mtd.offset) ||
++	     nla_put_u8(msg, MT76_TM_ATTR_IS_MAIN_PHY, phy == &dev->phy)))
+ 		goto out;
+ 
+ 	if (nla_put_u32(msg, MT76_TM_ATTR_TX_COUNT, td->tx_count) ||
+diff --git a/testmode.h b/testmode.h
+index 57949f2..e2190e7 100644
+--- a/testmode.h
++++ b/testmode.h
+@@ -19,6 +19,7 @@
+  *
+  * @MT76_TM_ATTR_MTD_PART: mtd partition used for eeprom data (string)
+  * @MT76_TM_ATTR_MTD_OFFSET: offset of eeprom data within the partition (u32)
++ * @MT76_TM_ATTR_IS_MAIN_PHY: Is current phy index the main phy or the ext phy (u8)
+  *
+  * @MT76_TM_ATTR_TX_COUNT: configured number of frames to send when setting
+  *	state to MT76_TM_STATE_TX_FRAMES (u32)
+@@ -40,6 +41,11 @@
+  *
+  * @MT76_TM_ATTR_STATS: statistics (nested, see &enum mt76_testmode_stats_attr)
+  *
++ * @MT76_TM_ATTR_PRECAL: Pre-cal data (u8)
++ * @MT76_TM_ATTR_PRECAL_INFO: group size, dpd size, dpd_info, transmit size,
++ *                            eeprom cal indicator (u32),
++ *                            dpd_info = [dpd_per_chan_size, chan_num_2g,
++ *                                        chan_num_5g, chan_num_6g]
+  * @MT76_TM_ATTR_TX_SPE_IDX: tx spatial extension index (u8)
+  *
+  * @MT76_TM_ATTR_TX_DUTY_CYCLE: packet tx duty cycle (u8)
+@@ -67,6 +73,7 @@ enum mt76_testmode_attr {
+ 
+ 	MT76_TM_ATTR_MTD_PART,
+ 	MT76_TM_ATTR_MTD_OFFSET,
++	MT76_TM_ATTR_IS_MAIN_PHY,
+ 
+ 	MT76_TM_ATTR_TX_COUNT,
+ 	MT76_TM_ATTR_TX_LENGTH,
+@@ -85,6 +92,8 @@ enum mt76_testmode_attr {
+ 	MT76_TM_ATTR_FREQ_OFFSET,
+ 
+ 	MT76_TM_ATTR_STATS,
++	MT76_TM_ATTR_PRECAL,
++	MT76_TM_ATTR_PRECAL_INFO,
+ 
+ 	MT76_TM_ATTR_TX_SPE_IDX,
+ 
+@@ -184,6 +193,14 @@ enum mt76_testmode_state {
+ 	MT76_TM_STATE_TX_FRAMES,
+ 	MT76_TM_STATE_RX_FRAMES,
+ 	MT76_TM_STATE_TX_CONT,
++	MT76_TM_STATE_GROUP_PREK,
++	MT76_TM_STATE_GROUP_PREK_DUMP,
++	MT76_TM_STATE_GROUP_PREK_CLEAN,
++	MT76_TM_STATE_DPD_2G,
++	MT76_TM_STATE_DPD_5G,
++	MT76_TM_STATE_DPD_6G,
++	MT76_TM_STATE_DPD_DUMP,
++	MT76_TM_STATE_DPD_CLEAN,
+ 	MT76_TM_STATE_ON,
+ 
+ 	/* keep last */
+diff --git a/tools/fields.c b/tools/fields.c
+index 6e36ab2..1be1ffd 100644
+--- a/tools/fields.c
++++ b/tools/fields.c
+@@ -11,6 +11,14 @@ static const char * const testmode_state[] = {
+ 	[MT76_TM_STATE_TX_FRAMES] = "tx_frames",
+ 	[MT76_TM_STATE_RX_FRAMES] = "rx_frames",
+ 	[MT76_TM_STATE_TX_CONT] = "tx_cont",
++	[MT76_TM_STATE_GROUP_PREK] = "group_prek",
++	[MT76_TM_STATE_GROUP_PREK_DUMP] = "group_prek_dump",
++	[MT76_TM_STATE_GROUP_PREK_CLEAN] = "group_prek_clean",
++	[MT76_TM_STATE_DPD_2G] = "dpd_2g",
++	[MT76_TM_STATE_DPD_5G] = "dpd_5g",
++	[MT76_TM_STATE_DPD_6G] = "dpd_6g",
++	[MT76_TM_STATE_DPD_DUMP] = "dpd_dump",
++	[MT76_TM_STATE_DPD_CLEAN] = "dpd_clean",
+ };
+ 
+ static const char * const testmode_tx_mode[] = {
+-- 
+2.18.0
+
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
similarity index 77%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
index a95ff2b..b59c0ea 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
@@ -1,14 +1,14 @@
-From 378d2227566d0f3d60cd9b59d91e5b13153653e5 Mon Sep 17 00:00:00 2001
+From 97a607158b050fc6ee59267ab39be725841fcd45 Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Sun, 24 Apr 2022 10:07:00 +0800
-Subject: [PATCH 1112/1119] mt76: mt7915: init rssi in WTBL when add station
+Subject: [PATCH 1113/1121] mt76: mt7915: init rssi in WTBL when add station
 
 ---
- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 4 ++++
+ mt7915/main.c | 4 ++++
  1 file changed, 4 insertions(+)
 
 diff --git a/mt7915/main.c b/mt7915/main.c
-index dd0b3cc2..06658aed 100644
+index b5c3c14..551e909 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -666,6 +666,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -30,5 +30,5 @@
  	mt7915_vendor_amnt_sta_remove(mvif->phy, sta);
  #endif
 -- 
-2.25.1
+2.18.0
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
similarity index 74%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
index 4d28ad7..c68be0b 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
@@ -1,7 +1,7 @@
-From af6a70a816d5a98d22b5bb1012e21cc2ecb4d5db Mon Sep 17 00:00:00 2001
+From 21c4f9da3ed3f42647386add05581ec57940dec4 Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Thu, 4 Aug 2022 14:08:11 +0800
-Subject: [PATCH] mt76: mt7915: reduce TWT SP sent to FW for cert
+Subject: [PATCH 1114/1121] mt76: mt7915: reduce TWT SP sent to FW for cert
 
 Set TWT SP duration to 88 percent to prevent HW sends PPDU over TWT SP.
 
@@ -11,10 +11,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index d7e717f4..2bd67f7c 100644
+index 42b1abc..eb53095 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -3538,7 +3538,7 @@ int mt7915_mcu_twt_agrt_update(struct mt7915_dev *dev,
+@@ -3556,7 +3556,7 @@ int mt7915_mcu_twt_agrt_update(struct mt7915_dev *dev,
  		.own_mac_idx = mvif->mt76.omac_idx,
  		.flowid = flow->id,
  		.peer_id = cpu_to_le16(flow->wcid),
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-airtime-fairness-feature-off-in-mac80211.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-airtime-fairness-feature-off-in-mac80211.patch
similarity index 64%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-airtime-fairness-feature-off-in-mac80211.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-airtime-fairness-feature-off-in-mac80211.patch
index d6d76d7..b59f9c4 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-airtime-fairness-feature-off-in-mac80211.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-airtime-fairness-feature-off-in-mac80211.patch
@@ -1,17 +1,17 @@
-From 270b493736a3f552b9fc2da8d6741c7e0168b470 Mon Sep 17 00:00:00 2001
+From f90ef0de50a5350775aef52908ee6be942fba9a8 Mon Sep 17 00:00:00 2001
 From: Evelyn Tsai <evelyn.tsai@mediatek.com>
 Date: Fri, 6 May 2022 15:58:42 +0800
-Subject: [PATCH 1114/1119] mt76: airtime fairness feature off in mac80211
+Subject: [PATCH 1115/1121] mt76: airtime fairness feature off in mac80211
 
 ---
- drivers/net/wireless/mediatek/mt76/mac80211.c | 1 -
+ mac80211.c | 1 -
  1 file changed, 1 deletion(-)
 
 diff --git a/mac80211.c b/mac80211.c
-index 9984def5..af2c09ad 100644
+index e1c3332..2f0605d 100644
 --- a/mac80211.c
 +++ b/mac80211.c
-@@ -427,7 +427,6 @@ mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)
+@@ -428,7 +428,6 @@ mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)
  			WIPHY_FLAG_AP_UAPSD;
  
  	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
@@ -20,5 +20,5 @@
  
  	wiphy->available_antennas_tx = phy->antenna_mask;
 -- 
-2.25.1
+2.18.0
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
similarity index 64%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
index b1540ba..0cf6cfb 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
@@ -1,7 +1,7 @@
-From a4033091ec1a76b05364ea714f2abea7addbebb9 Mon Sep 17 00:00:00 2001
+From 16d67349d56a818200f96ba21e8c9023094baffc Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Fri, 20 May 2022 19:19:25 +0800
-Subject: [PATCH 1115/1119] mt76: mt7915: add mt7986 and mt7916 pre-calibration
+Subject: [PATCH 1116/1121] mt76: mt7915: add mt7986 and mt7916 pre-calibration
 
 Add pre-calibration for mt7986 and mt7916. It has different data size
 with mt7915. Group cal needs 54k and 94k for 2G + 5G and 2G + 6G,
@@ -9,13 +9,13 @@
 
 Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
 ---
- .../wireless/mediatek/mt76/mt7915/eeprom.c    | 15 ++--
- .../wireless/mediatek/mt76/mt7915/eeprom.h    | 27 ++++++-
- .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 80 ++++++++++++++-----
- 3 files changed, 90 insertions(+), 32 deletions(-)
+ mt7915/eeprom.c | 15 +++++------
+ mt7915/eeprom.h |  1 +
+ mt7915/mcu.c    | 72 ++++++++++++++++++++++++++++++++++++-------------
+ 3 files changed, 62 insertions(+), 26 deletions(-)
 
 diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
-index 4b1a9811..ee3049e5 100644
+index 4b1a981..ee3049e 100644
 --- a/mt7915/eeprom.c
 +++ b/mt7915/eeprom.c
 @@ -9,23 +9,22 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
@@ -50,7 +50,7 @@
  
  static int mt7915_check_eeprom(struct mt7915_dev *dev)
 diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h
-index 7578ac6d..e924baef 100644
+index b980342..fb9fbfe 100644
 --- a/mt7915/eeprom.h
 +++ b/mt7915/eeprom.h
 @@ -19,6 +19,7 @@ enum mt7915_eeprom_field {
@@ -61,52 +61,11 @@
  	MT_EE_RATE_DELTA_2G =	0x252,
  	MT_EE_RATE_DELTA_5G =	0x29d,
  	MT_EE_TX0_POWER_2G =	0x2fc,
-@@ -39,10 +40,14 @@ enum mt7915_eeprom_field {
- };
- 
- #define MT_EE_WIFI_CAL_GROUP			BIT(0)
--#define MT_EE_WIFI_CAL_DPD			GENMASK(2, 1)
-+#define MT_EE_WIFI_CAL_DPD			GENMASK(3, 1)
- #define MT_EE_CAL_UNIT				1024
--#define MT_EE_CAL_GROUP_SIZE			(49 * MT_EE_CAL_UNIT + 16)
--#define MT_EE_CAL_DPD_SIZE			(54 * MT_EE_CAL_UNIT)
-+#define MT_EE_CAL_GROUP_SIZE_7915		(49 * MT_EE_CAL_UNIT + 16)
-+#define MT_EE_CAL_GROUP_SIZE_7916		(54 * MT_EE_CAL_UNIT + 16)
-+#define MT_EE_CAL_GROUP_SIZE_7975		(54 * MT_EE_CAL_UNIT + 16)
-+#define MT_EE_CAL_GROUP_SIZE_7976		(94 * MT_EE_CAL_UNIT + 16)
-+#define MT_EE_CAL_DPD_SIZE_V1			(54 * MT_EE_CAL_UNIT)
-+#define MT_EE_CAL_DPD_SIZE_V2			(300 * MT_EE_CAL_UNIT)
- 
- #define MT_EE_WIFI_CONF0_TX_PATH		GENMASK(2, 0)
- #define MT_EE_WIFI_CONF0_BAND_SEL		GENMASK(7, 6)
-@@ -160,6 +165,22 @@ mt7915_tssi_enabled(struct mt7915_dev *dev, enum nl80211_band band)
- 		return val & MT_EE_WIFI_CONF7_TSSI0_5G;
- }
- 
-+static inline u32
-+mt7915_get_cal_group_size(struct mt7915_dev *dev)
-+{
-+	switch (mt76_chip(&dev->mt76)) {
-+	case 0x7915:
-+		return MT_EE_CAL_GROUP_SIZE_7915;
-+	case 0x7916:
-+		return MT_EE_CAL_GROUP_SIZE_7916;
-+	default:
-+		if (mt7915_check_adie(dev, false))
-+			return MT_EE_CAL_GROUP_SIZE_7976;
-+
-+		return MT_EE_CAL_GROUP_SIZE_7975;
-+	}
-+}
-+
- extern const u8 mt7915_sku_group_len[MAX_SKU_RATE_GROUP_NUM];
- 
- #endif
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index c65fee98..29422f55 100644
+index eb53095..9d1dea2 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -2930,9 +2930,10 @@ static int mt7915_mcu_set_pre_cal(struct mt7915_dev *dev, u8 idx,
+@@ -2926,7 +2926,8 @@ static int mt7915_mcu_set_pre_cal(struct mt7915_dev *dev, u8 idx,
  int mt7915_mcu_apply_group_cal(struct mt7915_dev *dev)
  {
  	u8 idx = 0, *cal = dev->cal, *eep = dev->mt76.eeprom.data;
@@ -114,12 +73,9 @@
 +	u32 total = mt7915_get_cal_group_size(dev);
 +	u32 offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
  
--	if (1 || !(eep[MT_EE_DO_PRE_CAL] & MT_EE_WIFI_CAL_GROUP))
-+	if (1 || !(eep[offs] & MT_EE_WIFI_CAL_GROUP))
+ 	if (!(eep[offs] & MT_EE_WIFI_CAL_GROUP))
  		return 0;
- 
- 	/*
-@@ -2968,9 +2969,9 @@ static int mt7915_find_freq_idx(const u16 *freqs, int n_freqs, u16 cur)
+@@ -2964,9 +2965,9 @@ static int mt7915_find_freq_idx(const u16 *freqs, int n_freqs, u16 cur)
  	return -1;
  }
  
@@ -127,16 +83,16 @@
 +static int mt7915_dpd_freq_idx(struct mt7915_dev *dev, u16 freq, u8 bw)
  {
 -	static const u16 freq_list[] = {
-+	static const u16 freq_list_v1[] = {
++	const u16 freq_list_v1[] = {
  		5180, 5200, 5220, 5240,
  		5260, 5280, 5300, 5320,
  		5500, 5520, 5540, 5560,
-@@ -2978,65 +2979,102 @@ static int mt7915_dpd_freq_idx(u16 freq, u8 bw)
+@@ -2974,34 +2975,69 @@ static int mt7915_dpd_freq_idx(u16 freq, u8 bw)
  		5660, 5680, 5700, 5745,
  		5765, 5785, 5805, 5825
  	};
 -	int offset_2g = ARRAY_SIZE(freq_list);
-+	static const u16 freq_list_v2[] = {
++	const u16 freq_list_v2[] = {
 +		/* 6G BW20*/
 +		5955, 5975, 5995, 6015,
 +		6035, 6055, 6075, 6095,
@@ -167,7 +123,7 @@
 +		/* 5G BW160 */
 +		5250, 5570, 5815
 +	};
-+	static const u16 *freq_list = freq_list_v1;
++	const u16 *freq_list = freq_list_v1;
 +	int n_freqs = ARRAY_SIZE(freq_list_v1);
  	int idx;
  
@@ -211,18 +167,8 @@
  }
  
  int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy)
- {
- 	struct mt7915_dev *dev = phy->dev;
- 	struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
--	u16 total = 2, center_freq = chandef->center_freq1;
-+	u32 offs = is_mt7915(&dev->mt76) ? MT_EE_DO_PRE_CAL : MT_EE_DO_PRE_CAL_V2;
-+	u16 center_freq = chandef->center_freq1;
- 	u8 *cal = dev->cal, *eep = dev->mt76.eeprom.data;
-+	u8 cal_num = is_mt7915(&dev->mt76) ? 2 : 3;
- 	int idx;
- 
--	if (1 || !(eep[MT_EE_DO_PRE_CAL] & MT_EE_WIFI_CAL_DPD))
-+	if (1 || !(eep[offs] & MT_EE_WIFI_CAL_DPD))
+@@ -3033,24 +3069,24 @@ int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy)
+ 	if (!(eep[offs] & dpd_mask))
  		return 0;
  
 -	idx = mt7915_dpd_freq_idx(center_freq, chandef->width);
@@ -252,5 +198,5 @@
  
  	return 0;
 -- 
-2.25.1
+2.18.0
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-phy-capability-vendor-command.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-phy-capability-vendor-command.patch
similarity index 90%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-phy-capability-vendor-command.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-phy-capability-vendor-command.patch
index 2341225..541bc2a 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-phy-capability-vendor-command.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-phy-capability-vendor-command.patch
@@ -1,16 +1,16 @@
-From e6188ac3afe4e1027704f87409f4147215f32821 Mon Sep 17 00:00:00 2001
+From f84066415b1d7b24f8bda9cdd2ba96b525cf05ce Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <Yi-Chia.Hsieh@mediatek.com>
 Date: Tue, 12 Jul 2022 10:04:35 -0700
-Subject: [PATCH 1116/1119] mt76: mt7915: add phy capability vendor command
+Subject: [PATCH 1117/1121] mt76: mt7915: add phy capability vendor command
 
 ---
- .../wireless/mediatek/mt76/mt7915/mt7915.h    |  1 +
- .../wireless/mediatek/mt76/mt7915/vendor.c    | 52 +++++++++++++++++++
- .../wireless/mediatek/mt76/mt7915/vendor.h    | 25 +++++++++
+ mt7915/mt7915.h |  1 +
+ mt7915/vendor.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
+ mt7915/vendor.h | 25 ++++++++++++++++++++++++
  3 files changed, 78 insertions(+)
 
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 5f11b3fb..fb8bd877 100644
+index fc0621e..99796d7 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -11,6 +11,7 @@
@@ -22,7 +22,7 @@
  #define MT7916_WTBL_SIZE		544
  #define MT7915_WTBL_RESERVED		(mt7915_wtbl_size(dev) - 1)
 diff --git a/mt7915/vendor.c b/mt7915/vendor.c
-index c7551848..77d71e48 100644
+index c755184..77d71e4 100644
 --- a/mt7915/vendor.c
 +++ b/mt7915/vendor.c
 @@ -50,6 +50,18 @@ rfeature_ctrl_policy[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL] = {
@@ -99,7 +99,7 @@
  };
  
 diff --git a/mt7915/vendor.h b/mt7915/vendor.h
-index a8e4ebf9..719b851f 100644
+index a8e4ebf..719b851 100644
 --- a/mt7915/vendor.h
 +++ b/mt7915/vendor.h
 @@ -9,6 +9,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -140,5 +140,5 @@
 +
  #endif
 -- 
-2.25.1
+2.18.0
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
similarity index 87%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
index defd698..d3d5e73 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
@@ -1,24 +1,24 @@
-From 49eb731e0ede35ae2deb4e248f704b1c27afeeed Mon Sep 17 00:00:00 2001
+From a8d14b6b74819754b4c9419fb5ac3e5c5a1cc07c 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 1117/1119] mt76: mt7915: add vendor subcmd EDCCA ctrl
+Subject: [PATCH 1118/1121] mt76: mt7915: add vendor subcmd EDCCA ctrl
 
 Change-Id: I92dabf8be9c5a7ecec78f35325bc5645af8d15ab
 ---
- .../wireless/mediatek/mt76/mt76_connac_mcu.h  |  1 +
- .../net/wireless/mediatek/mt76/mt7915/main.c  |  3 +
- .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 38 +++++++++++
- .../net/wireless/mediatek/mt76/mt7915/mcu.h   | 12 ++++
- .../wireless/mediatek/mt76/mt7915/mt7915.h    |  2 +
- .../wireless/mediatek/mt76/mt7915/vendor.c    | 63 +++++++++++++++++++
- .../wireless/mediatek/mt76/mt7915/vendor.h    | 19 ++++++
+ mt76_connac_mcu.h |  1 +
+ mt7915/main.c     |  3 +++
+ mt7915/mcu.c      | 38 ++++++++++++++++++++++++++++
+ mt7915/mcu.h      | 12 +++++++++
+ mt7915/mt7915.h   |  2 ++
+ mt7915/vendor.c   | 63 +++++++++++++++++++++++++++++++++++++++++++++++
+ mt7915/vendor.h   | 19 ++++++++++++++
  7 files changed, 138 insertions(+)
 
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index cb1e94a3..ca68172d 100644
+index 9789380..2162a4a 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
-@@ -1147,6 +1147,7 @@ enum {
+@@ -1148,6 +1148,7 @@ enum {
  	MCU_EXT_CMD_SMESH_CTRL = 0xae,
  	MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
  	MCU_EXT_CMD_CERT_CFG = 0xb7,
@@ -27,7 +27,7 @@
  };
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 06658aed..6085e124 100644
+index 551e909..c287de3 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -456,6 +456,9 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
@@ -41,10 +41,10 @@
  		ret = mt7915_set_channel(phy);
  		if (ret)
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 29422f55..681a2a7c 100644
+index 9d1dea2..1f45d1a 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -4239,3 +4239,41 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
+@@ -4251,3 +4251,41 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
  
  	return 0;
  }
@@ -87,7 +87,7 @@
 +	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(EDCCA), &req, sizeof(req), true);
 +}
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index ad85e56c..b8a433e5 100644
+index ad85e56..b8a433e 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
 @@ -789,4 +789,16 @@ enum {
@@ -108,10 +108,10 @@
 +};
  #endif
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index fb8bd877..6462d502 100644
+index 99796d7..730b91b 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -721,6 +721,8 @@ void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
+@@ -725,6 +725,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
@@ -121,7 +121,7 @@
  #ifdef MTK_DEBUG
  int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
 diff --git a/mt7915/vendor.c b/mt7915/vendor.c
-index 77d71e48..5a28a554 100644
+index 77d71e4..5a28a55 100644
 --- a/mt7915/vendor.c
 +++ b/mt7915/vendor.c
 @@ -62,6 +62,17 @@ phy_capa_dump_policy[NUM_MTK_VENDOR_ATTRS_PHY_CAPA_DUMP] = {
@@ -209,7 +209,7 @@
  };
  
 diff --git a/mt7915/vendor.h b/mt7915/vendor.h
-index 719b851f..83c41bc1 100644
+index 719b851..83c41bc 100644
 --- a/mt7915/vendor.h
 +++ b/mt7915/vendor.h
 @@ -10,8 +10,27 @@ enum mtk_nl80211_vendor_subcmds {
@@ -241,5 +241,5 @@
  	CAPI_RFEATURE_CHANGED		= BIT(16),
  	CAPI_WIRELESS_CHANGED		= BIT(17),
 -- 
-2.25.1
+2.18.0
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-implement-bin-file-mode.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-implement-bin-file-mode.patch
similarity index 88%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-implement-bin-file-mode.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-implement-bin-file-mode.patch
index 8597721..28b7bd9 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-implement-bin-file-mode.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-implement-bin-file-mode.patch
@@ -1,22 +1,22 @@
-From 8a072ddf45b67a379a2fb63dd45e0f5024101403 Mon Sep 17 00:00:00 2001
+From 92e84cb630f113eaf411ecafc3f9d2ddedb29648 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Thu, 7 Jul 2022 11:09:59 +0800
-Subject: [PATCH 1118/1119] mt76: mt7915: implement bin file mode
+Subject: [PATCH 1119/1121] mt76: mt7915: implement bin file mode
 
 Change-Id: I2a726341541a11cbecdb210b33a8e79aefbd6cf3
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 ---
- drivers/net/wireless/mediatek/mt76/eeprom.c   | 18 +++++++
- drivers/net/wireless/mediatek/mt76/mt76.h     |  1 +
- .../wireless/mediatek/mt76/mt7915/eeprom.c    | 53 +++++++++++++++----
- .../wireless/mediatek/mt76/mt7915/mt7915.h    | 10 ++++
+ eeprom.c        | 18 +++++++++++++++++
+ mt76.h          |  1 +
+ mt7915/eeprom.c | 53 +++++++++++++++++++++++++++++++++++++++----------
+ mt7915/mt7915.h | 10 ++++++++++
  4 files changed, 71 insertions(+), 11 deletions(-)
 
 diff --git a/eeprom.c b/eeprom.c
-index d7ee123b..f2d0a65b 100644
+index e083964..5b9faf7 100644
 --- a/eeprom.c
 +++ b/eeprom.c
-@@ -102,6 +102,24 @@ out_put_node:
+@@ -104,6 +104,24 @@ out_put_node:
  }
  EXPORT_SYMBOL_GPL(mt76_get_of_eeprom);
  
@@ -42,10 +42,10 @@
  mt76_eeprom_override(struct mt76_phy *phy)
  {
 diff --git a/mt76.h b/mt76.h
-index 4c8a671f..49314895 100644
+index 0ed4188..4a41949 100644
 --- a/mt76.h
 +++ b/mt76.h
-@@ -1005,6 +1005,7 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str,
+@@ -1009,6 +1009,7 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str,
  int mt76_eeprom_init(struct mt76_dev *dev, int len);
  void mt76_eeprom_override(struct mt76_phy *phy);
  int mt76_get_of_eeprom(struct mt76_dev *dev, void *data, int offset, int len);
@@ -54,7 +54,7 @@
  struct mt76_queue *
  mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
 diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
-index ee3049e5..e5cfa5b0 100644
+index ee3049e..e5cfa5b 100644
 --- a/mt7915/eeprom.c
 +++ b/mt7915/eeprom.c
 @@ -46,26 +46,36 @@ static char *mt7915_eeprom_name(struct mt7915_dev *dev)
@@ -148,7 +148,7 @@
  		if (ret)
  			return ret;
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 6462d502..491566e9 100644
+index 730b91b..78f0b18 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -51,6 +51,15 @@
@@ -167,7 +167,7 @@
  #define MT7915_EEPROM_SIZE		3584
  #define MT7916_EEPROM_SIZE		4096
  
-@@ -377,6 +386,7 @@ struct mt7915_dev {
+@@ -375,6 +384,7 @@ struct mt7915_dev {
  
  	bool dbdc_support;
  	bool flash_mode;
@@ -176,5 +176,5 @@
  	bool ibf;
  
 -- 
-2.25.1
+2.18.0
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-initialize-wcid.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-initialize-wcid.patch
similarity index 71%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-initialize-wcid.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-initialize-wcid.patch
index d26e59c..64754c1 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-initialize-wcid.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-initialize-wcid.patch
@@ -1,7 +1,7 @@
-From 1c4ec7f43f20ebbbe0c30100e6798ace079c3714 Mon Sep 17 00:00:00 2001
+From 6809e334a42ff3d31dae7c93e893e73400feccc8 Mon Sep 17 00:00:00 2001
 From: Sujuan Chen <sujuan.chen@mediatek.com>
 Date: Tue, 12 Jul 2022 13:56:07 +0800
-Subject: [PATCH] mt76 mt7915 initialize wcid
+Subject: [PATCH 1120/1121] mt76 mt7915 initialize wcid
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -9,10 +9,10 @@
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 5e5df23d..9674015d 100644
+index f0eefc6..7c11e28 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
-@@ -963,7 +963,7 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
+@@ -965,7 +965,7 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)
  		 */
  		if (info & MT_TX_FREE_PAIR) {
  			struct mt7915_sta *msta;
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-HEMU-Add-dump-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-HEMU-Add-dump-support.patch
similarity index 94%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-HEMU-Add-dump-support.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-HEMU-Add-dump-support.patch
index e333271..d1fc6af 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-HEMU-Add-dump-support.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-HEMU-Add-dump-support.patch
@@ -1,7 +1,7 @@
-From 2bfc2727beaeebe4c475f27e65a22522a47e5ec0 Mon Sep 17 00:00:00 2001
+From 0cf7d42ee46fb0b8c7912aae0b66c2547ce4dd6c Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Thu, 11 Aug 2022 18:09:45 -0700
-Subject: [PATCH] mt76: HEMU: Add dump support
+Subject: [PATCH 1121/1121] mt76: HEMU: Add dump support
 
 Change-Id: I521214f3feb6f0d528a9f550255050ffd1ec96d2
 ---
@@ -73,5 +73,5 @@
  	/* keep last */
  	NUM_MTK_VENDOR_ATTRS_HEMU_CTRL,
 -- 
-2.32.0
+2.18.0
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-support.patch
index ed4e187..04f5775 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-support.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-support.patch
@@ -1,7 +1,7 @@
-From 47fc67f6071081280625a5cb34c5612429787f77 Mon Sep 17 00:00:00 2001
+From fa201a657888343fd8ac0c1c9f7cb5a0700c1c45 Mon Sep 17 00:00:00 2001
 From: Sujuan Chen <sujuan.chen@mediatek.com>
 Date: Sun, 12 Jun 2022 16:38:45 +0800
-Subject: [PATCH 3001/3002] mt76 add wed tx support
+Subject: [PATCH 3001/3006] mt76 add wed tx support
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -18,7 +18,7 @@
  10 files changed, 193 insertions(+), 97 deletions(-)
 
 diff --git a/mt76_connac.h b/mt76_connac.h
-index 7b6b3aa6..f71ded84 100644
+index 7b6b3aa..f71ded8 100644
 --- a/mt76_connac.h
 +++ b/mt76_connac.h
 @@ -116,6 +116,7 @@ struct mt76_connac_sta_key_conf {
@@ -30,7 +30,7 @@
  struct mt76_connac_fw_txp {
  	__le16 flags;
 diff --git a/mt7915/dma.c b/mt7915/dma.c
-index 8905018c..248a67f2 100644
+index 4b594a5..ac30698 100644
 --- a/mt7915/dma.c
 +++ b/mt7915/dma.c
 @@ -11,7 +11,10 @@ mt7915_init_tx_queues(struct mt7915_phy *phy, int idx, int n_desc, int ring_base
@@ -144,7 +144,7 @@
  			return ret;
  	}
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 2f154518..39a115ed 100644
+index 7c11e28..0a13b7d 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
 @@ -826,9 +826,9 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id)
@@ -160,7 +160,7 @@
  
  static void
 diff --git a/mt7915/main.c b/mt7915/main.c
-index c287de36..b77b3be7 100644
+index c287de3..b77b3be 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -1439,14 +1439,19 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
@@ -186,10 +186,10 @@
  
  	ctx->dev = NULL;
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 65f91c1f..dd46762d 100644
+index 1f45d1a..8c7328b 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -2374,7 +2374,7 @@ int mt7915_run_firmware(struct mt7915_dev *dev)
+@@ -2377,7 +2377,7 @@ int mt7915_run_firmware(struct mt7915_dev *dev)
  	if (ret)
  		return ret;
  
@@ -199,7 +199,7 @@
  
  	ret = mt7915_mcu_set_mwds(dev, 1);
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 8d966eff..b0d8a616 100644
+index 8d966ef..b0d8a61 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -10,6 +10,9 @@
@@ -341,10 +341,10 @@
  				     void __iomem *mem_base, u32 device_id)
  {
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 87be6002..a3ffbc63 100644
+index 78f0b18..23f8a62 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -532,6 +532,8 @@ static inline void mt7986_wmac_disable(struct mt7915_dev *dev)
+@@ -536,6 +536,8 @@ static inline void mt7986_wmac_disable(struct mt7915_dev *dev)
  {
  }
  #endif
@@ -354,7 +354,7 @@
  				     void __iomem *mem_base, u32 device_id);
  void mt7915_wfsys_reset(struct mt7915_dev *dev);
 diff --git a/mt7915/pci.c b/mt7915/pci.c
-index d74f6097..c5da01a9 100644
+index d74f609..c5da01a 100644
 --- a/mt7915/pci.c
 +++ b/mt7915/pci.c
 @@ -12,9 +12,6 @@
@@ -451,7 +451,7 @@
  		goto free_wed_or_irq_vector;
  
 diff --git a/mt7915/regs.h b/mt7915/regs.h
-index 05ab6d9b..432ed303 100644
+index 05ab6d9..432ed30 100644
 --- a/mt7915/regs.h
 +++ b/mt7915/regs.h
 @@ -617,6 +617,7 @@ enum offs_rev {
@@ -498,7 +498,7 @@
  #define MT_INT_TX_DONE_MCU		(MT_INT_TX_MCU(MT_MCUQ_WA) |	\
  					 MT_INT_TX_MCU(MT_MCUQ_WM) |	\
 diff --git a/mt7915/soc.c b/mt7915/soc.c
-index 3618718d..8d0b2068 100644
+index 3618718..8d0b206 100644
 --- a/mt7915/soc.c
 +++ b/mt7915/soc.c
 @@ -1171,10 +1171,6 @@ static int mt7986_wmac_probe(struct platform_device *pdev)
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3002-mt76-add-wed-rx-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3002-mt76-add-wed-rx-support.patch
index 49c1573..0e63f50 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3002-mt76-add-wed-rx-support.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3002-mt76-add-wed-rx-support.patch
@@ -1,7 +1,7 @@
-From 7051d8491ee276345001a75ee240d45eca8e5aca Mon Sep 17 00:00:00 2001
+From bd0e759316b431da2d81b15d3855262d1ed2a55b Mon Sep 17 00:00:00 2001
 From: Sujuan Chen <sujuan.chen@mediatek.com>
 Date: Tue, 5 Jul 2022 19:42:55 +0800
-Subject: [PATCH] mt76 add wed rx support
+Subject: [PATCH 3002/3006] mt76 add wed rx support
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -32,7 +32,7 @@
  24 files changed, 505 insertions(+), 81 deletions(-)
 
 diff --git a/dma.c b/dma.c
-index 8ea09e6e..3317d2b9 100644
+index 8ea09e6..3317d2b 100644
 --- a/dma.c
 +++ b/dma.c
 @@ -98,6 +98,63 @@ mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t)
@@ -483,7 +483,7 @@
  }
  EXPORT_SYMBOL_GPL(mt76_dma_cleanup);
 diff --git a/dma.h b/dma.h
-index fdf786f9..90370d12 100644
+index fdf786f..90370d1 100644
 --- a/dma.h
 +++ b/dma.h
 @@ -16,6 +16,16 @@
@@ -504,7 +504,7 @@
  #define MT_RX_INFO_LEN			4
  #define MT_FCE_INFO_LEN			4
 diff --git a/mac80211.c b/mac80211.c
-index 2f0605d5..a2bd8caa 100644
+index 2f0605d..a2bd8ca 100644
 --- a/mac80211.c
 +++ b/mac80211.c
 @@ -598,11 +598,14 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
@@ -535,7 +535,7 @@
  
  	mt76_rx_complete(dev, &frames, napi);
 diff --git a/mt76.h b/mt76.h
-index 701bee95..2903b625 100644
+index 4a41949..fb3ae86 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -20,6 +20,8 @@
@@ -584,7 +584,7 @@
  
  	void (*rx_poll_complete)(struct mt76_dev *dev, enum mt76_rxq_id q);
  
-@@ -755,6 +762,7 @@ struct mt76_dev {
+@@ -756,6 +763,7 @@ struct mt76_dev {
  	struct ieee80211_hw *hw;
  
  	spinlock_t lock;
@@ -592,7 +592,7 @@
  	spinlock_t cc_lock;
  
  	u32 cur_cc_bss_rx;
-@@ -780,6 +788,7 @@ struct mt76_dev {
+@@ -781,6 +789,7 @@ struct mt76_dev {
  	struct sk_buff_head rx_skb[__MT_RXQ_MAX];
  
  	struct list_head txwi_cache;
@@ -600,7 +600,7 @@
  	struct mt76_queue *q_mcu[__MT_MCUQ_MAX];
  	struct mt76_queue q_rx[__MT_RXQ_MAX];
  	const struct mt76_queue_ops *queue_ops;
-@@ -793,12 +802,16 @@ struct mt76_dev {
+@@ -794,12 +803,16 @@ struct mt76_dev {
  	u16 wed_token_count;
  	u16 token_count;
  	u16 token_size;
@@ -617,7 +617,7 @@
  	u32 wcid_phy_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
  
  	u64 vif_mask;
-@@ -1356,6 +1369,8 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
+@@ -1357,6 +1370,8 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
  }
  
  void mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
@@ -626,7 +626,7 @@
  void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
  		      struct napi_struct *napi);
  void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
-@@ -1500,6 +1515,12 @@ struct mt76_txwi_cache *
+@@ -1501,6 +1516,12 @@ struct mt76_txwi_cache *
  mt76_token_release(struct mt76_dev *dev, int token, bool *wake);
  int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi);
  void __mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked);
@@ -640,7 +640,7 @@
  static inline void mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked)
  {
 diff --git a/mt7603/dma.c b/mt7603/dma.c
-index 590cff9d..2ff71c53 100644
+index 590cff9..2ff71c5 100644
 --- a/mt7603/dma.c
 +++ b/mt7603/dma.c
 @@ -69,7 +69,7 @@ free:
@@ -653,7 +653,7 @@
  	struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
  	__le32 *rxd = (__le32 *)skb->data;
 diff --git a/mt7603/mt7603.h b/mt7603/mt7603.h
-index 0fd46d90..f2ce22ae 100644
+index 0fd46d9..f2ce22a 100644
 --- a/mt7603/mt7603.h
 +++ b/mt7603/mt7603.h
 @@ -244,7 +244,7 @@ int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
@@ -666,7 +666,7 @@
  void mt7603_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps);
  int mt7603_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 diff --git a/mt7615/mac.c b/mt7615/mac.c
-index d6aae60c..4774eaab 100644
+index d6aae60..4774eaa 100644
 --- a/mt7615/mac.c
 +++ b/mt7615/mac.c
 @@ -1651,7 +1651,7 @@ bool mt7615_rx_check(struct mt76_dev *mdev, void *data, int len)
@@ -679,7 +679,7 @@
  	struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76);
  	__le32 *rxd = (__le32 *)skb->data;
 diff --git a/mt7615/mt7615.h b/mt7615/mt7615.h
-index 060d52c8..232b0f29 100644
+index 060d52c..232b0f2 100644
 --- a/mt7615/mt7615.h
 +++ b/mt7615/mt7615.h
 @@ -511,7 +511,7 @@ void mt7615_tx_worker(struct mt76_worker *w);
@@ -692,7 +692,7 @@
  int mt7615_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
  		       struct ieee80211_sta *sta);
 diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
-index e701db8a..6ae1159e 100644
+index e701db8..6ae1159 100644
 --- a/mt76_connac_mcu.c
 +++ b/mt76_connac_mcu.c
 @@ -1190,6 +1190,7 @@ int mt76_connac_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif *mvif,
@@ -740,7 +740,7 @@
  }
  EXPORT_SYMBOL_GPL(mt76_connac_mcu_add_key);
 diff --git a/mt76x02.h b/mt76x02.h
-index f76fd22e..0b872af1 100644
+index f76fd22..0b872af 100644
 --- a/mt76x02.h
 +++ b/mt76x02.h
 @@ -173,7 +173,7 @@ int mt76x02_set_rts_threshold(struct ieee80211_hw *hw, u32 val);
@@ -753,7 +753,7 @@
  irqreturn_t mt76x02_irq_handler(int irq, void *dev_instance);
  void mt76x02_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
 diff --git a/mt76x02_txrx.c b/mt76x02_txrx.c
-index 96fdf423..bf24d3e0 100644
+index 96fdf42..bf24d3e 100644
 --- a/mt76x02_txrx.c
 +++ b/mt76x02_txrx.c
 @@ -33,7 +33,7 @@ void mt76x02_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
@@ -766,7 +766,7 @@
  	struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76);
  	void *rxwi = skb->data;
 diff --git a/mt7915/dma.c b/mt7915/dma.c
-index ac30698f..197a0169 100644
+index ac30698..197a016 100644
 --- a/mt7915/dma.c
 +++ b/mt7915/dma.c
 @@ -349,6 +349,7 @@ static int mt7915_dma_enable(struct mt7915_dev *dev)
@@ -837,7 +837,7 @@
  		ret = mt76_queue_alloc(dev, &dev->mt76.q_rx[MT_RXQ_BAND1],
  				       MT_RXQ_ID(MT_RXQ_BAND1),
 diff --git a/mt7915/init.c b/mt7915/init.c
-index 538ff5c3..cd9d846d 100644
+index 538ff5c..cd9d846 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
 @@ -695,6 +695,15 @@ mt7915_init_hardware(struct mt7915_dev *dev, struct mt7915_phy *phy2)
@@ -857,7 +857,7 @@
  	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
  	if (idx)
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 39a115ed..1a2cadc5 100644
+index 0a13b7d..4e1dfc9 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
 @@ -217,7 +217,7 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
@@ -1006,7 +1006,7 @@
  			return;
  		}
 diff --git a/mt7915/main.c b/mt7915/main.c
-index b77b3be7..29ee7007 100644
+index b77b3be..29ee700 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -670,8 +670,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -1058,10 +1058,10 @@
  
  	ctx->dev = NULL;
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index dd46762d..d83b3dcb 100644
+index 8c7328b..adbb107 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -1719,6 +1719,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
+@@ -1722,6 +1722,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
  		       struct ieee80211_sta *sta, bool enable)
  {
  	struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
@@ -1069,7 +1069,7 @@
  	struct mt7915_sta *msta;
  	struct sk_buff *skb;
  	int ret;
-@@ -1771,6 +1772,8 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
+@@ -1774,6 +1775,8 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
  		return ret;
  	}
  out:
@@ -1078,7 +1078,7 @@
  	return mt76_mcu_skb_send_msg(&dev->mt76, skb,
  				     MCU_EXT_CMD(STA_REC_UPDATE), true);
  }
-@@ -2345,6 +2348,7 @@ mt7915_mcu_init_rx_airtime(struct mt7915_dev *dev)
+@@ -2348,6 +2351,7 @@ mt7915_mcu_init_rx_airtime(struct mt7915_dev *dev)
  int mt7915_run_firmware(struct mt7915_dev *dev)
  {
  	int ret;
@@ -1086,7 +1086,7 @@
  
  	/* force firmware operation mode into normal state,
  	 * which should be set before firmware download stage.
-@@ -2374,8 +2378,14 @@ int mt7915_run_firmware(struct mt7915_dev *dev)
+@@ -2377,8 +2381,14 @@ int mt7915_run_firmware(struct mt7915_dev *dev)
  	if (ret)
  		return ret;
  
@@ -1104,7 +1104,7 @@
  	ret = mt7915_mcu_set_mwds(dev, 1);
  	if (ret)
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index b8a433e5..ce50e606 100644
+index b8a433e..ce50e60 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
 @@ -268,6 +268,7 @@ enum {
@@ -1116,7 +1116,7 @@
  
  enum mcu_mmps_mode {
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index b0d8a616..111444d7 100644
+index b0d8a61..111444d 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -28,6 +28,9 @@ static const u32 mt7915_reg[] = {
@@ -1197,7 +1197,7 @@
  	dev->mt76.dma_dev = wed->dev;
  	mdev->token_size = wed->wlan.token_start;
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index a3ffbc63..d23416ca 100644
+index 23f8a62..a4d97dd 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -18,6 +18,9 @@
@@ -1218,7 +1218,7 @@
  
  struct mt7915_vif;
  struct mt7915_sta;
-@@ -540,7 +544,9 @@ void mt7915_wfsys_reset(struct mt7915_dev *dev);
+@@ -544,7 +548,9 @@ void mt7915_wfsys_reset(struct mt7915_dev *dev);
  irqreturn_t mt7915_irq_handler(int irq, void *dev_instance);
  u64 __mt7915_get_tsf(struct ieee80211_hw *hw, struct mt7915_vif *mvif);
  u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
@@ -1229,7 +1229,7 @@
  int mt7915_register_device(struct mt7915_dev *dev);
  void mt7915_unregister_device(struct mt7915_dev *dev);
  int mt7915_eeprom_init(struct mt7915_dev *dev);
-@@ -692,7 +698,7 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
+@@ -697,7 +703,7 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
  			  struct mt76_tx_info *tx_info);
  void mt7915_tx_token_put(struct mt7915_dev *dev);
  void mt7915_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
@@ -1239,7 +1239,7 @@
  void mt7915_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps);
  void mt7915_stats_work(struct work_struct *work);
 diff --git a/mt7915/regs.h b/mt7915/regs.h
-index 432ed303..36ef8a9c 100644
+index 432ed30..36ef8a9 100644
 --- a/mt7915/regs.h
 +++ b/mt7915/regs.h
 @@ -27,6 +27,9 @@ enum reg_rev {
@@ -1285,7 +1285,7 @@
  #define MT_INT_SOURCE_CSR		__REG(INT_SOURCE_CSR)
  #define MT_INT_MASK_CSR			__REG(INT_MASK_CSR)
 diff --git a/mt7921/mac.c b/mt7921/mac.c
-index 1374c154..275f3679 100644
+index 1374c15..275f367 100644
 --- a/mt7921/mac.c
 +++ b/mt7921/mac.c
 @@ -555,7 +555,7 @@ out:
@@ -1298,7 +1298,7 @@
  	struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
  	__le32 *rxd = (__le32 *)skb->data;
 diff --git a/mt7921/mt7921.h b/mt7921/mt7921.h
-index c161031a..0a1f0357 100644
+index c161031..0a1f035 100644
 --- a/mt7921/mt7921.h
 +++ b/mt7921/mt7921.h
 @@ -381,7 +381,7 @@ int mt7921e_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
@@ -1320,7 +1320,7 @@
  int mt7921e_mac_reset(struct mt7921_dev *dev);
  int mt7921e_mcu_init(struct mt7921_dev *dev);
 diff --git a/mt7921/pci_mac.c b/mt7921/pci_mac.c
-index e1800674..ca982eb5 100644
+index e180067..ca982eb 100644
 --- a/mt7921/pci_mac.c
 +++ b/mt7921/pci_mac.c
 @@ -182,7 +182,7 @@ bool mt7921e_rx_check(struct mt76_dev *mdev, void *data, int len)
@@ -1342,7 +1342,7 @@
  	}
  }
 diff --git a/tx.c b/tx.c
-index 8b33186b..b812d067 100644
+index 8b33186..b812d06 100644
 --- a/tx.c
 +++ b/tx.c
 @@ -778,3 +778,37 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake)
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3003-mt76-add-fill-receive-path-to-report-wed-idx.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3003-mt76-add-fill-receive-path-to-report-wed-idx.patch
index 37ebdd1..6d56658 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3003-mt76-add-fill-receive-path-to-report-wed-idx.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3003-mt76-add-fill-receive-path-to-report-wed-idx.patch
@@ -1,7 +1,7 @@
-From 552c7b193e72472b522153449f195fbb46f2b6ed Mon Sep 17 00:00:00 2001
+From 831b4edf36e77bca67c5d5ffe8ed3311d2a0cfab Mon Sep 17 00:00:00 2001
 From: Sujuan Chen <sujuan.chen@mediatek.com>
 Date: Thu, 19 May 2022 13:44:42 +0800
-Subject: [PATCH 3003/3003] mt76: add fill receive path to report wed idx
+Subject: [PATCH 3003/3006] mt76: add fill receive path to report wed idx
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -9,10 +9,10 @@
  1 file changed, 19 insertions(+)
 
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 9c808ff..74c6f7c 100644
+index 29ee700..0f872f5 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -1475,6 +1475,24 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
+@@ -1476,6 +1476,24 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
  
  	return 0;
  }
@@ -37,7 +37,7 @@
  #endif
  
  const struct ieee80211_ops mt7915_ops = {
-@@ -1526,5 +1544,6 @@ const struct ieee80211_ops mt7915_ops = {
+@@ -1527,5 +1545,6 @@ const struct ieee80211_ops mt7915_ops = {
  	.set_radar_background = mt7915_set_radar_background,
  #ifdef CONFIG_NET_MEDIATEK_SOC_WED
  	.net_fill_forward_path = mt7915_net_fill_forward_path,
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3004-mt76-add-ser-spport-when-wed-on.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3004-mt76-add-ser-spport-when-wed-on.patch
old mode 100755
new mode 100644
index 3984947..106f722
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3004-mt76-add-ser-spport-when-wed-on.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3004-mt76-add-ser-spport-when-wed-on.patch
@@ -1,7 +1,7 @@
-From 4bae67631956c6878e1f055e1cb0e3dd2154f7b7 Mon Sep 17 00:00:00 2001
+From 9798a9df882e2c992ea8afe8d852c91eeddd3993 Mon Sep 17 00:00:00 2001
 From: Sujuan Chen <sujuan.chen@mediatek.com>
 Date: Thu, 28 Jul 2022 11:16:15 +0800
-Subject: [PATCH] mt76 add ser spport when wed on
+Subject: [PATCH 3004/3006] mt76 add ser spport when wed on
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -15,7 +15,7 @@
  7 files changed, 76 insertions(+), 15 deletions(-)
 
 diff --git a/dma.c b/dma.c
-index 3317d2b9..fa56ccfb 100644
+index 3317d2b..fa56ccf 100644
 --- a/dma.c
 +++ b/dma.c
 @@ -169,7 +169,7 @@ mt76_free_pending_txwi(struct mt76_dev *dev)
@@ -109,7 +109,7 @@
  	if (!q->rx_head)
  		return;
 diff --git a/dma.h b/dma.h
-index 90370d12..083cbca4 100644
+index 90370d1..083cbca 100644
 --- a/dma.h
 +++ b/dma.h
 @@ -58,5 +58,5 @@ enum mt76_mcu_evt_type {
@@ -120,10 +120,10 @@
 +int mt76_dma_wed_setup(struct mt76_dev *dev, struct mt76_queue *q, bool reset);
  #endif
 diff --git a/mt76.h b/mt76.h
-index 2903b625..831a47a9 100644
+index fb3ae86..2ad3900 100644
 --- a/mt76.h
 +++ b/mt76.h
-@@ -1371,6 +1371,7 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
+@@ -1372,6 +1372,7 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
  void mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
  void mt76_put_rxwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
  struct mt76_txwi_cache *mt76_get_rxwi(struct mt76_dev *dev);
@@ -132,7 +132,7 @@
  		      struct napi_struct *napi);
  void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
 diff --git a/mt7915/dma.c b/mt7915/dma.c
-index 197a0169..e0a51316 100644
+index 197a016..e0a5131 100644
 --- a/mt7915/dma.c
 +++ b/mt7915/dma.c
 @@ -522,6 +522,7 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
@@ -203,7 +203,7 @@
  }
  
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 1a2cadc5..11b73c8f 100644
+index 4e1dfc9..5b68492 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
 @@ -916,6 +916,8 @@ void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed)
@@ -248,7 +248,7 @@
  	if (ext_phy)
  		ieee80211_stop_queues(ext_phy->hw);
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 111444d7..1ccec14f 100644
+index 111444d..1ccec14 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -757,6 +757,8 @@ mt7915_pci_wed_init(struct mt7915_dev *dev, struct device *pdev, int *irq)
@@ -261,10 +261,10 @@
  	if (mtk_wed_device_attach(wed) != 0)
  		return 0;
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index d23416ca..01b2f681 100644
+index a4d97dd..3c4d2c2 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -547,6 +547,7 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
+@@ -551,6 +551,7 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
  u32 mt7915_wed_init_rx_buf(struct mtk_wed_device *wed,
  				int pkt_num);
  void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed);
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3005-mt76-mt7915-add-statistic-for-HW-Tx-Path.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3005-mt76-mt7915-add-statistic-for-HW-Tx-Path.patch
index 0b48205..8618824 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3005-mt76-mt7915-add-statistic-for-HW-Tx-Path.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3005-mt76-mt7915-add-statistic-for-HW-Tx-Path.patch
@@ -1,7 +1,7 @@
-From 7b9c6ae23f07ac5514492fff192fa927de1d5d17 Mon Sep 17 00:00:00 2001
+From 5f599f89d9ad8aaec596537bb304de9acfd9cde6 Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <Yi-Chia.Hsieh@mediatek.com>
 Date: Thu, 21 Jul 2022 10:56:09 -0700
-Subject: [PATCH] mt76: mt7915: add statistic for H/W Tx Path
+Subject: [PATCH 3005/3006] mt76: mt7915: add statistic for H/W Tx Path
 
 Set PPDU_TXS2H_EN_B0/B1 to get PPDU txs.
 Add MT_PACKET_ID_WED for PPDU txs, and change MT_PACKET_ID_FIRST to 3
@@ -21,7 +21,7 @@
  10 files changed, 141 insertions(+), 61 deletions(-)
 
 diff --git a/mt76.h b/mt76.h
-index 831a47a9..364b1119 100644
+index 2ad3900..c6f3ef7 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -275,6 +275,30 @@ DECLARE_EWMA(signal, 10, 8);
@@ -74,7 +74,7 @@
  #define MT_PACKET_ID_HAS_RATE		BIT(7)
  /* This is timer for when to give up when waiting for TXS callback,
   * with starting time being the time at which the DMA_DONE callback
-@@ -874,26 +901,6 @@ struct mt76_power_limits {
+@@ -875,26 +902,6 @@ struct mt76_power_limits {
  	s8 ru[7][12];
  };
  
@@ -102,7 +102,7 @@
  	u64 *data;
  	int idx;
 diff --git a/mt76_connac.h b/mt76_connac.h
-index f71ded84..4a43838b 100644
+index f71ded8..4a43838 100644
 --- a/mt76_connac.h
 +++ b/mt76_connac.h
 @@ -366,9 +366,10 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
@@ -119,7 +119,7 @@
  					 struct sk_buff *skb,
  					 __le32 *rxv, u32 mode);
 diff --git a/mt76_connac2_mac.h b/mt76_connac2_mac.h
-index 67ce216f..c7064ba2 100644
+index 67ce216..c7064ba 100644
 --- a/mt76_connac2_mac.h
 +++ b/mt76_connac2_mac.h
 @@ -123,6 +123,12 @@ enum {
@@ -151,7 +151,7 @@
  #define MT_RXD1_NORMAL_WLAN_IDX		GENMASK(9, 0)
  #define MT_RXD1_NORMAL_GROUP_1		BIT(11)
 diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
-index a9e58cfa..af265d99 100644
+index a9e58cf..af265d9 100644
 --- a/mt76_connac_mac.c
 +++ b/mt76_connac_mac.c
 @@ -487,6 +487,9 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
@@ -289,7 +289,7 @@
  
  	return !!skb;
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 5b684926..63c702e0 100644
+index 5b68492..63c702e 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
 @@ -1153,13 +1153,10 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
@@ -322,7 +322,7 @@
  		goto out;
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 0f872f5d..b7c6cf6a 100644
+index 0f872f5..b7c6cf6 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -1049,6 +1049,20 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
@@ -356,7 +356,7 @@
  
  static
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 1ccec14f..bb2d1c45 100644
+index 1ccec14..bb2d1c4 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -92,6 +92,7 @@ static const u32 mt7915_offs[] = {
@@ -425,7 +425,7 @@
  #endif
  
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 01b2f681..f1b9c0d6 100644
+index 3c4d2c2..570ecc4 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -142,8 +142,6 @@ struct mt7915_sta {
@@ -438,7 +438,7 @@
  
  	struct {
 diff --git a/mt7915/regs.h b/mt7915/regs.h
-index 36ef8a9c..dcb40181 100644
+index 36ef8a9..dcb4018 100644
 --- a/mt7915/regs.h
 +++ b/mt7915/regs.h
 @@ -52,6 +52,7 @@ enum offs_rev {
@@ -460,7 +460,7 @@
  #define MT_AGG_MRCR_BAR_CNT_LIMIT		GENMASK(15, 12)
  #define MT_AGG_MRCR_LAST_RTS_CTS_RN		BIT(6)
 diff --git a/mt7921/mt7921.h b/mt7921/mt7921.h
-index 0a1f0357..96267d5b 100644
+index 0a1f035..96267d5 100644
 --- a/mt7921/mt7921.h
 +++ b/mt7921/mt7921.h
 @@ -100,7 +100,6 @@ struct mt7921_sta {
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3006-mt76-mt7915-add-statistic-for-HW-Rx-Path.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3006-mt76-mt7915-add-statistic-for-HW-Rx-Path.patch
index e91955f..9baee7b 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3006-mt76-mt7915-add-statistic-for-HW-Rx-Path.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3006-mt76-mt7915-add-statistic-for-HW-Rx-Path.patch
@@ -1,7 +1,7 @@
-From 12b7c7a035359298fc7d14ae3a6dbc16ec0b70ad Mon Sep 17 00:00:00 2001
+From e5b46e9dcb0b86b87cbc61e3cc13d3c6e81c8b72 Mon Sep 17 00:00:00 2001
 From: Yi-Chia Hsieh <Yi-Chia.Hsieh@mediatek.com>
 Date: Fri, 5 Aug 2022 13:58:11 -0700
-Subject: [PATCH] mt76: mt7915: add statistic for H/W Rx Path
+Subject: [PATCH 3006/3006] mt76: mt7915: add statistic for H/W Rx Path
 
 Change-Id: Id94d663f08e91c83d296bd57e5e9b65a505ae1c7
 ---
@@ -16,10 +16,10 @@
  8 files changed, 108 insertions(+), 1 deletion(-)
 
 diff --git a/mt76.h b/mt76.h
-index a65e7a3..e56fd58 100644
+index c6f3ef7..d29bcdf 100644
 --- a/mt76.h
 +++ b/mt76.h
-@@ -289,6 +289,10 @@ struct mt76_sta_stats {
+@@ -297,6 +297,10 @@ struct mt76_sta_stats {
  	u32 tx_packets;
  	u32 tx_retries;
  	u32 tx_failed;
@@ -31,10 +31,10 @@
  
  struct mt76_wcid {
 diff --git a/mt76_connac.h b/mt76_connac.h
-index 8f78d12..41d6525 100644
+index 4a43838..e324c79 100644
 --- a/mt76_connac.h
 +++ b/mt76_connac.h
-@@ -218,6 +218,11 @@ static inline bool is_mt76_fw_txp(struct mt76_dev *dev)
+@@ -224,6 +224,11 @@ static inline bool is_mt76_fw_txp(struct mt76_dev *dev)
  	}
  }
  
@@ -47,10 +47,10 @@
  {
  	static const u8 width_to_bw[] = {
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index ca68172..722e859 100644
+index 2162a4a..339f324 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
-@@ -1200,6 +1200,41 @@ enum {
+@@ -1201,6 +1201,41 @@ enum {
  	MCU_CE_CMD_GET_TXPWR = 0xd0,
  };
  
@@ -93,10 +93,10 @@
  	PATCH_SEM_RELEASE,
  	PATCH_SEM_GET
 diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 5ee9bb2..9ce5a60 100644
+index 63c702e..516717c 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
-@@ -938,6 +938,31 @@ void mt7915_wed_trigger_ser(struct mtk_wed_device *wed)
+@@ -940,6 +940,31 @@ void mt7915_wed_trigger_ser(struct mtk_wed_device *wed)
  	return;
  }
  
@@ -128,7 +128,7 @@
  static void
  mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
  {
-@@ -1173,6 +1198,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
+@@ -1175,6 +1200,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
  					  &msta->wcid.stats);
  	else
  		mt76_connac2_mac_add_txs_skb(&dev->mt76, wcid, pid, txs_data);
@@ -137,7 +137,7 @@
  		goto out;
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 7935774..a73c488 100644
+index b7c6cf6..f8da685 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -1028,7 +1028,8 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
@@ -164,7 +164,7 @@
  }
  
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 1272bee..8536b1e 100644
+index adbb107..8449ed2 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -293,6 +293,27 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
@@ -196,7 +196,7 @@
  mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
  {
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index f8dd553..bd80315 100644
+index bb2d1c4..c4bdf7f 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -9,6 +9,7 @@
@@ -227,10 +227,10 @@
  #else
  	return 0;
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index b4d6b55..c02cc87 100644
+index 570ecc4..8c71b31 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -546,6 +546,8 @@ u32 mt7915_wed_init_rx_buf(struct mtk_wed_device *wed,
+@@ -550,6 +550,8 @@ u32 mt7915_wed_init_rx_buf(struct mtk_wed_device *wed,
  				int pkt_num);
  void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed);
  void mt7915_wed_trigger_ser(struct mtk_wed_device *wed);
@@ -239,7 +239,7 @@
  int mt7915_register_device(struct mt7915_dev *dev);
  void mt7915_unregister_device(struct mt7915_dev *dev);
  int mt7915_eeprom_init(struct mt7915_dev *dev);
-@@ -630,6 +632,7 @@ int mt7915_mcu_rdd_background_enable(struct mt7915_phy *phy,
+@@ -634,6 +636,7 @@ int mt7915_mcu_rdd_background_enable(struct mt7915_phy *phy,
  				     struct cfg80211_chan_def *chandef);
  int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set);
  int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3);
@@ -248,5 +248,5 @@
  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);
 -- 
-2.32.0
+2.18.0