[PATCH] wifi: mt76: mt7925: program the fixed rate table via MCU on MT7928
JB Tsai
jb.tsai at mediatek.com
Tue Nov 10 18:27:41 PST 2026
From: "allen.chien" <yung-lun.chien at mediatek.com>
MT7928 drops host MMIO writes to the WTBLON CRs, so the legacy rates
written by mt7925_mac_set_fixed_rate_table() never reach the FR table
and the firmware falls back to defaults.
Program the table through the MCU REG_ACCESS command instead, using
mt7925_mcu_regval(), and log an error if any of the writes is rejected.
Signed-off-by: allen.chien <yung-lun.chien at mediatek.com>
---
.../net/wireless/mediatek/mt76/mt7925/mac.c | 25 ++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 7af996abe294..9dcd65725d0a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -167,10 +167,29 @@ void mt7925_mac_set_fixed_rate_table(struct mt792x_dev *dev,
u32 ctrl = MT_WTBL_ITCR_WR | MT_WTBL_ITCR_EXEC | tbl_idx;
if (is_mt7928(&dev->mt76)) {
- mt76_wr(dev, MT7928_WTBL_ITDR0, rate_idx);
+ /* MT7928 drops host writes to the WTBLON CRs (reads still
+ * work), so program the table through MCU REG_ACCESS.
+ */
+ u32 spe = MT_WTBL_SPE_IDX_SEL;
+ u32 rate = rate_idx;
+ int ret;
+
+ ret = mt7925_mcu_regval(dev, MT7928_WTBL_ITDR0, &rate, true);
+ if (ret)
+ goto out;
/* use wtbl spe idx */
- mt76_wr(dev, MT7928_WTBL_ITDR1, MT_WTBL_SPE_IDX_SEL);
- mt76_wr(dev, MT7928_WTBL_ITCR, ctrl);
+ ret = mt7925_mcu_regval(dev, MT7928_WTBL_ITDR1, &spe, true);
+ if (ret)
+ goto out;
+ ret = mt7925_mcu_regval(dev, MT7928_WTBL_ITCR, &ctrl, true);
+ if (ret)
+ goto out;
+
+ return;
+out:
+ dev_err(dev->mt76.dev,
+ "failed to set fixed rate table idx %u: %d\n",
+ tbl_idx, ret);
} else {
mt76_wr(dev, MT_WTBL_ITDR0, rate_idx);
/* use wtbl spe idx */
--
2.45.2
More information about the Linux-mediatek
mailing list