From: Shayne Chen <shayne.chen@mediatek.com>
To: Felix Fietkau <nbd@nbd.name>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Ryder Lee <ryder.lee@mediatek.com>,
Evelyn Tsai <evelyn.tsai@mediatek.com>,
linux-mediatek <linux-mediatek@lists.infradead.org>,
Shayne Chen <shayne.chen@mediatek.com>
Subject: [PATCH mt76 6/7] wifi: mt76: mt7996: add duplicated WTBL command
Date: Tue, 25 Nov 2025 11:46:38 +0800 [thread overview]
Message-ID: <20251125034639.1416214-6-shayne.chen@mediatek.com> (raw)
In-Reply-To: <20251125034639.1416214-1-shayne.chen@mediatek.com>
This is a firmware mechanism to improve packet loss issues for mt7996 and
mt7992 chipsets.
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
.../net/wireless/mediatek/mt76/mt7996/init.c | 3 +++
.../net/wireless/mediatek/mt76/mt7996/mcu.c | 25 +++++++++++++++++--
.../net/wireless/mediatek/mt76/mt7996/mcu.h | 5 ++++
.../wireless/mediatek/mt76/mt7996/mt7996.h | 1 +
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/init.c b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
index 00a8286bd136..7e8bd3b142e7 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
@@ -756,6 +756,9 @@ static void mt7996_init_work(struct work_struct *work)
mt7996_mcu_set_eeprom(dev);
mt7996_mac_init(dev);
mt7996_txbf_init(dev);
+
+ if (!is_mt7990(&dev->mt76))
+ mt7996_mcu_set_dup_wtbl(dev);
}
void mt7996_wfsys_reset(struct mt7996_dev *dev)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
index 4e78f8e585d9..f96975be1e2e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
@@ -4031,7 +4031,6 @@ int mt7996_mcu_get_eeprom_free_block(struct mt7996_dev *dev, u8 *block_num)
int mt7996_mcu_get_chip_config(struct mt7996_dev *dev, u32 *cap)
{
-#define NIC_CAP 3
#define UNI_EVENT_CHIP_CONFIG_EFUSE_VERSION 0x21
struct {
u8 _rsv[4];
@@ -4039,7 +4038,7 @@ int mt7996_mcu_get_chip_config(struct mt7996_dev *dev, u32 *cap)
__le16 tag;
__le16 len;
} __packed req = {
- .tag = cpu_to_le16(NIC_CAP),
+ .tag = cpu_to_le16(UNI_CHIP_CONFIG_NIC_CAPA),
.len = cpu_to_le16(sizeof(req) - 4),
};
struct sk_buff *skb;
@@ -5043,3 +5042,25 @@ int mt7996_mcu_cp_support(struct mt7996_dev *dev, u8 mode)
return mt76_mcu_send_msg(&dev->mt76, MCU_WA_EXT_CMD(CP_SUPPORT),
&cp_mode, sizeof(cp_mode), true);
}
+
+int mt7996_mcu_set_dup_wtbl(struct mt7996_dev *dev)
+{
+#define DUP_WTBL_NUM 80
+ struct {
+ u8 _rsv[4];
+
+ __le16 tag;
+ __le16 len;
+ __le16 base;
+ __le16 num;
+ u8 _rsv2[4];
+ } __packed req = {
+ .tag = cpu_to_le16(UNI_CHIP_CONFIG_DUP_WTBL),
+ .len = cpu_to_le16(sizeof(req) - 4),
+ .base = cpu_to_le16(MT7996_WTBL_STA - DUP_WTBL_NUM + 1),
+ .num = cpu_to_le16(DUP_WTBL_NUM),
+ };
+
+ return mt76_mcu_send_msg(&dev->mt76, MCU_WM_UNI_CMD(CHIP_CONFIG), &req,
+ sizeof(req), true);
+}
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
index 1283beb0dc19..de14394bec22 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.h
@@ -798,6 +798,11 @@ enum {
UNI_CHANNEL_RX_PATH,
};
+enum {
+ UNI_CHIP_CONFIG_NIC_CAPA = 3,
+ UNI_CHIP_CONFIG_DUP_WTBL = 4,
+};
+
#define MT7996_BSS_UPDATE_MAX_SIZE (sizeof(struct bss_req_hdr) + \
sizeof(struct mt76_connac_bss_basic_tlv) + \
sizeof(struct bss_rlm_tlv) + \
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
index 8f1043159f58..f850be874b1b 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h
@@ -748,6 +748,7 @@ void mt7996_mcu_exit(struct mt7996_dev *dev);
int mt7996_mcu_get_all_sta_info(struct mt7996_phy *phy, u16 tag);
int mt7996_mcu_wed_rro_reset_sessions(struct mt7996_dev *dev, u16 id);
int mt7996_mcu_set_sniffer_mode(struct mt7996_phy *phy, bool enabled);
+int mt7996_mcu_set_dup_wtbl(struct mt7996_dev *dev);
static inline bool mt7996_has_hwrro(struct mt7996_dev *dev)
{
--
2.51.0
next prev parent reply other threads:[~2025-11-25 3:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-25 3:46 [PATCH mt76 1/7] wifi: mt76: mt7996: extend CSA and CCA support for MLO Shayne Chen
2025-11-25 3:46 ` [PATCH mt76 2/7] wifi: mt76: mt7996: fix the behavior of radar detection Shayne Chen
2025-12-09 11:19 ` Lorenzo Bianconi
2025-12-12 8:35 ` Shayne Chen
2025-11-25 3:46 ` [PATCH mt76 3/7] wifi: mt76: mt7996: set specific BSSINFO and STAREC commands after channel switch Shayne Chen
2025-11-25 3:46 ` [PATCH mt76 4/7] wifi: mt76: mt7996: abort CCA when CSA is starting Shayne Chen
2025-11-25 3:46 ` [PATCH mt76 5/7] wifi: mt76: mt7996: offload radar threshold initialization Shayne Chen
2025-11-25 3:46 ` Shayne Chen [this message]
2025-11-25 3:46 ` [PATCH mt76 7/7] wifi: mt76: mt7996: fix iface combination for different chipsets Shayne Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251125034639.1416214-6-shayne.chen@mediatek.com \
--to=shayne.chen@mediatek.com \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
--cc=ryder.lee@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox