#!/bin/sh

[ -e /lib/firmware/$FIRMWARE ] && exit 0

. /lib/functions/caldata.sh

board=$(board_name)

case "$FIRMWARE" in
"ath9k-eeprom-pci-0000:00:00.0.bin")
	case $board in
	engenius,eap350-v1|\
	engenius,ecb350-v1|\
	engenius,enh202-v1)
		caldata_extract "art" 0x1000 0xeb8
		;;
	dlink,dir-615-e4)
		caldata_extract "art" 0x1000 0x1000
		ath9k_patch_mac_crc $(mtd_get_mac_ascii "nvram" "lan_mac") 0x10c
		;;
	netgear,wnr2000-v3|\
	ubnt,airrouter|\
	ubnt,bullet-m-ar7240|\
	ubnt,bullet-m-ar7241|\
	ubnt,nanobridge-m|\
	ubnt,nanostation-loco-m|\
	ubnt,nanostation-m|\
	ubnt,picostation-m)
		caldata_extract "art" 0x1000 0x1000
		;;
	*)
		caldata_die "board $board is not supported yet"
		;;
	esac
	;;
esac
