[PATCH] wpa_supplicant: Allow configuring scan frequencies.

Ben Greear greearb
Tue Apr 30 16:02:28 PDT 2013


On 04/30/2013 03:48 PM, Jouni Malinen wrote:
> On Tue, Apr 30, 2013 at 03:10:13PM -0700, greearb at candelatech.com wrote:
>> This allows one to limit the channels that wpa_supplicant will
>> scan.  This is a useful addition to the freq_list configurable
>> in the network {} section.
>
> Could you please add an example to wpa_supplicant.conf with some
> documentation?
>
>> Signed-hostap: Ben Greear <greearb at candelatech.com>
>> Signed-off-by: Ben Greear <greearb at candelatech.com>
>
> Not that the extra line really causes any problems here, but just to
> note that I will drop the second one.
>
>> diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
>> +static int wpa_config_process_freq_list(const struct parse_data *data,
>
>> +	freqs = wpa_config_parse_int_array(value);
>> +	if (freqs == NULL)
>> +		return -1;
>> +	os_free(config->freq_list);
>> +	config->freq_list = freqs;
>> +	return 0;
>> +}
>
> Where does this config->freq_list get freed when the interface is
> removed?
>
>> diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h
>> @@ -648,6 +648,15 @@ struct wpa_config {
>>   	unsigned int max_num_sta;
>>
>>   	/**
>> +	 * freq_list - Array of allowed scan frequencies or %NULL for all
>> +	 *
>> +	 * This is an optional zero-terminated array of frequencies in
>> +	 * megahertz (MHz) to allow for narrowing scanning range.
>> +	 * TODO:  Could make it limit ssid freq_lists as well.
>> +	 */
>> +	int *freq_list;
>
> Could you please clarify what that TODO item means? I have a slight
> preference of not included it there as part of wpa_config documentation.

I think that the wpa_s->conf->freq_list could force all network
blocks to use use a subset of that freq_list (including the full
freq_list).

I'm not sure if it's worth coding up though, since users can just
manually set the freq_list in the network block(s).

I'll remove the TODO.

I'll work on the rest of the comments and re-post shortly.

Thanks,
Ben



-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com




More information about the Hostap mailing list