NOTE: this page is for archival only, see the note at the end of the page.

Go back –> ath9k_hw documentation

initvals-tool

The initvals-tool is a userspace application used to:

  • Get checksums of the initvals for the ath9k driver
  • Reformat initval file output
  • Synch the initvals from the Atheros HAL to ath9k

Get the initvals-tool code

There's a git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/initvals-tool.git

Hardware families supported

There are 4 hardware families:

  • ar5008
  • ar9001
  • ar9002
  • ar9003

Checksumming initvals

Say you want to make some silly patch to the initvals and want to ensure you haven't broken the initvals. An easy way to verify the initvals keep their integrity is to compute a checksum of the initval arrays. A checksum will be computed for every array.

By default the checksums for all arrays for all hardware families will be computed. You can however specify the specific hardware family you want checksums for by using the -f flag.

Examples:

# Get the checksums for all arrays for al hardware families
./initvals

# Only get checksums for the AR9002 family
./initvals -f ar9002

# Only get checksums for the AR9003 family
./initvals -f ar9003

Now, suppose you want to make some changes to the AR9003 initvals style, you would read the documentation below about how to do that and then you can do something like:

# First get your old checksums
./initvals -f ar9003 | sha1sum

# Use your new shiny modified print routine
./initvals -w -f ar9003 > ar9003_initvals.h

# Only get checksums for the AR9003 family, if you get the same sha1sum then
# the newly generated initvals contain the same data as the old one
./initvals -f ar9003 | sha1sum

The current algorithm used is pretty simple and uses XOR for each array. There is a current bug with the current implementation though, which would allow you to change the initvals value on one array from one row on the same column to another but that can be fixed by taking into consideration the (row + const_row_num * col + const_col_num). Each row gets its own set of 8 bits for its checksum computation. We use a u64 for the full checksum allowing us to use arrays of a max column size of 8. The Atheros initvals currently only use up to 6 columns so we only use the first 48 bits of the checksum for now.

Reformat initval style

Depending on your OS you may or may not need the initvals in a specific format. The format can be changed by using this tool to read the original arrays and output the arrays under a new format.

Examples:

# Generate all the initvals into one large file
./initvals -w

# Generate the initvals for the AR9002 family only
./initvals -w -f ar9002

# Generate the initvals for the AR9003 family only
./initvals -w -f ar9003

Synch initvals from the Atheros HAL

If you are an Atheros employee and want to synchronize changes made on the HAL onto ath9k you can use the initvals tool to generate a new initvals header for any specific hardware family. You will just need access to the Atheros .ini files and then compile this program with ATHEROS=1 as follows:

make clean make ATHEROS=1

You can then synch up the ath9k initvals by doing:

# To synch the AR5008 initvals
./initvals -w -f ar5008 > ar5008_initvals.h

# To synch the AR9001 initvals
./initvals -w -f ar9001 > ar9001_initvals.h

# To synch the AR9002 initvals
./initvals -w -f ar9002 > ar9002_initvals.h

# To synch the AR9003 initvals
./initvals -w -f ar9003 > ar9003_initvals.h

You can then just cp the files into drivers/net/wireless/ath/ath9k/ and generate a respective patch for upstream inclusion.


This is a static dump of the old wiki, taken after locking it in January 2015. The new wiki is at https://wireless.wiki.kernel.org/.
versions of this page: last, v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1