Browse Source

Add a configration parameter for sched_scan interval

The new sched_scan_interval parameter can be used to set the default
sched_scan interval, e.g., for power saving purposes.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Sheng Fang 12 years ago
parent
commit
4aa8186806
4 changed files with 13 additions and 1 deletions
  1. 1 0
      wpa_supplicant/config.c
  2. 5 0
      wpa_supplicant/config.h
  3. 4 0
      wpa_supplicant/config_file.c
  4. 3 1
      wpa_supplicant/scan.c

+ 1 - 0
wpa_supplicant/config.c

@@ -3105,6 +3105,7 @@ static const struct global_parse_data global_fields[] = {
 	{ FUNC(ap_vendor_elements), 0 },
 	{ INT_RANGE(ignore_old_scan_res, 0, 1), 0 },
 	{ FUNC(freq_list), 0 },
+	{ INT(sched_scan_interval), 0 },
 };
 
 #undef FUNC

+ 5 - 0
wpa_supplicant/config.h

@@ -862,6 +862,11 @@ struct wpa_config {
 	 * allowing it to update the internal BSS table.
 	 */
 	int ignore_old_scan_res;
+
+	/**
+	 * sched_scan_interval -  schedule scan interval
+	 */
+	unsigned int sched_scan_interval;
 };
 
 

+ 4 - 0
wpa_supplicant/config_file.c

@@ -1025,6 +1025,10 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
 		}
 		fprintf(f, "\n");
 	}
+
+	if (config->sched_scan_interval)
+		fprintf(f, "sched_scan_interval=%u\n",
+			config->sched_scan_interval);
 }
 
 #endif /* CONFIG_NO_CONFIG_WRITE */

+ 3 - 1
wpa_supplicant/scan.c

@@ -1019,7 +1019,9 @@ int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
 
 	if (!ssid || !wpa_s->prev_sched_ssid) {
 		wpa_dbg(wpa_s, MSG_DEBUG, "Beginning of SSID list");
-
+		if (wpa_s->conf->sched_scan_interval)
+			wpa_s->sched_scan_interval =
+				wpa_s->conf->sched_scan_interval;
 		if (wpa_s->sched_scan_interval == 0)
 			wpa_s->sched_scan_interval = 10;
 		wpa_s->sched_scan_timeout = max_sched_scan_ssids * 2;