3 [ -e /lib
/firmware
/$FIRMWARE ] && exit 0
6 .
/lib
/functions
/system.sh
9 echo "ath9k eeprom: " "$*"
13 ath9k_eeprom_extract
() {
19 mtd
=$
(find_mtd_chardev
$part)
21 ath9k_eeprom_die
"no mtd device found for partition $part"
23 dd if=$mtd of
=/lib
/firmware
/$FIRMWARE bs
=1 skip
=$offset count
=$count 2>/dev
/null || \
24 ath9k_eeprom_die
"failed to extract from $mtd"
27 ath9k_eeprom_extract_reverse
() {
35 mtd
=$
(find_mtd_chardev
"$part")
36 reversed
=$
(hexdump -v -s $offset -n $count -e '/1 "%02x "' $mtd)
38 for byte
in $reversed; do
39 caldata
="\x${byte}${caldata}"
42 printf "%b" "$caldata" > /lib
/firmware
/$FIRMWARE
48 "ath9k-eeprom-pci-0000:00:00.0.bin")
51 ath9k_eeprom_extract_reverse
"urloader" 5441 1088
55 ath9k_eeprom_extract
"art" 20480 1088
58 "tplink,tl-wr740n-v2"|\
60 ath9k_eeprom_extract
"art" 4096 2048
63 ath9k_eeprom_die
"board $board is not supported yet"