ath79: add mikrotik subtarget
[oweals/openwrt.git] / target / linux / ath79 / mikrotik / base-files / etc / hotplug.d / firmware / 10-ath9k-eeprom
diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
new file mode 100644 (file)
index 0000000..f5f8848
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+[ -e /lib/firmware/$FIRMWARE ] && exit 0
+
+. /lib/functions/caldata.sh
+. /lib/functions/mikrotik-caldata.sh
+
+board=$(board_name)
+
+case "$FIRMWARE" in
+"ath9k-eeprom-ahb-18100000.wmac.bin")
+       case $board in
+       mikrotik,routerboard-wap-g-5hact2hnd)
+               mikrotik_caldata_extract "art" 0x1000 0x440
+               ath9k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x10) +2)
+               ;;
+       *)
+               caldata_die "board $board is not supported yet"
+               ;;
+       esac
+       ;;
+esac