Skip to content

Commit 5a3353b

Browse files
LorenzoBianconigregkh
authored andcommitted
wifi: mt76: mt7996: Remove link pointer dependency in mt7996_mac_sta_remove_links()
[ Upstream commit 569ce43 ] 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: 344dd6a ("wifi: mt76: mt7996: Move num_sta accounting in mt7996_mac_sta_{add,remove}_links") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20260306-mt7996-deflink-lookup-link-remove-v1-1-7162b332873c@kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7da35e2 commit 5a3353b

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

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

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,7 @@ mt7996_mac_sta_remove_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
10471047

10481048
for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) {
10491049
struct mt7996_sta_link *msta_link = NULL;
1050-
struct mt7996_vif_link *link;
1051-
struct mt76_phy *mphy;
1050+
struct mt7996_phy *phy;
10521051

10531052
msta_link = rcu_replace_pointer(msta->link[link_id], msta_link,
10541053
lockdep_is_held(&mdev->mutex));
@@ -1057,17 +1056,12 @@ mt7996_mac_sta_remove_links(struct mt7996_dev *dev, struct ieee80211_vif *vif,
10571056

10581057
mt7996_mac_wtbl_update(dev, msta_link->wcid.idx,
10591058
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
1060-
10611059
mt7996_mac_sta_deinit_link(dev, msta_link);
1062-
link = mt7996_vif_link(dev, vif, link_id);
1063-
if (!link)
1064-
continue;
10651060

1066-
mphy = mt76_vif_link_phy(&link->mt76);
1067-
if (!mphy)
1068-
continue;
1061+
phy = __mt7996_phy(dev, msta_link->wcid.phy_idx);
1062+
if (phy)
1063+
phy->mt76->num_sta--;
10691064

1070-
mphy->num_sta--;
10711065
if (msta->deflink_id == link_id) {
10721066
msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
10731067
continue;

0 commit comments

Comments
 (0)