aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-12-26 15:35:48 (GMT)
committerJouni Malinen <j@w1.fi>2013-12-26 16:48:52 (GMT)
commitd81c73be18403f0c69d0c0ae4b26cf2c94807c8a (patch)
treefbc734a09b6c6f18d2fbb2e972ab751750bb0642 /wpa_supplicant/events.c
parenta5f40eff189d7f939f6434455ee63554ddb3c3ae (diff)
downloadhostap-d81c73be18403f0c69d0c0ae4b26cf2c94807c8a.zip
hostap-d81c73be18403f0c69d0c0ae4b26cf2c94807c8a.tar.gz
hostap-d81c73be18403f0c69d0c0ae4b26cf2c94807c8a.tar.bz2
Optional scan id for ctrl_iface SCAN requests
This allows users of wpa_supplicant control interface to figure out when their specific scan command has been started and completed. For example: CTRL-EVENT-SCAN-STARTED > scan freq=2412,2417 passive=1 use_id=1 3 CTRL-EVENT-SCAN-RESULTS CTRL-EVENT-SCAN-STARTED id=3 CTRL-EVENT-SCAN-RESULTS id=3 Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 740309d..d234d09 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1267,7 +1267,14 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
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);
+ if (wpa_s->last_scan_req == MANUAL_SCAN_REQ &&
+ wpa_s->manual_scan_use_id && wpa_s->own_scan_running) {
+ wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS "id=%u",
+ wpa_s->manual_scan_id);
+ wpa_s->manual_scan_use_id = 0;
+ } else {
+ wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS);
+ }
wpas_notify_scan_results(wpa_s);
wpas_notify_scan_done(wpa_s, 1);
@@ -2742,7 +2749,13 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
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);
+ if (wpa_s->last_scan_req == MANUAL_SCAN_REQ &&
+ wpa_s->manual_scan_use_id) {
+ wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_SCAN_STARTED "id=%u",
+ wpa_s->manual_scan_id);
+ } else {
+ 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;