ath79: fix source of label MAC address for Ubiquiti XM devices
[oweals/openwrt.git] / target / linux / ath79 / generic / base-files / etc / board.d / 02_network
index 7507c6584cae8c798381ae26114bb0525982f88d..05ee1aa016fcbb8b1ab8735a39f186e6457e0f9c 100755 (executable)
@@ -89,7 +89,11 @@ ath79_setup_interfaces()
        comfast,cf-e314n-v2|\
        tplink,cpe210-v1|\
        tplink,cpe220-v2|\
+       tplink,cpe220-v3|\
        tplink,cpe510-v1|\
+       tplink,wbs210-v2|\
+       tplink,wbs510-v1|\
+       tplink,wbs510-v2|\
        ubnt,nanostation-m|\
        ubnt,routerstation)
                ucidef_set_interfaces_lan_wan "eth1" "eth0"
@@ -142,10 +146,6 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan" "2:lan"
                ;;
-       glinet,gl-ar750s)
-               ucidef_add_switch "switch0" \
-                       "0@eth0" "2:lan:2" "3:lan:1" "1:wan"
-               ;;
        iodata,etg3-r|\
        iodata,wn-ac1167dgr|\
        iodata,wn-ac1600dgr|\
@@ -156,15 +156,17 @@ ath79_setup_interfaces()
        wd,mynet-n750)
                ucidef_add_switch "switch0" \
                        "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
-       ;;
+               ;;
        librerouter,librerouter-v1)
                ucidef_add_switch "switch0" \
                        "0@eth0" "5:wan" "6@eth1" "4:lan"
-       ;;
+               ;;
        nec,wg1200cr|\
        ubnt,nanostation-ac|\
        ubnt,unifiac-mesh-pro|\
-       ubnt,unifiac-pro)
+       ubnt,unifiac-pro|\
+       yuncore,a782|\
+       yuncore,xd4200)
                ucidef_add_switch "switch0" \
                        "0@eth0" "2:lan" "3:wan"
                ;;
@@ -184,6 +186,12 @@ ath79_setup_interfaces()
                ucidef_add_switch_port_attr "switch0" 2 led 9
                ucidef_add_switch_port_attr "switch0" 5 led 2
                ;;
+       netgear,wnr2200-8m|\
+       netgear,wnr2200-16m)
+               ucidef_set_interface_wan "eth0"
+               ucidef_add_switch "switch0" \
+                       "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
+               ;;
        phicomm,k2t)
                ucidef_add_switch "switch0" \
                        "0@eth0" "3:lan:1" "5:lan:2" "4:wan"
@@ -199,6 +207,7 @@ ath79_setup_interfaces()
                ;;
        tplink,archer-a7-v5|\
        tplink,archer-c6-v2|\
+       tplink,archer-c6-v2-us|\
        tplink,archer-c7-v4|\
        tplink,archer-c7-v5|\
        tplink,tl-wdr3600-v1|\
@@ -233,7 +242,8 @@ ath79_setup_interfaces()
                        "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
                ;;
        tplink,tl-wr1043nd-v2|\
-       tplink,tl-wr1043nd-v3)
+       tplink,tl-wr1043nd-v3|\
+       tplink,tl-wr1045nd-v2)
                ucidef_add_switch "switch0" \
                        "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "6@eth0"
                ;;
@@ -261,10 +271,6 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "3:lan:1" "4:lan:2"
                ;;
-       zyxel,nbg6716)
-               ucidef_add_switch "switch0" \
-                       "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth1"
-               ;;
        *)
                ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ;;
@@ -281,17 +287,12 @@ ath79_setup_macs()
                lan_mac=$(mtd_get_mac_binary "Board data" 2)
                label_mac=$lan_mac
                ;;
-       alfa-network,ap121f|\
-       ubnt,airrouter|\
-       ubnt,bullet-m|\
-       ubnt,nanostation-m|\
-       ubnt,rocket-m|\
-       ubnt,unifi)
-               label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+       alfa-network,ap121f)
+               label_mac=$(mtd_get_mac_binary art 0x1002)
                ;;
        avm,fritz300e)
                lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
-               label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+               label_mac=$(fritz_tffs -n macwlan -i $(find_mtd_part "tffs (1)"))
                ;;
        avm,fritz4020)
                lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
@@ -391,6 +392,13 @@ ath79_setup_macs()
                wan_mac=$(mtd_get_mac_text mac 0x18)
                label_mac=$wan_mac
                ;;
+       ubnt,airrouter|\
+       ubnt,bullet-m|\
+       ubnt,nanostation-m|\
+       ubnt,rocket-m|\
+       ubnt,unifi)
+               label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
+               ;;
        ubnt,routerstation|\
        ubnt,routerstation-pro)
                wan_mac=$(fconfig -s -r -d $(find_mtd_part "RedBoot config") -n ar7100_esa)
@@ -399,10 +407,6 @@ ath79_setup_macs()
        wd,mynet-wifi-rangeextender)
                lan_mac=$(nvram get et0macaddr)
                ;;
-       zyxel,nbg6716)
-               lan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2)
-               wan_mac=$(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3)
-               ;;
        esac
 
        [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac