aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers.c
diff options
context:
space:
mode:
authorAvraham Stern <avraham.stern@intel.com>2015-04-28 11:01:03 (GMT)
committerJouni Malinen <j@w1.fi>2015-05-03 14:34:54 (GMT)
commita5da657445147914cd9119a015d9fcd4665285ea (patch)
tree4cc4451a3ec0b2b7ab5a2fd68ff3c4fc708c476f /wpa_supplicant/dbus/dbus_new_handlers.c
parent0c28071872242d1acaaf18034ea39b0635fe604a (diff)
downloadhostap-a5da657445147914cd9119a015d9fcd4665285ea.zip
hostap-a5da657445147914cd9119a015d9fcd4665285ea.tar.gz
hostap-a5da657445147914cd9119a015d9fcd4665285ea.tar.bz2
dbus: Stop ongoing scheduled scan when scan is requested
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 3f5fd0a..97db9a8 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1332,14 +1332,25 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
message,
"You can specify only Channels in passive scan");
goto out;
- } else if (params.freqs && params.freqs[0]) {
- if (wpa_supplicant_trigger_scan(wpa_s, &params)) {
- reply = wpas_dbus_error_scan_error(
- message, "Scan request rejected");
- }
} else {
- wpa_s->scan_req = MANUAL_SCAN_REQ;
- wpa_supplicant_req_scan(wpa_s, 0, 0);
+ if (wpa_s->sched_scanning) {
+ wpa_printf(MSG_DEBUG,
+ "%s[dbus]: Stop ongoing sched_scan to allow requested scan to proceed",
+ __func__);
+ wpa_supplicant_cancel_sched_scan(wpa_s);
+ }
+
+ if (params.freqs && params.freqs[0]) {
+ if (wpa_supplicant_trigger_scan(wpa_s,
+ &params)) {
+ reply = wpas_dbus_error_scan_error(
+ message,
+ "Scan request rejected");
+ }
+ } else {
+ wpa_s->scan_req = MANUAL_SCAN_REQ;
+ wpa_supplicant_req_scan(wpa_s, 0, 0);
+ }
}
} else if (os_strcmp(type, "active") == 0) {
if (!params.num_ssids) {
@@ -1349,6 +1360,13 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
#ifdef CONFIG_AUTOSCAN
autoscan_deinit(wpa_s);
#endif /* CONFIG_AUTOSCAN */
+ if (wpa_s->sched_scanning) {
+ wpa_printf(MSG_DEBUG,
+ "%s[dbus]: Stop ongoing sched_scan to allow requested scan to proceed",
+ __func__);
+ wpa_supplicant_cancel_sched_scan(wpa_s);
+ }
+
if (wpa_supplicant_trigger_scan(wpa_s, &params)) {
reply = wpas_dbus_error_scan_error(
message, "Scan request rejected");