ramips: use generic board detection for D-Link DAP-1522 A1
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / board.d / 02_network
index cefc4f41fe8b358d7020b55e10fe026edc3afb0c..4208321e69ccc25f0fbc966fb99d048c881f1d61 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 
 . /lib/functions.sh
-. /lib/ramips.sh
 . /lib/functions/uci-defaults.sh
 . /lib/functions/system.sh
 
@@ -50,7 +49,6 @@ ramips_setup_interfaces()
        dcs-930l-b1|\
        ht-tm02|\
        linkits7688 | \
-       linkits7688d | \
        m2m|\
        microwrt|\
        mpr-a2|\
@@ -59,7 +57,8 @@ ramips_setup_interfaces()
        omega2p | \
        timecloud|\
        w150m|\
-       widora-neo|\
+       widora,neo-16m|\
+       widora,neo-32m|\
        wnce2001|\
        zbt-cpe102|\
        zte-q7)
@@ -73,6 +72,7 @@ ramips_setup_interfaces()
                ;;
        3g-6200n|\
        ai-br100|\
+       alfa-network,ac1200rm|\
        d240|\
        db-wrt01|\
        dir-300-b7|\
@@ -84,6 +84,7 @@ ramips_setup_interfaces()
        hc5661a|\
        hc5962|\
        hlk-rm04|\
+       k2p|\
        kn|\
        kn_rc|\
        mac1200rv2|\
@@ -93,6 +94,7 @@ ramips_setup_interfaces()
        mt7628|\
        mzk-750dhp|\
        mzk-w300nh2|\
+       d-team,newifi-d2|\
        nixcore-x1-8M|\
        nixcore-x1-16M|\
        oy-0001|\
@@ -100,8 +102,10 @@ ramips_setup_interfaces()
        psg1208|\
        psg1218a|\
        r6220|\
+       rt-n12p|\
        sap-g3200u3|\
        sk-wb8|\
+       u7621-06-256M-16M|\
        vr500|\
        wf-2881|\
        witi|\
@@ -109,10 +113,10 @@ ramips_setup_interfaces()
        wndr3700v5|\
        wt1520-4M|\
        wt1520-8M|\
-       y1|\
        youku-yk1|\
        zbt-ape522ii|\
        zbt-we1326|\
+       zbtlink,zbt-we3526|\
        zbt-we826-16M|\
        zbt-we826-32M|\
        zbt-wg2626|\
@@ -122,6 +126,10 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
                ;;
+       mir3g)
+               ucidef_add_switch "switch0" \
+                       "2:lan:2" "3:lan:1" "1:wan" "6t@eth0"
+               ;;
        psg1218b)
                ucidef_add_switch "switch0" \
                        "0:lan:3" "1:lan:2" "2:lan:1" "3:wan" "6@eth0"
@@ -135,6 +143,10 @@ ramips_setup_interfaces()
                ;;
        ar670w|\
        ar725w|\
+       rt-ac51u)
+               ucidef_add_switch "switch0" \
+                       "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
+               ;;
        rt-n15|\
        wl-351)
                ucidef_add_switch "switch0" \
@@ -149,11 +161,8 @@ ramips_setup_interfaces()
        atp-52b|\
        awm002-evb-4M|\
        awm002-evb-8M|\
-       awm003-evb|\
        c20i|\
-       c50|\
        dir-645|\
-       dir-860l-b1|\
        f5d8235-v2|\
        gl-mt300a|\
        gl-mt300n|\
@@ -165,7 +174,15 @@ ramips_setup_interfaces()
        mzk-wdpr|\
        rb750gr3|\
        rt-n14u|\
+       tplink,c20-v4|\
+       tplink,c50-v3|\
+       tplink,tl-mr3420-v5|\
+       tl-wr840n-v4|\
+       tl-wr840n-v5|\
+       tl-wr841n-v13|\
+       u7628-01-128M-16M|\
        ubnt-erx|\
+       ubnt-erx-sfp|\
        ur-326n4g|\
        wrtnode|\
        wrtnode2p | \
@@ -176,6 +193,27 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
                ;;
+       c50|\
+       tplink,c20-v1)
+               ucidef_add_switch "switch0" \
+                       "1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0"
+               ;;
+       dir-860l-b1)
+               ucidef_add_switch "switch0" \
+                       "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
+               ;;
+       gb-pc1)
+               ucidef_add_switch "switch0" \
+                       "0:lan" "4:lan" "6@eth0"
+               ;;
+       gb-pc2)
+               ucidef_add_switch "switch0" \
+                       "4:lan" "0:wan" "6@eth0"
+               ;;
+       gl-mt300n-v2)
+               ucidef_add_switch "switch0" \
+                       "1:lan" "0:wan" "6@eth0"
+               ;;
        awapn2403)
                ucidef_add_switch "switch0" \
                        "0:lan" "1:wan" "6@eth0"
@@ -193,6 +231,7 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9@eth0"
                ;;
+       c108|\
        cf-wr800n)
                ucidef_add_switch "switch0" \
                        "4:lan" "6t@eth0"
@@ -203,6 +242,7 @@ ramips_setup_interfaces()
                ;;
        cs-qr10|\
        d105|\
+       dlink,dap-1522-a1|\
        dch-m225|\
        ex2700|\
        ex3700|\
@@ -211,7 +251,9 @@ ramips_setup_interfaces()
        mzk-ex750np|\
        na930|\
        pbr-d1|\
+       u25awf-h1|\
        wli-tx4-ag300n|\
+       wmdr-143n|\
        wmr-300|\
        wn3000rpv3|\
        wrh-300cr)
@@ -259,6 +301,10 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                "1:lan:2" "2:lan:1" "4:wan" "6@eth0"
                ;;
+       re350-v1)
+               ucidef_add_switch "switch0" \
+                       "0:lan" "6@eth0"
+               ;;
        re6500)
                ucidef_add_switch "switch0" \
                        "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "6@eth0"
@@ -267,13 +313,22 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8@eth0"
                ;;
+       tew-638apb-v2)
+               ucidef_add_switch "switch0" \
+                       "4:lan" "6@eth0"
+               ;;
        tew-691gr|\
        tew-692gr|\
        wlr-6000)
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
                ;;
-       vocore2)
+       vonets,var11n-300)
+               ucidef_add_switch "switch0" \
+                       "0:lan" "4:wan" "6@eth0"
+               ;;
+       vocore2|\
+       vocore2lite)
                ucidef_add_switch "switch0" \
                        "0:lan" "2:lan" "6t@eth0"
                ;;
@@ -288,7 +343,8 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "3:lan" "4:wan" "6@eth0"
                ;;
-       wcr-150gn)
+       wcr-150gn|\
+       we1026-5g-16m)
                ucidef_add_switch "switch0" \
                        "0:lan" "6t@eth0"
                ;;
@@ -300,6 +356,11 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "0:wan" "6@eth0"
                ;;
+       zbtlink,zbt-we1226|\
+       y1)
+               ucidef_add_switch "switch0" \
+                       "0:lan:2" "1:lan:1" "4:wan" "6@eth0"
+               ;;
        *)
                RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"`
                if [ -n "${RT3X5X}" ]; then
@@ -319,7 +380,8 @@ ramips_setup_macs()
 
        case $board in
        a5-v11|\
-       ht-tm02)
+       ht-tm02|\
+       wmdr-143n)
                lan_mac=$(cat /sys/class/net/eth0/address)
                ;;
        all0239-3g|\
@@ -366,6 +428,9 @@ ramips_setup_macs()
        e1700)
                wan_mac=$(mtd_get_mac_ascii config WAN_MAC_ADDR)
                ;;
+       gl-mt300n-v2)
+               wan_mac=$(mtd_get_mac_binary factory 4)
+               ;;
        hc5*61|\
        hc5661a|\
        hc5962)
@@ -378,8 +443,7 @@ ramips_setup_macs()
        kng_rc)
                wan_mac=$(mtd_get_mac_binary factory 40)
                ;;
-       linkits7688 | \
-       linkits7688d)
+       linkits7688)
                wan_mac=$(mtd_get_mac_binary factory 4)
                lan_mac=$(mtd_get_mac_binary factory 46)
                ;;
@@ -387,6 +451,9 @@ ramips_setup_macs()
                lan_mac=$(mtd_get_mac_binary factory_info 13)
                wan_mac=$(macaddr_add "$lan_mac" 1)
                ;;
+       mir3g)
+               lan_mac=$(mtd_get_mac_binary Factory 0xe006)
+               ;;
        miwifi-mini)
                wan_mac=$(cat /sys/class/net/eth0/address)
                lan_mac=$(macaddr_setbit_la "$wan_mac")
@@ -476,7 +543,7 @@ ramips_setup_macs()
 }
 
 board_config_update
-board=$(ramips_board_name)
+board=$(board_name)
 ramips_setup_interfaces $board
 ramips_setup_macs $board
 board_config_flush