diff mbox

wpa_supplicant: Use freq_list scan filtar in sched_scan

Message ID 20140811102502.GA65664@mcs13.domain.local
State Accepted
Headers show

Commit Message

Bojan Prtvar Aug. 11, 2014, 10:25 a.m. UTC
Global freq_list scan filtar was taken into account only by
req_scan and not by req_sched_scan. We want to allow the user
to limit the channels that wpa_supplicant will scan in req_sched_scan
requests as well.

Signed-off-by: Bojan Prtvar <bojan.prtvar@rt-rk.com>
---
 wpa_supplicant/scan.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Jouni Malinen Aug. 26, 2014, 4:12 p.m. UTC | #1
On Mon, Aug 11, 2014 at 12:25:03PM +0200, Bojan Prtvar wrote:
> Global freq_list scan filtar was taken into account only by
> req_scan and not by req_sched_scan. We want to allow the user
> to limit the channels that wpa_supplicant will scan in req_sched_scan
> requests as well.

Thanks, applied.
diff mbox

Patch

diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
index 40eb8d8..ec80877 100644
--- a/wpa_supplicant/scan.c
+++ b/wpa_supplicant/scan.c
@@ -1244,6 +1244,13 @@  int wpa_supplicant_req_sched_scan(struct wpa_supplicant *wpa_s)
 	if (wpa_s->conf->filter_rssi)
 		params.filter_rssi = wpa_s->conf->filter_rssi;
 
+	/* See if user specified frequencies. If so, scan only those. */
+	if (wpa_s->conf->freq_list && !params.freqs) {
+		wpa_dbg(wpa_s, MSG_DEBUG,
+			"Optimize scan based on conf->freq_list");
+		int_array_concat(&params.freqs, wpa_s->conf->freq_list);
+	}
+
 	scan_params = &params;
 
 scan: