Patchwork [1/2] Skip scan if already scanning

login
register
mail settings
Submitter Dmitry Shmidt
Date Nov. 12, 2013, 8:40 p.m.
Message ID <20131112204351.8C23213FECA@ushik.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/290773/
State Superseded
Headers show

Comments

Dmitry Shmidt - Nov. 12, 2013, 8:40 p.m.
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
 wpa_supplicant/scan.c | 5 +++++
 1 file changed, 5 insertions(+)
Jouni Malinen - Nov. 18, 2013, 1:13 p.m.
On Tue, Nov 12, 2013 at 12:40:04PM -0800, Dmitry Shmidt wrote:

> diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
> @@ -567,6 +567,11 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
> +	if (wpa_s->scanning) {
> +		wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - already scanning");
> +		return;
> +	}
> +
>  	if (!wpa_supplicant_enabled_networks(wpa_s) &&

I had not really ever understood why this would be needed, but anyway, I
applied the PNO/sched_scan patch from Jithu and it obsoletes this by
handling wpa_s->scanning == 1 here in a more meaningful case with a
reschedule scan request. As such, I'm dropping this skip-scan patch.
Dmitry Shmidt - Nov. 18, 2013, 4:16 p.m.
On Mon, Nov 18, 2013 at 5:13 AM, Jouni Malinen <j@w1.fi> wrote:
> On Tue, Nov 12, 2013 at 12:40:04PM -0800, Dmitry Shmidt wrote:
>
>> diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
>> @@ -567,6 +567,11 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
>> +     if (wpa_s->scanning) {
>> +             wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - already scanning");
>> +             return;
>> +     }
>> +
>>       if (!wpa_supplicant_enabled_networks(wpa_s) &&
>
> I had not really ever understood why this would be needed, but anyway, I
> applied the PNO/sched_scan patch from Jithu and it obsoletes this by
> handling wpa_s->scanning == 1 here in a more meaningful case with a
> reschedule scan request. As such, I'm dropping this skip-scan patch.

Jithu's patch is much more generic, thanks !

>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP@lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap

Patch

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 019b86c..96c127b 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -567,6 +567,11 @@  static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
 		return;
 	}
 
+	if (wpa_s->scanning) {
+		wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - already scanning");
+		return;
+	}
+
 	if (!wpa_supplicant_enabled_networks(wpa_s) &&
 	    wpa_s->scan_req == NORMAL_SCAN_REQ) {
 		wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks - do not scan");