[PATCH 1/3] wpa_supplicant: Add scan_interval

Dmitry Shmidt dimitrysh
Mon Mar 21 10:43:20 PDT 2011


Signed-off-by: Dmitry Shmidt <dimitrysh at google.com>
---
 wpa_supplicant/events.c           |    2 +-
 wpa_supplicant/wpa_supplicant.c   |    1 +
 wpa_supplicant/wpa_supplicant_i.h |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 813fc42..7e42ff6 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -953,7 +953,7 @@ static int
_wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
 			wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network");
 			wpa_supplicant_associate(wpa_s, NULL, ssid);
 		} else {
-			int timeout_sec =3D 5;
+			int timeout_sec =3D wpa_s->scan_interval;
 			int timeout_usec =3D 0;
 #ifdef CONFIG_P2P
 			if (wpa_s->p2p_in_provisioning) {
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplican=
t.c
index b34bf03..6a0a23b 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2062,6 +2062,7 @@ static struct wpa_supplicant * wpa_supplicant_alloc(v=
oid)
 	if (wpa_s =3D=3D NULL)
 		return NULL;
 	wpa_s->scan_req =3D 1;
+	wpa_s->scan_interval =3D 5;
 	wpa_s->new_connection =3D 1;
 	wpa_s->parent =3D wpa_s;

diff --git a/wpa_supplicant/wpa_supplicant_i.h
b/wpa_supplicant/wpa_supplicant_i.h
index 859a65b..32e1252 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -405,6 +405,7 @@ struct wpa_supplicant {
 		       * are no enabled networks in the configuration */
 	int scan_runs; /* number of scan runs since WPS was started */
 	int *next_scan_freqs;
+	int scan_interval; /* time in sec between scans to find suitable AP */

 	struct wpa_client_mlme mlme;
 	unsigned int drv_flags;
--=20
1.7.3.1



More information about the Hostap mailing list