linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Luis R. Rodriguez" <lrodriguez@atheros.com>
Cc: linville@tuxdriver.com,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Felix Fietkau <nbd@openwrt.org>
Subject: Re: [PATCH 7/7] cfg80211/mac80211: Add Country IE parsing/802.11d support
Date: Wed, 05 Nov 2008 20:52:13 +0100	[thread overview]
Message-ID: <1225914733.3619.150.camel@johannes.berg> (raw)
In-Reply-To: <43e72e890811051124g3931e244i3e29c413a05c08f3@mail.gmail.com> (sfid-20081105_203443_261937_0EA8DECD)

[-- Attachment #1: Type: text/plain, Size: 3241 bytes --]

On Wed, 2008-11-05 at 11:24 -0800, Luis R. Rodriguez wrote:
> On Wed, Nov 5, 2008 at 10:10 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Wed, 2008-11-05 at 08:57 -0800, Luis R. Rodriguez wrote:
> >
> >> >> +/*
> >> >> + * IEEE 802.11-2007 7.3.2.9 Country information element
> >> >> + *
> >> >> + * Minimum length is 8 octects, ie len must be evenly
> >> >> + * divisible by 2
> >> >> + */
> >> >
> >> > That seems odd, I thought there are triplets in there? That mean it
> >> > should be 2+N*3, no?
> >>
> >> Forgot the environment 'I', 'O' or ' '.
> >>
> >> alpha+environment (3) + n * 3
> >
> > But then it should be evenly divisible by three, not two, right?
> 
> Nope, the end of the IE requires a pad to make it divisible by 2.

Ah, that's weird, I suspect nobody cares and that's why your Broadcom
router has only 6 bytes.

> > And 8
> > doesn't make sense as a minimum length either then.
> 
> Agreed :) but that's exactly why I put those comments there.

right :)

> >> > When I suggested to use a checksum I was thinking of an easy way to
> >> > debounce. But a checksum is never perfect. Hence, the WARN_ON you added
> >> > might trigger despite the debounce checksum. Or we might fail to follow
> >> > changes.
> >>
> >> Let me know what you think about the alpha2 + BSSID thing above. I
> >> guess it should also consider the environment (I, O, ' ') in case the
> >> AP is reconfigured to be outdoor (without being moved). I don't think
> >> we should care about supporting these cases on the fly but we should
> >> ensure the change won't break things.
> >
> > Well I haven't checked in detail which things you care about in the IE
> > now, but shouldn't you check if those changed?
> 
> We only care about the channel triplet and that has:
> 
> a. Channel start
> b. Number of channels
> c. Power
> 
> But I think that if the alpha2+environment is the same that's enough
> for the STA to assume the BSSID has not changed the IE. At least with
> openwrt I need to bring down the interface of the AP to change 11d.
> I'd guess most home APs act the same way as in that they require a
> reboot or something. On some APs I use I use iwpriv to change it but I
> haven't checked to see internally what that will do while its on.
> 
> The checksum really only should be useful if a secondary device tries
> to associate to an AP and it gets a country IE. It needs a way to know
> if the IE is different than the one an already-present device is
> using. What I'm suggesting is that if these things are the same we can
> assume it doesn't change: BSSID+alpha2+environment.

Ok, checksums are nice to avoid having to memcmp large things, but
afaict we're talking about maybe 12 bytes, right? If so, why don't we
just keep a copy of the country IE and compare it fully every time?

The way I see it, driver/mac80211 calls cfg80211's
	regulatory_11d(wiphy, ie, ie_length)
function and that sorts out whether to do anything at all, ignore it
because it already knows etc. So regardless of what we do we can just do
it all in here and not bother anything elsewhere with checksums,
debouncing etc, and will be free to change it easily.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2008-11-05 19:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05  2:49 [PATCH 0/7] cfg80211/mac80211: Add 802.11d support Luis R. Rodriguez
2008-11-05  2:50 ` [PATCH 1/7] cfg80211: mark negative frequencies as invalid Luis R. Rodriguez
2008-11-05  2:50   ` [PATCH 2/7] cfg80211: remove switch from __regulatory_hint() Luis R. Rodriguez
2008-11-05  2:50     ` [PATCH 3/7] cfg80211: remove switch from __set_regdom() Luis R. Rodriguez
2008-11-05  2:50       ` [PATCH 4/7] cfg80211: separate intersection section in __set_regdom() Luis R. Rodriguez
2008-11-05  2:50         ` [PATCH 5/7] cfg80211: expect different rd in cfg80211 when intersecting Luis R. Rodriguez
2008-11-05  2:50           ` [PATCH 6/7] cfg80211: initialize last_request Luis R. Rodriguez
2008-11-05  2:50             ` [PATCH 7/7] cfg80211/mac80211: Add Country IE parsing/802.11d support Luis R. Rodriguez
2008-11-05 12:23               ` Johannes Berg
2008-11-05 16:57                 ` Luis R. Rodriguez
2008-11-05 18:10                   ` Johannes Berg
2008-11-05 19:24                     ` Luis R. Rodriguez
2008-11-05 19:52                       ` Johannes Berg [this message]
2008-11-05 20:10                         ` Luis R. Rodriguez
2008-11-05 20:10                           ` Luis R. Rodriguez
2008-11-05 20:14                           ` Johannes Berg
2008-11-05 20:18                             ` Luis R. Rodriguez
2008-11-05 12:02             ` [PATCH 6/7] cfg80211: initialize last_request Johannes Berg
2008-11-05 19:53               ` Luis R. Rodriguez
2008-11-05 19:58                 ` Johannes Berg
2008-11-05 12:01           ` [PATCH 5/7] cfg80211: expect different rd in cfg80211 when intersecting Johannes Berg
2008-11-05 19:55             ` Luis R. Rodriguez
2008-11-05 19:59               ` Johannes Berg
2008-11-05 20:14                 ` Luis R. Rodriguez
2008-11-05 12:00         ` [PATCH 4/7] cfg80211: separate intersection section in __set_regdom() Johannes Berg
2008-11-05 11:58       ` [PATCH 3/7] cfg80211: remove switch from __set_regdom() Johannes Berg
2008-11-05 11:57     ` [PATCH 2/7] cfg80211: remove switch from __regulatory_hint() Johannes Berg
2008-11-05 11:56   ` [PATCH 1/7] cfg80211: mark negative frequencies as invalid Johannes Berg
2008-11-05 20:16 ` [PATCH 0/7] cfg80211/mac80211: Add 802.11d support Luis R. Rodriguez
2008-11-06 13:58   ` John W. Linville

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=1225914733.3619.150.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=lrodriguez@atheros.com \
    --cc=nbd@openwrt.org \
    /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;
as well as URLs for NNTP newsgroup(s).