Commit dd6e89ca authored by Ming Yen Hsieh's avatar Ming Yen Hsieh Committed by Felix Fietkau
Browse files

wifi: mt76: mt7925: skip EHT MLD TLV on non-MLD and pass conn_state for sta_cmd



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: cb1353ef ("wifi: mt76: mt7925: integrate *mlo_sta_cmd and *sta_cmd")
Reported-by: default avatarTal Inbar <inbartdev@gmail.com>
Tested-by: default avatarTal Inbar <inbartdev@gmail.com>
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20250818030201.997940-1-mingyen.hsieh@mediatek.com


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent c22769de
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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);