diff options
Diffstat (limited to 'target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom')
-rw-r--r-- | target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom | 24 |
1 files changed, 23 insertions, 1 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 498a509012..75b763076e 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 @@ -47,6 +47,24 @@ ath9k_eeprom_extract_raw() { ath9k_eeprom_die "failed to extract from $mtd" } +ath9k_eeprom_extract_reverse() { + local part=$1 + local offset=$2 + local count=$3 + local mtd + local reversed + local caldata + + mtd=$(find_mtd_chardev "$part") + reversed=$(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd) + + for byte in $reversed; do + caldata="\x${byte}${caldata}" + done + + printf "%b" "$caldata" > /lib/firmware/$FIRMWARE +} + ath9k_eeprom_extract() { local part=$1 local offset=$2 @@ -138,7 +156,11 @@ case "$FIRMWARE" in ath9k_eeprom_extract "calibration" 61440 0 ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 524 ;; - avm,fritz3370|avm,fritz7320|avm,fritz7360sl) + avm,fritz3370-rev2-hynix|\ + avm,fritz3370-rev2-micron) + ath9k_eeprom_extract_reverse "urlader" 5441 1088 + ;; + avm,fritz7320|avm,fritz7360sl) ath9k_eeprom_extract "urlader" 2437 0 ;; tplink,tdw8970|tplink,tdw8980) |