mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7925: move WCID teardown into link_sta_remove()
Move WCID teardown into mt7925_mac_link_sta_remove() to mirror the dev->mt76.wcid[] publish done during link add. This clears the published WCID before the rest of teardown, so WCID lookups no longer expose a link that is being removed. No functional change intended. Signed-off-by: Sean Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+8
-8
@@ -1151,12 +1151,14 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev,
|
|||||||
struct mt792x_link_sta *mlink)
|
struct mt792x_link_sta *mlink)
|
||||||
{
|
{
|
||||||
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
|
struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76);
|
||||||
|
struct mt76_wcid *wcid = &mlink->wcid;
|
||||||
struct ieee80211_bss_conf *link_conf;
|
struct ieee80211_bss_conf *link_conf;
|
||||||
u8 link_id = link_sta->link_id;
|
u8 link_id = link_sta->link_id;
|
||||||
|
u16 idx = wcid->idx;
|
||||||
|
|
||||||
mt7925_roc_abort_sync(dev);
|
mt7925_roc_abort_sync(dev);
|
||||||
|
|
||||||
mt76_connac_free_pending_tx_skbs(&dev->pm, &mlink->wcid);
|
mt76_connac_free_pending_tx_skbs(&dev->pm, wcid);
|
||||||
mt76_connac_pm_wake(&dev->mphy, &dev->pm);
|
mt76_connac_pm_wake(&dev->mphy, &dev->pm);
|
||||||
|
|
||||||
mt7925_mcu_sta_update(dev, link_sta, vif, mlink, false,
|
mt7925_mcu_sta_update(dev, link_sta, vif, mlink, false,
|
||||||
@@ -1183,6 +1185,10 @@ static void mt7925_mac_link_sta_remove(struct mt76_dev *mdev,
|
|||||||
list_del_init(&mlink->wcid.poll_list);
|
list_del_init(&mlink->wcid.poll_list);
|
||||||
spin_unlock_bh(&mdev->sta_poll_lock);
|
spin_unlock_bh(&mdev->sta_poll_lock);
|
||||||
|
|
||||||
|
rcu_assign_pointer(dev->mt76.wcid[idx], NULL);
|
||||||
|
mt76_wcid_cleanup(mdev, wcid);
|
||||||
|
mt76_wcid_mask_clear(mdev->wcid_mask, idx);
|
||||||
|
|
||||||
mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
|
mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1191,8 +1197,6 @@ mt7925_mac_sta_remove_links(struct mt792x_dev *dev, struct ieee80211_vif *vif,
|
|||||||
struct ieee80211_sta *sta, unsigned long old_links)
|
struct ieee80211_sta *sta, unsigned long old_links)
|
||||||
{
|
{
|
||||||
struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
|
struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv;
|
||||||
struct mt76_dev *mdev = &dev->mt76;
|
|
||||||
struct mt76_wcid *wcid;
|
|
||||||
unsigned int link_id;
|
unsigned int link_id;
|
||||||
|
|
||||||
/* clean up bss before starec */
|
/* clean up bss before starec */
|
||||||
@@ -1235,16 +1239,12 @@ mt7925_mac_sta_remove_links(struct mt792x_dev *dev, struct ieee80211_vif *vif,
|
|||||||
if (!mlink)
|
if (!mlink)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mt7925_mac_link_sta_remove(&dev->mt76, vif, link_sta, mlink);
|
|
||||||
|
|
||||||
wcid = &mlink->wcid;
|
|
||||||
rcu_assign_pointer(msta->link[link_id], NULL);
|
rcu_assign_pointer(msta->link[link_id], NULL);
|
||||||
msta->valid_links &= ~BIT(link_id);
|
msta->valid_links &= ~BIT(link_id);
|
||||||
mlink->sta = NULL;
|
mlink->sta = NULL;
|
||||||
mlink->pri_link = NULL;
|
mlink->pri_link = NULL;
|
||||||
|
|
||||||
mt76_wcid_cleanup(mdev, wcid);
|
mt7925_mac_link_sta_remove(&dev->mt76, vif, link_sta, mlink);
|
||||||
mt76_wcid_mask_clear(mdev->wcid_mask, wcid->idx);
|
|
||||||
|
|
||||||
if (msta->deflink_id == link_id)
|
if (msta->deflink_id == link_id)
|
||||||
msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
|
msta->deflink_id = IEEE80211_LINK_UNSPECIFIED;
|
||||||
|
|||||||
Reference in New Issue
Block a user