Add control interface command for aborting an ongoing scan

The new ABORT_SCAN command can be used to request an ongoing scan to be
aborted.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-10-27 10:58:52 +02:00 committed by Jouni Malinen
parent 4ead7cfd5d
commit 2ea2166d5a
2 changed files with 13 additions and 0 deletions

View file

@ -8670,6 +8670,9 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s,
} else if (os_strcmp(buf, "SCAN_RESULTS") == 0) { } else if (os_strcmp(buf, "SCAN_RESULTS") == 0) {
reply_len = wpa_supplicant_ctrl_iface_scan_results( reply_len = wpa_supplicant_ctrl_iface_scan_results(
wpa_s, reply, reply_size); wpa_s, reply, reply_size);
} else if (os_strcmp(buf, "ABORT_SCAN") == 0) {
if (wpas_abort_ongoing_scan(wpa_s) < 0)
reply_len = -1;
} else if (os_strncmp(buf, "SELECT_NETWORK ", 15) == 0) { } else if (os_strncmp(buf, "SELECT_NETWORK ", 15) == 0) {
if (wpa_supplicant_ctrl_iface_select_network(wpa_s, buf + 15)) if (wpa_supplicant_ctrl_iface_select_network(wpa_s, buf + 15))
reply_len = -1; reply_len = -1;

View file

@ -1770,6 +1770,13 @@ static int wpa_cli_cmd_scan_results(struct wpa_ctrl *ctrl, int argc,
} }
static int wpa_cli_cmd_abort_scan(struct wpa_ctrl *ctrl, int argc,
char *argv[])
{
return wpa_ctrl_command(ctrl, "ABORT_SCAN");
}
static int wpa_cli_cmd_bss(struct wpa_ctrl *ctrl, int argc, char *argv[]) static int wpa_cli_cmd_bss(struct wpa_ctrl *ctrl, int argc, char *argv[])
{ {
return wpa_cli_cmd(ctrl, "BSS", 1, argc, argv); return wpa_cli_cmd(ctrl, "BSS", 1, argc, argv);
@ -3029,6 +3036,9 @@ static const struct wpa_cli_cmd wpa_cli_commands[] = {
{ "scan_results", wpa_cli_cmd_scan_results, NULL, { "scan_results", wpa_cli_cmd_scan_results, NULL,
cli_cmd_flag_none, cli_cmd_flag_none,
"= get latest scan results" }, "= get latest scan results" },
{ "abort_scan", wpa_cli_cmd_abort_scan, NULL,
cli_cmd_flag_none,
"= request ongoing scan to be aborted" },
{ "bss", wpa_cli_cmd_bss, wpa_cli_complete_bss, { "bss", wpa_cli_cmd_bss, wpa_cli_complete_bss,
cli_cmd_flag_none, cli_cmd_flag_none,
"<<idx> | <bssid>> = get detailed scan result info" }, "<<idx> | <bssid>> = get detailed scan result info" },