diff mbox

wpa_supplicant: Problem with freq_list scan filter

Message ID 53E4E368.4090105@rt-rk.com
State Superseded
Headers show

Commit Message

Bojan Prtvar Aug. 8, 2014, 2:49 p.m. UTC
Hi Janusz,

On 08/08/2014 12:05, Janusz Dziedzic wrote:
> You have to check the code, fix if needed.
> Could be also driver don't care about scan_list and scan all freq in
> some cases (in such case you can workaround this and remove scan
> results in supplicant base on freq_list?).
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?  



 scan:

Comments

Jouni Malinen Aug. 10, 2014, 8:13 a.m. UTC | #1
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 mbox

Patch

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(&params.freqs, wpa_s->conf->freq_list);
+       }
        scan_params = &params;