filogic: add support for ASUS TUF-AX4200
[openwrt/staging/hauke.git] / target / linux / mediatek / filogic / base-files / etc / hotplug.d / ieee80211 / 11_fix_wifi_mac
index fd822e3d4cecf4f47f6d094d936f1ad5b05e2ce8..ecaf2eadcdb8af2ce28f78768b598e5a822d2f41 100644 (file)
@@ -10,6 +10,15 @@ PHYNBR=${DEVPATH##*/phy}
 board=$(board_name)
 
 case "$board" in
+       asus,tuf-ax4200)
+               CI_UBIPART="UBI_DEV"
+               addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
+               # Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
+               # addresses on mutiple VIFs with the other radio. Set LA bit and increment
+               # mac-address instead.
+               [ "$PHYNBR" = "0" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
+               ;;
        bananapi,bpi-r3)
                addr=$(macaddr_add $(cat /sys/class/net/eth0/address) 2)
                [ "$PHYNBR" = "0" ] && macaddr_unsetbit $addr 6 > /sys${DEVPATH}/macaddress