[][MAC80211][mt76][Implement iBF command mode support in testmode]

[Description]
Add mt76-test iBF commands and update iwpriv wrapper for iBF commands.

[Release-log]
N/A

Change-Id: Ic9dac7cfa2f60ee232efde677156bf1241b4c6e8
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6502057
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-testmode-add-iBF-command-mode-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-testmode-add-iBF-command-mode-support.patch
new file mode 100644
index 0000000..2cdeaae
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-testmode-add-iBF-command-mode-support.patch
@@ -0,0 +1,243 @@
+From ec1151e292e2c753543f509a8817760d00aecf89 Mon Sep 17 00:00:00 2001
+From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Date: Mon, 12 Sep 2022 18:16:54 +0800
+Subject: [PATCH 1113/1124] mt76: testmode: add iBF command mode support
+
+Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
+Change-Id: I7eea1d6412563f889e5774e787e58ce9eba001bd
+---
+ mt7915/testmode.c | 21 ++++++++++++++-------
+ testmode.c        | 41 +++++++++++++++++++++++++++++++++++++++++
+ testmode.h        |  2 ++
+ tools/fields.c    | 28 ++++++++++++++++++++++++++++
+ 4 files changed, 85 insertions(+), 7 deletions(-)
+
+diff --git a/mt7915/testmode.c b/mt7915/testmode.c
+index 7a49608..0a58ad9 100644
+--- a/mt7915/testmode.c
++++ b/mt7915/testmode.c
+@@ -701,6 +701,7 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
+ 	struct ieee80211_vif *vif = phy->monitor_vif;
+ 	struct mt7915_tm_pfmu_tag *tag = phy->dev->test.txbf_pfmu_tag;
+ 	u8 pfmu_idx = val[0], nc = val[2], nr;
++	bool is_atenl = val[6];
+ 	int ret;
+ 
+ 	if (td->tx_antenna_mask == 3)
+@@ -748,7 +749,7 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
+ 	if (ret)
+ 		return ret;
+ 
+-	if (!ebf)
++	if (!ebf && is_atenl)
+ 		return mt7915_tm_txbf_apply_tx(phy, 1, false, true, true);
+ 
+ 	return 0;
+@@ -775,7 +776,7 @@ mt7915_tm_txbf_phase_cal(struct mt7915_phy *phy, u16 *val)
+ 		.group_l_m_n = val[1],
+ 		.sx2 = val[2],
+ 		.cal_type = val[3],
+-		.lna_gain_level = 0, /* for test purpose */
++		.lna_gain_level = val[4],
+ 	};
+ 	struct mt7915_tm_txbf_phase *phase =
+ 		(struct mt7915_tm_txbf_phase *)dev->test.txbf_phase_cal;
+@@ -814,6 +815,8 @@ int mt7915_tm_txbf_status_read(struct mt7915_dev *dev, struct sk_buff *skb)
+ 			phase = &phase[cal->group];
+ 			memcpy(&phase->phase, cal->buf + 16, sizeof(phase->phase));
+ 			phase->status = cal->status;
++			/* for passing iTest script */
++			dev_info(dev->mt76.dev, "Calibrated result = %d\n", phase->status);
+ 			break;
+ 		case IBF_PHASE_CAL_VERIFY:
+ 		case IBF_PHASE_CAL_VERIFY_INSTRUMENT:
+@@ -865,7 +868,6 @@ mt7915_tm_txbf_profile_update_all(struct mt7915_phy *phy, u16 *val)
+ 	pfmu_data->phi11 = cpu_to_le16(phi11);
+ 	pfmu_data->phi21 = cpu_to_le16(phi21);
+ 	pfmu_data->phi31 = cpu_to_le16(phi31);
+-
+ 	if (subc_id == 63) {
+ 		struct mt7915_dev *dev = phy->dev;
+ 		struct {
+@@ -923,8 +925,8 @@ mt7915_tm_set_txbf(struct mt7915_phy *phy)
+ 	struct mt76_testmode_data *td = &phy->mt76->test;
+ 	u16 *val = td->txbf_param;
+ 
+-	pr_info("ibf cal process: act = %u, val = %u, %u, %u, %u, %u\n",
+-		td->txbf_act, val[0], val[1], val[2], val[3], val[4]);
++	pr_info("ibf cal process: act = %u, val = %u, %u, %u, %u, %u, %u\n",
++		td->txbf_act, val[0], val[1], val[2], val[3], val[4], val[5]);
+ 
+ 	switch (td->txbf_act) {
+ 	case MT76_TM_TXBF_ACT_INIT:
+@@ -942,10 +944,17 @@ mt7915_tm_set_txbf(struct mt7915_phy *phy)
+ 		return mt7915_tm_txbf_profile_update(phy, val, true);
+ 	case MT76_TM_TXBF_ACT_PHASE_CAL:
+ 		return mt7915_tm_txbf_phase_cal(phy, val);
++	case MT76_TM_TXBF_ACT_PROF_UPDATE_ALL_CMD:
+ 	case MT76_TM_TXBF_ACT_PROF_UPDATE_ALL:
+ 		return mt7915_tm_txbf_profile_update_all(phy, val);
+ 	case MT76_TM_TXBF_ACT_E2P_UPDATE:
+ 		return mt7915_tm_txbf_e2p_update(phy);
++	case MT76_TM_TXBF_ACT_APPLY_TX: {
++		u16 wlan_idx = val[0];
++		bool ebf = !!val[1], ibf = !!val[2], phase_cal = !!val[4];
++
++		return mt7915_tm_txbf_apply_tx(phy, wlan_idx, ebf, ibf, phase_cal);
++	}
+ 	default:
+ 		break;
+ 	};
+@@ -1071,7 +1080,6 @@ mt7915_tm_set_tx_len(struct mt7915_phy *phy, u32 tx_time)
+ 		rate.legacy = sband->bitrates[rate.mcs].bitrate;
+ 		break;
+ 	case MT76_TM_TX_MODE_HT:
+-		rate.mcs += rate.nss * 8;
+ 		flags |= RATE_INFO_FLAGS_MCS;
+ 
+ 		if (td->tx_rate_sgi)
+@@ -1435,7 +1443,6 @@ mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en)
+ 			if (duty_cycle < 100)
+ 				tx_time = duty_cycle * ipg / (100 - duty_cycle);
+ 		}
+-
+ 		mt7915_tm_set_ipg_params(phy, ipg, td->tx_rate_mode);
+ 		mt7915_tm_set_tx_len(phy, tx_time);
+ 
+diff --git a/testmode.c b/testmode.c
+index 82b8e98..aa874a8 100644
+--- a/testmode.c
++++ b/testmode.c
+@@ -530,6 +530,42 @@ out:
+ 	return err;
+ }
+ 
++static int
++mt76_testmode_txbf_profile_update_all_cmd(struct mt76_phy *phy, struct nlattr **tb, u32 state)
++{
++#define PARAM_UNIT	5
++	static u8 pfmu_idx;
++	struct mt76_testmode_data *td = &phy->test;
++	struct mt76_dev *dev = phy->dev;
++	struct nlattr *cur;
++	u16 tmp_val[PARAM_UNIT], *val = td->txbf_param;
++	int idx, rem, ret, i = 0;
++
++	memset(td->txbf_param, 0, sizeof(td->txbf_param));
++	nla_for_each_nested(cur, tb[MT76_TM_ATTR_TXBF_PARAM], rem) {
++		if (nla_len(cur) != 2)
++			return -EINVAL;
++		idx = i % PARAM_UNIT;
++		tmp_val[idx] = nla_get_u16(cur);
++		if (idx == 1 && (tmp_val[idx] == 0xf0 || tmp_val[idx] == 0xff)) {
++			pfmu_idx = tmp_val[0];
++			return 0;
++		}
++		if (idx == PARAM_UNIT - 1) {
++			val[0] = pfmu_idx;
++			memcpy(val + 1, tmp_val, sizeof(tmp_val));
++			if (dev->test_ops->set_params) {
++				ret = dev->test_ops->set_params(phy, tb, state);
++				if (ret)
++					return ret;
++			}
++		}
++		i++;
++	}
++
++	return 0;
++}
++
+ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ 		      void *data, int len)
+ {
+@@ -668,6 +704,11 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ 		    0, MT76_TM_TXBF_ACT_MAX))
+ 			goto out;
+ 
++		if (td->txbf_act == MT76_TM_TXBF_ACT_PROF_UPDATE_ALL_CMD) {
++			err = mt76_testmode_txbf_profile_update_all_cmd(phy, tb, state);
++			goto out;
++		}
++
+ 		memset(td->txbf_param, 0, sizeof(td->txbf_param));
+ 		nla_for_each_nested(cur, tb[MT76_TM_ATTR_TXBF_PARAM], rem) {
+ 			if (nla_len(cur) != 2 ||
+diff --git a/testmode.h b/testmode.h
+index e2190e7..5d1fe79 100644
+--- a/testmode.h
++++ b/testmode.h
+@@ -281,8 +281,10 @@ enum mt76_testmode_txbf_act {
+ 	MT76_TM_TXBF_ACT_TX_PREP,
+ 	MT76_TM_TXBF_ACT_IBF_PROF_UPDATE,
+ 	MT76_TM_TXBF_ACT_EBF_PROF_UPDATE,
++	MT76_TM_TXBF_ACT_APPLY_TX,
+ 	MT76_TM_TXBF_ACT_PHASE_CAL,
+ 	MT76_TM_TXBF_ACT_PROF_UPDATE_ALL,
++	MT76_TM_TXBF_ACT_PROF_UPDATE_ALL_CMD,
+ 	MT76_TM_TXBF_ACT_E2P_UPDATE,
+ 
+ 	/* keep last */
+diff --git a/tools/fields.c b/tools/fields.c
+index 1be1ffd..47fc69f 100644
+--- a/tools/fields.c
++++ b/tools/fields.c
+@@ -32,6 +32,20 @@ static const char * const testmode_tx_mode[] = {
+ 	[MT76_TM_TX_MODE_HE_MU] = "he_mu",
+ };
+ 
++static const char * const testmode_txbf_act[] = {
++	[MT76_TM_TXBF_ACT_INIT] = "init",
++	[MT76_TM_TXBF_ACT_UPDATE_CH] = "update_ch",
++	[MT76_TM_TXBF_ACT_PHASE_COMP] = "phase_comp",
++	[MT76_TM_TXBF_ACT_TX_PREP] = "tx_prep",
++	[MT76_TM_TXBF_ACT_IBF_PROF_UPDATE] = "ibf_prof_update",
++	[MT76_TM_TXBF_ACT_EBF_PROF_UPDATE] = "ebf_prof_update",
++	[MT76_TM_TXBF_ACT_APPLY_TX] = "apply_tx",
++	[MT76_TM_TXBF_ACT_PHASE_CAL] = "phase_cal",
++	[MT76_TM_TXBF_ACT_PROF_UPDATE_ALL] = "prof_update",
++	[MT76_TM_TXBF_ACT_PROF_UPDATE_ALL_CMD] = "prof_update_all",
++	[MT76_TM_TXBF_ACT_E2P_UPDATE] = "e2p_update",
++};
++
+ static void print_enum(const struct tm_field *field, struct nlattr *attr)
+ {
+ 	unsigned int i = nla_get_u8(attr);
+@@ -82,6 +96,17 @@ static void print_s8(const struct tm_field *field, struct nlattr *attr)
+ 	printf("%d", (int8_t)nla_get_u8(attr));
+ }
+ 
++static bool parse_u16_hex(const struct tm_field *field, int idx,
++			  struct nl_msg *msg, const char *val)
++{
++	return !nla_put_u16(msg, idx, strtoul(val, NULL, 16));
++}
++
++static void print_u16_hex(const struct tm_field *field, struct nlattr *attr)
++{
++	printf("%d", nla_get_u16(attr));
++}
++
+ static bool parse_u32(const struct tm_field *field, int idx,
+ 		      struct nl_msg *msg, const char *val)
+ {
+@@ -384,6 +409,8 @@ static const struct tm_field testdata_fields[NUM_MT76_TM_ATTRS] = {
+ 	FIELD(u8, AID, "aid"),
+ 	FIELD(u8, RU_ALLOC, "ru_alloc"),
+ 	FIELD(u8, RU_IDX, "ru_idx"),
++	FIELD_ENUM(TXBF_ACT, "txbf_act", testmode_txbf_act),
++	FIELD_ARRAY(u16_hex, TXBF_PARAM, "txbf_param"),
+ 	FIELD_MAC(MAC_ADDRS, "mac_addrs"),
+ 	FIELD_NESTED_RO(STATS, stats, "",
+ 			.print_extra = print_extra_stats),
+@@ -414,6 +441,7 @@ static struct nla_policy testdata_policy[NUM_MT76_TM_ATTRS] = {
+ 	[MT76_TM_ATTR_RU_ALLOC] = { .type = NLA_U8 },
+ 	[MT76_TM_ATTR_RU_IDX] = { .type = NLA_U8 },
+ 	[MT76_TM_ATTR_STATS] = { .type = NLA_NESTED },
++	[MT76_TM_ATTR_TXBF_ACT] = { .type = NLA_U8 },
+ };
+ 
+ const struct tm_field msg_field = {
+-- 
+2.18.0
+
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
similarity index 86%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
index 52e5e75..60ca52c 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1113-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-init-rssi-in-WTBL-when-add-station.patch
@@ -1,7 +1,7 @@
-From f5924783a8130cf8f53613ffaec44a1e116dae3f Mon Sep 17 00:00:00 2001
+From 5fc0e5aa0b2b7b3acbc0c89377c301163e83b531 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 1113/1121] mt76: mt7915: init rssi in WTBL when add station
+Subject: [PATCH 1114/1124] mt76: mt7915: init rssi in WTBL when add station
 
 ---
  mt7915/main.c | 4 ++++
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
similarity index 85%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
index a4b9ab2..c88fcb1 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1114-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-mt7915-reduce-TWT-SP-sent-to-FW-for-cert.patch
@@ -1,7 +1,7 @@
-From 6d7bba2a1a4d4757db3348df9486b8c55a8a5ecf Mon Sep 17 00:00:00 2001
+From 925be10947fa0ded7da35187477f41723f7fc8b3 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 1114/1121] mt76: mt7915: reduce TWT SP sent to FW for cert
+Subject: [PATCH 1115/1124] 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.
 
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-airtime-fairness-feature-off-in-mac80211.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-airtime-fairness-feature-off-in-mac80211.patch
similarity index 70%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-airtime-fairness-feature-off-in-mac80211.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-airtime-fairness-feature-off-in-mac80211.patch
index b343205..ef601a1 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1115-mt76-airtime-fairness-feature-off-in-mac80211.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-airtime-fairness-feature-off-in-mac80211.patch
@@ -1,17 +1,17 @@
-From 7ddf213d8c16bdea7827905e3e6c43f80beb26fd Mon Sep 17 00:00:00 2001
+From e49f96fd1610ae0414bb7a921a2094901911e41e 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 1115/1121] mt76: airtime fairness feature off in mac80211
+Subject: [PATCH 1116/1124] mt76: airtime fairness feature off in mac80211
 
 ---
  mac80211.c | 1 -
  1 file changed, 1 deletion(-)
 
 diff --git a/mac80211.c b/mac80211.c
-index e1c3332..2f0605d 100644
+index f34a93e..4eaf317 100644
 --- a/mac80211.c
 +++ b/mac80211.c
-@@ -428,7 +428,6 @@ mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)
+@@ -429,7 +429,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);
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
similarity index 97%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
index 1f5c089..6f2c7f7 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1116-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-mt7986-and-mt7916-pre-calibration.patch
@@ -1,7 +1,7 @@
-From 45b37195f796ce6f2d7ef6969e47447007aa50de Mon Sep 17 00:00:00 2001
+From e93d8124ef77ded639c54ee1f762982a06bc7bfc 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 1116/1121] mt76: mt7915: add mt7986 and mt7916 pre-calibration
+Subject: [PATCH 1117/1124] 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,
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-phy-capability-vendor-command.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-phy-capability-vendor-command.patch
similarity index 96%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-phy-capability-vendor-command.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-phy-capability-vendor-command.patch
index 89c8ebf..e9bda9e 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1117-mt76-mt7915-add-phy-capability-vendor-command.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-phy-capability-vendor-command.patch
@@ -1,7 +1,7 @@
-From ee5d960cf8e4d524eb5ceb5ae8a65a8bfd58b28e Mon Sep 17 00:00:00 2001
+From c8790614801df7e39e590a290f36a3855527bc38 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 1117/1121] mt76: mt7915: add phy capability vendor command
+Subject: [PATCH 1118/1124] mt76: mt7915: add phy capability vendor command
 
 ---
  mt7915/mt7915.h |  1 +
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
similarity index 98%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
index 2495a1b..a18cb98 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1118-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-add-vendor-subcmd-EDCCA-ctrl.patch
@@ -1,7 +1,7 @@
-From 7e582ea905e034e2d834d415a1889c66d2269d0b Mon Sep 17 00:00:00 2001
+From 6630fa32c32df43a091462643d75dd351ef2b13a 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 1118/1121] mt76: mt7915: add vendor subcmd EDCCA ctrl
+Subject: [PATCH 1119/1124] mt76: mt7915: add vendor subcmd EDCCA ctrl
 
 Change-Id: I92dabf8be9c5a7ecec78f35325bc5645af8d15ab
 ---
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-implement-bin-file-mode.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-implement-bin-file-mode.patch
similarity index 97%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-implement-bin-file-mode.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-implement-bin-file-mode.patch
index 6233dad..8c1d4a7 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1119-mt76-mt7915-implement-bin-file-mode.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-implement-bin-file-mode.patch
@@ -1,7 +1,7 @@
-From dbd3c04007801a0ea439218e7850a42a06d9f2a3 Mon Sep 17 00:00:00 2001
+From 7baba6d23f4633ee545c883f0676c7b076e88aee 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 1119/1121] mt76: mt7915: implement bin file mode
+Subject: [PATCH 1120/1124] mt76: mt7915: implement bin file mode
 
 Change-Id: I2a726341541a11cbecdb210b33a8e79aefbd6cf3
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-initialize-wcid.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-mt7915-initialize-wcid.patch
similarity index 83%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-initialize-wcid.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-mt7915-initialize-wcid.patch
index 2172868..a8dec05 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1120-mt76-mt7915-initialize-wcid.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-mt7915-initialize-wcid.patch
@@ -1,7 +1,7 @@
-From 7f7b35a036ad9b53f5a53a0728eb8a095eef5c8c Mon Sep 17 00:00:00 2001
+From 92302a0017de6f1eef70a62d7ecc27c95f2b5135 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 1120/1121] mt76 mt7915 initialize wcid
+Subject: [PATCH 1121/1124] mt76 mt7915 initialize wcid
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-HEMU-Add-dump-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-HEMU-Add-dump-support.patch
similarity index 94%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-HEMU-Add-dump-support.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-HEMU-Add-dump-support.patch
index 2733e03..e4d0183 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1121-mt76-HEMU-Add-dump-support.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-HEMU-Add-dump-support.patch
@@ -1,7 +1,7 @@
-From 40e89a6e3147b39899aeecc6c14c8b5046bc1b26 Mon Sep 17 00:00:00 2001
+From a4a5f09adcf51a57cd63033c25a1cc4f41e2112a Mon Sep 17 00:00:00 2001
 From: TomLiu <tomml.liu@mediatek.com>
 Date: Thu, 11 Aug 2022 18:09:45 -0700
-Subject: [PATCH 1121/1121] mt76: HEMU: Add dump support
+Subject: [PATCH 1122/1124] mt76: HEMU: Add dump support
 
 Change-Id: I521214f3feb6f0d528a9f550255050ffd1ec96d2
 ---
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ctrl.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1123-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ctrl.patch
similarity index 98%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ctrl.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1123-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ctrl.patch
index 9a786d7..4ec9fdf 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1122-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ctrl.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1123-mt76-mt7915-add-vendor-subcmd-three-wire-PTA-ctrl.patch
@@ -1,7 +1,8 @@
-From 516fcbdf41f48d71d814caaffb9e50b88778cd17 Mon Sep 17 00:00:00 2001
+From b1b5c25122a0976786e2500478b1bc344aa70f92 Mon Sep 17 00:00:00 2001
 From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
 Date: Tue, 30 Aug 2022 15:29:38 +0800
-Subject: [PATCH] mt76: mt7915: add vendor subcmd three wire (PTA) ctrl
+Subject: [PATCH 1123/1124] mt76: mt7915: add vendor subcmd three wire (PTA)
+ ctrl
 
 Change-Id: Ie092d63af9a1e06bef36fc5a5bac40fdab73dba5
 Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1123-mt76-add-ibf-control-vendor-cmd.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1124-mt76-add-ibf-control-vendor-cmd.patch
old mode 100755
new mode 100644
similarity index 96%
rename from autobuild_mac80211_release/package/kernel/mt76/patches/1123-mt76-add-ibf-control-vendor-cmd.patch
rename to autobuild_mac80211_release/package/kernel/mt76/patches/1124-mt76-add-ibf-control-vendor-cmd.patch
index 6473cb6..facb487
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1123-mt76-add-ibf-control-vendor-cmd.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1124-mt76-add-ibf-control-vendor-cmd.patch
@@ -1,7 +1,7 @@
-From bb8f76430a25f016c63a62f8b1ae5995398911ef Mon Sep 17 00:00:00 2001
+From 4f1d6d0b6bc61e8b3f70a910235ef8626fe7983d Mon Sep 17 00:00:00 2001
 From: mtk27835 <shurong.wen@mediatek.com>
 Date: Wed, 7 Sep 2022 14:01:29 -0700
-Subject: [PATCH] [PATCH 1123] mt76: add ibf control vendor cmd
+Subject: [PATCH 1124/1124] mt76: add ibf control vendor cmd
 
 Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
 ---
@@ -146,5 +146,5 @@
 +
  #endif
 -- 
-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 c7843f1..f2f3125 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 3049935f79f524aa6984ccfa97075df4b1aadb41 Mon Sep 17 00:00:00 2001
+From a215cf58f8f9bc1eaf3645a4a4ff77fc7d4acc80 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/3006] mt76 add wed tx support
+Subject: [PATCH 3001/3008] mt76 add wed tx support
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-wds-support.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-wds-support.patch
old mode 100755
new mode 100644
index 43e402d..e8dbc64
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-wds-support.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3001-mt76-add-wed-tx-wds-support.patch
@@ -1,7 +1,7 @@
-From f9508e4fbb8e78c849d27394c99295319ccf8a28 Mon Sep 17 00:00:00 2001
+From d34e4542c5a6e89521d6a0e0625455e8edca0829 Mon Sep 17 00:00:00 2001
 From: Sujuan Chen <sujuan.chen@mediatek.com>
 Date: Sat, 10 Sep 2022 17:09:21 +0800
-Subject: [PATCH] 3001-add-wed-tx-wds-support-on-mt7986
+Subject: [PATCH 3002/3008] 3001-add-wed-tx-wds-support-on-mt7986
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -72,7 +72,7 @@
  	idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
  	if (idx)
 diff --git a/mt7915/main.c b/mt7915/main.c
-index b77b3be..144718e 100644
+index b77b3be..828042e 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
 @@ -658,6 +658,24 @@ mt7915_channel_switch_beacon(struct ieee80211_hw *hw,
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 9202a43..17ac8dd 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 3516b23f9acad60c44a13119e42636f92ca9d9a2 Mon Sep 17 00:00:00 2001
+From 5da9d9bc7cfe0dc95358b6d983499f884c424c49 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 3002/3006] mt76 add wed rx support
+Subject: [PATCH 3003/3008] mt76 add wed rx support
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -501,7 +501,7 @@
  #define MT_RX_INFO_LEN			4
  #define MT_FCE_INFO_LEN			4
 diff --git a/mac80211.c b/mac80211.c
-index 4eaf317..731b78f 100644
+index c477d62..4a8d8d8 100644
 --- a/mac80211.c
 +++ b/mac80211.c
 @@ -599,11 +599,14 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
@@ -997,7 +997,7 @@
  				     MCU_EXT_CMD(STA_REC_UPDATE), true);
  }
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index b0d8a61..111444d 100644
+index de797fd..181b94d 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -28,6 +28,9 @@ static const u32 mt7915_reg[] = {
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 7f0674a..36c8084 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 2edbd3a1fc221674535ecd5addad6342adb4c73e Mon Sep 17 00:00:00 2001
+From 46d51f08c25a6ae72858a826c3290c958212a486 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/3006] mt76: add fill receive path to report wed idx
+Subject: [PATCH 3004/3008] 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 29ee700..0f872f5 100644
+index 828042e..e238eab 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -1476,6 +1476,24 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
+@@ -1497,6 +1497,24 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
  
  	return 0;
  }
@@ -37,7 +37,7 @@
  #endif
  
  const struct ieee80211_ops mt7915_ops = {
-@@ -1527,5 +1545,6 @@ const struct ieee80211_ops mt7915_ops = {
+@@ -1548,5 +1566,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
index 11f84cc..4a48a30 100644
--- 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 f7539f063a354671a7e8b9d769c77fd936e09f96 Mon Sep 17 00:00:00 2001
+From ea9bb882fa5d067de166aa7b025abaa1e06debcc 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 3004/3006] mt76 add ser spport when wed on
+Subject: [PATCH 3005/3008] mt76 add ser spport when wed on
 
 Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
 ---
@@ -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 fb3ae86..2ad3900 100644
+index 20fd0ec..ee63da5 100644
 --- a/mt76.h
 +++ b/mt76.h
-@@ -1372,6 +1372,7 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
+@@ -1373,6 +1373,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);
@@ -248,7 +248,7 @@
  	if (ext_phy)
  		ieee80211_stop_queues(ext_phy->hw);
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 111444d..1ccec14 100644
+index 181b94d..a0bb879 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,7 +261,7 @@
  	if (mtk_wed_device_attach(wed) != 0)
  		return 0;
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index b10b90a..b4c8cdf 100644
+index b805aae..ca62622 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -551,6 +551,7 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
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 b13a5e4..53d4bbd 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 369397e8762832dc633ade7407852acb235fd4aa Mon Sep 17 00:00:00 2001
+From a6cc491093f5280496ae75a2ba953d8a10d919f8 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 3005/3006] mt76: mt7915: add statistic for H/W Tx Path
+Subject: [PATCH 3006/3008] 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 2ad3900..c6f3ef7 100644
+index ee63da5..bd75b5a 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
-@@ -875,26 +902,6 @@ struct mt76_power_limits {
+@@ -876,26 +903,6 @@ struct mt76_power_limits {
  	s8 ru[7][12];
  };
  
@@ -322,10 +322,10 @@
  		goto out;
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index 0f872f5..b7c6cf6 100644
+index e238eab..1ea3f6f 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -1049,6 +1049,20 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
+@@ -1070,6 +1070,20 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
  	}
  	sinfo->txrate.flags = txrate->flags;
  	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
@@ -346,7 +346,7 @@
  }
  
  static void mt7915_sta_rc_work(void *data, struct ieee80211_sta *sta)
-@@ -1271,7 +1285,7 @@ static void mt7915_ethtool_worker(void *wi_data, struct ieee80211_sta *sta)
+@@ -1292,7 +1306,7 @@ static void mt7915_ethtool_worker(void *wi_data, struct ieee80211_sta *sta)
  	if (msta->vif->mt76.idx != wi->idx)
  		return;
  
@@ -356,7 +356,7 @@
  
  static
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 1ccec14..bb2d1c4 100644
+index a0bb879..e07153b 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 b4c8cdf..a1ce516 100644
+index ca62622..a487245 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -142,8 +142,6 @@ struct mt7915_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 1d5c092..e2335bf 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 f7138db4f2f9742c57bfc9dcf41c9ed7c0b9bd8f Mon Sep 17 00:00:00 2001
+From c2eb0d9692269323d6f6d94cc48f5e37ecccdb13 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 3006/3006] mt76: mt7915: add statistic for H/W Rx Path
+Subject: [PATCH 3007/3008] mt76: mt7915: add statistic for H/W Rx Path
 
 Change-Id: Id94d663f08e91c83d296bd57e5e9b65a505ae1c7
 ---
@@ -16,7 +16,7 @@
  8 files changed, 108 insertions(+), 1 deletion(-)
 
 diff --git a/mt76.h b/mt76.h
-index c6f3ef7..d29bcdf 100644
+index bd75b5a..480ed21 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -297,6 +297,10 @@ struct mt76_sta_stats {
@@ -137,10 +137,10 @@
  		goto out;
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index b7c6cf6..f8da685 100644
+index 1ea3f6f..7e5947d 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -1028,7 +1028,8 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
+@@ -1049,7 +1049,8 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
  	struct rate_info *txrate = &msta->wcid.rate;
  	struct rate_info rxrate = {};
  
@@ -150,7 +150,7 @@
  	    !mt7915_mcu_get_rx_rate(phy, vif, sta, &rxrate)) {
  		sinfo->rxrate = rxrate;
  		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE);
-@@ -1062,6 +1063,12 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
+@@ -1083,6 +1084,12 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
  
  		sinfo->tx_retries = msta->wcid.stats.tx_retries;
  		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_RETRIES);
@@ -164,7 +164,7 @@
  }
  
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 3d50b78..fda1ff2 100644
+index 22f68da..6b70e47 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 bb2d1c4..c4bdf7f 100644
+index e07153b..0561b2a 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
 @@ -9,6 +9,7 @@
@@ -227,7 +227,7 @@
  #else
  	return 0;
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index a1ce516..7c20235 100644
+index a487245..0348683 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -550,6 +550,8 @@ u32 mt7915_wed_init_rx_buf(struct mtk_wed_device *wed,
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/3007-mt76-mt7915-enable-red-per-band-token-drop-for-HW-Pa.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/3007-mt76-mt7915-enable-red-per-band-token-drop-for-HW-Pa.patch
index e6dc07a..2cec6cb 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/3007-mt76-mt7915-enable-red-per-band-token-drop-for-HW-Pa.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/3007-mt76-mt7915-enable-red-per-band-token-drop-for-HW-Pa.patch
@@ -1,7 +1,8 @@
-From 17753f183bce83f2b2f03e9f15312f84b67558e9 Mon Sep 17 00:00:00 2001
+From d56162deb8cfa121513bc4b4fc64d931e0770f7e Mon Sep 17 00:00:00 2001
 From: Peter Chiu <chui-hao.chiu@mediatek.com>
 Date: Fri, 2 Sep 2022 14:40:40 +0800
-Subject: [PATCH] mt76: mt7915: enable red per-band token drop for HW Path
+Subject: [PATCH 3008/3008] mt76: mt7915: enable red per-band token drop for HW
+ Path
 
 Limit the number of token used by each band. If a band uses too many token,
 it may hurt the throughput of the other band. The SW path can solve this
@@ -15,7 +16,7 @@
  3 files changed, 45 insertions(+), 11 deletions(-)
 
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 1cbdf0cf..c29eb80a 100644
+index 6b70e47..7be542e 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
 @@ -2410,8 +2410,13 @@ int mt7915_run_firmware(struct mt7915_dev *dev)
@@ -109,7 +110,7 @@
  int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
  {
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index ce50e606..230ad9db 100644
+index 1f56db6..9181e96 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
 @@ -269,6 +269,7 @@ enum {
@@ -121,7 +122,7 @@
  
  enum mcu_mmps_mode {
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index f2081640..f2a1e615 100644
+index 0348683..3029315 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
 @@ -749,11 +749,11 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
diff --git a/feed/atenl/files/iwpriv.sh b/feed/atenl/files/iwpriv.sh
index 4e7eee9..910e314 100755
--- a/feed/atenl/files/iwpriv.sh
+++ b/feed/atenl/files/iwpriv.sh
@@ -616,6 +616,70 @@
     do_cmd "mt76-test phy${phy_idx} set mac_addrs=${addr1},${addr2},${addr3}"
 }
 
+function convert_ibf {
+    local cmd=$1
+    local param=$2
+    local new_cmd=""
+    local new_param=$(echo ${param} | sed s/":"/","/g)
+
+    case ${cmd} in
+        "ATETxBfInit")
+            new_cmd="init"
+            new_param=1
+            do_cmd "mt76-test phy${phy_idx} set state=idle"
+            ;;
+        "ATEIBFPhaseComp")
+            new_cmd="phase_comp"
+            new_param="${new_param} aid=1"
+            ;;
+        "ATEEBfProfileConfig")
+            new_cmd="ebf_prof_update"
+            ;;
+        "ATEIBfProfileConfig")
+            new_cmd="ibf_prof_update"
+            ;;
+        "ATEIBfInstCal")
+            new_cmd="phase_cal"
+            ;;
+        "ATEIBfGdCal")
+            new_cmd="phase_cal"
+            new_param="${new_param},00"
+            ;;
+        "TxBfTxApply")
+            new_cmd="apply_tx"
+            ;;
+        "ATETxPacketWithBf")
+            local bf_on=${new_param:0:2}
+            local aid="01"
+            local wlan_idx=${new_param:3:2}
+            local update="00"
+            local tx_len=${new_param:6}
+
+            new_cmd="tx_prep"
+            new_param="${bf_on},${aid},${wlan_idx},${update}"
+            if [ "${tx_len}" = "00" ]; then
+                new_param="${new_param} aid=1 tx_count=10000000 tx_length=1024"
+            else
+                new_param="${new_param} aid=1 tx_count=${tx_len} tx_length=1024"
+            fi
+            do_cmd "mt76-test phy${phy_idx} set state=idle"
+            ;;
+        "TxBfProfileData20MAllWrite")
+            new_cmd="prof_update_all"
+            ;;
+        "ATEIBFPhaseE2pUpdate")
+            new_cmd="e2p_update"
+            ;;
+        *)
+    esac
+
+    do_cmd "mt76-test phy${phy_idx} set txbf_act=${new_cmd} txbf_param=${new_param}"
+
+    if [ "${cmd}" = "ATETxPacketWithBf" ]; then
+        do_cmd "mt76-test phy${phy_idx} set state=tx_frames"
+    fi
+}
+
 function do_ate_work() {
     local ate_cmd=$1
 
@@ -780,6 +844,12 @@
             set_mac_addr ${cmd} ${param}
             skip=1
             ;;
+        "ATETxBfInit"|"ATEIBFPhaseComp"|"ATEEBfProfileConfig"|"ATEIBfProfileConfig"| \
+        "TxBfTxApply"|"ATETxPacketWithBf"|"TxBfProfileData20MAllWrite"|"ATEIBfInstCal"|\
+        "ATEIBfGdCal"|"ATEIBFPhaseE2pUpdate")
+            convert_ibf ${cmd} ${param}
+            skip=1
+            ;;
         "bufferMode")
             if [ "${param}" = "2" ]; then
                 do_cmd "atenl -i ${interface} -c \"eeprom update buffermode\""
diff --git a/feed/atenl/src/nl.c b/feed/atenl/src/nl.c
index 85af9dc..b919356 100644
--- a/feed/atenl/src/nl.c
+++ b/feed/atenl/src/nl.c
@@ -849,7 +849,7 @@
 	struct nl_msg *msg = nl_priv->msg;
 	u32 *v = (u32 *)(hdr->data + 4);
 	u32 action = ntohl(v[0]);
-	u16 val[8];
+	u16 val[8], is_atenl = 1;
 	u8 tmp_ant;
 	void *ptr, *a;
 	char cmd[64];
@@ -925,9 +925,13 @@
 		a = nla_nest_start(msg, MT76_TM_ATTR_TXBF_PARAM);
 		if (!a)
 			return -ENOMEM;
-
+		/* Note: litepoint may send random number for lna_gain_level, reset to 0 */
+		if (action == TXBF_ACT_IBF_PHASE_CAL)
+			val[4] = 0;
 		for (i = 0; i < 5; i++)
 			nla_put_u16(msg, i, val[i]);
+		/* Used to distinguish between command mode and HQADLL mode */
+		nla_put_u16(msg, 5, is_atenl);
 		nla_nest_end(msg, a);
 		break;
 	case TXBF_ACT_IBF_PHASE_E2P_UPDATE:
diff --git a/feed/atenl/src/nl.h b/feed/atenl/src/nl.h
index eaf082f..27336bd 100644
--- a/feed/atenl/src/nl.h
+++ b/feed/atenl/src/nl.h
@@ -240,8 +240,10 @@
 	MT76_TM_TXBF_ACT_TX_PREP,
 	MT76_TM_TXBF_ACT_IBF_PROF_UPDATE,
 	MT76_TM_TXBF_ACT_EBF_PROF_UPDATE,
+	MT76_TM_TXBF_ACT_APPLY_TX,
 	MT76_TM_TXBF_ACT_PHASE_CAL,
 	MT76_TM_TXBF_ACT_PROF_UPDATE_ALL,
+	MT76_TM_TXBF_ACT_PROF_UPDATE_ALL_CMD,
 	MT76_TM_TXBF_ACT_E2P_UPDATE,
 
 	/* keep last */