mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
61 lines
1.1 KiB
Bash
61 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
|
|
|
. /lib/functions/caldata.sh
|
|
. /lib/functions/system.sh
|
|
|
|
board=$(board_name)
|
|
|
|
ath11k_generate_macs() {
|
|
case "$board" in
|
|
linksys,mr7350)
|
|
eth=$(mtd_get_mac_ascii devinfo hw_mac_addr)
|
|
;;
|
|
*)
|
|
eth=$(cat /sys/class/net/eth0/address)
|
|
;;
|
|
esac
|
|
|
|
touch /lib/firmware/ath11k-macs
|
|
mac1=$(macaddr_add $eth 2)
|
|
mac2=$(macaddr_add $eth 3)
|
|
mac3=$(macaddr_add $eth 4)
|
|
echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs
|
|
echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs
|
|
echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs
|
|
}
|
|
|
|
case "$FIRMWARE" in
|
|
"ath11k/IPQ6018/hw1.0/cal-ahb-c000000.wifi.bin")
|
|
case "$board" in
|
|
cmiot,ax18|\
|
|
linksys,mr|\
|
|
zn,m2)
|
|
caldata_extract "0:art" 0x1000 0x10000
|
|
;;
|
|
tplink,eap610-outdoor)
|
|
# /tmp/factory_data should be mounted by preinit
|
|
cp /tmp/factory_data/radio "/lib/firmware/$FIRMWARE"
|
|
;;
|
|
*)
|
|
caldata_die "Don't know how to read caldata for $board"
|
|
;;
|
|
esac
|
|
;;
|
|
|
|
ath11k-macs)
|
|
case "$board" in
|
|
cmiot,ax18|\
|
|
linksys,mr7350|\
|
|
zn,m2)
|
|
ath11k_generate_macs
|
|
;;
|
|
esac
|
|
;;
|
|
|
|
*)
|
|
exit 1
|
|
;;
|
|
esac
|