Message ID | 53E4E368.4090105@rt-rk.com |
---|---|
State | Superseded |
Headers | show |
On Fri, Aug 08, 2014 at 04:49:12PM +0200, Bojan Prtvar wrote: > Thank you for your hints. By examining the code I found out that > freq_list is only taken into account by > wpa_supplicant_req_scan() (via wpa_supplicant_scan(), to be more > precise) and my error case happens on > wpa_supplicant_req_sched_scan(). > So this is what I did, and this seams to fix the problem on my side. > However, I'm concerned about potential side effects, because I don't > understand the philosophy and difference > between req_scan and req_sched_scan. Can you please comment? That looks like a proper fix for sched_scan. I'd assume that possible use case was forgotten when the global freq_list functionality was added since it was most likely initially targeting drivers that do not support sched_scan. Could you please read the top level CONTRIBUTIONS file and post the patch with a Signed-off-by: tag in the commit message so that I can apply it? PS. freq_list affects only scanning. This does not prevent drivers from roaming to other frequencies when BSS-selection is done by the driver instead of wpa_supplicant. In other words, this is not a generic solution for forcing 5 GHz band to be used.
diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 40eb8d8..f07da46 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -1244,6 +1244,12 @@ 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 in sched scan"); + int_array_concat(¶ms.freqs, wpa_s->conf->freq_list); + } scan_params = ¶ms;