ramips: remove default switch setup in 02_network
authorChuanhong Guo <gch981213@gmail.com>
Tue, 28 Apr 2020 23:23:34 +0000 (07:23 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Tue, 19 May 2020 11:03:02 +0000 (19:03 +0800)
ramips images now relies on explicit switch setup for proper failsafe
functionality. Remove default cases where it relies on vlan setup in
dts and add switch setup for devices affected.

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/rt288x/base-files/etc/board.d/02_network
target/linux/ramips/rt305x/base-files/etc/board.d/02_network
target/linux/ramips/rt3883/base-files/etc/board.d/02_network

index b780d48179457a871fd34e130fde1ecae55364fd..d024674c109ef2472c4eec6dd10abeb32356fa17 100755 (executable)
@@ -16,11 +16,15 @@ ramips_setup_interfaces()
        dlink,dwr-116-a1|\
        dlink,dwr-921-c1|\
        dlink,dwr-922-e2|\
+       dovado,tiny-ac|\
        ohyeah,oy-0001|\
        phicomm,psg1208|\
        phicomm,psg1218a|\
        planex,db-wrt01|\
        planex,mzk-750dhp|\
+       ralink,mt7620a-evb|\
+       ralink,mt7620a-mt7610e-evb|\
+       ralink,mt7620a-v22sg-evb|\
        sanlinking,d240|\
        youku,yk1|\
        zbtlink,zbt-ape522ii|\
@@ -71,18 +75,17 @@ ramips_setup_interfaces()
                        "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
                ;;
        asus,rt-ac51u|\
-       asus,rt-ac54u)
-               ucidef_add_switch "switch0" \
-                       "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
-               ;;
+       asus,rt-ac54u|\
        asus,rt-n14u|\
        bdcom,wap2100-sk|\
+       edimax,ew-7478apc|\
        glinet,gl-mt300a|\
        glinet,gl-mt300n|\
        glinet,gl-mt750|\
        hiwifi,hc5661|\
        wrtnode,wrtnode|\
-       zbtlink,zbt-wa05)
+       zbtlink,zbt-wa05|\
+       zyxel,keenetic-omni-ii)
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
                ;;
@@ -213,17 +216,10 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
                ;;
-       zyxel,keenetic-omni-ii)
-               ucidef_add_switch "switch0" \
-                       "0:wan" "1:lan" "2:lan" "3:lan" "4:lan" "6@eth0"
-               ;;
        zyxel,keenetic-viva)
                ucidef_add_switch "switch1" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "7t@eth0"
                ;;
-       *)
-               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               ;;
        esac
 }
 
index a6543fd38fb11aec522326bddc3b556bd6a2e5de..d758fe5543065b3bb14f3a0e91fb870873565e47 100755 (executable)
@@ -122,9 +122,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan:2" "1:lan:1" "4:wan" "6@eth0"
                ;;
-       *)
-               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               ;;
        esac
 }
 
index 0cc0e0b28b6989403b3fdb0ab703914d81786868..134ac879cd7ce77ce4caf45ed4f8f7a207075478 100755 (executable)
@@ -28,9 +28,6 @@ ramips_setup_interfaces()
        dlink,dap-1522-a1)
                ucidef_set_interface_lan "eth0"
                ;;
-       *)
-               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               ;;
        esac
 }
 
index 5f18aa98f531538a9724db32d4fb026a0ea32c8f..ae456077fa5b9161c2db8d95119cf92e55cb2b93 100755 (executable)
@@ -4,47 +4,22 @@
 . /lib/functions/uci-defaults.sh
 . /lib/functions/system.sh
 
-ramips_setup_rt3x5x_vlans()
-{
-       if [ ! -x /sbin/swconfig ]; then
-               # legacy default
-               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               return
-       fi
-       local wanports=""
-       local lanports=""
-       for port in 5 4 3 2 1 0; do
-               if [ "$(swconfig dev rt305x port $port get disable)" = "1" ]; then
-                       continue
-               fi
-               if [ "$(swconfig dev rt305x port $port get lan)" = "0" ]; then
-                       wanports="$port:wan $wanports"
-               else
-                       lanports="$port:lan $lanports"
-               fi
-       done
-       ucidef_add_switch "rt305x" $lanports $wanports "6t@eth0"
-}
-
 ramips_setup_interfaces()
 {
        local board="$1"
 
        case $board in
-       accton,wr6202|\
-       alfa-network,w502u|\
-       netcore,nw718|\
-       petatel,psr-680w|\
-       skyline,sl-r7205|\
-       upvel,ur-336un)
-               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               ;;
+       7links,px-4885-4m|\
+       7links,px-4885-8m|\
        allnet,all0256n-4m|\
        allnet,all0256n-8m|\
        allnet,all5002|\
        allnet,all5003|\
+       belkin,f7c027|\
        dlink,dcs-930l-b1|\
        dlink,dcs-930|\
+       edimax,3g-6200nl|\
+       hame,mpr-a1|\
        hame,mpr-a2|\
        hauppauge,broadway|\
        hootoo,ht-tm02|\
@@ -54,6 +29,7 @@ ramips_setup_interfaces()
        tenda,3g150b|\
        tenda,3g300m|\
        tenda,w150m|\
+       trendnet,tew-714tru|\
        unbranded,a5-v11|\
        wansview,ncs601w|\
        zorlik,zl5900v2)
@@ -61,51 +37,102 @@ ramips_setup_interfaces()
                ucidef_add_switch_attr "switch0" "enable" "false"
                ucidef_set_interface_lan "eth0"
                ;;
-       alphanetworks,asl26555-8m|\
-       alphanetworks,asl26555-16m)
+       8devices,carambola)
                ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
+                       "0:lan" "1:lan" "6@eth0"
                ;;
+       accton,wr6202|\
+       alfa-network,w502u|\
        argus,atp-52b|\
        asiarf,awm002-evb-4m|\
        asiarf,awm002-evb-8m|\
+       asus,rt-n10-plus|\
+       asus,wl-330n|\
+       asus,wl-330n3g|\
+       aztech,hw550-3g|\
+       engenius,esr-9753|\
        jcg,jhr-n805r|\
        jcg,jhr-n825r|\
        jcg,jhr-n926r|\
+       petatel,psr-680w|\
        planex,mzk-wdpr|\
+       skyline,sl-r7205|\
+       teltonika,rut5xx|\
+       tenda,w306r-v2|\
+       unbranded,xdx-rn502j|\
        upvel,ur-326n4g)
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
                ;;
-       asiarf,awapn2403)
-               ucidef_add_switch "switch0" \
-                       "0:lan" "1:wan" "6@eth0"
-               ;;
-       asus,wl-330n|\
-       easyacc,wizard-8800)
-               ucidef_set_interface_lan "eth0.1"
-               ;;
-       aximcom,mr-102n)
-               ucidef_set_interface_lan "eth0.2"
-               ;;
-       belkin,f5d8235-v2|\
-       trendnet,tew-714tru)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
-               ;;
+       airlive,air3gii|\
+       asus,rt-g32-b1|\
+       asus,rt-n13u|\
+       aximcom,mr-102n|\
        buffalo,whr-g300n|\
+       dlink,dap-1350|\
+       dlink,dir-300-b1|\
        dlink,dir-300-b7|\
        dlink,dir-320-b1|\
+       dlink,dir-600-b1|\
        dlink,dir-610-a1|\
+       dlink,dir-615-d|\
+       dlink,dir-620-a1|\
+       dlink,dir-620-d1|\
+       dlink,dwr-512-b|\
+       easyacc,wizard-8800|\
        edimax,3g-6200n|\
+       fon,fonera-20n|\
        hilink,hlk-rm04|\
+       mofinetwork,mofi3500-3gn|\
+       netcore,nw718|\
+       nexaira,bc2|\
        nixcore,x1-16m|\
        nixcore,x1-8m|\
+       olimex,rt5350f-olinuxino|\
+       olimex,rt5350f-olinuxino-evb|\
+       omnima,miniembplug|\
+       omnima,miniembwifi|\
        planex,mzk-w300nh2|\
-       zyxel,keenetic)
+       poray,ip2202|\
+       poray,m3|\
+       poray,m4-4m|\
+       poray,m4-8m|\
+       poray,x5|\
+       poray,x8|\
+       prolink,pwh2004|\
+       ralink,v22rw-2x2|\
+       unbranded,wr512-3gn-4m|\
+       unbranded,wr512-3gn-8m|\
+       upvel,ur-336un|\
+       zyxel,keenetic|\
+       zyxel,nbg-419n|\
+       zyxel,nbg-419n-v2)
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
                ;;
+       alphanetworks,asl26555-8m|\
+       alphanetworks,asl26555-16m)
+               ucidef_add_switch "switch0" \
+                       "1:lan" "2:lan" "3:lan" "4:lan" "6t@eth0"
+               ;;
+       arcwireless,freestation5)
+               # FIXME: Which is the actual wan port?
+               ucidef_add_switch "switch0" \
+                       "0:lan" "1:wan" "2:wan" "3:wan" "4:wan" "6@eth0"
+               ;;
+       asiarf,awapn2403)
+               ucidef_add_switch "switch0" \
+                       "0:lan" "1:wan" "6@eth0"
+               ;;
+       aximcom,mr-102n|\
+       trendnet,tew-638apb-v2)
+               ucidef_add_switch "switch0" \
+                       "4:lan" "6@eth0"
+               ;;
+       belkin,f5d8235-v2)
+               ucidef_add_switch "switch0" \
+                       "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0"
+               ;;
        dlink,dir-615-h1)
                ucidef_add_switch "switch0" \
                        "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "4:wan:5" "6@eth0"
@@ -133,10 +160,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan" "6t@eth0"
                ;;
-       trendnet,tew-638apb-v2)
-               ucidef_add_switch "switch0" \
-                       "4:lan" "6@eth0"
-               ;;
        wiznet,wizfi630a)
                ucidef_add_switch "switch0" \
                        "0:lan" "1:lan" "2:wan" "6@eth0"
@@ -145,14 +168,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0:lan:3" "1:lan:2" "2:lan:1" "3:lan:0" "4:wan" "6@eth0"
                ;;
-       *)
-               RT3X5X=$(grep -E "(RT3.5|RT5350)" /proc/cpuinfo)
-               if [ -n "${RT3X5X}" ]; then
-                       ramips_setup_rt3x5x_vlans
-               else
-                       ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               fi
-               ;;
        esac
 }
 
index 873c72cea39fd8468ca40dc2bdaa869a54576ad5..7b73f9394434b3ce7de41debef9d20da91c4e012 100755 (executable)
@@ -39,9 +39,6 @@ ramips_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
                ;;
-       *)
-               ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
-               ;;
        esac
 }