wifi: mt76: mt7925: add link handling in mt7925_mac_sta_add
authorSean Wang <sean.wang@mediatek.com>
Sat, 6 Jul 2024 08:27:49 +0000 (01:27 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:02:02 +0000 (23:02 +0200)
Added link handling to mt7925_mac_sta_add to support MLD devices.

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

index afb58a9206b03e230efcddd8417e37de2076adec..042c9fe5a2d92f4c4041c57d1bf8b2678bac02fd 100644 (file)
@@ -885,15 +885,25 @@ mt7925_mac_sta_add_links(struct mt792x_dev *dev, struct ieee80211_vif *vif,
 int mt7925_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
                       struct ieee80211_sta *sta)
 {
+       struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
        struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
        struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
+       int err;
 
        msta->vif = mvif;
 
        if (vif->type == NL80211_IFTYPE_STATION)
                mvif->wep_sta = msta;
 
-       return mt7925_mac_link_sta_add(mdev, vif, &sta->deflink);
+       if (ieee80211_vif_is_mld(vif)) {
+               msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
+
+               err = mt7925_mac_sta_add_links(dev, vif, sta, sta->valid_links);
+       } else {
+               err = mt7925_mac_link_sta_add(mdev, vif, &sta->deflink);
+       }
+
+       return err;
 }
 EXPORT_SYMBOL_GPL(mt7925_mac_sta_add);