mediatek: bpi-r4: store random MAC addresses for the BPi-R4
[openwrt/openwrt.git] / target / linux / mediatek / filogic / base-files / etc / hotplug.d / ieee80211 / 11_fix_wifi_mac
index 53c9b7f259e3fdaca80d465fda36f60634eecb0b..62860390ebb2e67cd4f8a74b6f808a5cd4293dd6 100644 (file)
@@ -42,6 +42,12 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
                ;;
+       bananapi,bpi-r4)
+               addr=$(cat /sys/class/net/eth0/address)
+               [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "2" ] && macaddr_add $addr 4 > /sys${DEVPATH}/macaddress
+               ;;
        cetron,ct3003)
                addr=$(mtd_get_mac_binary "art" 0)
                [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress