[][MAC80211][misc][Refactor patches]
[Description]
Refactor patches to fix the incorrect HE TX GI report.
[Release-log]
N/A
Change-Id: I778f20224fa10767f1c04526d312e4a5c5569b91
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7348230
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1010-wifi-mt76-testmode-additional-supports.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1010-wifi-mt76-testmode-additional-supports.patch
index 9727cf9..30165ef 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1010-wifi-mt76-testmode-additional-supports.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1010-wifi-mt76-testmode-additional-supports.patch
@@ -1,4 +1,4 @@
-From 6e649474c35188ba94226b7f8d3d49a456e3cdab Mon Sep 17 00:00:00 2001
+From 7b460803571110f55c81a377d6680ea350663adc 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 1010/1031] wifi: mt76: testmode: additional supports
@@ -29,7 +29,7 @@
20 files changed, 1990 insertions(+), 156 deletions(-)
diff --git a/dma.c b/dma.c
-index e1b73a1..dc53cc7 100644
+index e1b73a1e..dc53cc7c 100644
--- a/dma.c
+++ b/dma.c
@@ -574,8 +574,7 @@ free:
@@ -43,7 +43,7 @@
#endif
diff --git a/mac80211.c b/mac80211.c
-index c3fa85d..f6fa788 100644
+index c3fa85d9..f6fa7887 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -55,6 +55,13 @@ static const struct ieee80211_channel mt76_channels_5ghz[] = {
@@ -73,10 +73,10 @@
static const struct ieee80211_channel mt76_channels_6ghz[] = {
diff --git a/mt76.h b/mt76.h
-index 024c5ed..f1fda51 100644
+index 7a4ede7a..7517135b 100644
--- a/mt76.h
+++ b/mt76.h
-@@ -642,6 +642,21 @@ struct mt76_testmode_ops {
+@@ -646,6 +646,21 @@ struct mt76_testmode_ops {
int (*set_params)(struct mt76_phy *phy, struct nlattr **tb,
enum mt76_testmode_state new_state);
int (*dump_stats)(struct mt76_phy *phy, struct sk_buff *msg);
@@ -98,7 +98,7 @@
};
#define MT_TM_FW_RX_COUNT BIT(0)
-@@ -650,16 +665,11 @@ struct mt76_testmode_data {
+@@ -654,16 +669,11 @@ struct mt76_testmode_data {
enum mt76_testmode_state state;
u32 param_set[DIV_ROUND_UP(NUM_MT76_TM_ATTRS, 32)];
@@ -115,7 +115,7 @@
u8 tx_rate_stbc;
u8 tx_ltf;
-@@ -675,10 +685,37 @@ struct mt76_testmode_data {
+@@ -679,10 +689,37 @@ struct mt76_testmode_data {
u8 tx_power[4];
u8 tx_power_control;
@@ -154,7 +154,7 @@
u32 tx_pending;
u32 tx_queued;
u16 tx_queued_limit;
-@@ -1142,6 +1179,59 @@ static inline bool mt76_testmode_enabled(struct mt76_phy *phy)
+@@ -1146,6 +1183,59 @@ static inline bool mt76_testmode_enabled(struct mt76_phy *phy)
#endif
}
@@ -214,7 +214,7 @@
static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
struct sk_buff *skb,
struct ieee80211_hw **hw)
-@@ -1152,7 +1242,8 @@ static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
+@@ -1156,7 +1246,8 @@ static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
for (i = 0; i < ARRAY_SIZE(dev->phys); i++) {
struct mt76_phy *phy = dev->phys[i];
@@ -224,7 +224,7 @@
*hw = dev->phys[i]->hw;
return true;
}
-@@ -1254,7 +1345,8 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+@@ -1258,7 +1349,8 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,
struct netlink_callback *cb, void *data, int len);
int mt76_testmode_set_state(struct mt76_phy *phy, enum mt76_testmode_state state);
@@ -235,7 +235,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 856b289..5649377 100644
+index 856b2897..56493774 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -395,6 +395,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
@@ -257,7 +257,7 @@
return;
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index aa6d2da..9641a08 100644
+index aa6d2dac..9641a080 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -996,6 +996,7 @@ enum {
@@ -277,7 +277,7 @@
MCU_EXT_CMD_CSI_CTRL = 0xc2,
};
diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
-index a796289..f1b1471 100644
+index a7962893..f1b14711 100644
--- a/mt7915/eeprom.c
+++ b/mt7915/eeprom.c
@@ -126,7 +126,7 @@ static int mt7915_eeprom_load(struct mt7915_dev *dev)
@@ -290,10 +290,10 @@
return ret;
}
diff --git a/mt7915/init.c b/mt7915/init.c
-index 1177e4e..f40d09c 100644
+index f6f3e8a6..2da66cb1 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
-@@ -695,7 +695,7 @@ static void mt7915_init_work(struct work_struct *work)
+@@ -697,7 +697,7 @@ static void mt7915_init_work(struct work_struct *work)
struct mt7915_dev *dev = container_of(work, struct mt7915_dev,
init_work);
@@ -303,10 +303,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 dd05b76..8fb3b49 100644
+index 4554a93c..a074608b 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
-@@ -627,16 +627,38 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
+@@ -607,16 +607,38 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
{
#ifdef CONFIG_NL80211_TESTMODE
struct mt76_testmode_data *td = &phy->mt76->test;
@@ -348,7 +348,7 @@
switch (td->tx_rate_mode) {
case MT76_TM_TX_MODE_HT:
-@@ -667,7 +689,7 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
+@@ -647,7 +669,7 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
rate_idx += 4;
r = &phy->mt76->hw->wiphy->bands[band]->bitrates[rate_idx];
@@ -357,7 +357,7 @@
mode = val >> 8;
rate_idx = val & 0xff;
-@@ -726,13 +748,14 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
+@@ -706,13 +728,14 @@ 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);
@@ -375,7 +375,7 @@
#endif
}
-@@ -1479,7 +1502,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
+@@ -1467,7 +1490,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
goto out;
/* set the necessary init items */
@@ -385,7 +385,7 @@
goto out;
diff --git a/mt7915/main.c b/mt7915/main.c
-index f63cea4..05e7d51 100644
+index 1988d8fd..f2dd21f2 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -238,7 +238,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
@@ -398,7 +398,7 @@
mvif->mt76.wmm_idx += 2;
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index b2118af..a41aba5 100644
+index 8aec083d..5f8a6155 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -384,6 +384,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -469,7 +469,7 @@
return 0;
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index f262303..04d903e 100644
+index 6248e4bc..11ac2ada 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -8,10 +8,15 @@
@@ -488,7 +488,7 @@
};
struct mt7915_mcu_thermal_ctrl {
-@@ -472,6 +477,12 @@ enum {
+@@ -508,6 +513,12 @@ enum {
enum {
MT_BF_SOUNDING_ON = 1,
@@ -501,7 +501,7 @@
MT_BF_TYPE_UPDATE = 20,
MT_BF_MODULE_UPDATE = 25
};
-@@ -716,10 +727,19 @@ struct mt7915_muru {
+@@ -756,10 +767,19 @@ struct mt7915_muru {
#define MURU_OFDMA_SCH_TYPE_UL BIT(1)
/* Common Config */
@@ -526,7 +526,7 @@
enum {
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 9451bf5..22dcd18 100644
+index 9451bf5d..22dcd18f 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -134,6 +134,7 @@ static const u32 mt7915_offs[] = {
@@ -546,10 +546,10 @@
[AGG_PCR0] = 0x040,
[AGG_ACR0] = 0x054,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 516d03d..74150b0 100644
+index 9c110b37..cf4af055 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
-@@ -323,6 +323,9 @@ struct mt7915_phy {
+@@ -328,6 +328,9 @@ struct mt7915_phy {
u8 last_snr;
u8 spe_idx;
@@ -559,7 +559,7 @@
} test;
#endif
-@@ -422,6 +425,14 @@ struct mt7915_dev {
+@@ -427,6 +430,14 @@ struct mt7915_dev {
void __iomem *dcm;
void __iomem *sku;
@@ -574,7 +574,7 @@
#ifdef MTK_DEBUG
u16 wlan_idx;
struct {
-@@ -595,8 +606,8 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
+@@ -600,8 +611,8 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
void *data, u32 field);
@@ -585,7 +585,7 @@
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,
bool hdr_trans);
-@@ -633,6 +644,7 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
+@@ -639,6 +650,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);
@@ -594,7 +594,7 @@
static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
{
diff --git a/mt7915/regs.h b/mt7915/regs.h
-index d6a05f1..e876848 100644
+index d6a05f13..e8768488 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -62,6 +62,7 @@ enum offs_rev {
@@ -615,7 +615,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 4693919..1ed2ea8 100644
+index 46939191..1ed2ea8c 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -9,6 +9,9 @@
@@ -1973,7 +1973,7 @@
+ .set_eeprom = mt7915_tm_set_eeprom,
};
diff --git a/mt7915/testmode.h b/mt7915/testmode.h
-index a1c54c8..01b08e9 100644
+index a1c54c89..01b08e9e 100644
--- a/mt7915/testmode.h
+++ b/mt7915/testmode.h
@@ -4,6 +4,8 @@
@@ -2288,7 +2288,7 @@
+
#endif
diff --git a/testmode.c b/testmode.c
-index 1d0d5d3..fd3b9b2 100644
+index 1d0d5d30..fd3b9b20 100644
--- a/testmode.c
+++ b/testmode.c
@@ -27,28 +27,16 @@ const struct nla_policy mt76_tm_policy[NUM_MT76_TM_ATTRS] = {
@@ -2759,7 +2759,7 @@
a = nla_nest_start(msg, MT76_TM_ATTR_TX_POWER);
if (!a)
diff --git a/testmode.h b/testmode.h
-index 8961326..57949f2 100644
+index 89613266..57949f2b 100644
--- a/testmode.h
+++ b/testmode.h
@@ -6,6 +6,8 @@
@@ -2864,7 +2864,7 @@
+
#endif
diff --git a/tools/fields.c b/tools/fields.c
-index e3f6908..7e564a3 100644
+index e3f69089..7e564a3b 100644
--- a/tools/fields.c
+++ b/tools/fields.c
@@ -10,6 +10,7 @@ static const char * const testmode_state[] = {
@@ -3005,7 +3005,7 @@
};
diff --git a/tx.c b/tx.c
-index 3ad9742..cecee18 100644
+index 3ad97423..cecee186 100644
--- a/tx.c
+++ b/tx.c
@@ -250,8 +250,7 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *