diff mbox

[1/2] Skip scan if already scanning

Message ID 20131112204351.8C23213FECA@ushik.mtv.corp.google.com
State Superseded
Headers show

Commit Message

Dmitry Shmidt Nov. 12, 2013, 8:40 p.m. UTC
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
 wpa_supplicant/scan.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Jouni Malinen Nov. 18, 2013, 1:13 p.m. UTC | #1
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. UTC | #2
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
diff mbox

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");