This adds the code used to do the final work for the Atheros HAL regulatory
dump to a CRDA db.txt. The Atheros HAL regulatory code was the only source
of information we had at that time for regulatory information.
This code is the final resulting work of the changes made to Atheros
HAL code to extract regulatory information using a new format for CRDA.
The hal-reg-dump tool was used to scrape the Atheros HAL for regulatory
informationa and extract it in a legible form.
Putting this on a public tree for historical purposes, the code itself
diverges quite a bit from what was merged on ath9k on 2.6.27 since this
code was written prior that merge effort.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
This python script can be used to read and interpret the power
rate registers for AR9003 using ath9k through debugfs. To use this you
will need applied:
0001-ath9k-Add-debugfs-interface-to-dump-registers.patch
from the crap/ directory of compat-wireless
Usage: cat /sys/kernel/debug/ath9k/phy0/regdump | read-powers
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
We are going to rename this git tree to qca-swiss-army-knife.git
and add more tools, as such lets throw the initvals work into
its own directory and allow for other tools to be thrown in here.
Lets add our own top level copyright license, and a simple README.
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
The current checksum implementation is broken,
it does not catch all differences in the initval
arrays.
Here is an example:
$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1 3ce64df7a3121eab71a13ba9c8e9d9075ab9bae5 pass
$ cat csumtest.patch | awk '{print "\t"$0}'
diff --git a/ar9330_1p1_initvals.h b/ar9330_1p1_initvals.h
index f11d9b2..508df60 100644
--- a/ar9330_1p1_initvals.h
+++ b/ar9330_1p1_initvals.h
@@ -19,7 +19,7 @@
static const u32 ar9331_1p1_baseband_postamble[][5] = {
/* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */
- {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8005, 0xd00a8005},
+ {0x00009810, 0x110a8005, 0x220a8005, 0x330a8005, 0xd00a8005},
{0x00009820, 0x206a002e, 0x206a002e, 0x206a002e, 0x206a002e},
{0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0},
{0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881},
@@ -353,7 +353,7 @@ static const u32 ar9331_1p1_xtal_25M[][2] = {
static const u32 ar9331_1p1_radio_core[][2] = {
/* Addr allmodes */
- {0x00016000, 0x36db6db6},
+ {0x00016000, 0x00db6db6},
{0x00016004, 0x6db6db40},
{0x00016008, 0x73800000},
{0x0001600c, 0x00000000},
@@ -377,7 +377,7 @@ static const u32 ar9331_1p1_radio_core[][2] = {
{0x000160b4, 0x92480040},
{0x000160c0, 0x006db6db},
{0x000160c4, 0x0186db60},
- {0x000160c8, 0x6db6db6c},
+ {0x000160c8, 0xffb6db6c},
{0x000160cc, 0x6de6c300},
{0x000160d0, 0x14500820},
{0x00016100, 0x04cb0001},
$ patch < csumtest.patch
patching file ar9330_1p1_initvals.h
$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1 3ce64df7a3121eab71a13ba9c8e9d9075ab9bae5 pass
Although the 'ar9330_1p1_initvals.h' file has been
patched, the checksums are the same in both cases.
This patch uses the SHA1 algorithm to generate hashes
for the initval arrays, and the modifications from above
can be catched with it:
$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1 e2011010f916d63f04bb8f17dbc9b977655a6132 pass
$ patch < csumtest.patch
patching file ar9330_1p1_initvals.h
$ ./verify_checksums.sh ar9330-1p1
ar9330-1p1 e2011010f916d63f04bb8f17dbc9b977655a6132 fail
+921643355e41fca62c2a97221bbd840b2f52d614 ar9331_1p1_baseband_postamble
+f3a229b38e29634251b453334db429887d0da825 ar9331_1p1_radio_core
For the reocrd, with the SHA1 code, verify_checksums.sh
will complain about the following:
$ ./verify_checksums.sh ar5008 ar9001
ar5008 e9b2f3c70ec0b86c9fe2b8611456743ee38f51c2 fail
+c8eae8c7820dded15c9f6e4d491f114faabcf70c ar5416Common
ar9001 1b4ad3f6abde428039b8f813f9985246ef8b0d00 fail
+253547730d9a29d6236b82946f9a51b76c93041b ar5416Common_9160
The checksum mismatch is caused by the fact, that the
CRC error fix submitted upstream is not yet present in
Atheros initvals.
The used SHA1 code is in public domain and it has
been taken from the MPICH2 project:
http://trac.mcs.anl.gov/projects/mpich2/export/8501/mpich2/trunk/src/mpi/romio/adio/common/sha1.chttp://trac.mcs.anl.gov/projects/mpich2/export/8501/mpich2/trunk/src/mpi/romio/adio/common/sha1.h
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The patch fixes the following warnings
(with CFLAGS=-Wall):
initvals.c:608: warning: return type defaults to ‘int’
initvals.c: In function ‘print_initvals_family’:
initvals.c:670: warning: control reaches end of non-void function
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The patch fixes the following warning
(with CFLAGS=-Wimplicit-function-declaration):
initvals.c: In function ‘print_initvals_family’:
initvals.c:612: warning: implicit declaration of function ‘strncmp’
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The patch fixes the followinf warning
(with CFLAGS=-Wmain):
initvals.c:673: warning: second argument of ‘main’ should be ‘char **’
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The patch fixes the following warnings
(with CFLAGS=-Wformat):
initvals.c: In function ‘ar5008_hw_print_initvals’:
initvals.c:393: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:394: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:395: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:396: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:397: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:398: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:399: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:400: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:401: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:402: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
initvals.c:403: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘unsigned int’
...
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The patch fixes the following warning
(with CFLAGS=-Wunused):
initvals.c: In function ‘ath9k_hw_print_initval’:
initvals.c:315: warning: unused variable ‘chksum’
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The ar9330_1p2_initvals.h file was missing from commit
0497068591 (initvals: add
ath9k specific initvals for AR9330 1.2)
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The ar9330_1p2_initvals.h file submitted to ath9k has
been generated manually from the ar9330_12.ini from the
LSDK-WLAN-9.2.0.405.tgz tarball.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
The ar9330_1p1_initvals.h file submitted to ath9k has
been generated manually from the ar9330_11.ini from the
LSDK-WLAN-9.2.0.405.tgz tarball.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
[juhosg@idared initvals-tool]$ make all
gcc -o initvals initvals.c
initvals.c: In function ‘ar9580_1p0_hw_print_initvals’:
initvals.c:476: error: ‘ar9580_1p0_modes_fast_clock’ undeclared (first use in this function)
initvals.c:476: error: (Each undeclared identifier is reported only once
initvals.c:476: error: for each function it appears in.)
<...>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
We are supposed to use -w to get the license and header crap.
./initvals -w -f ar9580-1p0 > ar9580_1p0_initvals.h
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>