diff options
author | Felix Fietkau <nbd@nbd.name> | 2024-08-27 12:29:55 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2024-09-06 15:23:06 +0300 |
commit | f3049b88b2b32326df97461813ae73e8bbc296fc (patch) | |
tree | b27220054f625cb6fdad7a1a8ad57d713fdb4e7e /drivers/net/wireless/mediatek | |
parent | 256cbd26fbafb30ba3314339106e5c594e9bd5f9 (diff) | |
download | linux-f3049b88b2b32326df97461813ae73e8bbc296fc.tar.xz |
wifi: mt76: mt7915: allocate vif wcid in the same range as stations
Reduces the amount of unnecessary WTBL bank switching, while still reserving
WTBL entries for vifs.
Link: https://patch.msgid.link/20240827093011.18621-8-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index 87a7b1589af2..a89674d6b602 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -245,7 +245,9 @@ static int mt7915_add_interface(struct ieee80211_hw *hw, dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx); phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); - idx = MT7915_WTBL_RESERVED - mvif->mt76.idx; + idx = mt76_wcid_alloc(dev->mt76.wcid_mask, mt7915_wtbl_size(dev)); + if (idx < 0) + return -ENOSPC; INIT_LIST_HEAD(&mvif->sta.rc_list); INIT_LIST_HEAD(&mvif->sta.wcid.poll_list); @@ -292,6 +294,7 @@ static void mt7915_remove_interface(struct ieee80211_hw *hw, mt7915_mcu_add_bss_info(phy, vif, false); mt7915_mcu_add_sta(dev, vif, NULL, false); + mt76_wcid_mask_clear(dev->mt76.wcid_mask, mvif->sta.wcid.idx); mutex_lock(&dev->mt76.mutex); mt76_testmode_reset(phy->mt76, true); |