wifi: mt76: mt7996: Fix deflink lookup removing links

Do not set vif deflink in mt7996_vif_link_remove routine if the vif txq
pointer is NULL in order to not miss the mtxq wcid field update adding
a new link with a valid vif txq pointer.

Fixes: 2e6bdd40e1d01 ("wifi: mt76: mt7996: Reset mtxq->idx if primary link is removed in mt7996_vif_link_remove()")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/20260306-mt7996-deflink-lookup-link-remove-v1-2-7162b332873c@kernel.org
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2026-03-13 13:15:47 +00:00
committed by Felix Fietkau
parent 94017d560b
commit 754e3af4d1
+8 -8
View File
@@ -415,26 +415,26 @@ void mt7996_vif_link_remove(struct mt76_phy *mphy, struct ieee80211_vif *vif,
rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
if (!mlink->wcid->offchannel &&
if (vif->txq && !mlink->wcid->offchannel &&
mvif->mt76.deflink_id == link_conf->link_id) {
struct ieee80211_bss_conf *iter;
struct mt76_txq *mtxq;
unsigned int link_id;
/* Primary link will be removed, look for a new one */
mvif->mt76.deflink_id = IEEE80211_LINK_UNSPECIFIED;
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
/* Primary link will be removed, look for a new one */
for_each_vif_active_link(vif, iter, link_id) {
struct mt7996_vif_link *link;
if (link_id == link_conf->link_id)
continue;
link = mt7996_vif_link(dev, vif, link_id);
if (!link)
continue;
if (vif->txq) {
struct mt76_txq *mtxq;
mtxq = (struct mt76_txq *)vif->txq->drv_priv;
mtxq->wcid = link->msta_link.wcid.idx;
}
mtxq->wcid = link->msta_link.wcid.idx;
mvif->mt76.deflink_id = link_id;
break;
}