diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-07-29 19:08:28 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2025-04-04 15:29:37 +0100 |
commit | 0b22643d97cc97267570bc5f144c1bfb12fe367f (patch) | |
tree | 97dc24b9e504750d2f69de44689cfef114b1be80 | |
parent | d5e7b9897fe649dc426b5808ead4e34d00583323 (diff) |
net: wlcore: clean up open BA sessions when removing STAwl18xx
When a peer is removed, it may have been moved out of range with open
BA sessions on the AP. Each open BA session consumes firmware resources
and if allowed to increase, will eventually cause the firmware to run
BA sessions. Not only does this impact firmware, but also the driver's
state tracking as well.
Fix this by ensuring that all BA sessions associated with a STA are
properly removed from the firmware and driver state just before the STA
is removed.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/net/wireless/ti/wlcore/main.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 0c9ef72291bb..441b2af4bda5 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -5144,6 +5144,25 @@ static int wl12xx_sta_remove(struct wl1271 *wl, if (WARN_ON(!test_bit(id, wlvif->ap.sta_hlid_map))) return -EINVAL; + if (wl->links[id].ba_bitmap) { + u8 ba = wl->links[id].ba_bitmap; + u8 tid; + + pr_info("WARNING: removing peer with active ba 0x%08x, count %u\n", + ba, wl->ba_rx_session_count); + + for (tid = 0; tid < 8; tid++) + if (ba & BIT(tid)) + wl12xx_acx_set_ba_receiver_session(wl, tid, 0, + false, id, 0); + if (wl->ba_rx_session_count >= hweight8(ba)) + wl->ba_rx_session_count -= hweight8(ba); + else + wl->ba_rx_session_count = 0; + + wl->links[id].ba_bitmap = 0; + } + ret = wl12xx_cmd_remove_peer(wl, wlvif, wl_sta->hlid); if (ret < 0) return ret; |