From 54ddd74369d5da56d81bff8e400d259449881345 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 17 Apr 2012 16:30:15 +0300 Subject: [PATCH] Add disable_scan_offload parameter to disable automatic scan offloading This new configuration parameter can be used to disable automatic offloading of scan requests to the driver which was previously used by default if the driver supported sched_scan. Signed-hostap: Jouni Malinen --- wpa_supplicant/config.c | 1 + wpa_supplicant/config.h | 9 +++++++++ wpa_supplicant/config_file.c | 3 +++ wpa_supplicant/scan.c | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index 2a166c7de..c423bc3be 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -2822,6 +2822,7 @@ static const struct global_parse_data global_fields[] = { #endif /* CONFIG_CTRL_IFACE */ { INT_RANGE(eapol_version, 1, 2), 0 }, { INT(ap_scan), 0 }, + { INT(disable_scan_offload), 0 }, { INT(fast_reauth), 0 }, { STR(opensc_engine_path), 0 }, { STR(pkcs11_engine_path), 0 }, diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 968f14bfb..eca0d0ff3 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -243,6 +243,15 @@ struct wpa_config { */ int ap_scan; + /** + * disable_scan_offload - Disable automatic offloading of scan requests + * + * By default, %wpa_supplicant tries to offload scanning if the driver + * indicates support for this (sched_scan). This configuration + * parameter can be used to disable this offloading mechanism. + */ + int disable_scan_offload; + /** * ctrl_interface - Parameters for the control interface * diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 671f7d655..3a4c35f4b 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -710,6 +710,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config) fprintf(f, "eapol_version=%d\n", config->eapol_version); if (config->ap_scan != DEFAULT_AP_SCAN) fprintf(f, "ap_scan=%d\n", config->ap_scan); + if (config->disable_scan_offload) + fprintf(f, "disable_scan_offload=%d\n", + config->disable_scan_offload); if (config->fast_reauth != DEFAULT_FAST_REAUTH) fprintf(f, "fast_reauth=%d\n", config->fast_reauth); if (config->opensc_engine_path) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index eec5c7bf6..6f16baaff 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -755,7 +755,7 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s) max_sched_scan_ssids = WPAS_MAX_SCAN_SSIDS; else max_sched_scan_ssids = wpa_s->max_sched_scan_ssids; - if (max_sched_scan_ssids < 1) + if (max_sched_scan_ssids < 1 || wpa_s->conf->disable_scan_offload) return -1; if (wpa_s->sched_scanning) {