mt7996_get_txpower() ignores its link_id and takes the phy of link 0. Every link of an MLD thus reports the tx power of the band of link 0. Where link 0 has no channel context, each link reports the power of the last radio of the interface. Reachable via the per-link tx power of NL80211_CMD_GET_INTERFACE. Take the phy of the requested link, like mt7996_sta_hw_queue_read() does. A link without a channel context keeps the fallback to a radio of the interface. That fallback serves an interface without a channel. Fixes: 86db2c5d4ed3 ("wifi: mt76: mt7996: implement driver specific get_txpower function") Fixes: a9eae65d97f3 ("wifi: mt76: mt7996: Export MLO AP capabilities to mac80211") Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7996/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/main.c b/drivers/net/wireless/mediatek/mt76/mt7996/main.c index ac4f8b89bd90..bcae654a2b47 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c @@ -985,11 +985,21 @@ mt7996_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, unsigned int link_id, int *dbm) { struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv; - struct mt7996_phy *phy = mt7996_vif_link_phy(&mvif->deflink); struct mt7996_dev *dev = mt7996_hw_dev(hw); + struct mt7996_phy *phy = NULL; + struct mt76_vif_link *mlink; struct wireless_dev *wdev; int n_chains, delta, i; + rcu_read_lock(); + mlink = link_id ? rcu_dereference(mvif->mt76.link[link_id]) : + &mvif->deflink.mt76; + if (mlink) + phy = mt7996_vif_link_phy(container_of(mlink, + struct mt7996_vif_link, + mt76)); + rcu_read_unlock(); + if (!phy) { wdev = ieee80211_vif_to_wdev(vif); for (i = 0; i < hw->wiphy->n_radio; i++) -- 2.47.3