Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] wcn36xx: Set sw-scan chan to 0 when not associated
@ 2020-07-31  2:01 Bryan O'Donoghue
  2020-07-31 14:11 ` Loic Poulain
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan O'Donoghue @ 2020-07-31  2:01 UTC (permalink / raw)
  To: kvalo, loic.poulain; +Cc: wcn36xx, linux-wireless, bryan.odonoghue

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(-)

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,
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] wcn36xx: Set sw-scan chan to 0 when not associated
  2020-07-31  2:01 [PATCH] wcn36xx: Set sw-scan chan to 0 when not associated Bryan O'Donoghue
@ 2020-07-31 14:11 ` Loic Poulain
  0 siblings, 0 replies; 2+ messages in thread
From: Loic Poulain @ 2020-07-31 14:11 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: Kalle Valo, wcn36xx, linux-wireless

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  2:01 [PATCH] wcn36xx: Set sw-scan chan to 0 when not associated Bryan O'Donoghue
2020-07-31 14:11 ` Loic Poulain

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git