wifi: mt76: mt7996: Remove link pointer dependency in mt7996_mac_sta_remove_links()

Remove link pointer dependency in mt7996_mac_sta_remove_links routine to
get the mt7996_phy pointer since the link can be already offchannel
running mt7996_mac_sta_remove_links(). Rely on __mt7996_phy routine
instead.

Fixes: 344dd6a4c919 ("wifi: mt76: mt7996: Move num_sta accounting in mt7996_mac_sta_{add,remove}_links")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Link: https://patch.msgid.link/20260306-mt7996-deflink-lookup-link-remove-v1-1-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 d2b1e1aa8e
commit 94017d560b
+4 -10
View File
@@ -1130,8 +1130,7 @@ mt7996_mac_sta_remove_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
struct mt7996_sta_link *msta_link = NULL;
struct mt7996_vif_link *link;
struct mt76_phy *mphy;
struct mt7996_phy *phy;
msta_link = rcu_replace_pointer(msta->link[link_id], msta_link,
lockdep_is_held(&mdev->mutex));
@@ -1140,17 +1139,12 @@ mt7996_mac_sta_remove_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
mt7996_mac_wtbl_update(dev, msta_link->wcid.idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
mt7996_mac_sta_deinit_link(dev, msta_link);
link = mt7996_vif_link(dev, vif, link_id);
if (!link)
continue;
mphy = mt76_vif_link_phy(&link->mt76);
if (!mphy)
continue;
phy = __mt7996_phy(dev, msta_link->wcid.phy_idx);
if (phy)
phy->mt76->num_sta--;
mphy->num_sta--;
if (msta->deflink_id == link_id) {
if (msta->seclink_id == msta->deflink_id) {
/* no secondary link available */