[Refactor and sync wifi from Openwrt]

[Description]
Refactor and sync wifi from Openwrt

[Release-log]
N/A

diff --git a/recipes-kernel/linux-mt76/files/patches/1111-mt76-testmode-additional-supports.patch b/recipes-kernel/linux-mt76/files/patches/1111-mt76-testmode-additional-supports.patch
index fcea41b..292e2fc 100644
--- a/recipes-kernel/linux-mt76/files/patches/1111-mt76-testmode-additional-supports.patch
+++ b/recipes-kernel/linux-mt76/files/patches/1111-mt76-testmode-additional-supports.patch
@@ -1,33 +1,33 @@
-From 2e542afa1d9932b4ec588ad2c622c74a16fa1edd Mon Sep 17 00:00:00 2001
+From de93c29a69f28d2cf9d2e10fbd3cb1ebda771548 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/1115] mt76: testmode: additional supports
 
 Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
 ---
- drivers/net/wireless/mediatek/mt76/dma.c      |    3 +-
- drivers/net/wireless/mediatek/mt76/mac80211.c |   12 +
- drivers/net/wireless/mediatek/mt76/mt76.h     |  111 +-
- .../wireless/mediatek/mt76/mt76_connac_mcu.c  |    4 +
- .../wireless/mediatek/mt76/mt76_connac_mcu.h  |    2 +
- .../net/wireless/mediatek/mt76/mt7915/init.c  |    2 +-
- .../net/wireless/mediatek/mt76/mt7915/mac.c   |   37 +-
- .../net/wireless/mediatek/mt76/mt7915/main.c  |    2 +-
- .../net/wireless/mediatek/mt76/mt7915/mcu.c   |   11 +-
- .../net/wireless/mediatek/mt76/mt7915/mcu.h   |   31 +-
- .../net/wireless/mediatek/mt76/mt7915/mmio.c  |    2 +
- .../wireless/mediatek/mt76/mt7915/mt7915.h    |   14 +-
- .../net/wireless/mediatek/mt76/mt7915/regs.h  |    3 +
- .../wireless/mediatek/mt76/mt7915/testmode.c  | 1171 +++++++++++++++--
- .../wireless/mediatek/mt76/mt7915/testmode.h  |  278 ++++
- drivers/net/wireless/mediatek/mt76/testmode.c |  274 +++-
- drivers/net/wireless/mediatek/mt76/testmode.h |   75 ++
- .../net/wireless/mediatek/mt76/tools/fields.c |   80 ++
- drivers/net/wireless/mediatek/mt76/tx.c       |    3 +-
- 19 files changed, 1963 insertions(+), 152 deletions(-)
+ dma.c             |    3 +-
+ mac80211.c        |   12 +
+ mt76.h            |  111 ++++-
+ mt76_connac_mcu.c |    4 +
+ mt76_connac_mcu.h |    2 +
+ mt7915/init.c     |    2 +-
+ mt7915/mac.c      |   37 +-
+ mt7915/main.c     |    2 +-
+ mt7915/mcu.c      |   10 +-
+ mt7915/mcu.h      |   28 +-
+ mt7915/mmio.c     |    2 +
+ mt7915/mt7915.h   |   14 +-
+ mt7915/regs.h     |    3 +
+ mt7915/testmode.c | 1171 ++++++++++++++++++++++++++++++++++++++++++---
+ mt7915/testmode.h |  278 +++++++++++
+ testmode.c        |  274 +++++++++--
+ testmode.h        |   75 +++
+ tools/fields.c    |   80 ++++
+ tx.c              |    3 +-
+ 19 files changed, 1962 insertions(+), 149 deletions(-)
 
 diff --git a/dma.c b/dma.c
-index 30de8be4..f6f5f129 100644
+index 30de8be..f6f5f12 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 31602d7f..49b99f36 100644
+index c1df063..dc3c63e 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 8f6279c5..3d1e893d 100644
+index 28720ee..062c5ce 100644
 --- a/mt76.h
 +++ b/mt76.h
 @@ -602,6 +602,21 @@ struct mt76_testmode_ops {
@@ -235,10 +235,10 @@
  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 4e495d4f..ebb78d33 100644
+index 261181d..cd35068 100644
 --- a/mt76_connac_mcu.c
 +++ b/mt76_connac_mcu.c
-@@ -389,6 +389,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
+@@ -391,6 +391,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
  	switch (vif->type) {
  	case NL80211_IFTYPE_MESH_POINT:
  	case NL80211_IFTYPE_AP:
@@ -246,7 +246,7 @@
  		if (vif->p2p)
  			conn_type = CONNECTION_P2P_GC;
  		else
-@@ -570,6 +571,9 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev,
+@@ -572,6 +573,9 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev,
  	rx->rca2 = 1;
  	rx->rv = 1;
  
@@ -257,10 +257,10 @@
  		return;
  
 diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 82498039..a3bbf5ca 100644
+index 32e540c..a0e6fa6 100644
 --- a/mt76_connac_mcu.h
 +++ b/mt76_connac_mcu.h
-@@ -816,6 +816,7 @@ enum {
+@@ -967,6 +967,7 @@ enum {
  	MCU_EXT_EVENT_FW_LOG_2_HOST = 0x13,
  	MCU_EXT_EVENT_THERMAL_PROTECT = 0x22,
  	MCU_EXT_EVENT_ASSERT_DUMP = 0x23,
@@ -268,7 +268,7 @@
  	MCU_EXT_EVENT_RDD_REPORT = 0x3a,
  	MCU_EXT_EVENT_CSA_NOTIFY = 0x4f,
  	MCU_EXT_EVENT_BCC_NOTIFY = 0x75,
-@@ -993,6 +994,7 @@ enum {
+@@ -1144,6 +1145,7 @@ enum {
  	MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
  	/* for vendor csi and air monitor */
  	MCU_EXT_CMD_SMESH_CTRL = 0xae,
@@ -277,10 +277,10 @@
  	MCU_EXT_CMD_CSI_CTRL = 0xc2,
  };
 diff --git a/mt7915/init.c b/mt7915/init.c
-index e4f6617f..25a9b5de 100644
+index 0d5109a..b549fa0 100644
 --- a/mt7915/init.c
 +++ b/mt7915/init.c
-@@ -573,7 +573,7 @@ static void mt7915_init_work(struct work_struct *work)
+@@ -576,7 +576,7 @@ static void mt7915_init_work(struct work_struct *work)
  	struct mt7915_dev *dev = container_of(work, struct mt7915_dev,
  				 init_work);
  
@@ -290,10 +290,10 @@
  	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 ffb0037b..12afb204 100644
+index 0593270..8fd4618 100644
 --- a/mt7915/mac.c
 +++ b/mt7915/mac.c
-@@ -914,17 +914,39 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
+@@ -565,17 +565,39 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
  {
  #ifdef CONFIG_NL80211_TESTMODE
  	struct mt76_testmode_data *td = &phy->mt76->test;
@@ -336,7 +336,7 @@
  	switch (td->tx_rate_mode) {
  	case MT76_TM_TX_MODE_HT:
  		nss = 1 + (rate_idx >> 3);
-@@ -1013,14 +1035,13 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
+@@ -664,14 +686,13 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
  	if (mode >= MT_PHY_TYPE_HE_SU)
  		val |= FIELD_PREP(MT_TXD6_HELTF, td->tx_ltf);
  
@@ -356,10 +356,10 @@
  }
  
 diff --git a/mt7915/main.c b/mt7915/main.c
-index f2a6d9da..942b8a9a 100644
+index dc5e4b0..e4b2076 100644
 --- a/mt7915/main.c
 +++ b/mt7915/main.c
-@@ -221,7 +221,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
+@@ -224,7 +224,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
  	mvif->phy = phy;
  	mvif->mt76.band_idx = phy->band_idx;
  
@@ -369,18 +369,10 @@
  		mvif->mt76.wmm_idx += 2;
  
 diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index 8a3bd33f..8ed8700d 100755
+index aee3a8c..810d72e 100644
 --- a/mt7915/mcu.c
 +++ b/mt7915/mcu.c
-@@ -360,7 +360,6 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
- 	if (mcu_txd->ext_cid) {
- 		mcu_txd->ext_cid_ack = 1;
- 
--		/* do not use Q_SET for efuse */
- 		if (cmd & __MCU_CMD_FIELD_QUERY)
- 			mcu_txd->set_query = MCU_Q_QUERY;
- 		else
-@@ -536,6 +535,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
+@@ -434,6 +434,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
  	case MCU_EXT_EVENT_BCC_NOTIFY:
  		mt7915_mcu_rx_bcc_notify(dev, skb);
  		break;
@@ -392,7 +384,7 @@
  	default:
  		break;
  	}
-@@ -565,6 +569,7 @@ void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb)
+@@ -465,6 +470,7 @@ void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb)
  	    rxd->ext_eid == MCU_EXT_EVENT_ASSERT_DUMP ||
  	    rxd->ext_eid == MCU_EXT_EVENT_PS_SYNC ||
  	    rxd->ext_eid == MCU_EXT_EVENT_BCC_NOTIFY ||
@@ -400,7 +392,7 @@
  	    !rxd->seq)
  		mt7915_mcu_rx_unsolicited_event(dev, skb);
  	else
-@@ -3030,14 +3035,14 @@ static int mt7915_mcu_set_eeprom_flash(struct mt7915_dev *dev)
+@@ -2812,14 +2818,14 @@ static int mt7915_mcu_set_eeprom_flash(struct mt7915_dev *dev)
  	return 0;
  }
  
@@ -418,10 +410,10 @@
  
  	return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(EFUSE_BUFFER_MODE),
 diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index adf71f10..82c21168 100644
+index 75442ba..873a805 100644
 --- a/mt7915/mcu.h
 +++ b/mt7915/mcu.h
-@@ -27,10 +27,15 @@ struct mt7915_mcu_txd {
+@@ -8,10 +8,15 @@
  
  enum {
  	MCU_ATE_SET_TRX = 0x1,
@@ -436,8 +428,8 @@
 +	MCU_ATE_SET_MU_RX_AID = 0x1e,
  };
  
- struct mt7915_mcu_rxd {
-@@ -455,6 +460,12 @@ enum {
+ struct mt7915_mcu_thermal_ctrl {
+@@ -431,6 +436,12 @@ enum {
  
  enum {
  	MT_BF_SOUNDING_ON = 1,
@@ -450,38 +442,35 @@
  	MT_BF_TYPE_UPDATE = 20,
  	MT_BF_MODULE_UPDATE = 25
  };
-@@ -681,12 +692,20 @@ struct mt7915_muru {
- #define MURU_OFDMA_SCH_TYPE_DL          BIT(0)
+@@ -661,10 +672,19 @@ struct mt7915_muru {
  #define MURU_OFDMA_SCH_TYPE_UL          BIT(1)
  
--/* Common Config */
+ /* Common Config */
 -#define MURU_COMM_PPDU_FMT              BIT(0)
 -#define MURU_COMM_SCH_TYPE              BIT(1)
 -#define MURU_COMM_SET                   (MURU_COMM_PPDU_FMT | MURU_COMM_SCH_TYPE)
--
 -/* DL&UL User config*/
-+/* Common Config */ 
 +/* #define MURU_COMM_PPDU_FMT              BIT(0) */
 +/* #define MURU_COMM_SCH_TYPE              BIT(1) */
 +/* #define MURU_COMM_SET                   (MURU_COMM_PPDU_FMT | MURU_COMM_SCH_TYPE) */
-+#define MURU_COMM_PPDU_FMT		BIT(0)
-+#define MURU_COMM_SCH_TYPE		BIT(1)
-+#define MURU_COMM_BAND			BIT(2)
-+#define MURU_COMM_WMM			BIT(3)
-+#define MURU_COMM_SPE_IDX		BIT(4)
-+#define MURU_COMM_PROC_TYPE		BIT(5)
-+#define MURU_COMM_SET		(MURU_COMM_PPDU_FMT | MURU_COMM_BAND | \
-+				 MURU_COMM_WMM | MURU_COMM_SPE_IDX)
++#define MURU_COMM_PPDU_FMT     BIT(0)
++#define MURU_COMM_SCH_TYPE     BIT(1)
++#define MURU_COMM_BAND         BIT(2)
++#define MURU_COMM_WMM          BIT(3)
++#define MURU_COMM_SPE_IDX      BIT(4)
++#define MURU_COMM_PROC_TYPE        BIT(5)
++#define MURU_COMM_SET      (MURU_COMM_PPDU_FMT | MURU_COMM_BAND | \
++				MURU_COMM_WMM | MURU_COMM_SPE_IDX)
 +
 +/* DL&UL User config */
  #define MURU_USER_CNT                   BIT(4)
  
  enum {
 diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index b3de3a7a..bbf8b16c 100644
+index bccb108..a84970d 100644
 --- a/mt7915/mmio.c
 +++ b/mt7915/mmio.c
-@@ -73,6 +73,7 @@ static const u32 mt7915_offs[] = {
+@@ -76,6 +76,7 @@ static const u32 mt7915_offs[] = {
  	[ARB_DRNGR0]		= 0x194,
  	[ARB_SCR]		= 0x080,
  	[RMAC_MIB_AIRTIME14]	= 0x3b8,
@@ -489,7 +478,7 @@
  	[AGG_AWSCR0]		= 0x05c,
  	[AGG_PCR0]		= 0x06c,
  	[AGG_ACR0]		= 0x084,
-@@ -147,6 +148,7 @@ static const u32 mt7916_offs[] = {
+@@ -150,6 +151,7 @@ static const u32 mt7916_offs[] = {
  	[ARB_DRNGR0]		= 0x1e0,
  	[ARB_SCR]		= 0x000,
  	[RMAC_MIB_AIRTIME14]	= 0x0398,
@@ -498,10 +487,10 @@
  	[AGG_PCR0]		= 0x040,
  	[AGG_ACR0]		= 0x054,
 diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index cf0630c8..4b375629 100644
+index 9f5da64..ff92e55 100644
 --- a/mt7915/mt7915.h
 +++ b/mt7915/mt7915.h
-@@ -294,6 +294,9 @@ struct mt7915_phy {
+@@ -303,6 +303,9 @@ struct mt7915_phy {
  		u8 last_snr;
  
  		u8 spe_idx;
@@ -511,7 +500,7 @@
  	} test;
  #endif
  
-@@ -382,6 +385,14 @@ struct mt7915_dev {
+@@ -394,6 +397,14 @@ struct mt7915_dev {
  	void __iomem *dcm;
  	void __iomem *sku;
  
@@ -526,7 +515,7 @@
  #ifdef MTK_DEBUG
  	u16 wlan_idx;
  	struct {
-@@ -572,7 +583,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
+@@ -571,7 +582,7 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
  				   struct ieee80211_vif *vif,
  				   struct ieee80211_sta *sta,
  				   void *data, u32 field);
@@ -535,7 +524,7 @@
  int mt7915_mcu_get_eeprom(struct mt7915_dev *dev, u32 offset);
  int mt7915_mcu_get_eeprom_free_block(struct mt7915_dev *dev, u8 *block_num);
  int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable,
-@@ -605,6 +616,7 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
+@@ -604,6 +615,7 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
  int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
  void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
  void mt7915_mcu_exit(struct mt7915_dev *dev);
@@ -544,10 +533,10 @@
  static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
  {
 diff --git a/mt7915/regs.h b/mt7915/regs.h
-index 99834310..6ba5e9fe 100644
+index 47bae86..444440e 100644
 --- a/mt7915/regs.h
 +++ b/mt7915/regs.h
-@@ -50,6 +50,7 @@ enum offs_rev {
+@@ -51,6 +51,7 @@ enum offs_rev {
  	ARB_DRNGR0,
  	ARB_SCR,
  	RMAC_MIB_AIRTIME14,
@@ -555,7 +544,7 @@
  	AGG_AWSCR0,
  	AGG_PCR0,
  	AGG_ACR0,
-@@ -458,6 +459,8 @@ enum offs_rev {
+@@ -467,6 +468,8 @@ enum offs_rev {
  #define MT_WF_AGG_BASE(_band)		((_band) ? 0x820f2000 : 0x820e2000)
  #define MT_WF_AGG(_band, ofs)		(MT_WF_AGG_BASE(_band) + (ofs))
  
@@ -565,7 +554,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 e8bf616c..16c9e4ae 100644
+index 123ceaf..a0a9f7b 100644
 --- a/mt7915/testmode.c
 +++ b/mt7915/testmode.c
 @@ -9,6 +9,9 @@
@@ -660,7 +649,7 @@
  }
  
  static int
-@@ -182,11 +230,737 @@ mt7915_tm_set_tam_arb(struct mt7915_phy *phy, bool enable, bool mu)
+@@ -182,12 +230,738 @@ mt7915_tm_set_tam_arb(struct mt7915_phy *phy, bool enable, bool mu)
  	return mt7915_mcu_set_muru_ctrl(dev, MURU_SET_ARB_OP_MODE, op_mode);
  }
  
@@ -1225,7 +1214,7 @@
 +#define BF_CAL_PHASE	21
 +	u8 format_id;
 +
-+	skb_pull(skb, sizeof(struct mt7915_mcu_rxd));
++	skb_pull(skb, sizeof(struct mt76_connac2_mcu_rxd));
 +	format_id = *(u8 *)skb->data;
 +
 +	if (format_id == BF_PFMU_TAG) {
@@ -1387,10 +1376,11 @@
 +}
 +
  static int
- mt7915_tm_set_wmm_qid(struct mt7915_dev *dev, u8 qid, u8 aifs, u8 cw_min,
+ mt7915_tm_set_wmm_qid(struct mt7915_phy *phy, u8 qid, u8 aifs, u8 cw_min,
 -		      u16 cw_max, u16 txop)
 +		      u16 cw_max, u16 txop, u8 tx_cmd)
  {
+ 	struct mt7915_vif *mvif = (struct mt7915_vif *)phy->monitor_vif->drv_priv;
 -	struct mt7915_mcu_tx req = { .total = 1 };
 +	struct mt7915_mcu_tx req = {
 +		.valid = true,
@@ -1399,10 +1389,10 @@
 +	};
  	struct edca *e = &req.edca[0];
  
- 	e->queue = qid;
-@@ -261,7 +1035,8 @@ done:
+ 	e->queue = qid + mvif->mt76.wmm_idx * MT76_CONNAC_MAX_WMM_SETS;
+@@ -262,7 +1036,8 @@ done:
  
- 	return mt7915_tm_set_wmm_qid(dev,
+ 	return mt7915_tm_set_wmm_qid(phy,
  				     mt76_connac_lmac_mapping(IEEE80211_AC_BE),
 -				     aifsn, cw, cw, 0);
 +				     aifsn, cw, cw, 0,
@@ -1410,7 +1400,7 @@
  }
  
  static int
-@@ -337,7 +1112,7 @@ mt7915_tm_set_tx_len(struct mt7915_phy *phy, u32 tx_time)
+@@ -338,7 +1113,7 @@ mt7915_tm_set_tx_len(struct mt7915_phy *phy, u32 tx_time)
  	bitrate = cfg80211_calculate_bitrate(&rate);
  	tx_len = bitrate * tx_time / 10 / 8;
  
@@ -1419,7 +1409,7 @@
  	if (ret)
  		return ret;
  
-@@ -455,18 +1230,180 @@ mt7915_tm_init(struct mt7915_phy *phy, bool en)
+@@ -456,18 +1231,180 @@ mt7915_tm_init(struct mt7915_phy *phy, bool en)
  
  	phy->mt76->test.flag |= MT_TM_FW_RX_COUNT;
  
@@ -1606,7 +1596,7 @@
  }
  
  static void
-@@ -475,47 +1412,48 @@ mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en)
+@@ -476,47 +1413,48 @@ mt7915_tm_set_tx_frames(struct mt7915_phy *phy, bool en)
  	static const u8 spe_idx_map[] = {0, 0, 1, 0, 3, 2, 4, 0,
  					 9, 8, 6, 10, 16, 12, 18, 0};
  	struct mt76_testmode_data *td = &phy->mt76->test;
@@ -1680,7 +1670,7 @@
  
  	mt7915_tm_set_trx(phy, TM_MAC_TX, en);
  }
-@@ -544,10 +1482,6 @@ mt7915_tm_get_rx_stats(struct mt7915_phy *phy, bool clear)
+@@ -545,10 +1483,6 @@ mt7915_tm_get_rx_stats(struct mt7915_phy *phy, bool clear)
  		return ret;
  
  	rs_band = (struct mt7915_tm_rx_stat_band *)skb->data;
@@ -1691,7 +1681,7 @@
  
  	if (!clear) {
  		enum mt76_rxq_id q = req.band ? MT_RXQ_EXT : MT_RXQ_MAIN;
-@@ -562,13 +1496,61 @@ mt7915_tm_get_rx_stats(struct mt7915_phy *phy, bool clear)
+@@ -563,13 +1497,61 @@ mt7915_tm_get_rx_stats(struct mt7915_phy *phy, bool clear)
  	return 0;
  }
  
@@ -1754,7 +1744,7 @@
  
  		/* read-clear */
  		mt7915_tm_get_rx_stats(phy, true);
-@@ -576,9 +1558,12 @@ mt7915_tm_set_rx_frames(struct mt7915_phy *phy, bool en)
+@@ -577,9 +1559,12 @@ mt7915_tm_set_rx_frames(struct mt7915_phy *phy, bool en)
  		/* clear fw count */
  		mt7915_tm_set_phy_count(phy, 0);
  		mt7915_tm_set_phy_count(phy, 1);
@@ -1769,7 +1759,7 @@
  }
  
  static int
-@@ -615,35 +1600,7 @@ mt7915_tm_set_tx_cont(struct mt7915_phy *phy, bool en)
+@@ -616,35 +1601,7 @@ mt7915_tm_set_tx_cont(struct mt7915_phy *phy, bool en)
  	tx_cont->center_ch = freq1;
  	tx_cont->tx_ant = td->tx_antenna_mask;
  	tx_cont->band = phy != &dev->phy;
@@ -1806,7 +1796,7 @@
  
  	if (!en) {
  		req.op.rf.param.func_data = cpu_to_le32(phy != &dev->phy);
-@@ -727,6 +1684,12 @@ mt7915_tm_update_params(struct mt7915_phy *phy, u32 changed)
+@@ -728,6 +1685,12 @@ mt7915_tm_update_params(struct mt7915_phy *phy, u32 changed)
  		mt7915_tm_set_freq_offset(phy, en, en ? td->freq_offset : 0);
  	if (changed & BIT(TM_CHANGED_TXPOWER))
  		mt7915_tm_set_tx_power(phy);
@@ -1819,7 +1809,7 @@
  }
  
  static int
-@@ -800,6 +1763,7 @@ static int
+@@ -801,6 +1764,7 @@ static int
  mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
  {
  	struct mt7915_phy *phy = mphy->priv;
@@ -1827,7 +1817,7 @@
  	void *rx, *rssi;
  	int i;
  
-@@ -845,11 +1809,68 @@ mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
+@@ -846,11 +1810,68 @@ mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
  
  	nla_nest_end(msg, rx);
  
@@ -1897,7 +1887,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 @@
@@ -2212,7 +2202,7 @@
 +
  #endif
 diff --git a/testmode.c b/testmode.c
-index e6d1f702..2c699ac8 100644
+index e6d1f70..2c699ac 100644
 --- a/testmode.c
 +++ b/testmode.c
 @@ -25,28 +25,15 @@ const struct nla_policy mt76_tm_policy[NUM_MT76_TM_ATTRS] = {
@@ -2678,7 +2668,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 @@
@@ -2783,7 +2773,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[] = {
@@ -2909,7 +2899,7 @@
  };
  
 diff --git a/tx.c b/tx.c
-index 02067edc..0457c3eb 100644
+index 02067ed..0457c3e 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 *
@@ -2923,5 +2913,5 @@
  			wake_up(&dev->tx_wait);
  
 -- 
-2.25.1
+2.18.0