diff mbox series

wcn36xx: Set sw-scan chan to 0 when not associated

Message ID 20200731020157.744145-1-bryan.odonoghue@linaro.org (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series wcn36xx: Set sw-scan chan to 0 when not associated | expand

Commit Message

Bryan O'Donoghue July 31, 2020, 2:01 a.m. UTC
A patch in ath/pending rewrites the software scan for the wcn36xx to
accommodate multiplexing with data, link monitoring and so on.

However if a device disassociates from an AP then the last operating
channel will not be re-scanned.

After some discussion and testing on this topic

https://www.spinics.net/lists/linux-wireless/msg201242.html
https://www.spinics.net/lists/linux-wireless/msg201254.html

this patch implements a relatively simple fix. It sets the initial software
scan channel to 0 if we are not associated with an AP or to the current
operating channel if we are assciated with an AP.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Loic Poulain July 31, 2020, 2:11 p.m. UTC | #1
On Fri, 31 Jul 2020 at 04:01, Bryan O'Donoghue
<bryan.odonoghue@linaro.org> wrote:
>
> A patch in ath/pending rewrites the software scan for the wcn36xx to
> accommodate multiplexing with data, link monitoring and so on.
>
> However if a device disassociates from an AP then the last operating
> channel will not be re-scanned.
>
> After some discussion and testing on this topic
>
> https://www.spinics.net/lists/linux-wireless/msg201242.html
> https://www.spinics.net/lists/linux-wireless/msg201254.html
>
> this patch implements a relatively simple fix. It sets the initial software
> scan channel to 0 if we are not associated with an AP or to the current
> operating channel if we are assciated with an AP.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
>  drivers/net/wireless/ath/wcn36xx/main.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

That looks good to me, that will force regular scanning on all channels
when disconnected from AP.

Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index fb8978a3c11e..87fdc073c957 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -697,10 +697,14 @@  static void wcn36xx_sw_scan_start(struct ieee80211_hw *hw,
 				  const u8 *mac_addr)
 {
 	struct wcn36xx *wcn = hw->priv;
+	struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
 
 	wcn->sw_scan = true;
 	wcn->sw_scan_vif = vif;
-	wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn);
+	if (vif_priv->sta_assoc)
+		wcn->sw_scan_opchannel = WCN36XX_HW_CHANNEL(wcn);
+	else
+		wcn->sw_scan_opchannel = 0;
 }
 
 static void wcn36xx_sw_scan_complete(struct ieee80211_hw *hw,