aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/scan.c
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2012-09-14 10:47:43 -0700
committerDmitry Shmidt <dimitrysh@google.com>2012-09-14 10:47:43 -0700
commit5887a9d552f3d9d612011daba073e076daab5b2a (patch)
tree590ba43d6ffed95d57df9b3695a3e2b1ab75a8c2 /wpa_supplicant/scan.c
parent9bce59c7fef20e34a05f04d1e33a4076083dca0c (diff)
downloadexternal_wpa_supplicant_8-5887a9d552f3d9d612011daba073e076daab5b2a.zip
external_wpa_supplicant_8-5887a9d552f3d9d612011daba073e076daab5b2a.tar.gz
external_wpa_supplicant_8-5887a9d552f3d9d612011daba073e076daab5b2a.tar.bz2
wpa_supplicant: Skip unnecessary scan attempts
Change-Id: Ieea8843c0fcb063dbb1df56e5cdf3fbdd0590cd4 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wpa_supplicant/scan.c')
-rw-r--r--wpa_supplicant/scan.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index f088da1..8c548b3 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -453,7 +453,13 @@ static void wpa_supplicant_scan(void *eloop_ctx, void *timeout_ctx)
wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
return;
}
-
+#ifdef ANDROID
+ if (wpa_s->scanning) {
+ /* If we are already in scanning state, we shall ignore this new scan request*/
+ wpa_dbg(wpa_s, MSG_DEBUG, "Skip scan - already scanning");
+ return;
+ }
+#endif
if (!wpa_supplicant_enabled_networks(wpa_s) &&
!wpa_s->scan_req) {
wpa_dbg(wpa_s, MSG_DEBUG, "No enabled networks - do not scan");