resync with kamikaze
[openwrt.git] / target / linux / package / base-files / files / brcm-2.4 / etc / hotplug.d / net / 09-net
index 75604eb..9dd7796 100644 (file)
@@ -1,15 +1,15 @@
 #!/bin/sh
-setup_eth()
+setup_wl()
 {
-       for part in $(nvram get unused_ifnames); do
-               [ "$part" = "$INTERFACE" ] && exit 0
-       done
        [ -f /proc/net/wl0 ] && {
                lsmod | grep wlcompat >&- || insmod wlcompat
        }
        iwconfig "$INTERFACE" 2>&- | grep -v 'no wireless' >&- && {
                /sbin/wifi
        }
+}
+setup_eth()
+{
        [ -d /proc/switch ] || {
                insmod switch-core
                insmod switch-robo || insmod switch-adm
@@ -17,10 +17,12 @@ setup_eth()
        if="$(echo "$INTERFACE" | sed s,eth,et,)"
        ifconfig "$INTERFACE" up 2>&- >&-
        [ -d "/proc/switch/$INTERFACE" ] || return 0
+       echo "1" > "/proc/switch/$INTERFACE/reset"
        echo "1" > "/proc/switch/$INTERFACE/enable_vlan"
        for vlan in $(seq 0 15); do
-               [ "$(nvram get vlan${vlan}hwname)" = "$if" ] && {
-                       vports="$(nvram get vlan${vlan}ports)"
+               eval "hwname=\"\${vlan${vlan}hwname}\""
+               [ "$hwname" = "$if" ] && {
+                       eval "vports=\"\${vlan${vlan}ports}\""
                        [ -n "$vports" ] && echo "$vports" > "/proc/switch/$INTERFACE/vlan/$vlan/ports"
                        $DEBUG vconfig add "$INTERFACE" "$vlan"
                }
@@ -31,6 +33,7 @@ do_register()
 {
        case "${INTERFACE%%[0-9]*}" in
                eth) setup_eth;;
+               wl) setup_wl;;
        esac
 }
 
This page took 0.027905 seconds and 4 git commands to generate.