2008-06-30 06:37:38

by Johan Adolfsson

[permalink] [raw]
Subject: [PATCH] Add module parameter to override regioncode on libertas


Resending to linux-wireless after positive feedback on libertas-dev.

Attached is a patch against the 2.6.25 driver that adds a
module parameter called "regioncode" to set the region code
in the libertas driver.

Hope the format is ok.
Signed-off-by: [email protected]

Best regards
/Johan


Attachments:
regioncode_patch.txt (3.02 kB)

2008-06-30 17:47:11

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] Add module parameter to override regioncode on libertas

On Mon, Jun 30, 2008 at 12:44:26PM -0300, Henrique de Moraes Holschuh wrote:

> Now I get my trusty laptop with the EEPROM-based regdomain driver, and
> travel to somewhere where the channel overlap with the Americas regdomain
> the vendor used is such that the card can actually operate outside of the
> requirements for the local government. If I am lucky, it just won't allow
> me to talk to everyone like what happens in Brazil. If I am not, I could be
> breaking the law.
>
> Where, in the entire scenario above, was the regulatory information in the
> EEPROM useful to me? NEVER. It was a hindrance in every step.

Hardware vendor representatives insist that regulaions should be
enforced as the product of both where you are (or claim to be) _and_
where the device was certified to operate when it was produced. I have
no specific examples to cite of what might happen if e.g. a USA device
is operated on channel 13, but the hardware vendors insist that this
should not be allowed to happen. "It works for me" anecdotes aside,
it seems like a bad idea to encourage (or fail to discourage) users
to override certified hardware regulatory settings.

If this is the only way to influence the regulatory enforcement
then your 2nd example is a valid. But in that case moving to a
cfg80211-based regulatory enforcement seems like a better way to go.

John
--
John W. Linville
[email protected]

2008-06-30 11:07:06

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] Add module parameter to override regioncode on libertas

On Mon, 2008-06-30 at 08:36 +0200, Johan Adolfsson wrote:
> Resending to linux-wireless after positive feedback on libertas-dev.
>
> Attached is a patch against the 2.6.25 driver that adds a
> module parameter called "regioncode" to set the region code
> in the libertas driver.
>
> Hope the format is ok.
> Signed-off-by: [email protected]

I wonder if libertas could start using cfg80211 for this? Just register
a wiphy and use the enabled channels there?

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-06-30 14:17:10

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] Add module parameter to override regioncode on libertas

On Mon, Jun 30, 2008 at 08:36:56AM +0200, Johan Adolfsson wrote:
>
> Resending to linux-wireless after positive feedback on libertas-dev.
>
> Attached is a patch against the 2.6.25 driver that adds a
> module parameter called "regioncode" to set the region code
> in the libertas driver.
>
> Hope the format is ok.
> Signed-off-by: [email protected]

Anyone want to offer an opinion on how this (overriding the region
code from the hardware) differs in effect from the patch that disabled
all regulatory controls on mac80211 devices?

>From what I understand about regulatory practices, it seems
irresponsible to allow a regulatory setting embedded in a device's
ROM to be so easily overridden?

John
--
John W. Linville
[email protected]

Subject: Re: [PATCH] Add module parameter to override regioncode on libertas

On Mon, 30 Jun 2008, John W. Linville wrote:
> On Mon, Jun 30, 2008 at 08:36:56AM +0200, Johan Adolfsson wrote:
> > Resending to linux-wireless after positive feedback on libertas-dev.
> >
> > Attached is a patch against the 2.6.25 driver that adds a
> > module parameter called "regioncode" to set the region code
> > in the libertas driver.
> >
> > Hope the format is ok.
> > Signed-off-by: [email protected]
>
> Anyone want to offer an opinion on how this (overriding the region
> code from the hardware) differs in effect from the patch that disabled
> all regulatory controls on mac80211 devices?
>
> >From what I understand about regulatory practices, it seems
> irresponsible to allow a regulatory setting embedded in a device's
> ROM to be so easily overridden?

IMO, it is actually the right thing to do. We should just plain ignore
EEPROM regulatory domain information (not antenna gain and other data, just
the "where in the world the card is" data) in the general case, except maybe
if you want to use as a last resort default.

Let me explain my reasoning through an example: I live in Brazil. It is
extremely common to get crippled wireless devices here, because we get
paired up with the USA and rest of the North, Central and South Americas by
some very big vendors in one big regulatory domain. That's annoying, and I
have been left without connectivity more than once when I was in a hotzone
operating in channel 13 (which has *exactly* the same restrictions for usage
as those for channels 1-12 in Brazil), but my card thought channel 13 was
illegal to operate at.

Now I get my trusty laptop with the EEPROM-based regdomain driver, and
travel to somewhere where the channel overlap with the Americas regdomain
the vendor used is such that the card can actually operate outside of the
requirements for the local government. If I am lucky, it just won't allow
me to talk to everyone like what happens in Brazil. If I am not, I could be
breaking the law.

Where, in the entire scenario above, was the regulatory information in the
EEPROM useful to me? NEVER. It was a hindrance in every step.

We live in a small world. Regulatory information in EEPROMs is something
that just plain doesn't work well in the general case for any mobile
hardware that you're going to travel with. Heck, in most cases it doesn't
work that well even if you are NOT going to travel with, given the corners
the vendors cut out of their regulatory domain tables...

The whole idea of EEPROM-based selection of a regulatory domains is a failed
concept. It cannot be fixed, so let's get rid of it. We can do better.

I'd rather I could tell the system "I am in country foo", and it would apply
all the regulatory information for country foo correctly. That's the way to
go, since the system can't find out where it is automatically (but userspace
could, actually, if given a sophisticated world map and (GPS or something
else) geo-location feed).

And, if we have devices that are exceptions (and I bet we do) and must be
always locked to some specific regulatory domain, we deal with it on the
drivers of these devices, instead of causing issues for everyone else.

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh

2008-06-30 11:59:20

by Johan Adolfsson

[permalink] [raw]
Subject: RE: [PATCH] Add module parameter to override regioncode on libertas



> -----Original Message-----
> From: Johannes Berg [mailto:[email protected]]
> Sent: den 30 juni 2008 13:05
> To: Johan Adolfsson
> Cc: [email protected]; 'Dan Williams'
> Subject: Re: [PATCH] Add module parameter to override
> regioncode on libertas
>
>
> On Mon, 2008-06-30 at 08:36 +0200, Johan Adolfsson wrote:
> > Resending to linux-wireless after positive feedback on libertas-dev.
> >
> > Attached is a patch against the 2.6.25 driver that adds a
> > module parameter called "regioncode" to set the region code
> > in the libertas driver.
> >
> > Hope the format is ok.
> > Signed-off-by: [email protected]
>
> I wonder if libertas could start using cfg80211 for this?
> Just register
> a wiphy and use the enabled channels there?
>
> johannes

I suppose it could, just read a little on the subject, but it's unclear
to me how mature the cfg80211 is and how much overkill it is compared
to what we really need (embedded solution, regulatory domains set at
production time (before shipping) and not easaly selectable by end user).

(I added liberas-dev to Cc:)

/Johan