wifi: mt76: mt7925: update mt7925_mcu_sta_rate_ctrl_tlv for MLO
authorSean Wang <sean.wang@mediatek.com>
Sat, 6 Jul 2024 08:28:11 +0000 (01:28 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:02:08 +0000 (23:02 +0200)
Get band information from the per-link BSS.

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/4f6ca2d082627bb93f79d5a4df80dc08998ee5d2.1720248331.git.sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index 199070bff0f0e1e2f205d18e0e241ae75b7d30de..fbf43dda0cd6b784229a4d320ddf4f1dc232751a 100644 (file)
@@ -1714,12 +1714,20 @@ mt7925_mcu_sta_rate_ctrl_tlv(struct sk_buff *skb,
                             struct ieee80211_link_sta *link_sta)
 {
        struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
-       struct cfg80211_chan_def *chandef = &mvif->bss_conf.mt76.ctx->def;
-       enum nl80211_band band = chandef->chan->band;
+       struct ieee80211_bss_conf *link_conf;
+       struct cfg80211_chan_def *chandef;
        struct sta_rec_ra_info *ra_info;
+       struct mt792x_bss_conf *mconf;
+       enum nl80211_band band;
        struct tlv *tlv;
        u16 supp_rates;
 
+       link_conf = mt792x_vif_to_bss_conf(vif, link_sta->link_id);
+       mconf = mt792x_vif_to_link(mvif, link_sta->link_id);
+       chandef = mconf->mt76.ctx ? &mconf->mt76.ctx->def :
+                                   &link_conf->chanreq.oper;
+       band = chandef->chan->band;
+
        tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_RA, sizeof(*ra_info));
        ra_info = (struct sta_rec_ra_info *)tlv;