treewide: move MAC address patch functions to common library
[openwrt/openwrt.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 board=$(board_name)
8
9 case "$FIRMWARE" in
10 "pci_wmac0.eeprom")
11 case $board in
12 tplink,tl-wdr4900-v1)
13 caldata_extract "caldata" 0x1000 0x800
14 ath9k_patch_mac $(mtd_get_mac_binary u-boot 0x4fc00)
15 ;;
16 *)
17 caldata_die "board $board is not supported yet"
18 ;;
19 esac
20 ;;
21
22 "pci_wmac1.eeprom")
23 case $board in
24 tplink,tl-wdr4900-v1)
25 caldata_extract "caldata" 0x5000 0x800
26 ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) -1)
27 ;;
28 *)
29 caldata_die "board $board is not supported yet"
30 ;;
31 esac
32 ;;
33 esac