[PATCH 1/2] hostapd: Add Power Constraint element

Marek Puzyniak marek.puzyniak at tieto.com
Fri Feb 21 08:38:09 EST 2014

On 14 February 2014 18:25, Jouni Malinen <j at w1.fi> wrote:
> On Fri, Feb 07, 2014 at 10:19:13PM +0100, Marek Puzyniak wrote:
>> From: Srinivasan B <srinivasanb at posedge.com>
>> Add Power Constraint information element to Beacon and Probe Response
>> frames when hostapd is configured on 5 GHz band and Country information
>> element is also added. According to spec IEEE802.11-2012 a STA shall
>> determine a local maximum transmit power for the current channel based
>> on information derived from Country and Power Constraint elements.
> How was this tested?

I set local_power_constraint option to 3 in hostapd.conf then started
AP and observed air logs. In beacons and probe responses I can see
Power Constraint element with Local Power Constraint set to 3.

>> +             } else if (os_strcmp(buf, "local_pwr_contraint") == 0) {
>> +                             conf->local_pwr_constraint = val;
>> diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
>> +#local_pwr_constraint=3
> Note any difference in the spelling?

Yes, I see it. Unfortunately I had the same mistake in my hostapd.conf
that's why I haven't noticed that.

>> +     /*
>> +      * CRDA provides reduced TX power than actual regulatory max TX power.
>> +      * Value of 0 to the local power constraint provides an opportunity
>> +      * for the client devices to operate at the power limit provided by CRDA
>> +      * (for client devices
>> +      * "Local max TX pwr" = regulatory max TX pwr - Local pwr constraint)
>> +      */
> This is somewhat confusing statement in the core hostapd code which can
> be used with multiple drivers, many of which are not even on Linux,
> never mind use CRDA.. Why does this speak about CRDA and is this to be
> understood as the functionality not working unless CRDA is used?

I changed this comment to something like that:
         * A STA that is not an AP shall use a transmit power less than or
         * equal to the local maximum transmit power level for the channel.
         * The local maximum transmit power can be calculated from the formula:
         * local max TX pwr = max TX pwr - local pwr constraint
         * Where max TX pwr is maximum transmit power level specified for
         * channel in Country element and local pwr contraint is specified
         * for channel in this Power Constraint element.

I will send version 2 of this patch.


More information about the HostAP mailing list