[PATCH 2/2] ibss: add fixed freq ssid param

Dan Williams dcbw at redhat.com
Mon Jan 19 09:45:22 EST 2015


On Mon, 2015-01-19 at 10:02 +0100, Janusz Dziedzic wrote:
> Add fixed freq param and pass to driver.
> 
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic at tieto.com>
> ---
>  src/drivers/driver.h            | 7 +++++++
>  src/drivers/driver_nl80211.c    | 6 ++++++
>  wpa_supplicant/config.c         | 1 +
>  wpa_supplicant/config_ssid.h    | 5 +++++
>  wpa_supplicant/wpa_supplicant.c | 7 +++++++
>  5 files changed, 26 insertions(+)
> 
> diff --git a/src/drivers/driver.h b/src/drivers/driver.h
> index b8a7c51..8e24d77 100644
> --- a/src/drivers/driver.h
> +++ b/src/drivers/driver.h
> @@ -767,6 +767,13 @@ struct wpa_driver_associate_params {
>  	int fixed_bssid;
>  
>  	/**
> +	 * fixed_freq - fix control channel in IBSS mode
> +	 * 1 = fix control channel
> +	 * 0 = don't fix control channel
> +	 */
> +	int fixed_freq;

Does this simply tell the kernel driver to never ever leave the
specified channel, eg disabling BSS coalescing?

Dan

> +	/**
>  	 * disable_ht - Disable HT (IEEE 802.11n) for this connection
>  	 */
>  	int disable_ht;
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index 3ed9851..d6c9dd7 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -4298,6 +4298,12 @@ retry:
>  			goto fail;
>  	}
>  
> +	if (params->fixed_freq) {
> +		wpa_printf(MSG_DEBUG, "  * fixed_freq");
> +		if (nla_put_flag(msg, NL80211_ATTR_FREQ_FIXED))
> +			goto fail;
> +	}
> +
>  	if (params->key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X ||
>  	    params->key_mgmt_suite == WPA_KEY_MGMT_PSK ||
>  	    params->key_mgmt_suite == WPA_KEY_MGMT_IEEE8021X_SHA256 ||
> diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c
> index 1ccae0b..f5420a5 100644
> --- a/wpa_supplicant/config.c
> +++ b/wpa_supplicant/config.c
> @@ -1876,6 +1876,7 @@ static const struct parse_data ssid_fields[] = {
>  	{ INT_RANGE(peerkey, 0, 1) },
>  	{ INT_RANGE(mixed_cell, 0, 1) },
>  	{ INT_RANGE(frequency, 0, 65000) },
> +	{ INT_RANGE(fixed_freq, 0, 1) },
>  #ifdef CONFIG_MESH
>  	{ FUNC(mesh_basic_rates) },
>  	{ INT(dot11MeshMaxRetries) },
> diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h
> index f744895..9e68525 100644
> --- a/wpa_supplicant/config_ssid.h
> +++ b/wpa_supplicant/config_ssid.h
> @@ -420,6 +420,11 @@ struct wpa_ssid {
>  	int frequency;
>  
>  	/**
> +	 * fixed_freq - use fixed frequency for IBSS
> +	 */
> +	int fixed_freq;
> +
> +	/**
>  	 * mesh_basic_rates - BSS Basic rate set for mesh network
>  	 *
>  	 */
> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> index 56f4c44..884aca6 100644
> --- a/wpa_supplicant/wpa_supplicant.c
> +++ b/wpa_supplicant/wpa_supplicant.c
> @@ -1677,6 +1677,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
>  		if (ssid->mode != WPAS_MODE_IBSS)
>  			break;
>  
> +		if (ssid->fixed_freq)
> +			break;
> +
>  		if (!bss_is_ibss(bss))
>  			continue;
>  
> @@ -1690,6 +1693,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
>  		}
>  	}
>  
> +	if (ssid->fixed_freq)
> +		obss_scan = 0;
> +
>  	/* For IBSS check HT_IBSS flag */
>  	if (ssid->mode == WPAS_MODE_IBSS &&
>  	    !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_HT_IBSS))
> @@ -2135,6 +2141,7 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
>  		ibss_mesh_setup_freq(wpa_s, ssid, &params.freq);
>  
>  	if (ssid->mode == WPAS_MODE_IBSS) {
> +		params.fixed_freq = ssid->fixed_freq;
>  		if (ssid->beacon_int)
>  			params.beacon_int = ssid->beacon_int;
>  		else




More information about the HostAP mailing list