aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-12-26 15:33:26 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-26 16:27:48 (GMT)
commita5f40eff189d7f939f6434455ee63554ddb3c3ae (patch)
tree04001f2d8c1ab273d7c85841b9551e8b2a6ca617 /wpa_supplicant/events.c
parent18ae237783736feed235497c2269f59e7bc88f0d (diff)
downloadhostap-a5f40eff189d7f939f6434455ee63554ddb3c3ae.zip
hostap-a5f40eff189d7f939f6434455ee63554ddb3c3ae.tar.gz
hostap-a5f40eff189d7f939f6434455ee63554ddb3c3ae.tar.bz2
Track whether scan was started by us or an external program
This can be used to improve scan behavior in cases external programs request scans directly from the driver. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index eeb27e3..740309d 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1265,7 +1265,8 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
return 0;
}
- wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available");
+ wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available (own=%u ext=%u)",
+ wpa_s->own_scan_running, wpa_s->external_scan_running);
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
wpas_notify_scan_results(wpa_s);
@@ -2736,8 +2737,22 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
wpa_supplicant_event_michael_mic_failure(wpa_s, data);
break;
#ifndef CONFIG_NO_SCAN_PROCESSING
+ case EVENT_SCAN_STARTED:
+ if (wpa_s->own_scan_requested) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "Own scan request started a scan");
+ wpa_s->own_scan_requested = 0;
+ wpa_s->own_scan_running = 1;
+ wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_STARTED);
+ } else {
+ wpa_dbg(wpa_s, MSG_DEBUG, "External program started a scan");
+ wpa_s->external_scan_running = 1;
+ wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_STARTED);
+ }
+ break;
case EVENT_SCAN_RESULTS:
wpa_supplicant_event_scan_results(wpa_s, data);
+ wpa_s->own_scan_running = 0;
+ wpa_s->external_scan_running = 0;
if (wpa_s->wpa_state != WPA_AUTHENTICATING &&
wpa_s->wpa_state != WPA_ASSOCIATING)
wpas_p2p_continue_after_scan(wpa_s);