diff options
author | Sean Wang <sean.wang@mediatek.com> | 2024-06-12 20:02:40 -0700 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2024-07-09 23:01:59 +0200 |
commit | 1541d63c5fe2cebce85b2af84a2850a302ffda9c (patch) | |
tree | 3c9a760043fb162403d80b576c74d44abcd61764 | |
parent | 95977b1d10cfeb12b67a76dc2eefa86300c396d1 (diff) | |
download | linux-stable-1541d63c5fe2cebce85b2af84a2850a302ffda9c.tar.gz linux-stable-1541d63c5fe2cebce85b2af84a2850a302ffda9c.tar.bz2 linux-stable-1541d63c5fe2cebce85b2af84a2850a302ffda9c.zip |
wifi: mt76: mt7925: add mt7925_mac_link_bss_remove to remove per-link BSS
The mt7925_mac_link_bss_remove function currently removes the per-link BSS.
We will extend this function when we implement the MLO functionality.
This patch only includes structural changes and does not involve any
logic changes.
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20240613030241.5771-47-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt792x_core.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_core.c b/drivers/net/wireless/mediatek/mt76/mt792x_core.c index b1c51e3f39d0..813296fad0ed 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x_core.c +++ b/drivers/net/wireless/mediatek/mt76/mt792x_core.c @@ -113,31 +113,38 @@ void mt792x_stop(struct ieee80211_hw *hw, bool suspend) } EXPORT_SYMBOL_GPL(mt792x_stop); -void mt792x_remove_interface(struct ieee80211_hw *hw, - struct ieee80211_vif *vif) +static void mt792x_mac_link_bss_remove(struct mt792x_dev *dev, + struct ieee80211_bss_conf *link_conf, + struct mt792x_link_sta *mlink) { - struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; - struct mt792x_sta *msta = &mvif->sta; - struct mt792x_dev *dev = mt792x_hw_dev(hw); - struct mt792x_phy *phy = mt792x_hw_phy(hw); - int idx = msta->deflink.wcid.idx; + struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf); + int idx = mlink->wcid.idx; mt792x_mutex_acquire(dev); - mt76_connac_free_pending_tx_skbs(&dev->pm, &msta->deflink.wcid); - mt76_connac_mcu_uni_add_dev(&dev->mphy, &vif->bss_conf, &mvif->sta.deflink.wcid, false); + mt76_connac_free_pending_tx_skbs(&dev->pm, &mlink->wcid); + mt76_connac_mcu_uni_add_dev(&dev->mphy, link_conf, &mlink->wcid, false); rcu_assign_pointer(dev->mt76.wcid[idx], NULL); - dev->mt76.vif_mask &= ~BIT_ULL(mvif->bss_conf.mt76.idx); - phy->omac_mask &= ~BIT_ULL(mvif->bss_conf.mt76.omac_idx); + dev->mt76.vif_mask &= ~BIT_ULL(mconf->mt76.idx); + mconf->vif->phy->omac_mask &= ~BIT_ULL(mconf->mt76.omac_idx); mt792x_mutex_release(dev); spin_lock_bh(&dev->mt76.sta_poll_lock); - if (!list_empty(&msta->deflink.wcid.poll_list)) - list_del_init(&msta->deflink.wcid.poll_list); + if (!list_empty(&mlink->wcid.poll_list)) + list_del_init(&mlink->wcid.poll_list); spin_unlock_bh(&dev->mt76.sta_poll_lock); - mt76_wcid_cleanup(&dev->mt76, &msta->deflink.wcid); + mt76_wcid_cleanup(&dev->mt76, &mlink->wcid); +} + +void mt792x_remove_interface(struct ieee80211_hw *hw, + struct ieee80211_vif *vif) +{ + struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; + struct mt792x_dev *dev = mt792x_hw_dev(hw); + + mt792x_mac_link_bss_remove(dev, &vif->bss_conf, &mvif->sta.deflink); } EXPORT_SYMBOL_GPL(mt792x_remove_interface); |