mirror of
https://github.com/qca/qca-swiss-army-knife.git
synced 2026-01-28 01:17:17 +01:00
QCA swiss army knife
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>
|
||
|---|---|---|
| .gitignore | ||
| ar5008_initvals.h | ||
| ar9001_initvals.h | ||
| ar9002_initvals.h | ||
| ar9003_2p0_initvals.h | ||
| ar9003_2p2_initvals.h | ||
| checksums.txt | ||
| initvals.c | ||
| Makefile | ||
| README | ||
You can RTFM here: http://wireless.kernel.org/en/users/Drivers/ath9k_hw/initvals-tool