mediatek: add support for Cudy WR3000 v1
[openwrt/openwrt.git] / target / linux / mediatek / filogic / base-files / etc / hotplug.d / ieee80211 / 11_fix_wifi_mac
index bcd32fab8e256b25f87143dc6b743906979f3975..8088b98eb6e054140e0cf90361a7c6548166c70c 100644 (file)
@@ -24,6 +24,14 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_unsetbit $addr 6 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_setbit $addr 6 > /sys${DEVPATH}/macaddress
                ;;
+       cudy,wr3000-v1)
+               addr=$(mtd_get_mac_binary bdinfo 0xde00)
+               # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
+               # addresses on multiple VIFs with the other radio. Set LA bit and increment
+               # mac-address instead.
+               [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
+               ;;
        tplink,tl-xdr4288|\
        tplink,tl-xdr6086|\
        tplink,tl-xdr6088)