From 9afdb046d32866fd161233a2861476bfaf845f6a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 20 Feb 2013 15:31:43 +0000 Subject: [PATCH] brcm47xx: do not use vlan0 any more. The Broadcom switch driver says that vlan0 should not be used with any switch other than bcm5325. This makes OpenWrt always use vlan1 and vlan2 instead. SVN-Revision: 35704 --- .../brcm47xx/base-files/etc/init.d/netconfig | 80 +++++++++---------- .../lib/preinit/05_set_failsafe_switch_brcm | 2 +- .../lib/preinit/15_set_preinit_interface_brcm | 4 +- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/target/linux/brcm47xx/base-files/etc/init.d/netconfig b/target/linux/brcm47xx/base-files/etc/init.d/netconfig index 3839f9f106c..61bcb25dddb 100755 --- a/target/linux/brcm47xx/base-files/etc/init.d/netconfig +++ b/target/linux/brcm47xx/base-files/etc/init.d/netconfig @@ -81,10 +81,10 @@ start() { BEGIN { FS="=" - c["lan_ifname"]="eth0.0" - c["wan_ifname"]="eth0.1" - c["vlan0ports"]="1 2 3 4 5" - c["vlan1ports"]="0 5" + c["lan_ifname"]="eth0.1" + c["wan_ifname"]="eth0.2" + c["vlan1ports"]="1 2 3 4 5" + c["vlan2ports"]="0 5" getline < "/proc/diag/model" model=$0 for (i = 0; i < 6; i++) { @@ -95,8 +95,8 @@ start() { getline < "/proc/switch/eth0/cpuport" cpuport=$0 if (cpuport == "8") { - c["vlan0ports"]="1 2 3 4 8" - c["vlan1ports"]="0 8" + c["vlan1ports"]="1 2 3 4 8" + c["vlan2ports"]="0 8" } } } @@ -109,13 +109,13 @@ start() { END { if (((nvram["vlan0ports"] ~ /^0 1 2 3 8/ ) && (nvram["vlan1ports"] ~ /^4 8/ && (cpuport == "8"))) || \ ((nvram["vlan1ports"] ~ /^0 1 2 3 8/ ) && (nvram["vlan2ports"] ~ /^4 8/ && (cpuport == "8")))) { - c["vlan0ports"] = "0 1 2 3 8" - c["vlan1ports"] = "4 8" + c["vlan1ports"] = "0 1 2 3 8" + c["vlan2ports"] = "4 8" } if (((nvram["vlan0ports"] ~ /^0 1 2 3 5/ ) && (nvram["vlan1ports"] ~ /^4 5/ && (cpuport == "5"))) || \ ((nvram["vlan1ports"] ~ /^0 1 2 3 5/ ) && (nvram["vlan2ports"] ~ /^4 5/ && (cpuport == "5")))) { - c["vlan0ports"] = "0 1 2 3 5" - c["vlan1ports"] = "4 5" + c["vlan1ports"] = "0 1 2 3 5" + c["vlan2ports"] = "4 5" } if ((model == "ASUS WL-HDD") || (model == "ASUS WL-300g") || (model == "Linksys WAP54G V1")) { c["wan_ifname"] = "" @@ -123,23 +123,23 @@ start() { } if (model == "ASUS WL-330gE") { c["wan_ifname"] = "" - c["lan_ifname"] = "eth0.0" - c["vlan0ports"] = "4 5" - c["vlan1ports"] = "" + c["lan_ifname"] = "eth0.1" + c["vlan1ports"] = "4 5" + c["vlan2ports"] = "" } if ((model == "ASUS WL-500g") || (model == "Microsoft MN-700")) { c["wan_ifname"] = "eth1" c["lan_ifname"] = "eth0" } if ((model == "ASUS WL-500g Premium V2") || (model == "Dell TrueMobile 2300 v2") || (model == "Buffalo WHR-G125")) { - c["vlan0ports"] = "0 1 2 3 5" - c["vlan1ports"] = "4 5" + c["vlan1ports"] = "0 1 2 3 5" + c["vlan2ports"] = "4 5" } if (model == "Dell TrueMobile 2300") { c["lan_ifname"] = "eth0" c["wan_ifname"] = "eth1" - c["vlan0ports"] = "0 1 2 3 4 5u" - c["vlan1ports"] = "" + c["vlan1ports"] = "0 1 2 3 4 5u" + c["vlan2ports"] = "" } if (nvram["boardtype"] == "bcm94710r4") { # Toshiba WRC-1000 @@ -147,18 +147,18 @@ start() { c["wan_ifname"] = "eth1" } if ((nvram["boardtype"] == "wgt634u") || (nvram["boardtype"] == "0x0467")) { - c["vlan0ports"] = "0 1 2 3 5" - c["vlan1ports"] = "4 5" + c["vlan1ports"] = "0 1 2 3 5" + c["vlan2ports"] = "4 5" } if ((nvram["boardtype"] == "0x042f") || (nvram["boardtype"] == "0x0472")) { if (nvram["boardnum"] == "45") { # WL-500gP - c["vlan0ports"] = "1 2 3 4 5" - c["vlan1ports"] = "0 5" + c["vlan1ports"] = "1 2 3 4 5" + c["vlan2ports"] = "0 5" } else { # Generic BCM94704 - c["vlan0ports"] = "0 1 2 3 4 5u" - c["vlan1ports"] = "" + c["vlan1ports"] = "0 1 2 3 4 5u" + c["vlan2ports"] = "" c["lan_ifname"] = "eth0" c["wan_ifname"] = "eth1" @@ -171,8 +171,8 @@ start() { } # Buffalo WBR-B11 and Buffalo WBR-G54 if (nvram["boardtype"] == "bcm94710ap") { - c["vlan0ports"] = "0 1 2 3 4 5u" - c["vlan1ports"] = "" + c["vlan1ports"] = "0 1 2 3 4 5u" + c["vlan2ports"] = "" c["lan_ifname"] = "eth0" c["wan_ifname"] = "eth1" } @@ -196,41 +196,41 @@ start() { # Generic BCM94704 settings instead so we revert to proper settings here. # Hopefully someone will fix this properly soon. if (model == "ASUS WL-700gE") { - c["lan_ifname"]="eth0.0" - c["wan_ifname"]="eth0.1" - c["vlan0ports"]="1 2 3 4 5" - c["vlan1ports"]="0 5" + c["lan_ifname"]="eth0.1" + c["wan_ifname"]="eth0.2" + c["vlan1ports"]="1 2 3 4 5" + c["vlan2ports"]="0 5" } if ((model == "Motorola WR850G V2/V3") || (model == "Siemens SE505 V2")) { - c["vlan0ports"]="0 1 2 3 5" - c["vlan1ports"]="4 5" + c["vlan1ports"]="0 1 2 3 5" + c["vlan2ports"]="4 5" } if (model == "ASUS WL-500W") { c["lan_ifname"] = "eth0" c["wan_ifname"] = "eth1" - c["vlan0ports"] = "0 1 2 3 4 5u" - c["vlan1ports"] = "" + c["vlan1ports"] = "0 1 2 3 4 5u" + c["vlan2ports"] = "" } if (model == "OvisLink WL-1600GL") { - c["lan_ifname"] = "eth0.0" - c["wan_ifname"] = "eth0.1" - c["vlan0ports"] = "0 1 2 3 5" - c["vlan1ports"] = "4 5" + c["lan_ifname"] = "eth0.1" + c["wan_ifname"] = "eth0.2" + c["vlan1ports"] = "0 1 2 3 5" + c["vlan2ports"] = "4 5" } if (model == "SimpleTech SimpleShare NAS") { c["lan_ifname"] = "eth0" c["wan_ifname"] = "" - c["vlan0ports"] = "" c["vlan1ports"] = "" + c["vlan2ports"] = "" } - if (c["vlan0ports"] || c["vlan1ports"]) { + if (c["vlan1ports"] || c["vlan2ports"]) { print "#### VLAN configuration " print "config switch eth0" print " option enable 1" print "" - vlan(0, "vlan0ports") vlan(1, "vlan1ports") + vlan(2, "vlan2ports") } print "#### Loopback configuration" print "config interface loopback" diff --git a/target/linux/brcm47xx/base-files/lib/preinit/05_set_failsafe_switch_brcm b/target/linux/brcm47xx/base-files/lib/preinit/05_set_failsafe_switch_brcm index c7d0fc8da84..dd8fd6e9f63 100644 --- a/target/linux/brcm47xx/base-files/lib/preinit/05_set_failsafe_switch_brcm +++ b/target/linux/brcm47xx/base-files/lib/preinit/05_set_failsafe_switch_brcm @@ -3,7 +3,7 @@ failsafe_ip() { [ -d /proc/switch/eth0 ] && [ "$ifname" = "eth0" ] && { ifconfig eth0 0.0.0.0 down - echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/0/ports + echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/1/ports } [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { diff --git a/target/linux/brcm47xx/base-files/lib/preinit/15_set_preinit_interface_brcm b/target/linux/brcm47xx/base-files/lib/preinit/15_set_preinit_interface_brcm index 0a8915080f3..8c425a094ec 100644 --- a/target/linux/brcm47xx/base-files/lib/preinit/15_set_preinit_interface_brcm +++ b/target/linux/brcm47xx/base-files/lib/preinit/15_set_preinit_interface_brcm @@ -27,11 +27,11 @@ preinit_net_echo() { # this would be easier if we blasted the message across all ports # but we don't want packets leaking across interfaces for port in $(seq 0 4); do { - echo "$port ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/0/ports + echo "$port ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/1/ports port_net_echo $1 }; done - echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/0/ports + echo "0 1 2 3 4 ${cpu_port:-5u*}" > /proc/switch/eth0/vlan/1/ports } || port_net_echo $1 } -- 2.30.2