]> www.infradead.org Git - users/griffoul/linux.git/commitdiff
wifi: mt76: mt7925: skip EHT MLD TLV on non-MLD and pass conn_state for sta_cmd
authorMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Mon, 18 Aug 2025 03:02:01 +0000 (11:02 +0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 27 Aug 2025 09:03:55 +0000 (11:03 +0200)
Return early in mt7925_mcu_sta_eht_mld_tlv() for non-MLD vifs to avoid bogus
MLD TLVs, and pass the proper connection state to sta_basic TLV.

Cc: stable@vger.kernel.org
Fixes: cb1353ef3473 ("wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd")
Reported-by: Tal Inbar <inbartdev@gmail.com>
Tested-by: Tal Inbar <inbartdev@gmail.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250818030201.997940-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index 300c863f0e3e2017c3ad36dca57fadcda302a9b1..cd457be26523e61b37edf1fef3b585cc740fb42a 100644 (file)
@@ -1834,13 +1834,13 @@ mt7925_mcu_sta_eht_mld_tlv(struct sk_buff *skb,
        struct tlv *tlv;
        u16 eml_cap;
 
+       if (!ieee80211_vif_is_mld(vif))
+               return;
+
        tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_EHT_MLD, sizeof(*eht_mld));
        eht_mld = (struct sta_rec_eht_mld *)tlv;
        eht_mld->mld_type = 0xff;
 
-       if (!ieee80211_vif_is_mld(vif))
-               return;
-
        ext_capa = cfg80211_get_iftype_ext_capa(wiphy,
                                                ieee80211_vif_type_p2p(vif));
        if (!ext_capa)
@@ -1912,6 +1912,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
        struct mt76_dev *dev = phy->dev;
        struct mt792x_bss_conf *mconf;
        struct sk_buff *skb;
+       int conn_state;
 
        mconf = mt792x_vif_to_link(mvif, info->wcid->link_id);
 
@@ -1920,10 +1921,13 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
        if (IS_ERR(skb))
                return PTR_ERR(skb);
 
+       conn_state = info->enable ? CONN_STATE_PORT_SECURE :
+                                   CONN_STATE_DISCONNECT;
+
        if (info->enable && info->link_sta) {
                mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
                                              info->link_sta,
-                                             info->enable, info->newly);
+                                             conn_state, info->newly);
                mt7925_mcu_sta_phy_tlv(skb, info->vif, info->link_sta);
                mt7925_mcu_sta_ht_tlv(skb, info->link_sta);
                mt7925_mcu_sta_vht_tlv(skb, info->link_sta);