ath79: convert ath10k calibration data to NVMEM (ASCII MAC)
[openwrt/staging/dangole.git] / target / linux / ath79 / nand / base-files / etc / hotplug.d / ieee80211 / 10-fix-wifi-mac
1 [ "$ACTION" = "add" ] || exit 0
2
3 PHYNBR=${DEVPATH##*/phy}
4
5 [ -n $PHYNBR ] || exit 0
6
7 . /lib/functions.sh
8 . /lib/functions/system.sh
9
10 board=$(board_name)
11
12 case $board in
13 glinet,gl-e750)
14 # Set mac address for 5g device
15 [ "$PHYNBR" -eq 0 ] && \
16 macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress
17 ;;
18 zyxel,emg2926-q10a|\
19 zyxel,nbg6716)
20 ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr)
21 [ "$PHYNBR" -eq 0 ] && \
22 macaddr_add $ethaddr 1 > /sys${DEVPATH}/macaddress
23 [ "$PHYNBR" -eq 1 ] && \
24 echo -n $ethaddr > /sys${DEVPATH}/macaddress
25 ;;
26 esac