2 # Copyright (C) 2006 OpenWrt.org
6 [ -d /proc
/switch
] ||
{
8 insmod switch-robo || insmod switch-adm
10 if="$(echo "$INTERFACE" | sed s,eth,et,)"
11 ifconfig
"$INTERFACE" up
2>&- >&-
12 [ -d "/proc/switch/$INTERFACE" ] ||
return 0
13 echo "1" > "/proc/switch/$INTERFACE/reset"
14 echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
15 for vlan
in $
(seq 0 15); do
16 eval "hwname=\"\${vlan${vlan}hwname}\""
17 [ "$hwname" = "$if" ] && {
18 eval "vports=\"\${vlan${vlan}ports}\""
19 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
20 $DEBUG vconfig add
"$INTERFACE" "$vlan"
27 case "${INTERFACE%%[0-9]*}" in
34 add|register
) do_register
;;