The mt76_connac_mcu_set_rate_txpower() function sends TX power settings to the firmware but never updates phy->txpower_cur. This causes mt76_get_txpower() to return stale or incorrect values (typically showing 3 dBm regardless of actual transmit power) when userspace queries TX power via nl80211. This affects MT7921 and other connac-based devices. Users observe: $ iw dev wlan0 info ... txpower 3.00 dBm The firmware receives and applies the correct power level, but the reported value is wrong because txpower_cur is never set. Fix by updating phy->txpower_cur after successfully configuring TX power, matching the behavior of other mt76 drivers like mt7915. Signed-off-by: Lucid Duck --- drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 045771228..7cd357419 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -2251,7 +2251,7 @@ mt76_connac_mcu_rate_txpower_band(struct mt76_phy *phy, int mt76_connac_mcu_set_rate_txpower(struct mt76_phy *phy) { - int err; + int err, tx_power; if (phy->cap.has_2ghz) { err = mt76_connac_mcu_rate_txpower_band(phy, @@ -2272,6 +2272,12 @@ int mt76_connac_mcu_set_rate_txpower(struct mt76_phy *phy) return err; } + /* Update txpower_cur for accurate reporting via nl80211 */ + tx_power = 2 * phy->hw->conf.power_level; + if (!tx_power) + tx_power = 127; + phy->txpower_cur = tx_power; + return 0; } EXPORT_SYMBOL_GPL(mt76_connac_mcu_set_rate_txpower); -- 2.52.0