ramips: basic support for Planex MZK-750DHP
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / uci-defaults / 02_network
index 98aefbdf3249cfa625e94871cfd22838dbf5aa82..b54b55532698951162d2fa4f02117c39a5a8980d 100755 (executable)
@@ -13,7 +13,6 @@ ramips_setup_rt3x5x_vlans()
        fi
        local wanports=""
        local lanports=""
        fi
        local wanports=""
        local lanports=""
-       swconfig dev rt305x set reset 1
        for port in 5 4 3 2 1 0; do
                if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
                        continue
        for port in 5 4 3 2 1 0; do
                if [ `swconfig dev rt305x port $port get disable` = "1" ]; then
                        continue
@@ -41,19 +40,22 @@ ramips_setup_interfaces()
        w150m | \
        all0256n | \
        all5002 | \
        w150m | \
        all0256n | \
        all5002 | \
-       broadway)
+       all5003 | \
+       broadway | \
+       dcs-930| \
+       ncs601w | \
+       wnce2001)
                ucidef_add_switch "switch0" "1" "0"
                ucidef_set_interface_lan "eth0"
                ;;
 
                ucidef_add_switch "switch0" "1" "0"
                ucidef_set_interface_lan "eth0"
                ;;
 
-       dir-615-h1 | \
        3g-6200nl | \
        3g-6200nl | \
-       wl-330n)
+       wl-330n | \
+       wmr300)
                ucidef_set_interface_lan "eth0.1"
                ;;
 
        3g-6200n | \
                ucidef_set_interface_lan "eth0.1"
                ;;
 
        3g-6200n | \
-       argus-atp52b | \
        b2c | \
        nw718 | \
        psr-680w | \
        b2c | \
        nw718 | \
        psr-680w | \
@@ -63,23 +65,56 @@ ramips_setup_interfaces()
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ;;
 
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ;;
 
-       dir-645)
+       awapn2403)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "0 6t"
+               ucidef_add_switch_vlan "switch0" "2" "1 6t"
+               ;;
+
+       br-6475nd)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 9t"
+               ucidef_add_switch_vlan "switch0" "2" "0 9t"
+               ;;
+
+       asl26555)
+               ucidef_set_interface_lan "eth0.1"
+               ucidef_add_switch "switch0" "1" "1"
                ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
                ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
-               ucidef_add_switch_vlan "switch0" "2" "0 6t"
                ;;
 
                ;;
 
-       mzk-w300nh2)
+       cy-swr1100)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 9t"
+               ucidef_add_switch_vlan "switch0" "2" "4 9t"
+               ;;
+
+       dir-610-a1 | \
+       dir-300-b7 | \
+       dir-320-b1 | \
+       dir-615-h1 | \
+       hlk-rm04 | \
+       mzk-w300nh2 | \
+       mzk-750dhp)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
                ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
                ucidef_add_switch_vlan "switch0" "2" "4 6t"
                ;;
 
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
                ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 6t"
                ucidef_add_switch_vlan "switch0" "2" "4 6t"
                ;;
 
+       awm002-evb | \
+       argus-atp52b | \
+       dir-645 | \
        f5d8235-v1 | \
        f5d8235-v2 | \
        f5d8235-v1 | \
        f5d8235-v2 | \
-       ur-326n4g)
+       hg255d | \
+       rt-n14u | \
+       wrtnode | \
+       ur-326n4g | \
+       zbt-wa05)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
                ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
                ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
@@ -98,6 +133,7 @@ ramips_setup_interfaces()
                ucidef_add_switch_vlan "switch0" "2" "0 5t"
                ;;
 
                ucidef_add_switch_vlan "switch0" "2" "0 5t"
                ;;
 
+       ar725w | \
        rt-n15 | \
        wl-351)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
        rt-n15 | \
        wl-351)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
@@ -121,12 +157,22 @@ ramips_setup_interfaces()
                ucidef_add_switch_vlan "switch0" "2" "0t 5"
                ;;
 
                ucidef_add_switch_vlan "switch0" "2" "0t 5"
                ;;
 
-       freestation5 | \
        wcr-150gn)
        wcr-150gn)
-               ucidef_set_interfaces_lan_wan "eth0.2" "eth0.1"
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "0 6t"
+               ucidef_add_switch_vlan "switch0" "2" "6t"
+               ;;
+
+       wr8305rt)
+               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "0 1 2 3 4 6t"
+               ucidef_add_switch_vlan "switch0" "2" "4 6t"
                ;;
 
        d105 | \
                ;;
 
        d105 | \
+       na930 | \
        omni-emb-hpm|\
        wli-tx4-ag300n)
                ucidef_set_interface_lan "eth0"
        omni-emb-hpm|\
        wli-tx4-ag300n)
                ucidef_set_interface_lan "eth0"
@@ -137,7 +183,7 @@ ramips_setup_interfaces()
                if [ -n "${RT3X5X}" ]; then
                        ramips_setup_rt3x5x_vlans
                else
                if [ -n "${RT3X5X}" ]; then
                        ramips_setup_rt3x5x_vlans
                else
-                       ucidef_set_interfaces_lan_wan "eth0" "eth1"
+                       ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                fi
                ;;
        esac
                fi
                ;;
        esac
@@ -150,100 +196,55 @@ ramips_setup_macs()
        local wan_mac=""
 
        case $board in
        local wan_mac=""
 
        case $board in
-       all0256n | \
-       all5002 | \
-       dir-615-h1)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               ;;
-       3g-6200n | \
-       3g300m | \
-       w150m | \
-       air3gii | \
-       argus-atp52b | \
-       bc2 | \
-       br6425 | \
-       broadway | \
-       f5d8235-v1 | \
-       mzk-w300nh2 | \
-       nw718 | \
-       psr-680w | \
-       rt-n15 | \
-       sl-r7205 | \
-       wl-351)
-               lan_mac=$(mtd_get_mac_binary factory 4)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
+       br-6475nd)
+               lan_mac=$(mtd_get_mac_binary devdata 13)
+               wan_mac=$(mtd_get_mac_binary devdata 7)
                ;;
 
        w306r-v20)
                ;;
 
        w306r-v20)
-               lan_mac=$(mtd_get_mac_binary factory 4)
                wan_mac=$(macaddr_add "$lan_mac" 5)
                ;;
 
                wan_mac=$(macaddr_add "$lan_mac" 5)
                ;;
 
-       rt-n13u | \
-       fonera20n)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
+       tew-691gr)
+               wan_mac=$(macaddr_add "$lan_mac" 3)
                ;;
 
                ;;
 
-       dir-300-b1 |\
-       dir-300-b2 |\
-       dir-600-b1)
-               lan_mac=$(mtd_get_mac_binary devdata 16388)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
+       tew-692gr)
+               wan_mac=$(macaddr_add "$lan_mac" 4)
+               ;;
+
+       m3 |\
+       m4 |\
+       x5 |\
+       x8)
+               lan_mac=$(macaddr_add "$lan_mac" -1)
                ;;
 
        dir-620-a1)
                ;;
 
        dir-620-a1)
-               lan_mac=$(mtd_get_mac_binary factory 4)
                lan_mac=$(macaddr_setbit_la "$lan_mac")
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
                lan_mac=$(macaddr_setbit_la "$lan_mac")
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
+       cy-swr1100 | \
        dir-645)
                lan_mac=$(mtd_get_mac_ascii nvram lanmac)
                wan_mac=$(mtd_get_mac_ascii nvram wanmac)
                ;;
 
        dir-645)
                lan_mac=$(mtd_get_mac_ascii nvram lanmac)
                wan_mac=$(mtd_get_mac_ascii nvram wanmac)
                ;;
 
-       esr-9753 | \
-       ur-326n4g | \
-       ur-336un)
-               lan_mac=$(mtd_get_mac_binary devdata 16388)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
-               ;;
-
        nbg-419n | \
        wcr-150gn)
        nbg-419n | \
        wcr-150gn)
-                lan_mac=$(mtd_get_mac_binary factory 4)
                 wan_mac=$(mtd_get_mac_binary factory 40)
                ;;
 
                 wan_mac=$(mtd_get_mac_binary factory 40)
                ;;
 
-       omni-emb-hpm)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               ;;
-
-       f5d8235-v2)
-               lan_mac=$(mtd_get_mac_binary "u-boot" 262148)
-               wan_mac=$(macaddr_add "$lan_mac" 1)
-               ;;
-
        rt-n56u)
        rt-n56u)
-               lan_mac=$(mtd_get_mac_binary factory 4)
                wan_mac=$(mtd_get_mac_binary factory 32772)
                ;;
 
                wan_mac=$(mtd_get_mac_binary factory 32772)
                ;;
 
-       tew-691gr)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               wan_mac=$(macaddr_add "$lan_mac" 3)
-               ;;
-
-       tew-692gr)
-               lan_mac=$(mtd_get_mac_binary factory 40)
-               wan_mac=$(macaddr_add "$lan_mac" 4)
-               ;;
-
        all0239-3g | \
        carambola | \
        all0239-3g | \
        carambola | \
-       w502u)
-               lan_mac=$(mtd_get_mac_binary factory 40)
+       freestation5 | \
+       w502u | \
+       wnce2001)
                wan_mac=$(mtd_get_mac_binary factory 46)
                ;;
 
                wan_mac=$(mtd_get_mac_binary factory 46)
                ;;
 
@@ -252,9 +253,14 @@ ramips_setup_macs()
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
-       d105 | \
-       wli-tx4-ag300n)
+       wr8305rt)
                lan_mac=$(mtd_get_mac_binary factory 4)
                lan_mac=$(mtd_get_mac_binary factory 4)
+               wan_mac=$(macaddr_add "$lan_mac" 1)
+               ;;
+
+       *)
+               lan_mac=$(cat /sys/class/net/eth0/address)
+               wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
 
        esac
                ;;
 
        esac