From: Johannes Berg <johannes@sipsolutions.net>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 6/6] cfg80211: Fix parsed country IE info for 5 GHz
Date: Thu, 08 Jan 2009 14:04:00 +0100 [thread overview]
Message-ID: <1231419840.3685.12.camel@johannes> (raw)
In-Reply-To: <1231379017-28363-7-git-send-email-lrodriguez@atheros.com>
[-- Attachment #1: Type: text/plain, Size: 2591 bytes --]
On Wed, 2009-01-07 at 17:43 -0800, Luis R. Rodriguez wrote:
> The country IE number of channels on 5 GHz specifies the number
> of 5 GHz channels, not the number of sequential channel numbers.
> For example, if in a country IEs if the first channel given is 36
> and the number of channels passed is 4 then the individual channel
> numbers defined for the 5 GHz PHY by these parameters
>
> are: 36, 40, 44, 48
> not: 36, 37, 38, 39
>
> See: http://tinyurl.com/11d-clarification
>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> net/wireless/reg.c | 21 +++++++++++++++++++--
> 1 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index bea98ed..b34fd84 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -563,6 +563,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
>
> /* This time around we fill in the rd */
> while (country_ie_len >= 3) {
> + int end_channel = 0;
> struct ieee80211_country_ie_triplet *triplet =
> (struct ieee80211_country_ie_triplet *) country_ie;
> struct ieee80211_reg_rule *reg_rule = NULL;
> @@ -584,6 +585,23 @@ static struct ieee80211_regdomain *country_ie_2_rd(
>
> reg_rule->flags = flags;
>
> + /* 2 GHz */
> + if (triplet->chans.first_channel <= 14)
> + end_channel = triplet->chans.first_channel +
> + triplet->chans.num_channels;
> + else
> + /*
> + * 5 GHz -- For example in country IEs if the first
> + * channel given is 36 and the number of channels is 4
> + * then the individual channel numbers defined for the
> + * 5 GHz PHY by these parameters are: 36, 40, 44, and 48
> + * and not 36, 37, 38, 39.
> + *
> + * See: http://tinyurl.com/11d-clarification
> + */
> + end_channel = triplet->chans.first_channel +
> + (4 * (triplet->chans.num_channels - 1));
> +
> /* The +10 is since the regulatory domain expects
> * the actual band edge, not the center of freq for
> * its start and end freqs, assuming 20 MHz bandwidth on
> @@ -593,8 +611,7 @@ static struct ieee80211_regdomain *country_ie_2_rd(
> triplet->chans.first_channel) - 10);
> freq_range->end_freq_khz =
> MHZ_TO_KHZ(ieee80211_channel_to_frequency(
> - triplet->chans.first_channel +
> - triplet->chans.num_channels) + 10);
> + end_channel) + 10);
>
> /* Large arbitrary values, we intersect later */
> /* Increment this if we ever support >= 40 MHz channels
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2009-01-08 13:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-08 1:43 [PATCH 0/6] cfg80211: few fixes and adds support for multiple reg hints Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 1/6] cfg80211: call reg_notifier() once Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 2/6] cfg80211: make handle_band() and handle_channel() wiphy specific Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 3/6] cfg80211: allow multiple driver regulatory_hints() Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 4/6] cfg80211: fix typo on message after intersection Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 5/6] cfg80211: Fix regression with 11d on bands Luis R. Rodriguez
2009-01-08 1:43 ` [PATCH 6/6] cfg80211: Fix parsed country IE info for 5 GHz Luis R. Rodriguez
2009-01-08 13:04 ` Johannes Berg [this message]
2009-01-08 13:03 ` [PATCH 5/6] cfg80211: Fix regression with 11d on bands Johannes Berg
2009-01-08 13:00 ` [PATCH 4/6] cfg80211: fix typo on message after intersection Johannes Berg
2009-01-08 12:59 ` [PATCH 3/6] cfg80211: allow multiple driver regulatory_hints() Johannes Berg
2009-01-08 12:58 ` [PATCH 2/6] cfg80211: make handle_band() and handle_channel() wiphy specific Johannes Berg
2009-01-08 12:58 ` [PATCH 1/6] cfg80211: call reg_notifier() once Johannes Berg
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=1231419840.3685.12.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=lrodriguez@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