aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanchanapally, Vidyullatha <vkanchan@qti.qualcomm.com>2015-10-19 14:00:34 (GMT)
committerJouni Malinen <j@w1.fi>2015-11-26 17:44:14 (GMT)
commit4ead7cfd5d7dfe2f80ffe5b744291b2e149321eb (patch)
treef7ce01a9905f4afbf2feb3cfefb8bac7a833d117
parent4f30addb3866a8bb9393c1cfd42e012150c36a8e (diff)
downloadhostap-4ead7cfd5d7dfe2f80ffe5b744291b2e149321eb.zip
hostap-4ead7cfd5d7dfe2f80ffe5b744291b2e149321eb.tar.gz
hostap-4ead7cfd5d7dfe2f80ffe5b744291b2e149321eb.tar.bz2
Abort an ongoing scan before connect
Connect radio work is sometimes delayed for a considerable duration if there is an ongoing scan radio work. To avoid these delays abort the ongoing scan on that interface before queuing a connect request. Upon a scan done indication from the driver, connect radio work will be scheduled. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--wpa_supplicant/scan.c11
-rw-r--r--wpa_supplicant/scan.h1
-rw-r--r--wpa_supplicant/sme.c2
-rw-r--r--wpa_supplicant/wpa_supplicant.c2
4 files changed, 16 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 076766e..a39922f 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -2465,3 +2465,14 @@ int wpas_mac_addr_rand_scan_set(struct wpa_supplicant *wpa_s,
wpa_s->mac_addr_rand_enable |= type;
return 0;
}
+
+
+int wpas_abort_ongoing_scan(struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->scan_work && wpa_s->own_scan_running) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "Abort an ongoing scan");
+ return wpa_drv_abort_scan(wpa_s);
+ }
+
+ return 0;
+}
diff --git a/wpa_supplicant/scan.h b/wpa_supplicant/scan.h
index 7650f5a..0f1c8e4 100644
--- a/wpa_supplicant/scan.h
+++ b/wpa_supplicant/scan.h
@@ -54,5 +54,6 @@ void wpas_mac_addr_rand_scan_clear(struct wpa_supplicant *wpa_s,
int wpas_mac_addr_rand_scan_set(struct wpa_supplicant *wpa_s,
unsigned int type, const u8 *addr,
const u8 *mask);
+int wpas_abort_ongoing_scan(struct wpa_supplicant *wpa_s);
#endif /* SCAN_H */
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index f2e5a43..2a3a728 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -632,6 +632,8 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
radio_remove_works(wpa_s, "sme-connect", 0);
}
+ wpas_abort_ongoing_scan(wpa_s);
+
cwork = os_zalloc(sizeof(*cwork));
if (cwork == NULL)
return;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 920c281..94b5eff 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1706,6 +1706,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
return;
}
+ wpas_abort_ongoing_scan(wpa_s);
+
cwork = os_zalloc(sizeof(*cwork));
if (cwork == NULL)
return;