]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: mt7925: extend mt7925_mcu_add_bss_info for per-link STA
authorSean Wang <sean.wang@mediatek.com>
Thu, 13 Jun 2024 03:02:33 +0000 (20:02 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:01:57 +0000 (23:01 +0200)
Extend mt7925_mcu_add_bss_info 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-40-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/main.c
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
drivers/net/wireless/mediatek/mt76/mt7925/mcu.h

index f3a32fe9a754c7b38d7c8f809e6277c602817dcb..e701d40569fb49bcc00c617ab4a8bcef78f10aa7 100644 (file)
@@ -489,6 +489,7 @@ static int mt7925_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
        struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
        struct mt792x_sta *msta = sta ? (struct mt792x_sta *)sta->drv_priv :
                                  &mvif->sta;
+       struct ieee80211_link_sta *link_sta = sta ? &sta->deflink : NULL;
        struct mt76_wcid *wcid = &msta->deflink.wcid;
        struct ieee80211_bss_conf *link_conf;
        u8 *wcid_keyidx = &wcid->hw_key_idx;
@@ -535,7 +536,7 @@ static int mt7925_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 
                mvif->bss_conf.mt76.cipher = mt7925_mcu_get_cipher(key->cipher);
                mt7925_mcu_add_bss_info(phy, mvif->bss_conf.mt76.ctx, link_conf,
-                                       sta, true);
+                                       link_sta, true);
        }
 
        if (cmd == SET_KEY)
@@ -738,7 +739,7 @@ int mt7925_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
        /* should update bss info before STA add */
        if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
                mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
-                                       link_conf, sta, false);
+                                       link_conf, &sta->deflink, false);
 
        ret = mt7925_mcu_sta_update(dev, &sta->deflink, vif, true,
                                    MT76_STA_INFO_STATE_NONE);
@@ -765,7 +766,7 @@ void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 
        if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
                mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
-                                       link_conf, sta, true);
+                                       link_conf, &sta->deflink, true);
 
        ewma_avg_signal_init(&msta->deflink.avg_ack_signal);
 
@@ -802,7 +803,7 @@ void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
                ewma_rssi_init(&mvif->bss_conf.rssi);
                if (!sta->tdls)
                        mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx,
-                                               link_conf, sta, false);
+                                               link_conf, &sta->deflink, false);
        }
 
        spin_lock_bh(&mdev->sta_poll_lock);
index 901a5d1f4f04ca97edeaa70a3e079d981b2436c3..03cce9fca0c35467a98d682f46aa43b8fdb4443c 100644 (file)
@@ -2338,7 +2338,7 @@ int mt7925_mcu_set_timing(struct mt792x_phy *phy,
 int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
                            struct ieee80211_chanctx_conf *ctx,
                            struct ieee80211_bss_conf *link_conf,
-                           struct ieee80211_sta *sta,
+                           struct ieee80211_link_sta *link_sta,
                            int enable)
 {
        struct mt792x_vif *mvif = (struct mt792x_vif *)link_conf->vif->drv_priv;
@@ -2353,13 +2353,13 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
                return PTR_ERR(skb);
 
        /* bss_basic must be first */
-       mt7925_mcu_bss_basic_tlv(skb, link_conf, sta, ctx, phy->mt76,
+       mt7925_mcu_bss_basic_tlv(skb, link_conf, link_sta->sta, ctx, phy->mt76,
                                 mvif->sta.deflink.wcid.idx, enable);
        mt7925_mcu_bss_sec_tlv(skb, link_conf);
 
        mt7925_mcu_bss_bmc_tlv(skb, phy, ctx, link_conf);
        mt7925_mcu_bss_qos_tlv(skb, link_conf);
-       mt7925_mcu_bss_mld_tlv(skb, link_conf, sta);
+       mt7925_mcu_bss_mld_tlv(skb, link_conf, link_sta->sta);
        mt7925_mcu_bss_ifs_tlv(skb, link_conf);
 
        if (link_conf->he_support) {
index c5197577cdc84931e154428e18bc5407505586cb..da4e84f468d234dbaf76d27e311914456847e52a 100644 (file)
@@ -595,7 +595,7 @@ int mt7925_mcu_sched_scan_enable(struct mt76_phy *phy,
 int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
                            struct ieee80211_chanctx_conf *ctx,
                            struct ieee80211_bss_conf *link_conf,
-                           struct ieee80211_sta *sta,
+                           struct ieee80211_link_sta *link_sta,
                            int enable);
 int mt7925_mcu_set_timing(struct mt792x_phy *phy,
                          struct ieee80211_bss_conf *link_conf);