mediatek: add support for Routerich AX3000
[openwrt/staging/981213.git] / target / linux / mediatek / filogic / base-files / etc / hotplug.d / ieee80211 / 11_fix_wifi_mac
index ea8593906804a607bd4a72bafe490331189f63d9..ca98350a1b4e50d8d8731682aaeebd4992bf5f33 100644 (file)
@@ -16,7 +16,8 @@ case "$board" in
                [ "$PHYNBR" = "1" ] && cat $key_path/6gMAC > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "2" ] && cat $key_path/5gMAC > /sys${DEVPATH}/macaddress
                ;;
-       asus,tuf-ax4200)
+       asus,tuf-ax4200|\
+       asus,tuf-ax6000)
                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
@@ -35,6 +36,17 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 2) > /sys${DEVPATH}/macaddress
                ;;
+       cmcc,rax3000m)
+               case "$(cmdline_get_var root)" in
+               /dev/mmc*)
+                       addr=$(mmc_get_mac_binary factory 0xa)
+                       ;;
+               *)
+                       addr=$(mtd_get_mac_binary factory 0xa)
+                       ;;
+               esac
+               [ "$PHYNBR" = "1" ] && echo "$addr" > /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
@@ -43,11 +55,21 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress
                ;;
+       glinet,gl-mt6000)
+               addr=$(mmc_get_mac_binary factory 0x04)
+               [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
+               ;;
        h3c,magic-nx30-pro)
                addr=$(mtd_get_mac_ascii pdt_data_1 ethaddr)
                [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
                ;;
+       jcg,q30-pro)
+               # Originally, phy1 is phy0 mac with LA bit set. However, this would conflict
+               # addresses on multiple VIFs with the other radio. Use label mac to set LA bit.
+               [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(get_mac_label) > /sys${DEVPATH}/macaddress
+               ;;
        mercusys,mr90x-v1)
                addr=$(get_mac_binary "/tmp/tp_data/default-mac" 0)
                [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
@@ -63,12 +85,30 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
                ;;
+       smartrg,sdg-8612|\
+       smartrg,sdg-8614|\
+       smartrg,sdg-8622|\
+       smartrg,sdg-8632)
+               addr=$(mmc_get_mac_ascii mfginfo MFG_MAC)
+               [ "$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
+               ;;
        tplink,tl-xdr4288|\
        tplink,tl-xdr6086|\
        tplink,tl-xdr6088)
                [ "$PHYNBR" = "0" ] && get_mac_label > /sys${DEVPATH}/macaddress
                ;;
-       zyxel,ex5601-t0)
+       ubnt,unifi-6-plus)
+               addr=$(mtd_get_mac_binary EEPROM 0x6)
+               [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
+               ;;
+       routerich,ax3000|\
+       zbtlink,zbt-z8102ax|\
+       zbtlink,zbt-z8103ax|\
+       zyxel,ex5601-t0|\
+       zyxel,ex5601-t0-ubootmod)
                addr=$(mtd_get_mac_binary "Factory" 0x4)
                [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
                ;;