diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-08-09 17:45:13 +0200 |
---|---|---|
committer | Alexander Couzens <lynxis@fe80.eu> | 2019-08-14 12:36:37 +0200 |
commit | b133e466b08e25ea59be9108de5f262f7eff49a6 (patch) | |
tree | dbc48250081f63215bbaa430651fb1cf4ad03da4 /target/linux/lantiq/base-files/etc | |
parent | 75bfc393ba6cffd783e723d3115c25b70836c116 (diff) | |
download | upstream-b133e466b08e25ea59be9108de5f262f7eff49a6.tar.gz upstream-b133e466b08e25ea59be9108de5f262f7eff49a6.tar.bz2 upstream-b133e466b08e25ea59be9108de5f262f7eff49a6.zip |
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>
Diffstat (limited to 'target/linux/lantiq/base-files/etc')
-rw-r--r-- | target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index aec963a721..82f6885221 100644 --- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -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" |