Skip to contentSkip to conversation

wifi: mt76: mt7996: send no MLD group in a non-MLD link operation

PATCH New Piotr Kubik 1 participant 1 message Oct 20

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: mt76: mt7996: send no MLD group in a non-MLD link operation

The driver keeps the link of an AP after the AP stops, and it sends the link operation again when the AP starts. The command carries the MLD group and the remap index of the vif. Only an MLD vif gets these indexes, so a non-MLD AP sends 0 for both. When an MLD on the same device holds group 0 and remap 0, for example the station MLD of a repeater, the firmware takes the address of the AP for that MLD. The station then sends its data with the BSSID of the AP as transmitter address, and its AP drops the station for inactivity.

Send 0xff for both indexes for a non-MLD vif, as the BSS MLD TLV of mt7996_mcu_add_bss_info() already does.

Fixes e7ec71d9f8fa ("wifi: mt76: mt7996: Add mcu APIs to enable/disable vif links.")
---
 drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +7 -2
index cd7587c..c0b467f 100644
@@ -2701,8 +2701,13 @@ int mt7996_mcu_mld_link_oper(struct mt7996_dev *dev,
 	mld_op->link_operation = add;
 	mld_op->own_mld_id = link->mld_idx;
 	mld_op->link_id = link_conf->link_id;
-	mld_op->group_mld_id = add ? mvif->mld_group_idx : 0xff;
-	mld_op->remap_idx = add ? mvif->mld_remap_idx : 0xff;
+	if (add && ieee80211_vif_is_mld(vif)) {
+		mld_op->group_mld_id = mvif->mld_group_idx;
+		mld_op->remap_idx = mvif->mld_remap_idx;
+	} else {
+		mld_op->group_mld_id = 0xff;
+		mld_op->remap_idx = 0xff;
+	}
 	memcpy(mld_op->mac_addr, vif->addr, ETH_ALEN);
 
 	return mt76_mcu_skb_send_msg(&dev->mt76, skb,