diff mbox series

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

Message ID 20200731020157.744145-1-bryan.odonoghue@linaro.org
State New
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(-)

-- 
2.27.0

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>
Kalle Valo Aug. 15, 2020, 7:51 a.m. UTC | #2
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>

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


This doesn't apply, most likely due to a patch in the pending branch I
dropped. Please ath.git master branch as the baseline for wcn36xx
patches.

error: patch failed: drivers/net/wireless/ath/wcn36xx/main.c:697
error: drivers/net/wireless/ath/wcn36xx/main.c: patch does not apply
stg import: Diff does not apply cleanly

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/patch/11693885/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
wcn36xx mailing list
wcn36xx@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/wcn36xx
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,