wifi: mt76: mt7925: introduce MLO capability control
authorMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Mon, 17 Feb 2025 08:17:29 +0000 (16:17 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Mar 2025 13:47:02 +0000 (14:47 +0100)
This patch introduces MLO capability control for the MT792x Wi-Fi driver.
It removes the unused `MT792x_CHIP_CAP_MLO_EVT_EN` flag and introduces new
capability flags `MT792x_CHIP_CAP_MLO_EN` and `MT792x_CHIP_CAP_MLO_EML_EN`
to enable MLO and EML features based on firmware capabilities.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Reviewed-by: Sabeeh Khan <sabeeh-khan@ti.com>
Link: https://patch.msgid.link/20250217081729.1840930-1-mingyen.hsieh@mediatek.com
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/mt792x.h

index 98daf80..ad47a4b 100644 (file)
@@ -251,7 +251,7 @@ int mt7925_init_mlo_caps(struct mt792x_phy *phy)
                },
        };
 
-       if (!(phy->chip_cap & MT792x_CHIP_CAP_MLO_EVT_EN))
+       if (!(phy->chip_cap & MT792x_CHIP_CAP_MLO_EN))
                return 0;
 
        ext_capab[0].eml_capabilities = phy->eml_cap;
index 15815ad..5f40c3c 100644 (file)
@@ -2559,6 +2559,7 @@ mt7925_mcu_bss_mld_tlv(struct sk_buff *skb,
        struct ieee80211_vif *vif = link_conf->vif;
        struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf);
        struct mt792x_vif *mvif = (struct mt792x_vif *)link_conf->vif->drv_priv;
+       struct mt792x_phy *phy = mvif->phy;
        struct bss_mld_tlv *mld;
        struct tlv *tlv;
        bool is_mld;
@@ -2574,8 +2575,13 @@ mt7925_mcu_bss_mld_tlv(struct sk_buff *skb,
        mld->group_mld_id = is_mld ? mvif->bss_conf.mt76.idx : 0xff;
        mld->own_mld_id = mconf->mt76.idx + 32;
        mld->remap_idx = 0xff;
-       mld->eml_enable = !!(link_conf->vif->cfg.eml_cap &
-                            IEEE80211_EML_CAP_EMLSR_SUPP);
+
+       if (phy->chip_cap & MT792x_CHIP_CAP_MLO_EML_EN) {
+               mld->eml_enable = !!(link_conf->vif->cfg.eml_cap &
+                                    IEEE80211_EML_CAP_EMLSR_SUPP);
+       } else {
+               mld->eml_enable = 0;
+       }
 
        memcpy(mld->mac_addr, vif->addr, ETH_ALEN);
 }
index 32ed01a..454c6f5 100644 (file)
@@ -27,8 +27,9 @@
 
 #define MT792x_CHIP_CAP_CLC_EVT_EN BIT(0)
 #define MT792x_CHIP_CAP_RSSI_NOTIFY_EVT_EN BIT(1)
-#define MT792x_CHIP_CAP_MLO_EVT_EN BIT(2)
 #define MT792x_CHIP_CAP_WF_RF_PIN_CTRL_EVT_EN BIT(3)
+#define MT792x_CHIP_CAP_MLO_EN BIT(8)
+#define MT792x_CHIP_CAP_MLO_EML_EN BIT(9)
 
 /* NOTE: used to map mt76_rates. idx may change if firmware expands table */
 #define MT792x_BASIC_RATES_TBL 11