[RFC] wpa_supplicant: set prev_sched_ssid only if needed

Submitted by Spinadel, David on Nov. 5, 2012, 9:45 a.m.

Details

Message ID F781B6216F70FE49AB7B89F25E2F80C0BF1354@HASMSX152.ger.corp.intel.com
State Superseded
Headers show

Commit Message

Spinadel, David Nov. 5, 2012, 9:45 a.m.
Hi,

There are probably whitespaces problems, sorry. If you want this patch, I will find a way to send it without redundant things.


From 119a7496fa0e223adfd17456d1212f7099a55643 Mon Sep 17 00:00:00 2001
From: David Spinadel <david.spinadel@intel.com>
Date: Mon, 5 Nov 2012 09:46:14 +0200
Subject: [PATCH] wpa_supplicant: set prev_sched_ssid only if needed

Set prev_sched_ssid only in case that there is no room
for another ssid, and there is at least one more ssid to scan.
Otherwise, when enabling or adding a new network during
scheduled scan, it will start the next iteration from the
last sched ssid, and won't scan for all networks.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
---
 wpa_supplicant/scan.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

--
1.7.1

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Comments

Spinadel, David Nov. 5, 2012, 9:59 a.m.
if (wildcard) {
@@ -929,11 +928,12 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
                                          (wpas_network_disabled(wpa_s, ssid) ||
                                           !ssid->scan_ssid));
                                 break;
+                               if (!ssid)
+                                       wpa_s->prev_sched_ssid = NULL;
                         }
                 }


Well, these two lines should be before the break...

David
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Patch hide | download patch | download mbox

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index df663bc..38af84c 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -880,7 +880,6 @@  int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
                wpa_s->sched_scan_timeout = max_sched_scan_ssids * 2;
                wpa_s->first_sched_scan = 1;
                ssid = wpa_s->conf->ssid;
-               wpa_s->prev_sched_ssid = ssid;
        }

        if (wildcard) {
@@ -929,11 +928,12 @@  int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
                                         (wpas_network_disabled(wpa_s, ssid) ||
                                          !ssid->scan_ssid));
                                break;
+                               if (!ssid)
+                                       wpa_s->prev_sched_ssid = NULL;
                        }
                }

        next:
-               wpa_s->prev_sched_ssid = ssid;
                ssid = ssid->next;
        }