wifi: mt76: mt7925: adjust rm BSS flow to prevent next connection failure

Removing BSS without removing STAREC first will cause firmware
abnormal and next connection fail.

Fixes: f8797298565e ("wifi: mt76: mt7925: Cleanup MLO settings post-disconnection")
Cc: [email protected]
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Tested-by: Caleb Jorden <[email protected]>
Signed-off-by: Ming Yen Hsieh <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Ming Yen Hsieh
2025-03-10 13:07:19 +01:00
committed by Felix Fietkau
parent f54ff3caba
commit aa7d366ccf
+35 -9
View File
@@ -1155,7 +1155,12 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev,
struct mt792x_bss_conf *mconf;
mconf = mt792x_link_conf_to_mconf(link_conf);
mt792x_mac_link_bss_remove(dev, mconf, mlink);
if (ieee80211_vif_is_mld(vif))
mt792x_mac_link_bss_remove(dev, mconf, mlink);
else
mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, link_conf,
link_sta, false);
}
spin_lock_bh(&mdev->sta_poll_lock);
@@ -1175,6 +1180,31 @@ mt7925_mac_sta_remove_links(struct mt792x_dev *dev, struct ieee80211_vif *vif,
struct mt76_wcid *wcid;
unsigned int link_id;
/* clean up bss before starec */
for_each_set_bit(link_id, &old_links, IEEE80211_MLD_MAX_NUM_LINKS) {
struct ieee80211_link_sta *link_sta;
struct ieee80211_bss_conf *link_conf;
struct mt792x_bss_conf *mconf;
struct mt792x_link_sta *mlink;
link_sta = mt792x_sta_to_link_sta(vif, sta, link_id);
if (!link_sta)
continue;
mlink = mt792x_sta_to_link(msta, link_id);
if (!mlink)
continue;
link_conf = mt792x_vif_to_bss_conf(vif, link_id);
if (!link_conf)
continue;
mconf = mt792x_link_conf_to_mconf(link_conf);
mt7925_mcu_add_bss_info(&dev->phy, mconf->mt76.ctx, link_conf,
link_sta, false);
}
for_each_set_bit(link_id, &old_links, IEEE80211_MLD_MAX_NUM_LINKS) {
struct ieee80211_link_sta *link_sta;
struct mt792x_link_sta *mlink;
@@ -1242,14 +1272,10 @@ void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
mt7925_mac_sta_remove_links(dev, vif, sta, rem);
if (ieee80211_vif_is_mld(vif)) {
mt7925_mcu_set_dbdc(&dev->mphy, false);
/* recovery omac address for the legacy interface */
memcpy(dev_req.tlv.omac_addr, vif->addr, ETH_ALEN);
mt76_mcu_send_msg(mdev, MCU_UNI_CMD(DEV_INFO_UPDATE),
&dev_req, sizeof(dev_req), true);
}
/* recovery omac address for the legacy interface */
memcpy(dev_req.tlv.omac_addr, vif->addr, ETH_ALEN);
mt76_mcu_send_msg(mdev, MCU_UNI_CMD(DEV_INFO_UPDATE),
&dev_req, sizeof(dev_req), true);
if (vif->type == NL80211_IFTYPE_STATION) {
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;