diff mbox series

[18/31] wifi: mwifiex: make mwifiex_enable_hs() safe for multiple station mode

Message ID 20240820-mwifiex-cleanup-v1-18-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
We have to stop the bg scan for all bss in station mode, not only the
first one.

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

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
index d3cba6895f8ce..aa138cab7bea9 100644
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
@@ -507,9 +507,12 @@  int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
 		}
 	}
 
-	priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
+	for (i = 0; i < adapter->priv_num; i++) {
+		priv = adapter->priv[i];
+
+		if (!priv->sched_scanning)
+			continue;
 
-	if (priv && priv->sched_scanning) {
 #ifdef CONFIG_PM
 		if (priv->wdev.wiphy->wowlan_config &&
 		    !priv->wdev.wiphy->wowlan_config->nd_config) {