From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH mt76-next 05/18] wifi: mt76: mt7996: report the tx power of the requested link
Date: Wed, 25 Nov 2026 18:36:03 +0100 [thread overview]
Message-ID: <20261125173616.3776951-5-nbd@nbd.name> (raw)
In-Reply-To: <20261125173616.3776951-1-nbd@nbd.name>
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 <nbd@nbd.name>
---
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
next prev parent reply other threads:[~2026-11-25 17:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 17:35 [PATCH mt76-next 01/18] wifi: mt76: mt7925: keep the RX PN state of a station across a rekey Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 02/18] wifi: mt76: mt7915: hold the rate update of a station in power save Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 03/18] wifi: mt76: mt7996: take the phy of a fixed rate from the station link Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 04/18] wifi: mt76: mt7915: keep the BF column count within the row count Felix Fietkau
2026-11-25 17:36 ` Felix Fietkau [this message]
2026-11-25 17:36 ` [PATCH mt76-next 06/18] wifi: mt76: mt7996: refuse an RF register offset above 12 bits Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 07/18] wifi: mt76: mt7996: hold the mutex across the thermal protection store Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 08/18] wifi: mt76: mt7996: wait for the answer of each state command Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 09/18] wifi: mt76: mt7915: wait for the answer of the background chain control Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 10/18] wifi: mt76: mt7996: bound the in-band discovery frame by its buffer Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 11/18] wifi: mt76: mt7915: reset on an MCU timeout only once the hw is registered Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 12/18] wifi: mt76: mt7996: " Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 13/18] wifi: mt76: mt7915: mask the LDPC bits of STA_REC_HT and STA_REC_VHT Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 14/18] wifi: mt76: mt7996: mask the LDPC bits of STA_REC_HT, _VHT and _HE_V2 Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 15/18] wifi: mt76: mt7996: send HE_BASIC for each HE link of an MLD Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 16/18] wifi: mt76: restore the operating channel after a failed ROC start Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 17/18] wifi: mt76: mt7996: set the duplicate WTBL range again after a reset Felix Fietkau
2026-11-25 17:36 ` [PATCH mt76-next 18/18] wifi: mt76: mt7996: keep station wcids out of the duplicate WTBL range Felix Fietkau
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=20261125173616.3776951-5-nbd@nbd.name \
--to=nbd@nbd.name \
--cc=linux-wireless@vger.kernel.org \
/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