Search Linux Wireless

Re: [PATCH] mac80211: Handle power constraint level advertised in 11d+h beacon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2009-01-05 at 15:06 +0530, Vasanthakumar Thiagarajan wrote:

> -	if (!local->hw.conf.user_power_level)
> +	if (local->sw_scanning)
>  		power = chan->max_power;
>  	else
> -		power = min(chan->max_power, local->hw.conf.user_power_level);
> +		power = local->hw.conf.power_constr_level ?
> +			(chan->max_power - local->hw.conf.power_constr_level) :
> +			chan->max_power;

I think I'd prefer that to be written as

if (!scanning && power_constr_level)
	power = ... - ...
else
	power = chan->max_power;

Also, I don't understand the subtraction? And why are you checking only
for sw scanning and not hw scanning?

> +void ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
> +				 u16 capab_info, u8 *pwr_constr_elem,
> +				 u8 pwr_constr_elem_len)
> +{
> +	struct ieee80211_conf *conf = &sdata->local->hw.conf;
> +
> +	if (!(capab_info & WLAN_CAPABILITY_SPECTRUM_MGMT))
> +		return;
> +
> +	/* Power constraint IE length should be 1 octet */
> +	if (pwr_constr_elem_len != 1)
> +		return;
> +
> +	if ((*pwr_constr_elem <= conf->channel->max_power) &&
> +	    (*pwr_constr_elem != conf->power_constr_level)) {
> +		conf->power_constr_level = *pwr_constr_elem;
> +		ieee80211_hw_config(sdata->local, 0);

That needs a changed flag, no? And how does the subtraction make sense
like this? The spec talks about the country element's max power, and
then subtracting this, to get the local power, but if the local power
was set lower than that then we shouldn't subtract even more, no?

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux