issue switch reset when bringing up the ethernet device
[openwrt.git] / openwrt / target / linux / package / base-files / files / brcm-2.6 / etc / hotplug.d / net / 09-net
1 #!/bin/sh
2 setup_eth()
3 {
4 for part in $(nvram get unused_ifnames); do
5 [ "$part" = "$INTERFACE" ] && exit 0
6 done
7 [ -d /proc/switch ] || {
8 insmod switch-core
9 insmod switch-robo || insmod switch-adm
10 }
11 if="$(echo "$INTERFACE" | sed s,eth,et,)"
12 ifconfig "$INTERFACE" up 2>&- >&-
13 [ -d "/proc/switch/$INTERFACE" ] || return 0
14 echo "1" > "/proc/switch/$INTERFACE/reset"
15 echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
16 for vlan in $(seq 0 15); do
17 [ "$(nvram get vlan${vlan}hwname)" = "$if" ] && {
18 vports="$(nvram get vlan${vlan}ports)"
19 [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
20 $DEBUG vconfig add "$INTERFACE" "$vlan"
21 }
22 done
23 }
24
25 do_register()
26 {
27 case "${INTERFACE%%[0-9]*}" in
28 eth) setup_eth;;
29 esac
30 }
31
32
33 case "$ACTION" in
34 add|register) do_register;;
35 esac
This page took 0.049125 seconds and 5 git commands to generate.