From 58a8af2ce379a19364963ec1f94a29871c00bac9 Mon Sep 17 00:00:00 2001 From: Eyal Shapira Date: Sun, 28 Oct 2012 19:45:12 +0200 Subject: Allow concurrent normal scan and sched scan (UPSTREAM) Some drivers support sched scan and normal scan. Enable this by configuration of concurrent_sched_scan=1 This can speed up connection to scan_ssid=1 networks as the sched scan doesn't get interrupted by a normal scan for wildcard SSID. Signed-off-by: Eyal Shapira --- wpa_supplicant/config.c | 1 + wpa_supplicant/config.h | 6 ++++++ wpa_supplicant/config_file.c | 3 +++ wpa_supplicant/ctrl_iface.c | 7 +++++-- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index c89fb39..9d93161 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -3001,6 +3001,7 @@ static const struct global_parse_data global_fields[] = { MAX_NUM_SCHED_SCAN_SHORT_INTERVALS), 0 }, { INT_RANGE(sched_scan_short_interval, 1, MAX_SCHED_SCAN_INTERVAL), 0 }, { INT_RANGE(sched_scan_long_interval, 1, MAX_SCHED_SCAN_INTERVAL), 0 }, + { INT_RANGE(concurrent_sched_scan, 0, 1), 0 }, }; #undef FUNC diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 31e7a9a..8273f14 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -747,6 +747,12 @@ struct wpa_config { * p2p_disabled - Whether P2P operations are disabled for this interface */ int p2p_disabled; + + /* + * concurrent_sched_scan - sched scan can run concurrently with normal + * scan and no need to stop one to do the other. + */ + int concurrent_sched_scan; }; diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 9bb01b4..cba8604 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -919,6 +919,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) if (config->p2p_conc_mode) fprintf(f, "p2p_conc_mode=%u\n", config->p2p_conc_mode); #endif + if (config->concurrent_sched_scan) + fprintf(f, "concurrent_sched_scan=%u\n", + config->concurrent_sched_scan); } #endif /* CONFIG_NO_CONFIG_WRITE */ diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c index 8aad951..0f5f431 100644 --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c @@ -4577,13 +4577,16 @@ char * wpa_supplicant_ctrl_iface_process(struct wpa_supplicant *wpa_s, if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) reply_len = -1; else { - if (!wpa_s->sched_scanning && !wpa_s->scanning && + if ((wpa_s->conf->concurrent_sched_scan || + !wpa_s->sched_scanning) && + !wpa_s->scanning && ((wpa_s->wpa_state <= WPA_SCANNING) || (wpa_s->wpa_state == WPA_COMPLETED))) { wpa_s->normal_scans = 0; wpa_s->scan_req = 2; wpa_supplicant_req_scan(wpa_s, 0, 0); - } else if (wpa_s->sched_scanning) { + } else if (wpa_s->sched_scanning && + !wpa_s->conf->concurrent_sched_scan) { wpa_printf(MSG_DEBUG, "Stop ongoing " "sched_scan to allow requested " "full scan to proceed"); -- cgit v1.1