ramips: fix mac address of miwifi-mini
[openwrt/openwrt.git] / target / linux / ipq806x / base-files / etc / hotplug.d / ieee80211 / 10_fix_wifi_mac
1 #!/bin/ash
2
3 [ "$ACTION" == "add" ] || exit 0
4
5 PHYNBR=${DEVPATH##*/phy}
6
7 [ -n $PHYNBR ] || exit 0
8
9 . /lib/ipq806x.sh
10 . /lib/functions/system.sh
11
12 board=$(ipq806x_board_name)
13
14 case "$board" in
15 c2600)
16 echo $(macaddr_add $(mtd_get_mac_binary default-mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
17 ;;
18 ea8500)
19 echo $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
20 ;;
21 r7800)
22 echo $(macaddr_add $(mtd_get_mac_binary art 6) $(($PHYNBR + 1)) ) > /sys${DEVPATH}/macaddress
23 ;;
24 vr2600v)
25 echo $(macaddr_add $(mtd_get_mac_binary default-mac 0) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress
26 ;;
27 *)
28 ;;
29 esac