]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add disable_scan_offload parameter to disable automatic scan offloading
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 17 Apr 2012 13:30:15 +0000 (16:30 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 17 Apr 2012 13:30:15 +0000 (16:30 +0300)
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 <jouni@qca.qualcomm.com>

wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/scan.c

index 2a166c7dee0e7be90c9875f7b1afb4c306845b33..c423bc3beebb3a6622fba6641b801d0038a0a8fd 100644 (file)
@@ -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 },
index 968f14bfb5ce25fe6261f31a079dcc732878a71f..eca0d0ff369aa8f42764c55d44cdbb425135ab45 100644 (file)
@@ -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
         *
index 671f7d65566d25cf28ee76203e6437f569320c2f..3a4c35f4bcae2bddb6321f58cc4d2e8ec4ceeee8 100644 (file)
@@ -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)
index eec5c7bf6b29a6405889eef6ec6064b76e58cd6f..6f16baaff422bfbf74d7d116bbba78d87c09335d 100644 (file)
@@ -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) {