ramips: explicitly disable built-in switch when needed
authorChuanhong Guo <gch981213@gmail.com>
Fri, 10 Apr 2020 04:32:42 +0000 (12:32 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sun, 12 Apr 2020 14:29:17 +0000 (22:29 +0800)
previously we rely on the failsafe setup in preinit scripts to disable
built-in switch implicitly for single-port devices. This doesn't work
anymore due to preinit script removal.
this patch explicitly disable built-in switch for needed devices.

Fixes: a8d62a4eb1 ("ramips: remove set_preinit_iface script")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/ramips/mt7620/base-files/etc/board.d/02_network
target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
target/linux/ramips/rt305x/base-files/etc/board.d/02_network

index d870b5c11c41434ef6c7ebc12bf479adaf460fac..44a9db6ece6877eef2e5f7b7248bf857ef2c4c12 100755 (executable)
@@ -40,8 +40,14 @@ ramips_setup_interfaces()
        alfa-network,tube-e4g|\
        buffalo,wmr-300|\
        dlink,dch-m225|\
+       edimax,ew-7476rpc|\
+       edimax,ew-7478ac|\
        elecom,wrh-300cr|\
        kimax,u25awf-h1|\
+       kimax,u35wf|\
+       kingston,mlw221|\
+       kingston,mlwg2|\
+       microduino,microwrt|\
        netgear,ex2700|\
        netgear,ex3700|\
        netgear,ex6130|\
@@ -52,7 +58,12 @@ ramips_setup_interfaces()
        ravpower,wd03|\
        sercomm,na930|\
        tplink,re200-v1|\
-       tplink,re210-v1)
+       tplink,re210-v1|\
+       yukai,bocco|\
+       zbtlink,zbt-cpe102|\
+       zte,q7)
+               ucidef_add_switch "switch0"
+               ucidef_add_switch_attr "switch0" "enable" "false"
                ucidef_set_interface_lan "eth0"
                ;;
        asus,rp-n53)
@@ -106,19 +117,10 @@ ramips_setup_interfaces()
                ;;
        edimax,br-6478ac-v2|\
        tplink,archer-c2-v1)
-               ucidef_add_switch "switch1" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
-               ;;
-       edimax,ew-7476rpc|\
-       edimax,ew-7478ac|\
-       kimax,u35wf|\
-       microduino,microwrt|\
-       yukai,bocco|\
-       zbtlink,zbt-cpe102|\
-       zte,q7)
                ucidef_add_switch "switch0"
                ucidef_add_switch_attr "switch0" "enable" "false"
-               ucidef_set_interface_lan "eth0"
+               ucidef_add_switch "switch1" \
+                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
                ;;
        engenius,esr600)
                ucidef_add_switch "switch0" \
@@ -142,6 +144,8 @@ ramips_setup_interfaces()
                ;;
        iodata,wn-ac1167gr|\
        iodata,wn-ac733gr3)
+               ucidef_add_switch "switch0"
+               ucidef_add_switch_attr "switch0" "enable" "false"
                ucidef_add_switch "switch1" \
                        "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
                ;;
@@ -149,12 +153,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
                ;;
-       kingston,mlw221)
-               ucidef_set_interface_lan "eth0.2"
-               ;;
-       kingston,mlwg2)
-               ucidef_set_interface_lan "eth0.1"
-               ;;
        lava,lr-25g001)
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
@@ -170,6 +168,8 @@ ramips_setup_interfaces()
                ;;
        linksys,e1700|\
        ralink,mt7620a-mt7530-evb)
+               ucidef_add_switch "switch0"
+               ucidef_add_switch_attr "switch0" "enable" "false"
                ucidef_add_switch "switch1" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
                ;;
index 523071750611dc6e2c3e4569095d4f3ee1fe186a..a6543fd38fb11aec522326bddc3b556bd6a2e5de 100755 (executable)
@@ -11,11 +11,19 @@ ramips_setup_interfaces()
        case $board in
        alfa-network,awusfree1|\
        d-team,pbr-d1|\
+       mediatek,linkit-smart-7688|\
+       onion,omega2p|\
+       onion,omega2|\
        tama,w06|\
        tplink,re200-v2|\
        tplink,re305-v1|\
        tplink,tl-mr3020-v3|\
-       tplink,tl-wr802n-v4)
+       tplink,tl-wr802n-v4|\
+       tplink,tl-wa801nd-v5|\
+       widora,neo-16m|\
+       widora,neo-32m)
+               ucidef_add_switch "switch0"
+               ucidef_add_switch_attr "switch0" "enable" "false"
                ucidef_set_interface_lan "eth0"
                ;;
        buffalo,wcr-1166ds)
@@ -81,16 +89,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
                ;;
-       mediatek,linkit-smart-7688|\
-       onion,omega2p|\
-       onion,omega2|\
-       tplink,tl-wa801nd-v5|\
-       widora,neo-16m|\
-       widora,neo-32m)
-               ucidef_add_switch "switch0"
-               ucidef_add_switch_attr "switch0" "enable" "false"
-               ucidef_set_interface_lan "eth0"
-               ;;
        netgear,r6120)
                ucidef_add_switch "switch0" \
                        "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan" "6@eth0"
index 5efcd5395546644bbd512558ba7e8d8512522bce..d6ba16f7a8b2cb20717940e215a4673586657aeb 100755 (executable)
@@ -110,6 +110,8 @@ ramips_setup_interfaces()
                        "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
                ;;
        huawei,d105)
+               ucidef_add_switch "switch0"
+               ucidef_add_switch_attr "switch0" "enable" "false"
                ucidef_set_interface_lan "eth0"
                ;;
        huawei,hg255d)