Skip to content

Commit 575bc4f

Browse files
LorenzoBianconigregkh
authored andcommitted
wifi: mt76: mt7996: Decrement sta counter removing the link in mt7996_mac_reset_sta_iter()
[ Upstream commit e648051 ] Fixes tracking per-phy stations for offchannel switching. Fixes: ace5d3b ("wifi: mt76: mt7996: improve hardware restart reliability") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20260308-mt7996_mac_reset_vif_iter-fix-v1-1-57f640aa2dcf@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ed66bd2 commit 575bc4f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • drivers/net/wireless/mediatek/mt76/mt7996

drivers/net/wireless/mediatek/mt76/mt7996/mac.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,13 +2400,18 @@ mt7996_mac_reset_sta_iter(void *data, struct ieee80211_sta *sta)
24002400

24012401
for (i = 0; i < ARRAY_SIZE(msta->link); i++) {
24022402
struct mt7996_sta_link *msta_link = NULL;
2403+
struct mt7996_phy *phy;
24032404

24042405
msta_link = rcu_replace_pointer(msta->link[i], msta_link,
24052406
lockdep_is_held(&dev->mt76.mutex));
24062407
if (!msta_link)
24072408
continue;
24082409

24092410
mt7996_mac_sta_deinit_link(dev, msta_link);
2411+
phy = __mt7996_phy(dev, msta_link->wcid.phy_idx);
2412+
if (phy)
2413+
phy->mt76->num_sta--;
2414+
24102415
if (msta_link != &msta->deflink)
24112416
kfree_rcu(msta_link, rcu_head);
24122417
}

0 commit comments

Comments
 (0)