[PATCH] hostapd: add VHT channel switch IEs

Jouni Malinen j
Fri May 8 07:11:33 PDT 2015


On Tue, May 05, 2015 at 01:25:50PM +0530, Rajkumar Manoharan wrote:
> Add wide band channel switch and VHT tx power envelope IEs for
> VHT bandwidth channel switch.

> @@ -316,7 +316,7 @@ static u8 * hostapd_eid_csa(struct hostapd_data *hapd, u8 *eid)
> -static u8 * hostapd_eid_secondary_channel(struct hostapd_data *hapd, u8 *eid)
> +static u8 *hostapd_eid_secondary_channel(struct hostapd_data *hapd, u8 *eid)

Please do not include unrelated whitespace changes in the patch
(especially when they are breaking the expected style).

> @@ -337,6 +337,72 @@ static u8 * hostapd_eid_secondary_channel(struct hostapd_data *hapd, u8 *eid)
> +static u8 *hostapd_eid_wide_bw_chansw(struct hostapd_data *hapd, u8 *eid)

> +	switch (params->bandwidth) {
> +	case 40:
> +		*eid++ = VHT_CHANWIDTH_USE_HT;
> +		break;
> +	case 80:
> +		*eid++ = VHT_CHANWIDTH_80MHZ;
> +		break;
> +	case 160:
> +		*eid++ = VHT_CHANWIDTH_160MHZ;
> +		break;
> +	}

This should likely handle case of something else, e.g., by returning
without adding the IE.

> +	*eid++ = params->freq + params->sec_channel_offset * 10;
> +	*eid++ = params->center_freq2;

This cannot be correct.. params->freq and center_freq2 (I'd assume) are
in MHz while the *eid is a one octet field (channel center frequency
index, not frequency).

> +	*eid++ = WLAN_EID_VHT_TRANSMIT_POWER_ENVELOPE;
> +	*eid++ = 5;
> +	*eid++ = 2;
> +	*eid++ = chan->max_tx_power;
> +	*eid++ = chan->max_tx_power;
> +	*eid++ = chan->max_tx_power;
> +	*eid++ = chan->max_tx_power;

Could you please clarify why this is adding the same max TX power for
all four different cases and especially why that is done regardless of
the channel bandwidth? In particular, why would 160/80+80 MHz value be
included if the target channel is only 40 or 80 MHz wide?

That value 2 as the Transmit Power Information does not match rest of
the element. It would indicate LocalMaximumTransmitPower Count 2 which
means TX power limits for 20, 40, and 80 MHz, i.e., only three values
while four values are being filled int.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list