bcde02593a14830a944339363f5777538bc91477
[openwrt/staging/wigyori.git] / target / linux / mpc85xx / base-files / etc / hotplug.d / firmware / 10-ath9k-eeprom
1 #!/bin/sh
2
3 [ -e /lib/firmware/$FIRMWARE ] && exit 0
4
5 . /lib/functions/caldata.sh
6
7 tpl_set_wireless_mac()
8 {
9 local offset=$1
10 local mac
11
12 mac=$(mtd_get_mac_binary u-boot 0x4fc00)
13 mac=$(macaddr_add $mac $offset)
14
15 macaddr_2bin $mac | dd bs=1 count=6 seek=2 conv=notrunc of=/lib/firmware/$FIRMWARE 2>/dev/null
16 }
17
18 board=$(board_name)
19
20 case "$FIRMWARE" in
21 "pci_wmac0.eeprom")
22 case $board in
23 tplink,tl-wdr4900-v1)
24 caldata_extract "caldata" 0x1000 0x800
25 tpl_set_wireless_mac 0
26 ;;
27 *)
28 caldata_die "board $board is not supported yet"
29 ;;
30 esac
31 ;;
32
33 "pci_wmac1.eeprom")
34 case $board in
35 tplink,tl-wdr4900-v1)
36 caldata_extract "caldata" 0x5000 0x800
37 tpl_set_wireless_mac -1
38 ;;
39 *)
40 caldata_die "board $board is not supported yet"
41 ;;
42 esac
43 ;;
44 esac