[LEDE-DEV] [PATCH] mesh: Set correct secondary channel offset if HT40 is disabled

Koen Vandeputte koen.vandeputte at ncentric.com
Tue Jul 26 01:29:53 PDT 2016


Tested-by: Koen vandeputte <koen.vandeputte at ncentric.com 
<mailto:psidhu at gateworks.com>>

This patch also solves the same issue in IBSS mode


Koen

On 2016-07-26 04:45, Masashi Honma wrote:
> Previously, secondary channel offset could be non zero even though
> disable_ht40=1. This patch fixes it.
>
> Signed-off-by: Masashi Honma<masashi.honma at gmail.com>
> ---
>   wpa_supplicant/wpa_supplicant.c | 32 ++++++++++++++++++++------------
>   1 file changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
> index aa4efd3..0548560 100644
> --- a/wpa_supplicant/wpa_supplicant.c
> +++ b/wpa_supplicant/wpa_supplicant.c
> @@ -1907,20 +1907,27 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
>   			break;
>   		}
>   	}
> +#ifdef CONFIG_HT_OVERRIDES
> +	if (ssid->disable_ht40)
> +		ht40 = 0;
> +#endif /* CONFIG_HT_OVERRIDES */
>   
> -	/* Find secondary channel */
> -	for (i = 0; i < mode->num_channels; i++) {
> -		sec_chan = &mode->channels[i];
> -		if (sec_chan->chan == channel + ht40 * 4)
> -			break;
> -		sec_chan = NULL;
> -	}
> -	if (!sec_chan)
> -		return;
> +	if (ht40) {
> +		/* Find secondary channel */
> +		for (i = 0; i < mode->num_channels; i++) {
> +			sec_chan = &mode->channels[i];
> +			if (sec_chan->chan == channel + ht40 * 4)
> +				break;
> +			sec_chan = NULL;
> +		}
> +		if (!sec_chan)
> +			return;
>   
> -	/* Check secondary channel flags */
> -	if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
> -		return;
> +		/* Check secondary channel flags */
> +		if (sec_chan->flag &
> +		    (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
> +			return;
> +	}
>   
>   	freq->channel = pri_chan->chan;
>   
> @@ -1936,6 +1943,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
>   		freq->sec_channel_offset = 1;
>   		break;
>   	default:
> +		freq->sec_channel_offset = 0;
>   		break;
>   	}
>   




More information about the Lede-dev mailing list