mediatek: filogic: add support ASUS RT-AX59U
[openwrt/staging/blocktrron.git] / target / linux / mediatek / filogic / base-files / etc / hotplug.d / ieee80211 / 11_fix_wifi_mac
index 6111854e0434384eba970294ae37f48a1665b014..f8ebc1da42fb135ebfde94ff24ae6ae2dfc1b2ae 100644 (file)
@@ -16,6 +16,16 @@ case "$board" in
                [ "$PHYNBR" = "1" ] && cat $key_path/6gMAC > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "2" ] && cat $key_path/5gMAC > /sys${DEVPATH}/macaddress
                ;;
+       asus,rt-ax59u)
+               CI_UBIPART="UBI_DEV"
+               addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
+               # Originally, phy1 is phy0 mac with LA and 28th bits set. However, this would conflict
+               # addresses on multiple VIFs with the other radio when bit 28 is already set.
+               # Set LA and 28 bits and increment mac-address instead.
+               [ "$PHYNBR" = "1" ] && \
+                       macaddr_setbit_la $(macaddr_setbit $(macaddr_add $addr 1) 28) > \
+                       /sys${DEVPATH}/macaddress
+               ;;
        asus,tuf-ax4200|\
        asus,tuf-ax6000)
                CI_UBIPART="UBI_DEV"