* Re: [PATCH] wireless: update regulatory sample code
2008-10-22 18:55 [PATCH] wireless: update regulatory sample code Johannes Berg
@ 2008-10-22 12:35 ` Luis R. Rodriguez
2008-10-22 19:41 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2008-10-22 12:35 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Luis R. Rodriguez, linux-wireless
On Wed, Oct 22, 2008 at 11:55:52AM -0700, Johannes Berg wrote:
> Update the same code for the recent changes. I did this as a
> separate patch to avoid removing a lot of sample code only
> to add it back again in the next patch.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> Documentation/networking/regulatory.txt | 19 ++++++++-----------
> 1 file changed, 8 insertions(+), 11 deletions(-)
>
> --- everything.orig/Documentation/networking/regulatory.txt 2008-10-22 20:51:50.000000000 +0200
> +++ everything/Documentation/networking/regulatory.txt 2008-10-22 20:54:12.000000000 +0200
> @@ -131,7 +131,7 @@ are expected to do this during initializ
>
> r = zd_reg2alpha2(mac->regdomain, alpha2);
> if (!r)
> - regulatory_hint(hw->wiphy, alpha2, NULL);
> + regulatory_hint(alpha2);
>
> Example code - drivers providing a built in regulatory domain:
Should we mention how currently this should be avoided unless
your regulatory definition is also intersected with hw capabilities
and that the same channels are the ones that are registered to cfg80211?
Luis
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wireless: update regulatory sample code
2008-10-22 19:41 ` Johannes Berg
@ 2008-10-22 14:40 ` Luis R. Rodriguez
2008-10-23 6:24 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2008-10-22 14:40 UTC (permalink / raw)
To: Johannes Berg
Cc: Luis Rodriguez, John Linville, Luis R. Rodriguez, linux-wireless
On Wed, Oct 22, 2008 at 12:41:28PM -0700, Johannes Berg wrote:
> On Wed, 2008-10-22 at 05:35 -0700, Luis R. Rodriguez wrote:
> > On Wed, Oct 22, 2008 at 11:55:52AM -0700, Johannes Berg wrote:
> > > Update the same code for the recent changes. I did this as a
> > > separate patch to avoid removing a lot of sample code only
> > > to add it back again in the next patch.
> > >
> > > Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> > > ---
> > > Documentation/networking/regulatory.txt | 19 ++++++++-----------
> > > 1 file changed, 8 insertions(+), 11 deletions(-)
> > >
> > > --- everything.orig/Documentation/networking/regulatory.txt 2008-10-22 20:51:50.000000000 +0200
> > > +++ everything/Documentation/networking/regulatory.txt 2008-10-22 20:54:12.000000000 +0200
> > > @@ -131,7 +131,7 @@ are expected to do this during initializ
> > >
> > > r = zd_reg2alpha2(mac->regdomain, alpha2);
> > > if (!r)
> > > - regulatory_hint(hw->wiphy, alpha2, NULL);
> > > + regulatory_hint(alpha2);
> > >
> > > Example code - drivers providing a built in regulatory domain:
> >
> > Should we mention how currently this should be avoided unless
> > your regulatory definition is also intersected with hw capabilities
> > and that the same channels are the ones that are registered to cfg80211?
Well rd hint for when we provide a structure, that code right now
disregards when initiator == USER, and this works well only for
when the driver sending the rd struct hint also only registered
to cfg80211 the channels its legally capable of. If a driver
which does not use reg_notifier() and registers *all* of its channels
uses this then the USER set regdom will be used and *all* channels
will be left intact.
Luis
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] wireless: update regulatory sample code
@ 2008-10-22 18:55 Johannes Berg
2008-10-22 12:35 ` Luis R. Rodriguez
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2008-10-22 18:55 UTC (permalink / raw)
To: John Linville; +Cc: Luis R. Rodriguez, linux-wireless
Update the same code for the recent changes. I did this as a
separate patch to avoid removing a lot of sample code only
to add it back again in the next patch.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
Documentation/networking/regulatory.txt | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
--- everything.orig/Documentation/networking/regulatory.txt 2008-10-22 20:51:50.000000000 +0200
+++ everything/Documentation/networking/regulatory.txt 2008-10-22 20:54:12.000000000 +0200
@@ -131,7 +131,7 @@ are expected to do this during initializ
r = zd_reg2alpha2(mac->regdomain, alpha2);
if (!r)
- regulatory_hint(hw->wiphy, alpha2, NULL);
+ regulatory_hint(alpha2);
Example code - drivers providing a built in regulatory domain:
--------------------------------------------------------------
@@ -178,17 +178,14 @@ Then in some part of your code after you
rd = kzalloc(size_of_regd, GFP_KERNEL);
if (!rd)
- return -ENOMEM;
+ return -ENOMEM;
memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain));
- for (i=0; i < num_rules; i++) {
- memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i],
- sizeof(struct ieee80211_reg_rule));
- }
- r = regulatory_hint(hw->wiphy, NULL, rd);
- if (r) {
- kfree(rd);
- return r;
- }
+ for (i=0; i < num_rules; i++)
+ memcpy(&rd->reg_rules[i],
+ &mydriver_jp_regdom.reg_rules[i],
+ sizeof(struct ieee80211_reg_rule));
+ regulatory_struct_hint(rd, BIT(IEEE80211_BAND_2GHZ) |
+ BIT(IEEE80211_BAND_5GHZ));
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wireless: update regulatory sample code
2008-10-22 12:35 ` Luis R. Rodriguez
@ 2008-10-22 19:41 ` Johannes Berg
2008-10-22 14:40 ` Luis R. Rodriguez
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2008-10-22 19:41 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: John Linville, Luis R. Rodriguez, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]
On Wed, 2008-10-22 at 05:35 -0700, Luis R. Rodriguez wrote:
> On Wed, Oct 22, 2008 at 11:55:52AM -0700, Johannes Berg wrote:
> > Update the same code for the recent changes. I did this as a
> > separate patch to avoid removing a lot of sample code only
> > to add it back again in the next patch.
> >
> > Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> > ---
> > Documentation/networking/regulatory.txt | 19 ++++++++-----------
> > 1 file changed, 8 insertions(+), 11 deletions(-)
> >
> > --- everything.orig/Documentation/networking/regulatory.txt 2008-10-22 20:51:50.000000000 +0200
> > +++ everything/Documentation/networking/regulatory.txt 2008-10-22 20:54:12.000000000 +0200
> > @@ -131,7 +131,7 @@ are expected to do this during initializ
> >
> > r = zd_reg2alpha2(mac->regdomain, alpha2);
> > if (!r)
> > - regulatory_hint(hw->wiphy, alpha2, NULL);
> > + regulatory_hint(alpha2);
> >
> > Example code - drivers providing a built in regulatory domain:
>
> Should we mention how currently this should be avoided unless
> your regulatory definition is also intersected with hw capabilities
> and that the same channels are the ones that are registered to cfg80211?
?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] wireless: update regulatory sample code
2008-10-22 14:40 ` Luis R. Rodriguez
@ 2008-10-23 6:24 ` Johannes Berg
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-10-23 6:24 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Luis Rodriguez, John Linville, Luis R. Rodriguez, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 995 bytes --]
On Wed, 2008-10-22 at 07:40 -0700, Luis R. Rodriguez wrote:
> > > Should we mention how currently this should be avoided unless
> > > your regulatory definition is also intersected with hw capabilities
> > > and that the same channels are the ones that are registered to cfg80211?
>
> Well rd hint for when we provide a structure, that code right now
> disregards when initiator == USER, and this works well only for
> when the driver sending the rd struct hint also only registered
> to cfg80211 the channels its legally capable of. If a driver
> which does not use reg_notifier() and registers *all* of its channels
> uses this then the USER set regdom will be used and *all* channels
> will be left intact.
No, only those that are available from CRDA will be used. And this is
totally irrelevant in the case where this applies anyway because the
Intel drivers register only the channels from their eeprom, the same set
they hint at. Yet it's still unrelated.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-10-23 6:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-22 18:55 [PATCH] wireless: update regulatory sample code Johannes Berg
2008-10-22 12:35 ` Luis R. Rodriguez
2008-10-22 19:41 ` Johannes Berg
2008-10-22 14:40 ` Luis R. Rodriguez
2008-10-23 6:24 ` Johannes Berg
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).