3 FW_FILE="/lib/firmware/$FIRMWARE"
6 echo "ath9k eeprom: " "$*" >&2
10 ath9k_eeprom_extract() {
16 mtd=$(find_mtd_chardev $part)
18 ath9k_eeprom_die "no mtd device found for partition $part"
20 dd if=$mtd bs=$offset skip=1 count=1 2>/dev/null | dd of=$FW_FILE bs=$count count=1 2>/dev/null || \
21 ath9k_eeprom_die "failed to extract from $mtd"
24 tpl_set_wireless_mac()
29 mac=$(mtd_get_mac_binary u-boot 326656)
30 mac=$(macaddr_add $mac $offset)
32 macaddr_2bin $mac | dd bs=1 count=6 seek=2 conv=notrunc of=$FW_FILE 2>/dev/null
35 [ -e $FW_FILE ] && exit 0
38 . /lib/functions/system.sh
46 ath9k_eeprom_extract "caldata" 4096 2048
47 tpl_set_wireless_mac 0
50 ath9k_eeprom_die "board $board is not supported yet"
58 ath9k_eeprom_extract "caldata" 20480 2048
59 tpl_set_wireless_mac -1
62 ath9k_eeprom_die "board $board is not supported yet"