From a72a8da790e4784ea6c5956883f41f0ccfa6f0b9 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Wed, 23 Jan 2013 10:12:40 +0000 Subject: bcm63xx: switch to b53 and swconfig Switch to using the B53 switch driver where appropriate. Use a non-tagged default config where it isn't confirmed to be working. Remove the switch configuration in preinit as the switch will now be configured by the driver to use port isolation to prevent leakage between lan and wan. While at it, also provide a switch config for Neufbox 6. Signed-off-by: Jonas Gorski git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35307 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../base-files/etc/uci-defaults/02_network | 78 +++++++++++++++++----- target/linux/brcm63xx/base-files/lib/brcm63xx.sh | 2 +- .../lib/preinit/05_failsafe_config_switch_brcm63xx | 5 -- .../lib/preinit/15_set_preinit_interface_brcm63xx | 19 +----- 4 files changed, 65 insertions(+), 39 deletions(-) (limited to 'target/linux/brcm63xx/base-files') diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network index 08b8558006..106bf5f86f 100755 --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network @@ -14,40 +14,88 @@ ucidef_set_interface_loopback case "$board_name" in -96328avng |\ -96328A-1241N |\ -96328A-1441N1 |\ -963281TAN |\ -963281T_TEF |\ -96348A-122 |\ +96348W3 |\ 96358-502V |\ -CT6373-1 |\ -AW4339U |\ +SPW500V) + ucidef_set_interface_lan "eth0" + ;; + +96338GW |\ +96338W |\ +96338W2_E7T |\ +96348A-122 |\ +96348W3 |\ CPVA642 |\ CT536_CT5621 |\ +CT6373-1 |\ D-4P-W |\ "F@ST2604" |\ -HW556* |\ -NB6 |\ -SPW303V |\ -SPW500V |\ -V2110 |\ -96348W3) +RTA1320_16M |\ +RTA770BW |\ +V2110) ucidef_set_interface_lan "eth0" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5" + ;; + +96348GW |\ +96348GW-10 |\ +96348GW-11 |\ +96348GW-A |\ +96358VW |\ +96358VW2 |\ +AGPF-S0 |\ +"CPVA502+" |\ +DV201AMR |\ +DWV-S0 |\ +"F@ST2404" |\ +HW553 |\ +MAGIC |\ +RTA1025W_16 |\ +V2500V_BB) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ucidef_add_switch "eth1" "1" "1" + ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5" ;; -AW4139) +AW4139 |\ +HW556*) ucidef_set_interface_lan "eth0.1" ucidef_add_switch "eth0" "1" "1" ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 4 5t" ;; +NB4-* |\ DVG3810BN) ucidef_set_interfaces_lan_wan "eth1.1" "eth0" ucidef_add_switch "eth1" "1" "1" ucidef_add_switch_vlan "eth1" "1" "0 1 2 3 4 5t" ;; +96328avng |\ +96328A-1241N |\ +96328A-1441N1 |\ +963281TAN |\ +963281T_TEF |\ +96368MVNgr) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t" + ;; + +96368MVWG) + ucidef_set_interface_lan "eth0.1" + ucidef_add_switch "eth0" "1" "1" + ucidef_add_switch_vlan "eth0" "1" "1 2 4 5 8t" + ;; + +NB6) + 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" + ;; + *) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh index 999f775171..8116e807dd 100755 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh @@ -13,7 +13,7 @@ brcm63xx_has_reset_button="" brcm63xx_detect() { board_name=$(awk 'BEGIN{FS="[ \t:/]+"} /system type/ {print $4}' /proc/cpuinfo) - if [ "$board_name" = "96358VW" ] && [ -e /proc/switch/eth1/enable ]; then + if [ "$board_name" = "96358VW" ] && [ -n "$(swconfig dev eth1 help 2>/dev/null)" ]; then board_name="DVAG3810BN" fi diff --git a/target/linux/brcm63xx/base-files/lib/preinit/05_failsafe_config_switch_brcm63xx b/target/linux/brcm63xx/base-files/lib/preinit/05_failsafe_config_switch_brcm63xx index 43da8cc068..e1653e3936 100644 --- a/target/linux/brcm63xx/base-files/lib/preinit/05_failsafe_config_switch_brcm63xx +++ b/target/linux/brcm63xx/base-files/lib/preinit/05_failsafe_config_switch_brcm63xx @@ -1,11 +1,6 @@ #!/bin/sh failsafe_ip() { - [ -d "/proc/switch/$ifname" ] && { - ifconfig "$ifname" 0.0.0.0 down - echo "0 1 2 3 4 ${cpu_port:-5u*}" > "/proc/switch/$ifname/vlan/0/ports" - } - [ -n "$pi_ifname" ] && grep -q "$pi_ifname" /proc/net/dev && { ifconfig $pi_ifname $pi_ip netmask $pi_netmask broadcast $pi_broadcast up } diff --git a/target/linux/brcm63xx/base-files/lib/preinit/15_set_preinit_interface_brcm63xx b/target/linux/brcm63xx/base-files/lib/preinit/15_set_preinit_interface_brcm63xx index 9d366fa339..7655fb7d53 100644 --- a/target/linux/brcm63xx/base-files/lib/preinit/15_set_preinit_interface_brcm63xx +++ b/target/linux/brcm63xx/base-files/lib/preinit/15_set_preinit_interface_brcm63xx @@ -16,29 +16,12 @@ preinit_ip_deconfig() { ifconfig $pi_ifname 0.0.0.0 down } fi - [ -d "/proc/switch/$ifname" ] && { - echo 1 > "/proc/switch/$ifname/reset" - echo "0 1 2 3 4 ${cpu_port:-5u*}" > "/proc/switch/$ifname/vlan/0/ports" - } - } preinit_net_echo() { preinit_ip - - [ -d "/proc/switch/$ifname" ] && { - echo 1 > "/proc/switch/$ifname/reset" - # 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/$ifname/vlan/0/ports" - port_net_echo $1 - }; done - - echo "0 ${cpu_port:-5u*}" > "/proc/switch/$ifname/vlan/0/ports" - - } || port_net_echo $1 + port_net_echo $1 } -- cgit v1.2.3