[PATCH v2] hostapd: add Transmit Power Envelope IE
Jouni Malinen
j at w1.fi
Thu Nov 26 11:03:22 PST 2015
On Mon, Nov 23, 2015 at 06:40:26PM +0530, Rajkumar Manoharan wrote:
> Add Transmit Power Envelope element defined in
> IEEE P802.11-REVmc/D4.3, 8.4.2.161.
Thanks, applied.
> diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c
> +u8 * hostapd_eid_vht_txpwr_env(struct hostapd_data *hapd, u8 *eid)
> + max_tx_power = chan->max_tx_power - local_pwr_constraint;
> +
> + /*
> + * Local Maximum Transmit power is encoded as 2's complement
> + * with a 0.5 dB step
> + */
> + max_tx_power = ~(max_tx_power * 2) + 1;
Though, this does not look correct.. That would mess up positive values
pretty badly. I think I fixed this, but anyway, please take a look at
send a patch to update this, if needed.
> + *eid++ = WLAN_EID_VHT_TRANSMIT_POWER_ENVELOPE;
> + *eid++ = 4;
That length value is not correct since this is now variable length:
> + /*
> + * Max Transmit Power count and
> + * Max Transmit Power units = 0 (EIRP)
> + */
> + *eid++ = tx_pwr_count;
> +
> + i = 0;
> + while (i++ <= tx_pwr_count)
> + *eid++ = max_tx_power;
Here.. Fixed the length field to match.
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list