diff mbox series

[14/31] wifi: mwifiex: iterate over privs in mwifiex_process_assoc_resp()

Message ID 20240820-mwifiex-cleanup-v1-14-320d8de4a4b7@pengutronix.de
State New
Headers show
Series wifi: mwifiex: cleanup driver | expand

Commit Message

Sascha Hauer Aug. 20, 2024, 11:55 a.m. UTC
mwifiex_process_assoc_resp() only checks the first bss in station
mode for having an assoc response. This breaks when there are multiple
bss in station mode, in that case we have to check all of them for
having an assoc response. Do this by iterating over the available
bss.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/wireless/marvell/mwifiex/cmdevt.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
index d91351384c6bb..c515887cc0623 100644
--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
@@ -921,10 +921,15 @@  void mwifiex_process_assoc_resp(struct mwifiex_adapter *adapter)
 	struct cfg80211_rx_assoc_resp_data assoc_resp = {
 		.uapsd_queues = -1,
 	};
-	struct mwifiex_private *priv =
-		mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
+	struct mwifiex_private *priv;
+	int i;
+
+	for (i = 0; i < adapter->priv_num; i++) {
+		priv = adapter->priv[i];
+
+		if (!priv->assoc_rsp_size)
+			continue;
 
-	if (priv->assoc_rsp_size) {
 		assoc_resp.links[0].bss = priv->req_bss;
 		assoc_resp.buf = priv->assoc_rsp_buf;
 		assoc_resp.len = priv->assoc_rsp_size;