Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2020 17:32:36 -0400
From:      Aaron <notjanedeere@gmail.com>
To:        freebsd-wireless@freebsd.org
Subject:   Re: regdomain.xml
Message-ID:  <87ea181d-b859-ea07-731e-e910e43db16b@gmail.com>

next in thread | raw e-mail | index | archive | help
Sent this to Adrian instead of the list:

---

I preface this with the realisation that I'm using 12.1-RELEASE and 
should switch to one of the dev releases.  13-CURRENT?

>     I read the "regdomain" manpage ... no help there.
>
> Yeah, it's ...old. :-0
Stick that on the TODO?  Once everything else is done, obviously.
> Luckily we can just use what's in the linux regulatory domain tables 
> because they've already done the work of scouring the regulatory sites 
> for their information :-)
I'll search for this myself, but if someone has a link?
>
>       * the regulatory database is indexed by SKU, rather than by country.
>         So adding a new _country_ is actually rather annoyingly difficult.
>           o There's a <country-codes> section that links to <rd>, so
>     either
>             someone's already done the work here or I need this item
>     explained.
>
> The file is organised per-SKU; 'rd' is regulatory domain, not country.

The <regulatory-domain> portion of the file is organised by <rd>, which 
contains a <sku>.  However, there is a <country-codes> section that is 
organised by <country> and contains an <rd>.  If I wanted to add a new 
country working under the FCC rules, I'd just add one here and presto.  
So why is adding a country difficult?

<country id="ZZ">
   <isocc>999</isocc> <name>Madeupistan</name> <rd ref="japan"/>
</country>

And now Madeupistan is mapped to the "japan" <rd>.

>       * Change the regulatory database code to be indexed by something
>     that
>         isn't hard-coded, and have the "regulatory domain entry index" map
>         _to_ an SKU where needed.
>           o "regulatory database code" meaning <rd id="...">?
>           o Since SKU in this context is not a Stock Keeping Unit ...
>             definition please?
>
>
> it /is/ stock keeping unit. Ok, so!
>
> This database is an XML representation of the Atheros regulatory 
> database. You can find that in sys/dev/ath/ath_hal/ah_regdomain/ or 
> something similar under ath_hal.
> It's organised per-SKU because the Atheros parts are kinda organised 
> that way. Eg, there are multiple japan codes because the japan rules 
> state that older hardware doesn't need to work with newer rules, but 
> newer hardware does. So each respin of the japan regdomain rules 
> created a new SKU.

This is actually more confusing rather than less.  If the SKU is a piece 
of hardware, it shouldn't be in this file at all.  If it SHOULD be here, 
it should be in its own section.  Currently there's a list of <rd>s, a 
list of <country>s, and a list of <freqband>s.  If particular hardware 
(a <sku>) needs to be mapped onto a particular <rd>, should there be a 
list of <sku>s?

Also, isn't it user-defined which domain you join?  I know my wifi 
hardware asks me which country/domain/environment I'm in, it doesn't 
seem to set that without my intervention.  Where in the software does a 
particular piece of hardware get assigned to JAPAN-2010 instead of 
JAPAN-2020?

Also ... the regulatory domains have versions?  They don't seem to be 
present in regdomain.xml.  Should they be added?

>       * This lets me do useful things like _update the regulatory
>     database_..
>           o When you refer to the "regulatory database", do you just mean
>             "/etc/regdomain.xml"?  And what updates are you trying to do
>             that are currently difficult?
>
> Well, it's a pain to update things :-) Eg, if I wanted to update the 
> US I'd have to go update all the FCC domains that the US can use. FCC 
> is FCC without DFS channels; FCC3 is FCC with DFS channels. It's just 
> a lot of work.
As implemented the file allows one <country> to <rd> mapping per ISO 
country code (<isocc>).  According to the file, the only <rd> the US 
uses is FCC.  How are you currently mapping the US onto multiple <rd>s?  
Is it happening somewhere outside "/etc/regdomain.xml"?
>
>       * add VHT flags and 80/80+80/160MHz wide channel widths.
>           o More data entry.  Link to the data you want added?
>
> I've added it for FCC. You can see what work it was just to add them 
> there. :-)
Which FreeBSD version is this work in?  13-CURRENT?
> So, I'd really like to figure out how to simplify the regdomain.xml 
> file. But - we should come up with a firm plan first. Luckily this IS 
> basically all userland work. :-)

I'm trying to understand all the relationships so the refactoring solves 
rather than causes problems.  I'll be sticking to code samples in the 
mailing list until everyone's comfortable the new format is better than 
the old one.

I'm not a FreeBSD user, mostly I just have it running on routers and 
wifi hardware (hence my interest).  Are XML config files widely used?

Anyway, thanks for the response!

CmdrWgls




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87ea181d-b859-ea07-731e-e910e43db16b>