]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: mt7925: extend mt7925_get_phy_mode_ext for per-link STA
authorSean Wang <sean.wang@mediatek.com>
Thu, 13 Jun 2024 03:02:28 +0000 (20:02 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:01:56 +0000 (23:01 +0200)
Extend mt7925_get_phy_mode_ext with the per-link STA configuration.

The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.

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

index a0fd02dd9551fb0b1b2630e61b20a22bcbee4034..c6902009fd28c9641c87f951b98641771aea4a65 100644 (file)
@@ -2035,16 +2035,17 @@ int mt7925_mcu_set_chctx(struct mt76_phy *phy, struct mt76_vif *mvif,
 
 static u8
 mt7925_get_phy_mode_ext(struct mt76_phy *phy, struct ieee80211_vif *vif,
-                       enum nl80211_band band, struct ieee80211_sta *sta)
+                       enum nl80211_band band,
+                       struct ieee80211_link_sta *link_sta)
 {
        struct ieee80211_he_6ghz_capa *he_6ghz_capa;
        const struct ieee80211_sta_eht_cap *eht_cap;
        __le16 capa = 0;
        u8 mode = 0;
 
-       if (sta) {
-               he_6ghz_capa = &sta->deflink.he_6ghz_capa;
-               eht_cap = &sta->deflink.eht_cap;
+       if (link_sta) {
+               he_6ghz_capa = &link_sta->he_6ghz_capa;
+               eht_cap = &link_sta->eht_cap;
        } else {
                struct ieee80211_supported_band *sband;
 
@@ -2090,6 +2091,7 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb,
        struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf);
        struct mt792x_sta *msta = sta ? (struct mt792x_sta *)sta->drv_priv :
                                  &mconf->vif->sta;
+       struct ieee80211_link_sta *link_sta = sta ? &sta->deflink : NULL;
        struct cfg80211_chan_def *chandef = ctx ? &ctx->def : &phy->chandef;
        enum nl80211_band band = chandef->chan->band;
        struct mt76_connac_bss_basic_tlv *basic_req;
@@ -2104,7 +2106,8 @@ mt7925_mcu_bss_basic_tlv(struct sk_buff *skb,
                                                      mconf->mt76.omac_idx;
        basic_req->hw_bss_idx = idx;
 
-       basic_req->phymode_ext = mt7925_get_phy_mode_ext(phy, vif, band, sta);
+       basic_req->phymode_ext = mt7925_get_phy_mode_ext(phy, vif, band,
+                                                        link_sta);
 
        if (band == NL80211_BAND_2GHZ)
                basic_req->nonht_basic_phy = cpu_to_le16(PHY_TYPE_ERP_INDEX);