Age | Commit message (Collapse) | Author | Files | Lines |
|
reglib_get_country_idx() --> reglib_get_rd_alpha2()
reglib_get_country_alpha2() --> reglib_get_rd_alpha2()
This reflects better what we provide back out.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
|
|
The only other remaining user of regdb.h is regdbdump tool
but as I see it this utility can exist in either a reglib
library, or on each OS for its own specific adaptation of
the reglib code. For now we just make regdbump use the local
copy of nl80211.h. Later the reglib library can have its own
print / dump utility if we deem it necessary.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
|
|
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
|
|
This will be used later once crda.c starts using the
ieee80211_regdomain data structure passed on from reglib
instead of using the mmap()'d regulatory file directly.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
|
|
This will be used by CRDA to find the alpha2.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
|
|
To allow for a simple library on reglib.c we want to enable
an iterator over the regulatory database that does not have
to lock the file, or pass references to the file. We instead
add an iterator reglib_get_country_idx() which will use a
new reglib_get_country_idx(), that does an O(n) search for
each new regulatory domain it needs to read.
The trade off here is to allow for a simple reglib.c implementation
at the cost that upon each iteration reglib_get_country_idx()
we will will be opening the regdb, and verifying the db signature.
Given that the only user of this iterator is regdbdump though and
that this is used for debugging for now this is trade off I am
willing to live with.
Systems that want to use the regdb as a database for fine tuning
radio parameters dynamically and reading this file very *often*
(seconds, minutes, who knows what the future holds) may want to
consider a slight optimization of exporting the direct mmap()
through the library but we are I think light years away from that.
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
|
|
Given that we may need to make a library out of some
routines here to share with the regulatory simulator.
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
|
|
The wireless-regdb only accounts for two bytes for
the country code but CRDA defined the alpha2 to be
as a string of length 2, and so does the nl80211 attribute
policy:
[NL80211_ATTR_REG_ALPHA2] = { .type = NLA_STRING, .len = 2 },
The meaning of a string is it'll be null terminated, so if you
do not add the null termination a country without the null termination
will not match up with the nl80211 attribute policy.
This has no impact for us unless we want to use the next available
pad byte on the wireless-regdb. This fixes CRDA by using a local copy
of the regdb's alpha2 that is properly null terminated and sending it.
The implications of this change is that new wirelesss-regdb's that
make use of the next pad byte for a country will get that country
ignored for regulatory hints sent to the kernel. At this point we
don't yet know what the next byte will be used for though so this
has no impact. The second pad byte is being used for DFS and that
is not impacted by this nor is this change required for it.
Distributions should upgrade though in case we ever do decide to use
this last precious country byte. I've tested that this indeed fixes
the bogus issue I saw when instead of using the second pad byte we
use the first pad byte. Thanks to Johannes for spotting the issue.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
|
|
The function is only ever used in that translation unit so it makes no
sense to define it for all the binaries.
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
|
|
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
|
|
Lets make country2rd() easier to read by not using
double pointers.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
|
|
This adds country2rd() and friends which allows us to
use more friendlier data structures that are not big endian
and standardizes printing this new rd structure.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
|
|
renamed: regdb.c -> reglib.c
renamed: crda.h -> reglib.h
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
|