3 FW_FILE="/lib/firmware/$FIRMWARE"
6 echo "ath9k eeprom: " "$*" >&2
10 ath9k_eeprom_extract() {
17 . /lib/functions/system.sh
19 mtd=$(find_mtd_chardev $part)
21 ath9k_eeprom_die "no mtd device found for partition $part"
23 dd if=$mtd bs=$offset skip=1 count=1 2>/dev/null | dd of=$FW_FILE bs=$count count=1 2>/dev/null || \
24 ath9k_eeprom_die "failed to extract from $mtd"
27 tpl_set_wireless_mac()
33 . /lib/functions/system.sh
35 mac=$(mtd_get_mac_binary u-boot 326656)
36 mac=$(macaddr_add $mac $offset)
38 macaddr_2bin $mac | dd bs=1 count=6 seek=2 conv=notrunc of=$FW_FILE 2>/dev/null
41 [ -e $FW_FILE ] && exit 0
45 board=$(mpc85xx_board_name)
51 ath9k_eeprom_extract "caldata" 4096 2048
52 tpl_set_wireless_mac 0
55 ath9k_eeprom_die "board $board is not supported yet"
63 ath9k_eeprom_extract "caldata" 20480 2048
64 tpl_set_wireless_mac -1
67 ath9k_eeprom_die "board $board is not supported yet"