2
0
forked from Ivasoft/openwrt

treewide: convert WiFi caldata size and offset to hexadecimal

This changes size and offset set for WiFi caldata extraction and
MAC address adjustment to hexadecimal notation.

This will be much clearer for the reader when numbers are big, and
will also match the style used for mtd-cal-data in DTS files.

Since dd cannot deal with hexadecimal notation, one has to convert
back to decimal by simple $(($hexnum)).

Acked-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler
2019-08-09 17:45:13 +02:00
committed by Alexander Couzens
parent 75bfc393ba
commit b133e466b0
11 changed files with 202 additions and 202 deletions

View File

@@ -30,7 +30,7 @@ ath9k_eeprom_die() {
ath9k_eeprom_extract_raw() {
local source=$1
local offset=$2
local offset=$(($2))
local swap=$3
local size=4096
local bs=1
@@ -50,7 +50,7 @@ ath9k_eeprom_extract_raw() {
ath9k_eeprom_extract_reverse() {
local part=$1
local offset=$2
local count=$3
local count=$(($3))
local mtd
local reversed
local caldata
@@ -102,8 +102,8 @@ ath9k_patch_fw_mac_crc() {
ath9k_patch_fw_mac() {
local mac=$1
local mac_offset=$2
local chksum_offset=$3
local mac_offset=$(($2))
local chksum_offset=$(($3))
local xor_mac
local xor_fw_mac
local xor_fw_chksum
@@ -135,40 +135,40 @@ case "$FIRMWARE" in
case "$board" in
arcadyan,arv7518pw)
ath9k_eeprom_extract "boardconfig" 1024 1
ath9k_eeprom_extract "boardconfig" 0x400 1
;;
arcadyan,arv8539pw22)
ath9k_eeprom_extract "art" 1024 1
ath9k_eeprom_extract "art" 0x400 1
;;
bt,homehub-v2b)
ath9k_eeprom_extract "art" 0 1
ath9k_patch_fw_mac_crc "00:00:00:00:00:00" 524
ath9k_eeprom_extract "art" 0x0 1
ath9k_patch_fw_mac_crc "00:00:00:00:00:00" 0x20c
;;
bt,homehub-v3a)
ath9k_eeprom_extract "art-copy" 0 1
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot_env ethaddr) +2) 268
ath9k_eeprom_extract "art-copy" 0x0 1
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot_env ethaddr) +2) 0x10c
;;
bt,homehub-v5a)
ath9k_ubi_eeprom_extract "caldata" 4096 0
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +2) 268
ath9k_ubi_eeprom_extract "caldata" 0x1000 0
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +2) 0x10c
;;
netgear,dgn3500|netgear,dgn3500b)
ath9k_eeprom_extract "calibration" 61440 0
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 524
ath9k_eeprom_extract "calibration" 0xf000 0
ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 0x20c
;;
avm,fritz3370-rev2-hynix|\
avm,fritz3370-rev2-micron|\
avm,fritz7362sl)
ath9k_eeprom_extract_reverse "urlader" 5441 1088
ath9k_eeprom_extract_reverse "urlader" 0x1541 0x440
;;
avm,fritz7312|avm,fritz7320|avm,fritz7360sl)
ath9k_eeprom_extract "urlader" 2437 0
ath9k_eeprom_extract "urlader" 0x985 0
;;
avm,fritz7412)
/usr/bin/fritz_cal_extract -i 1 -s 0x1e000 -e 0x207 -l 4096 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader")
;;
tplink,tdw8970|tplink,tdw8980)
ath9k_eeprom_extract "boardconfig" 135168 0
ath9k_eeprom_extract "boardconfig" 0x21000 0
;;
*)
ath9k_eeprom_die "board $board is not supported yet"