aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
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
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')
-rw-r--r--wpa_supplicant/p2p_supplicant.c5
-rw-r--r--wpa_supplicant/scan.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index 2cd2e8e..76f50c7 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -5346,12 +5346,7 @@ unsigned int wpas_p2p_search_delay(struct wpa_supplicant *wpa_s)
rn2 = ifs->driver->get_radio_name(ifs->drv_priv);
if (!rn2 || os_strcmp(rn, rn2) != 0)
continue;
-#ifdef ANDROID_P2P
- /* We need not delay the p2p_scan if STA is already connected */
- if (ifs->wpa_state > WPA_SCANNING && ifs->wpa_state < WPA_COMPLETED) {
-#else
if (ifs->wpa_state > WPA_SCANNING) {
-#endif
wpa_dbg(wpa_s, MSG_DEBUG, "P2P: Use %u ms search "
"delay due to concurrent operation on "
"interface %s",
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");