]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mt76: mt7925: add MBSSID support
authorMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Tue, 29 Jul 2025 08:49:32 +0000 (16:49 +0800)
committerFelix Fietkau <nbd@nbd.name>
Mon, 15 Sep 2025 07:47:38 +0000 (09:47 +0200)
Enable MBSSID support for MT7925 by setting the
appropriate capability to the firmware.

Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250729084932.264155-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_core.c

index b0e053b15227396cc1334455f6164a5bc4756fe2..c7903972b1d595c650bf49753fb88010fd0d36eb 100644 (file)
@@ -240,6 +240,7 @@ int mt7925_init_mlo_caps(struct mt792x_phy *phy)
 {
        struct wiphy *wiphy = phy->mt76->hw->wiphy;
        static const u8 ext_capa_sta[] = {
+               [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
                [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
        };
        static struct wiphy_iftype_ext_capab ext_capab[] = {
index cd457be26523e61b37edf1fef3b585cc740fb42a..10d68d241ba1f04e85f692b5a46bdad525ccad05 100644 (file)
@@ -2621,6 +2621,25 @@ mt7925_mcu_bss_qos_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf
        qos->qos = link_conf->qos;
 }
 
+static void
+mt7925_mcu_bss_mbssid_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf,
+                         bool enable)
+{
+       struct bss_info_uni_mbssid *mbssid;
+       struct tlv *tlv;
+
+       if (!enable && !link_conf->bssid_indicator)
+               return;
+
+       tlv = mt76_connac_mcu_add_tlv(skb, UNI_BSS_INFO_11V_MBSSID,
+                                     sizeof(*mbssid));
+
+       mbssid = (struct bss_info_uni_mbssid *)tlv;
+       mbssid->max_indicator = link_conf->bssid_indicator;
+       mbssid->mbss_idx = link_conf->bssid_index;
+       mbssid->tx_bss_omac_idx = 0;
+}
+
 static void
 mt7925_mcu_bss_he_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf,
                      struct mt792x_phy *phy)
@@ -2787,8 +2806,10 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
                mt7925_mcu_bss_color_tlv(skb, link_conf, enable);
        }
 
-       if (enable)
+       if (enable) {
                mt7925_mcu_bss_rlm_tlv(skb, phy->mt76, link_conf, ctx);
+               mt7925_mcu_bss_mbssid_tlv(skb, link_conf, enable);
+       }
 
        return mt76_mcu_skb_send_msg(&dev->mt76, skb,
                                     MCU_UNI_CMD(BSS_INFO_UPDATE), true);
index e3a703398b30c2e55711ad7d95fff149695136e4..44378f7394e8dbc677b1366faa8fa5ce2eb72d99 100644 (file)
@@ -689,8 +689,13 @@ int mt792x_init_wiphy(struct ieee80211_hw *hw)
        ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
        ieee80211_hw_set(hw, CONNECTION_MONITOR);
        ieee80211_hw_set(hw, NO_VIRTUAL_MONITOR);
-       if (is_mt7921(&dev->mt76))
+
+       if (is_mt7921(&dev->mt76)) {
                ieee80211_hw_set(hw, CHANCTX_STA_CSA);
+       } else {
+               ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
+               ieee80211_hw_set(hw, SUPPORTS_ONLY_HE_MULTI_BSSID);
+       }
 
        if (dev->pm.enable)
                ieee80211_hw_set(hw, CONNECTION_MONITOR);