diff options
| author | Kanchanapally, Vidyullatha <vkanchan@qti.qualcomm.com> | 2015-10-19 19:30:34 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-02-09 06:22:54 -0800 |
| commit | a3c2d12aadd5f90104dc04b3e2db1d246d578444 (patch) | |
| tree | 6b8a640669bbc74f044bd9a5acd4384bde7ee033 /wpa_supplicant | |
| parent | 1af6f718b5a2ff6cd72663c955b1057a4f53db83 (diff) | |
| download | android_external_wpa_supplicant_8-a3c2d12aadd5f90104dc04b3e2db1d246d578444.tar.gz android_external_wpa_supplicant_8-a3c2d12aadd5f90104dc04b3e2db1d246d578444.tar.bz2 android_external_wpa_supplicant_8-a3c2d12aadd5f90104dc04b3e2db1d246d578444.zip | |
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>
Git-commit: 4ead7cfd5d7dfe2f80ffe5b744291b2e149321eb
Git-repo : git://w1.fi/srv/git/hostap.git
Change-Id: I51d1ea7ba07585d103db88fb9f4819e55c462cfb
CRs-fixed: 930855
Diffstat (limited to 'wpa_supplicant')
| -rw-r--r-- | wpa_supplicant/scan.c | 11 | ||||
| -rw-r--r-- | wpa_supplicant/scan.h | 1 | ||||
| -rw-r--r-- | wpa_supplicant/sme.c | 2 | ||||
| -rw-r--r-- | wpa_supplicant/wpa_supplicant.c | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 00d2b5e1..58b6561d 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -2459,3 +2459,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 7650f5a2..0f1c8e49 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 54bb6c94..39965de0 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 3cd183ec..c57fe492 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -1694,6 +1694,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; |
