]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: connac: Extend mt76_connac_mcu_uni_add_dev for MLO
authorSean Wang <sean.wang@mediatek.com>
Wed, 11 Dec 2024 01:19:10 +0000 (17:19 -0800)
committerFelix Fietkau <nbd@nbd.name>
Tue, 14 Jan 2025 12:34:34 +0000 (13:34 +0100)
This commit extends the `mt76_connac_mcu_uni_add_dev` function to include
support for Multi-Link Operation (MLO). Additionally, backward
compatibility for MT7921 is preserved, enabling seamless integration with
existing setups.

Fixes: 86c051f2c418 ("wifi: mt76: mt7925: enabling MLO when the firmware supports it")
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20241211011926.5002-1-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h
drivers/net/wireless/mediatek/mt76/mt7921/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/main.c
drivers/net/wireless/mediatek/mt76/mt7925/mac.c
drivers/net/wireless/mediatek/mt76/mt7925/main.c
drivers/net/wireless/mediatek/mt76/mt792x_core.c

index 804d3f5a5244ae0fdd4bbe7985ae9a5ec561d52a..5373937b0e0444649e4d1498b1aa2b5fe923512f 100644 (file)
@@ -1113,7 +1113,7 @@ mt7615_mcu_uni_add_dev(struct mt7615_phy *phy, struct ieee80211_vif *vif,
 {
        struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
 
-       return mt76_connac_mcu_uni_add_dev(phy->mt76, &vif->bss_conf,
+       return mt76_connac_mcu_uni_add_dev(phy->mt76, &vif->bss_conf, &mvif->mt76,
                                           &mvif->sta.wcid, enable);
 }
 
index 77f3e92d581a19d55ad5574defcf06d6be458add..4171710d645c9303ce49f6eb254c7b5ab90e3753 100644 (file)
@@ -1137,10 +1137,10 @@ EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_ba_tlv);
 
 int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy,
                                struct ieee80211_bss_conf *bss_conf,
+                               struct mt76_vif *mvif,
                                struct mt76_wcid *wcid,
                                bool enable)
 {
-       struct mt76_vif *mvif = (struct mt76_vif *)bss_conf->vif->drv_priv;
        struct mt76_dev *dev = phy->dev;
        struct {
                struct {
index 1b0e80dfc346b8bd984c08e687acda201b0f1bea..57a8340fa70097c62039fe3e8da5c4d3d1b47549 100644 (file)
@@ -1938,6 +1938,7 @@ void mt76_connac_mcu_sta_ba_tlv(struct sk_buff *skb,
                                bool enable, bool tx);
 int mt76_connac_mcu_uni_add_dev(struct mt76_phy *phy,
                                struct ieee80211_bss_conf *bss_conf,
+                               struct mt76_vif *mvif,
                                struct mt76_wcid *wcid,
                                bool enable);
 int mt76_connac_mcu_sta_ba(struct mt76_dev *dev, struct mt76_vif *mvif,
index 047106b65d2bc687e42363de5c8d91416791e6d3..bd1455698ebe5f6d4d359e76894435ae85df0164 100644 (file)
@@ -647,6 +647,7 @@ mt7921_vif_connect_iter(void *priv, u8 *mac,
                ieee80211_disconnect(vif, true);
 
        mt76_connac_mcu_uni_add_dev(&dev->mphy, &vif->bss_conf,
+                                   &mvif->bss_conf.mt76,
                                    &mvif->sta.deflink.wcid, true);
        mt7921_mcu_set_tx(dev, vif);
 
index 573a2cd7fe4544e675c368d799c39276e4a792da..1542c762e2a60d724dc94f9f67ae70a3f89f877d 100644 (file)
@@ -308,6 +308,7 @@ mt7921_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
        mvif->bss_conf.mt76.wmm_idx = mvif->bss_conf.mt76.idx % MT76_CONNAC_MAX_WMM_SETS;
 
        ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, &vif->bss_conf,
+                                         &mvif->bss_conf.mt76,
                                          &mvif->sta.deflink.wcid, true);
        if (ret)
                goto out;
index 634c42bbf23f67dca1ece422bb359d166cb87f9d..ddd406969061e44149832a00e3be548ad08c722d 100644 (file)
@@ -1271,6 +1271,7 @@ mt7925_vif_connect_iter(void *priv, u8 *mac,
        struct mt792x_dev *dev = mvif->phy->dev;
        struct ieee80211_hw *hw = mt76_hw(dev);
        struct ieee80211_bss_conf *bss_conf;
+       struct mt792x_bss_conf *mconf;
        int i;
 
        if (vif->type == NL80211_IFTYPE_STATION)
@@ -1278,8 +1279,9 @@ mt7925_vif_connect_iter(void *priv, u8 *mac,
 
        for_each_set_bit(i, &valid, IEEE80211_MLD_MAX_NUM_LINKS) {
                bss_conf = mt792x_vif_to_bss_conf(vif, i);
+               mconf = mt792x_vif_to_link(mvif, i);
 
-               mt76_connac_mcu_uni_add_dev(&dev->mphy, bss_conf,
+               mt76_connac_mcu_uni_add_dev(&dev->mphy, bss_conf, &mconf->mt76,
                                            &mvif->sta.deflink.wcid, true);
                mt7925_mcu_set_tx(dev, bss_conf);
        }
index a5110f8485e526388e402bf073d0ac084f7bc47b..c45396b17a8aff8a47742a53781b9c77e0512244 100644 (file)
@@ -372,7 +372,7 @@ static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,
        else
                mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL;
 
-       ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf,
+       ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76,
                                          &mlink->wcid, true);
        if (ret)
                goto out;
index 868cb97fa2ff58b2c10532bfef9b03220d8dc852..edb01941aa8296da358b73cb2f8a4a551038013d 100644 (file)
@@ -151,7 +151,8 @@ void mt792x_mac_link_bss_remove(struct mt792x_dev *dev,
        link_conf = mt792x_vif_to_bss_conf(vif, mconf->link_id);
 
        mt76_connac_free_pending_tx_skbs(&dev->pm, &mlink->wcid);
-       mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mlink->wcid, false);
+       mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mconf->mt76,
+                                   &mlink->wcid, false);
 
        rcu_assign_pointer(dev->mt76.wcid[idx], NULL);