mpc85xx: add support for Hewlett Packard MSM460
[openwrt/staging/blocktrron.git] / target / linux / mpc85xx / 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/functions.sh
10 . /lib/functions/system.sh
11
12 board=$(board_name)
13
14 case "$board" in
15 enterasys,ws-ap3715i)
16 [ "$PHYNBR" -eq 0 ] && mtd_get_mac_ascii cfg2 RADIOADDR1 > /sys${DEVPATH}/macaddress
17 [ "$PHYNBR" -eq 1 ] && mtd_get_mac_ascii cfg2 RADIOADDR0 > /sys${DEVPATH}/macaddress
18 ;;
19 enterasys,ws-ap3710i|\
20 extreme-networks,ws-ap3825i)
21 mtd_get_mac_ascii cfg2 RADIOADDR${PHYNBR} > /sys${DEVPATH}/macaddress
22 ;;
23 hpe,msm460)
24 wifi_mac=$(mtd_get_mac_binary colubris-bid 0x1f9bd)
25 [ "$PHYNBR" -eq 0 ] && echo "$wifi_mac" > /sys${DEVPATH}/macaddress
26 [ "$PHYNBR" -eq 1 ] && echo "$(macaddr_add $wifi_mac 16)" > /sys${DEVPATH}/macaddress
27 ;;
28 ocedo,panda)
29 mtd_get_mac_ascii uboot-env0 wmac$(($PHYNBR + 1)) > /sys${DEVPATH}/macaddress
30 ;;
31 sophos,red-15w-rev1)
32 mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress
33 ;;
34 esac