aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-11-12crda: Makefile: fix .so compilation line with some compilersHEADv4.15masterBrian Norris1-2/+2
Write the CC rule such that it only tries to produce a single output file (the .so). When including the .h files in the compiler invocation, this suggests we should be producing pre-compiled headers too, which doesn't make sense in this context, and Clang happens not to like. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2018-11-21README: add legacy noticeLuis Chamberlain1-5/+11
As if kernel v4.15 CRDA is no longer needed. Annotate this. The code will still be maintained to help older kernels. Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2018-11-21crda: add URLs to READMEXose Vazquez Perez1-0/+2
Cc: Luis R. Rodriguez <mcgrof@kernel.org> Cc: WIRELESS ML <linux-wireless@vger.kernel.org> Cc: REGDB ML <wireless-regdb@lists.infradead.org> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2018-11-21crda: be explicit about file permission on installLuis Chamberlain1-2/+2
If you have a umask of 077 your library files won't be accessible to non-root users. Fix that. Reported-by: Lukas Pirl <mail@lukas-pirl.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
2018-04-28reglib: properly ident code on reglib_is_valid_rd()Luis R. Rodriguez1-1/+1
Just a missing tab. No functional changes. Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
2018-01-05crda: Fix error: `keys’ defined but not usedv4.14Jelle van der Waa1-1/+1
Fix error: ‘keys’ defined but not used [-Werror=unused-const-variable=] by informing GCC keys is unused. Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
2018-01-05Update gitignoreJelle van der Waa1-0/+3
Add new binaries db2rd and optimize, also ignore the generated .so. Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
2014-12-10crda: Trust regulatory.bin from Seth Forsheev3.18Seth Forshee4-10/+23
I have taken over maintenance of the regulatory database from linville. Add my key so that regulatory.bin files signed by me will be trusted, but also keep John's key so that existing files will continue to be trusted. Update the makefile to point to the new wireless-regdb repository location, and update the readme and man page to reflect the change in maintainership. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2014-07-02crda: db2rd, parse/print CAC timeJanusz Dziedzic3-1/+18
db2rd, parse and print DFS CAC time Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2014-06-18crda: simplify text parsing for country/rulesJanusz Dziedzic1-293/+62
Remove strange parsers. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2014-06-10crda: add AUTO-BW rule flag supportJanusz Dziedzic2-0/+5
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2014-06-10crda: sync with latest nl80211.hJanusz Dziedzic2-55/+473
Sync with latest nl80211.h wireless-testing. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2014-02-19crda: Add DESTDIR support in install-libreg* rules in MakefileJohn W. Linville1-4/+4
Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2014-02-19crda: Fix the linking order to avoid compilation errorKrishna Chaitanya1-2/+3
While linking the crda.o and libreg.so, first put crda.o and then -lreg. This fixed the below error: GEN keys-gcrypt.c Trusted pubkeys: pubkeys/linville.key.pub.pem CC libreg.so CC crda.o LD crda crda.o: In function `main': crda/crda.c:196: undefined reference to `reglib_get_rd_alpha2' collect2: ld returned 1 exit status make: *** [crda] Error 1 Note: This still doesn't fix the below error (will send another mail) CHK /usr/lib/crda/regulatory.bin Database signature verification failed. Invalid or empty regulatory file, note: a binary regulatory file should be used. make: *** [verify] Error 234 Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
2014-01-24crda: document contribution process using the DCOLuis R. Rodriguez1-0/+49
This documents the contribution process for CRDA, which makes use of the Developer Certificate of Origin: http://developercertificate.org/ Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-11-20reglib: fix memset usagev3.13Christian Lamparter1-2/+2
gcc-4.8 fails to compile reglib due to: reglib.c:1133:22: error: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess] memset(rd, 0, sizeof(rd)); ^ reglib.c:1155:22: error: argument to ‘sizeof’ in... (same as above) Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: make reglib a shared libraryLuis R. Rodriguez1-12/+36
Now that we have quite a few helpers this puts the more valuable helpers into a library. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: make ssl keys include stdint.hLuis R. Rodriguez1-0/+2
This is required to fix compilation if we move reglig to its own library. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: add regulatory domain optimizerLuis R. Rodriguez4-4/+360
This adds a regulatory domain optimizer which can be used with information of a regulatory domain in db.txt format in stdin. It makes use of the new shiny regulatory domain stream parser. The way this works is it iterates over the regulatory domain computing unions between each frequency, starting from each frequency as a pivot. If a union leads to a valid regulatory rule we verify that the pivot and othre frequency rules that provided that valid union can fit into that union regulatory rule by computing an intersection. If an intersection is possible it means two rules can be optimized out. We do this repetitively. Note: cfg80211's nl80211.h API has: #define NL80211_MAX_SUPP_REG_RULES 32 Our tools, both the stream parser and the optimizer are not limited to these artificial limits ! We can work on extending the kernel's limit but so far we have had no needs. A few notes below though on the existing reasoning for the limit and possible future enhancements. This is used nl80211_set_reg() upon intercept of a regulatory domain being sent from userspace to it. We picked a limitation to at least have a stopping gap to avoid userpace flooding the kernel with a denial of service requests on memory from userspace. This means that userspace can only request at most a kmalloc of up to 32 regulatory rules for processing for the regulatory data that we are copying from userspace. There's a Linux kernel enhancement that will be made soon so that we invalidate bogus requests, by checking to see if the incomming regulatory domain alpha2 was not expected upon a regulatory hint initiator (even if userspace first tells the kernel it is waiting for a response from kernel space), and if its invalid then we drop the userspace supplied request, therefore avoiding some form of flooding on memory to the kernel. Note that we can still get flooding if the userspace API is used to *request* to the kernel for a regulatory domain to be sent from userspace, in that case the kernel will properly expect the regulatory data for the alpha2. To prevent flooding there perhaps its a good idea for us to check whether a userspace pending request is pendingg and if so deny new updates until the last one triggers a timeout. Screenshot for a US file with 40 rules: mcgrof@frijol ~/devel/xlreg (git::master)$ cat us | grep --"(" | wc -l 40 mcgrof@frijol ~/devel/crda (git::master)$ cat us country US: DFS-FCC (2402.000 - 2422.000 @ 20.000), (30.00) (2407.000 - 2427.000 @ 20.000), (30.00) (2412.000 - 2432.000 @ 20.000), (30.00) (2417.000 - 2437.000 @ 20.000), (30.00) (2422.000 - 2442.000 @ 20.000), (30.00) (2427.000 - 2447.000 @ 20.000), (30.00) (2432.000 - 2452.000 @ 20.000), (30.00) (2437.000 - 2457.000 @ 20.000), (30.00) (2442.000 - 2462.000 @ 20.000), (30.00) (2447.000 - 2467.000 @ 20.000), (30.00) (2452.000 - 2472.000 @ 20.000), (30.00) (2402.000 - 2442.000 @ 40.000), (30.00) (2407.000 - 2447.000 @ 40.000), (30.00) (2412.000 - 2452.000 @ 40.000), (30.00) (2417.000 - 2457.000 @ 40.000), (30.00) (2422.000 - 2462.000 @ 40.000), (30.00) (2427.000 - 2467.000 @ 40.000), (30.00) (2432.000 - 2472.000 @ 40.000), (30.00) (5170.000 - 5190.000 @ 20.000), (17.00) (5190.000 - 5210.000 @ 20.000), (17.00) (5210.000 - 5230.000 @ 20.000), (17.00) (5230.000 - 5250.000 @ 20.000), (17.00) (5250.000 - 5270.000 @ 20.000), (23.00), DFS (5270.000 - 5290.000 @ 20.000), (23.00), DFS (5290.000 - 5310.000 @ 20.000), (23.00), DFS (5310.000 - 5330.000 @ 20.000), (23.00), DFS (5735.000 - 5755.000 @ 20.000), (30.00) (5755.000 - 5775.000 @ 20.000), (30.00) (5775.000 - 5795.000 @ 20.000), (30.00) (5795.000 - 5815.000 @ 20.000), (30.00) (5815.000 - 5835.000 @ 20.000), (30.00) (5170.000 - 5210.000 @ 40.000), (17.00) (5210.000 - 5250.000 @ 40.000), (17.00) (5250.000 - 5290.000 @ 40.000), (23.00), DFS (5290.000 - 5330.000 @ 40.000), (23.00), DFS (5735.000 - 5775.000 @ 40.000), (30.00) (5775.000 - 5815.000 @ 40.000), (30.00) (5170.000 - 5250.000 @ 80.000), (17.00) (5250.000 - 5330.000 @ 80.000), (23.00), DFS (5735.000 - 5815.000 @ 80.000), (30.00) mcgrof@frijol ~/devel/crda (git::master)$ cat us | ./optimize country US: DFS-FCC (2402.000 - 2472.000 @ 40.000), (30.00) (5170.000 - 5250.000 @ 80.000), (17.00) (5250.000 - 5330.000 @ 80.000), (23.00), DFS (5735.000 - 5835.000 @ 80.000), (30.00) I've also tested this with the current db.txt from wireless-regdb and get real optimiziations which I will post later. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: add regulatory domain stream parserLuis R. Rodriguez4-2/+627
This adds a stream parser for regulatory domains. This allows developers to build regulatory domains now using the db.txt from a stream, either stdin, or a from an opened file. This also adds a simple db2rd which for now only uses the library but with a bit of effort can also be used as a suitable replacement for the kernel's genregdb.awk. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: fix -pedantic gcc compilationLuis R. Rodriguez1-1/+3
gcc likes to complain about this, fix that as we're going to get a bit more anal with code here soon as we're moving towards making a library out of reglib. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: relicense under copyleft-next-0.3.0Luis R. Rodriguez2-1/+232
I'm relicensing CRDA to copyleft-next-0.3.0. The original motivation was to help with the BSD family but they are not using any of this software and as this software grows I'd like to ensure we use the best free software license possible. Fontana's work on copyleft-next is great and has good community traction. At this point development for copyleft-next has slowed down as copyleft-next-0.3.0 is already a good, usable alternative to GPLv2 and GPLv3. A few notes: * With copyleft we don't have to specify 'at your option any later version' since the license allows that by default. * Some folks might wonder if copyleft-next-0.3.0 is OSI OSD-conformant or FSF-free since neither of those bodies have examined the license officially, but note, although IANAL, that copyleft-next is outbound-compatible with GPLv2 and GPLv3 Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: remove antenna gainLuis R. Rodriguez1-5/+0
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-10-30crda: consolidate passive-scan and no-ibss flagsLuis R. Rodriguez2-6/+9
We consolidate these two flags into one flag to indicate initiating radiation is not allowed. For parsing we'll treat the no-ibss flag moving forward as also passive-scan as well, newer kernels will always treat these equally, older kernels will use the still use them separately even though in practice they are used together interchangably. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-07-16reglib: add reglib_is_valid_rd() and verify data upon buildLuis R. Rodriguez3-0/+31
This will verify the sanity of a regulatory domain upon build time. This is useful if you are making modifications to wireless-regdb and need to verify the regulatory domains won't be rejected by a similar checker. In the case of the Linux kernel regulatory domain data structures that get a complaint would have been rejected completely. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-07-16reglib: Validate all structure and array lengthsBen Hutchings2-19/+44
Add checks that: - Signature length does not exceed the file length (this was already checked, but did not account for signature lengths greater than 2 GB) - Database length is long enough for all structures we expect in it - Array length calculations will not overflow To keep these checks simple, change the types of array length and index variables to unsigned int (must be at least 32-bit, matching the file format) and the types of byte-length variables to size_t. Alexandre Rebert <alexandre@cmu.edu> reported and provided a test case for the signature length issue; the others I found by inspection. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: make reglib_for_each_country() use the reglib contextLuis R. Rodriguez4-35/+42
This allows users of reglib to iterate over the regdb with just one open() and mmap() to be kept sharing as much code as possible. This makes the regdbdump and intersection code use the context therefore sharing all that boiler plate code. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: pass struct reglib_regdb_ctx to country2rd()Luis R. Rodriguez1-7/+7
This consolidates the number of arguments. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: add reglib regdb context helpers: reglib_(malloc|free)_regdb_ctx()Luis R. Rodriguez2-104/+167
These are used to allow users of reglib to instantiate a reglib context to be used with reglib without having to always open the regdb, mmap() it and verify it. It also allows us to tuck away all that magic from users and put the responsibility on reglib to do all the sanity work for users. To start with consolidate with two users: reglib_get_rd_idx() and reglib_get_rd_alpha2() Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: move regdbprint to its own helperLuis R. Rodriguez1-8/+17
We'll later move this to reglib but first we have to clean up the print utility to make it more general. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: move reglib_intersect_regdb() to reglibLuis R. Rodriguez3-63/+65
There are no functional changes in this change. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: separate intersecting a full db into a helperLuis R. Rodriguez1-21/+37
This should make it easier to review the code and allow us to stuff it next into reglib. This has no real functional changes except that of returning NULL in case of any failure while reading the regdb. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: clarify intersect.c only computes an intersectionLuis R. Rodriguez1-2/+2
World regulatory domains should deal with passive scan flags to account for gaps in the frequency spectrum that some countries do not rely on but some APs / Cell towers could be relied upon for determining location. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: fix spacing on reglib_for_each_country()Luis R. Rodriguez1-2/+2
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename min() to reglib_min()Luis R. Rodriguez2-5/+5
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename max() to reglib_max()Luis R. Rodriguez2-2/+2
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename is_valid_regdom() to reglib_is_valid_regdom()Luis R. Rodriguez2-2/+2
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename is_alpha2() to reglib_is_alpha2()Luis R. Rodriguez1-2/+2
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename isalpha_upper() to reglib_isalpha_upper()Luis R. Rodriguez1-2/+2
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename is_world_regdom() to reglib_is_world_regdom()Luis R. Rodriguez2-3/+3
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: move reg print helpers to reglibLuis R. Rodriguez3-82/+75
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: make print-regdom use internal flagsLuis R. Rodriguez1-16/+15
Do not rely on nl80211.h for general regulatory db parsing. Its best to use our own OS agnostic definitions. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: add regdb_dfs_regionsLuis R. Rodriguez1-2/+22
These are already in dbparse.py. As it stands silicon vendor DFS solutions group up DFS compliance requirements into three categorical groups. Each country that requires DFS has opted to follow one type of group category set of rules. CRDA was already reading the DFS regions but using nl80211.h definitions for its parsing and printing of these flags, its best to use our own OS agnostic definitions. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename print_regdom() to reglib_print_regdom()Luis R. Rodriguez4-4/+4
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename crda_verify_db_signature() to reglib_verify_db_signature()Luis R. Rodriguez2-7/+7
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename crda_get_file_ptr() to reglib_get_file_ptr()Luis R. Rodriguez2-11/+11
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: rename regdom_intersect() to reglib_intersect_rds()Luis R. Rodriguez3-7/+7
This fits more in line with the reglib prefix usage. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-30crda: remove verbosity out of intersect.cLuis R. Rodriguez1-30/+3
No need for such much verbosity, additionally, we'll move this eventually to reglib. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: rename world and prev_world on intersect.cLuis R. Rodriguez1-22/+22
The assumption was that intersect.c was creating a world regulatory domain for by doing an intersection of all regulatory domains. This is technically still true however it does not add passive scan flag'd frequency ranges and as such to be precise lets just rename the "world" and "prev_world" variables as intersection variables. This change introduces no functional changes. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: use gcry_mpi_release() when using gcry_mpi_scan()Luis R. Rodriguez1-0/+4
Its not well documented you should do this but I found out through valgrind. This fixes the last 4 valgrind issues I was seeing with regdbdump. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: explicitly use close() and munmap() on reglib_get_rd_alpha2()Luis R. Rodriguez1-8/+15
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: use gcry_sexp_release() on crda_verify_db_signature()Luis R. Rodriguez1-2/+6
This fixes 6 of 10 reported valgrind errors when crda_verify_db_signature() is used through regdbdump. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: separate crda_verify_db_signature() implementationsLuis R. Rodriguez1-6/+21
This will allow us to handle the error codes more cleanly and in a readible manner. This change should have no functional change. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: explicitly close file descriptor and munmap() on failuresLuis R. Rodriguez1-6/+10
Just do this explicitly. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: explicitly munmap() on reglib_get_rd_alpha2()Luis R. Rodriguez1-0/+1
Although the region mapped by mmap() is also automatically unmapped when the process is terminated lets just munmap() it ourselves to be more tidy. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-29crda: fix intersect.c memory managementLuis R. Rodriguez1-21/+13
We didn't free memory in some cases, fix this and to help with the complexity also simplify the case where any regdom_intersect() fails by completely failing. In such cases we need an alternative strategy to build "world regulatory" domains. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-25crda: annotate intersection worst case scenerioLuis R. Rodriguez1-1/+8
In the worst case scenerio of regulatory domain intersections between a different set of regulatory rules you will end up without being able to initiate radiation on any frequency range. Provide a hint as to what needs to be done next in order to actually build a useful regulatory domain. Currently we do this manually but building the mathematics would be even more useful as we grow usage of the spectrum. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-25crda: do not double count on reglib_for_each_country()Luis R. Rodriguez2-9/+4
Commit ebcbfcf4 introduced reglib_for_each_country() used by regdbump and later intersect. This helper however only increased the index count after we requestd getting a new regulatory domain, this is incorrect and causes us to iterate over the same element twice in the beginning. This means intersection and regdb printing was going over the first element twice. This has been present since v1.1. This also requires an adjustment on intersect due to the way things were being handled before. mcgrof@frijol ~/devel/crda (git::master)$ git describe --contains ebcbfcf4 v1.1.3~9 Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-24crda: move intersection if first attempt failedLuis R. Rodriguez1-2/+1
The intersection should be able to continue on even if the first two countries could not be intersected. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-24crda: fix regression when using reglib_for_each_country()Luis R. Rodriguez2-0/+13
When reglib_for_each_country() was introduced via ebcbfcf4 its users were not updated with the possibility of rd being NULL due to the fact that the parsed file could be invalid or empty. The users mcgrof@frijol ~/devel/crda (git::master)$ git describe --contains 7a09f4dd v1.1.3~8 mcgrof@frijol ~/devel/crda (git::master)$ git describe --contains ebcbfcf45 v1.1.3~9 This regression exists since v1.1. Fix this. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-23crda: move regdom_intersect() to reglibLuis R. Rodriguez3-157/+162
This will be used later by other code so just share it. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-23crda: remove unused BUG_ON() from intersect.cLuis R. Rodriguez1-7/+0
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-23crda: constify usage of struct ieee80211_regdomainLuis R. Rodriguez6-35/+38
Where we can use const. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-23crda: remove verbose errors out of regdom_intersect()Luis R. Rodriguez1-10/+3
We want to move this to reglib so nuke all that fluff. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-23crda: port over Linux is_valid_reg_rule() change bd05f28eLuis R. Rodriguez1-1/+2
This was added upstream: mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains bd05f28e v2.6.29~3^2~47 commit bd05f28e1a15ae62994fe309a524695fe26dd834 Author: Roel Kluin <roel.kluin@gmail.com> Date: Tue Mar 3 22:55:21 2009 +0100 cfg80211: test before subtraction on unsigned freq_diff is unsigned, so test before subtraction Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-05-23crda: make reg_rules_intersect() style match LinuxLuis R. Rodriguez1-4/+4
This makes reg_rules_intersect() style match exactly as it is upstream as of next-20130522. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-04-03crda: display DFS regulatory domain in regdbdumpZefir Kurtisi1-1/+18
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-04-03crda: synch up nl80211.hZefir Kurtisi1-97/+1110
This is needed to make DFS regulatory domain support work again. Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2013-01-21crda: fix compile warning on pcc for reglib for string.hLuis R. Rodriguez1-0/+1
This fixes these compile warnings: make -j5 -l4 UDEV_RULE_DIR=/lib/udev/rules.d REG_BIN=/usr/lib64/crda/regulatory.bin USE_OPENSSL=1 CC=x86_64-pc-linux-gnu-gcc all_noverify V=1 x86_64-pc-linux-gnu-gcc -c -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -o crda.o crda.c x86_64-pc-linux-gnu-gcc -c -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -o intersect.o intersect.c ./utils/key2pub.py --ssl pubkeys/linville.key.pub.pem keys-ssl.c x86_64-pc-linux-gnu-gcc -c -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -o print-regdom.o print-regdom.c x86_64-pc-linux-gnu-gcc -c -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -o regdbdump.o regdbdump.c x86_64-pc-linux-gnu-gcc -c -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -o reglib.o reglib.c reglib.c: In function ‘country2rd’: reglib.c:213:2: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration] reglib.c:213:2: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default] reglib.c: In function ‘reglib_get_rd_alpha2’: reglib.c:344:3: warning: implicit declaration of function ‘memcmp’ [-Wimplicit-function-declaration] x86_64-pc-linux-gnu-gcc -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o crda reglib.o crda.o `pkg-config --libs openssl` -lnl-genl-3 -lnl-3 `pkg-config --libs libnl-3.0` x86_64-pc-linux-gnu-gcc -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o intersect reglib.o intersect.o print-regdom.o `pkg-config --libs openssl` x86_64-pc-linux-gnu-gcc -Os -pipe -march=native -frecord-gcc-switches -ggdb -Wall -g -DUSE_OPENSSL -DPUBKEY_DIR=\"/etc/wireless-regdb/pubkeys\" `pkg-config --cflags openssl` -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o regdbdump reglib.o regdbdump.o print-regdom.o `pkg-config --libs openssl` Reported-by: Richard Farina <sidhayn@gmail.com> Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2012-01-18crda: rename reglib_get_*() routinesv1.1.3Luis R. Rodriguez3-7/+7
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>
2012-01-18crda: make usage of regdb.h exclusive to reglib.cLuis R. Rodriguez3-11/+13
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>
2012-01-18crda: make country2rd() staticLuis R. Rodriguez2-6/+3
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-01-18crda: clean header filesLuis R. Rodriguez3-9/+0
Remove unused headers now that we have an object (soon to be library) using what it has to separately. Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-01-18crda: make crda use reglib_get_country_alpha2()Luis R. Rodriguez1-87/+23
This removes all file specific operations over to the reglib. This also required converting the processing of the regulatory domain from the mmap'd rules to the standard ieee80211_regdomain data structure. Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-01-18crda: add dfs_region to the ieee80211_regdomain data structureLuis R. Rodriguez2-0/+2
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>
2012-01-18crda: add new reglib_get_country_alpha2()Luis R. Rodriguez2-0/+77
This will be used by CRDA to find the alpha2. Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-01-18crda: close fd upon leavingLuis R. Rodriguez1-0/+3
This was never done. Do this at the end for now but soon this will be changed in preference for the file opening only to be done by crda for checking which file to use to pass on to reglib for usage. Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-01-18crda: make intersect.c use reglib_for_each_country()Luis R. Rodriguez1-81/+12
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-01-18crda: add a reglib iterator reglib_for_each_country()Luis R. Rodriguez4-76/+83
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>
2012-01-18crda: move country2rd() and its helper to reglib.cLuis R. Rodriguez2-61/+61
Start cleaning the way we deal with reglib.c as the goal is to make that stuff a library to be shared first in userspace with the regulatory simulator [0]. We start off by moving country2rd() and its helper over to reglib.c. [0] git://github.com/mcgrof/regsim.git Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2012-01-18crda: add nested support for libnl-3.2Stefan Lippers-Hollmann2-11/+18
Skip libnl-3.1 due to broken .pc files. Tested to work with: - libnl-3.2.3 (Debian 3.2.3-1) Changes-licensed-under: ISC Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
2011-11-15crda: use stdint.h instead of linux/types.hLuis R. Rodriguez7-47/+47
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>
2011-10-10crda: add support to send DFS master regionLuis R. Rodriguez3-1/+24
wireless-regdb now has support for a DFS master region for each country. We must read this from the file and send it as an NL80211_ATTR_DFS_REGION attribute. We add a "creqs" value for the country structure but only use the first two bits as that is all we need right now. Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
2011-10-10crda: fix null string assumption for alpha2Luis R. Rodriguez2-15/+2
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>
2011-10-03crda: synch up nl80211.hLuis R. Rodriguez1-48/+1916
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
2011-08-09crda: add nested support for libnl-3.0v1.1.2Tim Gardner2-9/+16
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
2010-01-25Space fixv1.1.1Luis R. Rodriguez1-1/+1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2010-01-25Implement runtime loading of RSA public keysPaul Fertser2-1/+25
This patch allows crda to load and use additional keys from a pre-configured location for the database signature verification. This provides a convenient way for distro maintainers and card manufacturers to supply a custom regulatory database along with their public keys, without the need to recompile crda. Implemented for USE_OPENSSL=1 case only because libgcrypt lacks PEM parser. Default location for public keys in PEM format is /etc/wireless-regdb/pubkeys and can be changed by specifying RUNTIME_PUBKEY_DIR at the make command line. Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2009-10-13crda: Cosmetic fix for udev pathTim Gardner1-1/+1
BugLink: http://bugs.launchpad.net/bugs/340995 SBINDIR already has a trailing '/', so its not needed in the udev rule. Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
2009-08-06CRDA and cross-compilationPavel Roskin1-2/+5
On Thu, 2009-08-06 at 09:56 -0700, Luis R. Rodriguez wrote: > ACK, is it possible to make it simpler? OK, here's my take. We only need a native compiler to verify regulatory.bin. I believe it's orthogonal to building CRDA. For someone doing a cross-compilation, it makes no sense to verify the installed regulatory.bin. Thus, the verification should be optional. But the compilation of regdbdump shouldn't be. Firstly, it's installed by "make install". Secondly, somebody may want to verify regulatory.bin on the target system. Here's the patch: crda: make it possible to disable verification Signed-off-by: Pavel Roskin <proski@gnu.org>
2009-04-17break lines nicer in 64-bit openssl keysv1.1.0Johannes Berg1-1/+1
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
2009-04-17make openssl keys 64-bit safeJohannes Berg1-1/+32
openssl uses unsigned longs -- which are 8 bytes on 64-bit platforms, not 4, so the python code needs to account for that... how stupid! Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
2009-04-17make openssl verification safe for multiple keysJohannes Berg1-14/+10
it seems openssl caches some things in there and subsequent uses of the same key struct fail or something -- since this fixes it I'm not bothering trying to figure out what's wrong Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
2009-04-17Allow distributions to specify a custom pubkeys dirv1.0.2Luis R. Rodriguez1-2/+6
Distributions which need a custom pubkey dir can just specify it upon build time. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-03-05Doh, forgot to add crda after SBINDIRLuis R. Rodriguez1-1/+1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-02-24Add comments to explain pathsLuis R. Rodriguez1-3/+3
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-02-24Add /usr/local/lib/crda/regulatory.bin as first in pathLuis R. Rodriguez1-0/+1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-02-24crda: allow loading of regulatory.bin from /lib/crda in addition to ↵Helmut Schaa1-3/+13
/usr/lib/crda As crda is typically installed in /sbin it might be worth to install regulatory.bin into /lib/crda instead of /usr/lib/crda. Hence, extend crda to try both paths for loading the database. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
2009-02-24Fix Makefile to not overwrite udev/regulatory.rules for SBINDIR changesLuis R. Rodriguez1-3/+3
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-02-11also replace the SBINDIR used in the rules fileDaniel Mierswa2-1/+2
2009-02-06use SBINDIR in install target of CRDADaniel Mierswa1-1/+1
You supply the user with a chance to specify SBINDIR during make install, yet forgot to use it in one place at the install target. I attached a patch against trunk for crda.git which fixes that.
2009-02-02crda: rename nl_handle to nl_sock for libnl-2.0Pat Erley1-13/+14
Upstream has renamed nl_handle to nl_sock. Update crda to the new names and add #define for libnl-1.1. Signed-off-by: Pat Erley <pat-lkml@erley.org> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-02-02crda: report if no supported version of libnl is foundPavel Roskin1-0/+4
Otherwise, the error messase would be very confusing.
2009-01-24Update debian example changelogLuis R. Rodriguez1-0/+6
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-24Updates spec file versionLuis R. Rodriguez1-1/+1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-24crda: Fix --as-needed usagev1.0.1Diego E. 'Flameeyes' Pettenò1-3/+3
For --as-needed to work (and for traditional ld too) the libraries should always be passed _after_ the object files, move them so that they are picked up properly. Also rename LIBS to NLLIBS to avoid confusion between LIBS/LDLIBS. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-23Adds example debian package directory to help maintainersv1.0.0Luis R. Rodriguez6-0/+53
This one uses cdbs to make debian/rules smaller. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-23Adds example RPM spec file (assumes 1.0.0 which I will mark shortly).Luis R. Rodriguez1-0/+32
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-23Small makefile fixLuis R. Rodriguez1-2/+4
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-23Add regdbdump.8 man page and update MakefileLuis R. Rodriguez3-12/+68
We add a man page for regdbdump and we correct some typos on the Makefile. We now add SBINDIR and MANDIR targets as well for installation. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-23Fix typo on man page regarding udev rule pathLuis R. Rodriguez1-1/+1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-23Adds a crda man page, update Makefile for distributionsLuis R. Rodriguez2-1/+94
This adds crda man page and adds options the Makefile to let distributions customize their udev rule target directory and level for the regulatory.rules. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2009-01-18crda: Throw verbose error message if M2Crypto is missingMichael Buesch1-1/+7
Instead of throwing a cryptic Python backtrace, throw a better error message, if the M2Crypto module is not installed. Signed-off-by: Michael Buesch <mb@bu3sch.de>
2009-01-15crda: prevent key2pub.py from generating bogus output on failurePavel Roskin2-28/+31
Specify output file on the command line, so that it's not created in case of fatal errors, such as asbence of M2Crypto. Signed-off-by: Pavel Roskin <proski@gnu.org>
2008-12-22Add a checker for REG_BIN and easy instructions on how to add itLuis R. Rodriguez2-2/+15
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-22Allow CRDA to use new libnl2Pat Erley2-6/+45
This patch updates CRDA to use the new libnl-2 interface, and adds backwards compatability with libnl-1. It follows the same pattern that the patch included into iw uses. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Pat Erley <pat-lkml@erley.org>
2008-12-10crda: fix two bugsJohannes Berg2-3/+4
1) wrong wildcard expansion in makefile 2) multiple pubkeys don't work This fixes both of these issues. Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-03Sync nl80211.h - a few updates and now under the ISC licenseLuis R. Rodriguez1-3/+91
It contains a few nl80211 updates, this file is also now under the ISC license which removes any legal ambiguity from ISC licensed programs (like this one) from shipping it. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Use Makefile dependency information for linking.v0.9.5Diego 'Flameeyes' Pettenò1-3/+3
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Split printing functions to their own translation unit.Diego 'Flameeyes' Pettenò3-123/+126
This allows to avoid linking them in the crda binary where they are not used. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Move is_valid_reg_rule() in intersect.c.Diego 'Flameeyes' Pettenò3-21/+20
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>
2008-12-01Avoid implicit declaration of memset() with OpenSSL.Diego 'Flameeyes' Pettenò1-0/+1
When building the libgcrypt-based code, string.h is included through libgcrypt itself, but when building with OpenSSL it's missing. Include it explicitly so that it's always safe. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Mark constant the generated key tables for libgcrypt.Diego 'Flameeyes' Pettenò1-3/+3
Since they are never modified, mark the key tables constant so they are emitted in .rodata. Note that even though they are probably also never modified, the OpenSSL tables generate warnings when they are marked constant, as such they are untouched. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Mark functions static when not used outside their translation unit.Diego 'Flameeyes' Pettenò3-6/+3
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Ignore built files.Diego E. 'Flameeyes' Pettenò1-0/+2
Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Don't use recursive make for verify targetDiego 'Flameeyes' Pettenò1-2/+1
This makes the build more parallel since regdbdump.o build and link can happen in parallel with the keys generation and the build of the rest of the units. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Make it possible to switch gcrypt/openssl via knobDiego 'Flameeyes' Pettenò1-7/+14
By building with "make USE_OPENSSL=1", OpenSSL will be used in libcrypt's stead. This also allows for properly depend just on the keys-*.c source file that is actually going to be used. Note that the all target is moved up so that it still hits as default target. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Fix dependencies for parallel make and othersDiego 'Flameeyes' Pettenò1-3/+5
Since the keys .c files are included by reglib.c, it's not the final output to depend on them but rather reglib.o. This not only fixes proper regeneration of reglib.o when the pem files are changed, but also allows proper parallel make of the package. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-12-01Fix building with --as-needed LD flagDiego 'Flameeyes' Pettenò1-5/+5
When using GNU ld --as-needed option, you need to ensure that the order of parameters to the linker is formally correct, with libraries coming after the object files. For this reason, don't use LDFLAGS for passing the libraries, and make sure that LDLIBS goes at the end of the line. Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-24Install regdbdumpv0.9.4Luis R. Rodriguez1-0/+3
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-24Rename dump to regdbdump, update READMEv0.9.3Luis R. Rodriguez3-10/+17
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-17We ship our own nl80211.h so remove KLIB stuffv0.9.2Luis R. Rodriguez1-11/+3
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-17Update README and remove utils/web that the wireless-regdb.git sucked in.Luis R. Rodriguez4-706/+21
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-17Add linville's public key and use it, also do relyLuis R. Rodriguez3-85/+35
on regulutory.bin being present where the distribution wants it to be. Note that it should be installed first. You only need regulatory.bin present to verify the signature used to build it matches. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-17Whoops, forgot to git-mv regulatory.rules :)Luis R. Rodriguez1-0/+5
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-17Move regulatory.rules to its own dirLuis R. Rodriguez2-7/+2
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-11-17Separate db.txt authorship from this package, also rely onLuis R. Rodriguez7-642/+42
external URLs to retrieve the regulatory.bin and public keys. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-30Ship nl80211.h and use itv0.9.1Luis R. Rodriguez2-1/+696
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-29Remove some comments that no longer apply on intersectv0.9Luis R. Rodriguez2-16/+2
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-29This fixes SIGSEGV and incorrect free() callsLuis R. Rodriguez1-1/+1
This needs some more review... Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-29Make intersection logic a bit more readableLuis R. Rodriguez1-24/+24
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-29Add intersection code, not working yet :(Luis R. Rodriguez2-1/+340
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-29Double pointers obfuscate code, dieLuis R. Rodriguez3-14/+11
Lets make country2rd() easier to read by not using double pointers. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-29is_valid_reg_rule() is false when freq_diff is 0Luis R. Rodriguez1-1/+1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-28Add conversion utitlies, standardize printingLuis R. Rodriguez4-72/+221
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>
2008-10-28Share common routines into a reg lib, other objects will later reuse.Luis R. Rodriguez5-6/+6
renamed: regdb.c -> reglib.c renamed: crda.h -> reglib.h Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-27Move last helpers to crda.h, forgot to add crda.h to git tooLuis R. Rodriguez2-22/+49
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-27Avoid stdlib, this saves 145 bytesLuis R. Rodriguez1-2/+11
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-27Move common helpers and functions into crda.hLuis R. Rodriguez3-26/+3
We keep regdb.h clean specifically for file regdb data structures. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-23Makefile improvements.Davide Pesavento1-31/+51
* use pkg-config for libnl and openssl * fix dir creation in the 'install' target * transform all 'keys-*.c' targets into a single pattern rule * better output in non-verbose mode * general cleanup Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-23Fix some trivial warnings.Davide Pesavento2-16/+18
Fix warnings spit out by gcc -Wextra and checkpatch.pl Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-23Use the correct index when iterating over the array of public keys.Davide Pesavento1-2/+2
Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-23Unify and share get_file_ptr() too.Davide Pesavento4-47/+36
Identical code used by both crda.c and dump.c Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-23Ignore more binary files.Davide Pesavento1-0/+2
Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-23Consolidate db signature validation in one function.Davide Pesavento5-231/+134
Both crda.c and dump.c had their own version of the code which checks the validity of the signature on the regulatory db. Having a common implementation shared by both files makes maintenance easier and removes code duplication. Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-20crda: Fix the keys-gcrypt.c target and remove key.priv.pem on cleanEvgeni Golov1-1/+4
* use $(wildcard *.pem) in the keys-gcrypt.c target * remove key.priv.pem if it's the test-key in the clean target Signed-off-by: Evgeni Golov <sargentd@die-welt.net> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-20Fixed an inconsistency in OFDM and CCK flags definitionBenoit PAPILLAULT1-3/+5
This makes the flags match Linux nl80211.h Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-20Use const and add is_valid_regdom() checkBenoit PAPILLAULT1-6/+22
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Singed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr>
2008-10-20Added documentation on the file formatBenoit PAPILLAULT1-18/+29
Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-10-20Added libnl dependencyBenoit PAPILLAULT1-0/+2
Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-30Remove silly debug print from reg_handler()Luis R. Rodriguez1-1/+0
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-30Initialize gcrypt in dump.cLuis R. Rodriguez2-1/+7
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-29Makefile: add support for DESTDIR.Davide Pesavento1-8/+11
Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-29Use char literals in comparisons, instead of their ASCII codes.Davide Pesavento1-3/+2
Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-29Delay netlink initialization and cache allocation.Davide Pesavento1-31/+21
By calling nl80211_init() a bit later, we can simplify error handling and avoid a lot of goto's in error paths. While at it, fix a couple of minor leaks in openssl-related code. Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-29Do not initialize gcrypt twice.Davide Pesavento1-5/+3
Signed-off-by: Davide Pesavento <davidepesa@gmail.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-17Fix gcrypt initializationJohannes Berg1-0/+6
This seems to fix to get this to work on some versions of gcrypt.
2008-09-05Forgot once more place to remov NO-HT40Luis R. Rodriguez1-2/+0
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-09-05No need for NO-HT20 or NO-HT40, remove them as this code isn't used yetLuis R. Rodriguez1-2/+0
in userspace anywhere and kernel support hasn't been merged yet. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-08-12Install regulatory.rules into udev directory.Luis R. Rodriguez1-0/+1
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-08-12Use your KLIB_BUILD path for nl80211 headers.Luis R. Rodriguez1-1/+6
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-08-11Instead of setting NO-HT40, simply set the bandwidth to 20 MHz.Luis R. Rodriguez1-70/+70
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-08-11Let the kernel use uevents to call CRDA.Luis R. Rodriguez3-8/+36
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-11Remove unused headers.Luis R. Rodriguez1-5/+0
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-10Kill NL80211_ATTR_NUM_REG_RULES.Luis R. Rodriguez1-1/+0
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-10Kill UUID stuff.Luis R. Rodriguez1-116/+2
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-10This now sends a regulatory domain properly into the kernel :DLuis R. Rodriguez2-37/+77
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-10Add valid UUID processing.Luis R. Rodriguez1-6/+104
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-09Shut the compiler up.Luis R. Rodriguez1-3/+3
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-09Add some error return values, remove some unused variables.Luis R. Rodriguez2-19/+24
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-07-09Add CRDA, this needs some love, my netlink-fu sucks.Luis R. Rodriguez3-1/+431
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-06-17Reinstate DE, Johannes had done research on this based onLuis R. Rodriguez1-4/+8
data from "Frequenznutzungsplan" (as published in April 2008), downloaded from http://www.bundesnetzagentur.de/media/archive/13358.pdf Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-06-17Add DFS entries into db.txt. This was done for frequency rangesLuis R. Rodriguez1-118/+120
in 5260 MHz - 5700 MHz. For frequency ranges with a larger span we split them to ensure DFS is still used only on the specific band. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-06-05Remove edge power stuff from source as its not needed.Luis R. Rodriguez3-25/+0
If we can standardize on it later then good but this needs more review on implementations by different vendors. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-06-05Import a suggested guide for regulatory db.txt.Luis R. Rodriguez4-193/+614
Extend the documentation to explain details on compliance limits, and DFS. Add a LICENSE. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2008-05-29fix small problem with previous commitJohannes Berg1-14/+13
2008-05-29parse country lists right awayJohannes Berg1-8/+12
2008-05-29remove no-ht20 flagJohannes Berg3-4/+2
2008-05-29key2pub: print out explicit key lengthJohannes Berg1-4/+4
2008-05-27add edge-power settingsJohannes Berg3-11/+36
2008-05-27make db2bin take explicit argumentsJohannes Berg2-22/+31
2008-05-27add NO-HT20, NO-HT40 flagsJohannes Berg3-0/+8
2008-05-27verify that struct sizes are as expectedJohannes Berg1-0/+22
2008-05-27remove "max IR" from databaseJohannes Berg6-31/+13
2008-05-27the second 5 GHz band in DE isn't restricted to indoorJohannes Berg1-1/+1
2008-05-27add no-ibss and passive-scan flagsJohannes Berg3-0/+8
2008-05-27add another allowed band for GermanyJohannes Berg1-2/+4
2008-05-26show only two decimal digits (as that is what gets saved into the binary db)Johannes Berg2-5/+5
2008-05-26put units in bracketsJohannes Berg1-7/+7
2008-05-26fix syntax errorsJohannes Berg1-2/+2