QCA swiss army knife
Find a file
Luis R. Rodriguez dd08b7ab9d Enhance initval checksums calculations
The checksum algorithm is simple. For each array it does
the XOR of all the values. This is buggy since it allows us
to swap values within the same column of an array and it would
yield identical checksums. An example where this flaw would
happen would be if we were to use a change like the following:

diff --git a/ar9003_2p2_initvals.h b/ar9003_2p2_initvals.h
index ec98ab5..0f57343 100644
--- a/ar9003_2p2_initvals.h
+++ b/ar9003_2p2_initvals.h
@@ -22,8 +22,8 @@
 static const u32 ar9300_2p2_radio_postamble[][5] = {
 	/* Addr      5G_HT20     5G_HT40     2G_HT40     2G_HT20   */
 	{0x0001609c, 0x0dd08f29, 0x0dd08f29, 0x0b283f31, 0x0b283f31},
-	{0x000160ac, 0xa4653c00, 0xa4653c00, 0x24652800, 0x24652800},
-	{0x000160b0, 0x03284f3e, 0x03284f3e, 0x05d08f20, 0x05d08f20},
+	{0x000160ac, 0xa4653c00, 0x03284f3e, 0x24652800, 0x24652800},
+	{0x000160b0, 0x03284f3e, 0xa4653c00, 0x05d08f20, 0x05d08f20},
 	{0x0001610c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},
 	{0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008},
 	{0x0001650c, 0x08000000, 0x00000000, 0x00000000, 0x00000000},

This change would result in the same checksum for the array
ar9300_2p2_radio_postamble. To fix this we must take into consideration
the row and column for the checksum calculation. We do this by
using a prime number in addition to each row and column and
mangle this with the value of the array x,y position. This
gives us a different value for each x,y position in the array.

With these changes the above change would not be picked up by
the initvals checksum compuation.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
2010-10-06 16:48:36 -07:00
.gitignore Add a .gitignore file 2010-07-08 10:44:26 -07:00
ar5008_initvals.h Synchs with ath9k_hw initvals 2010-10-06 16:12:03 -07:00
ar9001_initvals.h Apply the corrupt frame fix in the generated initvals 2010-07-08 10:44:27 -07:00
ar9002_initvals.h Synchs with ath9k_hw initvals 2010-10-06 16:12:03 -07:00
ar9003_2p0_initvals.h Synchs with ath9k_hw initvals 2010-10-06 16:12:03 -07:00
ar9003_2p2_initvals.h Synchs with ath9k_hw initvals 2010-10-06 16:12:03 -07:00
checksums.txt Update checksums after the last batch of changes 2010-07-08 10:44:26 -07:00
initvals.c Enhance initval checksums calculations 2010-10-06 16:48:36 -07:00
Makefile Add support for generating the AR9002 initvals from Atheros sources 2010-07-08 10:44:25 -07:00
README Add a README 2010-04-21 00:32:49 -07:00

You can RTFM here: http://wireless.kernel.org/en/users/Drivers/ath9k_hw/initvals-tool