summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2024-07-06 01:27:53 -0700
committerFelix Fietkau <nbd@nbd.name>2024-07-09 23:02:03 +0200
commitb880cb3caa3e19610701322451b8bdb6f1f6813b (patch)
treef0b43280fc3a6d9e00e3262ae93d1836c56ed678 /drivers/net/wireless/mediatek
parent3e758e9f777cde8e9d0106e7b36c6eca389e5856 (diff)
wifi: mt76: mt7925: add link handling to mt7925_change_chanctx
add link handling to mt7925_change_chanctx Co-developed-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com> Co-developed-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Deren Wu <deren.wu@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Link: https://patch.msgid.link/49f2a2f8230979a4e123bc1dab70a8496875cc6c.1720248331.git.sean.wang@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7925/main.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
index a2cf05fdfc3a..957e6bcaf9c1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
@@ -1571,13 +1571,15 @@ mt7925_change_chanctx(struct ieee80211_hw *hw,
{
struct mt792x_chanctx *mctx = (struct mt792x_chanctx *)ctx->drv_priv;
struct mt792x_phy *phy = mt792x_hw_phy(hw);
+ struct mt792x_bss_conf *mconf;
struct ieee80211_vif *vif;
struct mt792x_vif *mvif;
if (!mctx->bss_conf)
return;
- mvif = container_of(mctx->bss_conf, struct mt792x_vif, bss_conf);
+ mconf = mctx->bss_conf;
+ mvif = mconf->vif;
vif = container_of((void *)mvif, struct ieee80211_vif, drv_priv);
mt792x_mutex_acquire(phy->dev);
@@ -1585,8 +1587,24 @@ mt7925_change_chanctx(struct ieee80211_hw *hw,
mt7925_mcu_set_sniffer(mvif->phy->dev, vif, true);
mt7925_mcu_config_sniffer(mvif, ctx);
} else {
- mt7925_mcu_set_chctx(mvif->phy->mt76, &mvif->bss_conf.mt76, ctx);
+ if (ieee80211_vif_is_mld(vif)) {
+ unsigned long valid = mvif->valid_links;
+ u8 i;
+
+ for_each_set_bit(i, &valid, IEEE80211_MLD_MAX_NUM_LINKS) {
+ mconf = mt792x_vif_to_link(mvif, i);
+ if (mconf && mconf->mt76.ctx == ctx)
+ break;
+ }
+
+ } else {
+ mconf = &mvif->bss_conf;
+ }
+
+ if (mconf)
+ mt7925_mcu_set_chctx(mvif->phy->mt76, &mconf->mt76, ctx);
}
+
mt792x_mutex_release(phy->dev);
}