From: Johannes Berg <johannes@sipsolutions.net>
To: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: Handle power constraint level advertised in 11d+h beacon
Date: Mon, 05 Jan 2009 12:12:34 +0100 [thread overview]
Message-ID: <1231153954.3334.4.camel@johannes> (raw)
In-Reply-To: <1231148165-10529-1-git-send-email-vasanth@atheros.com> (sfid-20090105_103849_565950_8A6A9F2D)
[-- Attachment #1: Type: text/plain, Size: 1557 bytes --]
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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2009-01-05 11:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-05 9:36 [PATCH] mac80211: Handle power constraint level advertised in 11d+h beacon Vasanthakumar Thiagarajan
2009-01-05 11:12 ` Johannes Berg [this message]
2009-01-05 13:37 ` Vasanthakumar Thiagarajan
2009-01-05 13:42 ` Johannes Berg
2009-01-05 13:45 ` Vasanthakumar Thiagarajan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1231153954.3334.4.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=vasanth@atheros.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox