diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-10-15 16:23:36 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-10-15 16:23:36 +0000 |
commit | 02c7575a8fa155d844d4785b3037f8128f1db5df (patch) | |
tree | 6ed470e448458e1cc3161c482c331a45197ca793 | |
parent | 667cbd46c2b226aa8e36e8bdc5bd21d527f34976 (diff) | |
download | master-187ad058-02c7575a8fa155d844d4785b3037f8128f1db5df.tar.gz master-187ad058-02c7575a8fa155d844d4785b3037f8128f1db5df.tar.bz2 master-187ad058-02c7575a8fa155d844d4785b3037f8128f1db5df.zip |
implement network callbacks for broadcom wl
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5118 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/broadcom-wl/files/lib/wifi/broadcom.sh | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh index bc90f088b4..5bb69da94f 100644 --- a/package/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh @@ -1,16 +1,34 @@ append DRIVERS "broadcom" -bridge_interface() { - ( - . /etc/functions.sh - include network +find_vif_config() {( + local vif="$1" + local cfg + local ifname + + config_get cfg "$vif" network + + [ -z "$cfg" ] && { + include /lib/network scan_interfaces - cfg="$(find_config "$1")" - [ -z "$cfg" ] && return 0 - config_get iftype "$cfg" type - [ "$iftype" = bridge ] && config_get "$iftype" bridge - ) -} + + config_get ifname "$vif" ifnamea + + cfg="$(find_config "$ifname")" + } + [ -z "$cfg" ] && return 0 + echo "$cfg" +)} + +bridge_interface() {( + local cfg="$1" + [ -z "$cfg" ] && return 0 + + include /lib/network + scan_interfaces + + config_get iftype "$cfg" type + [ "$iftype" = bridge ] && config_get "$iftype" ifname +)} scan_broadcom() { local device="$1" @@ -154,8 +172,12 @@ enable_broadcom() { config_get ifname "$vif" ifname append if_up "ifconfig $ifname up" ";$N" + net_cfg="$(find_vif_config "$vif")" + [ -z "$net_cfg" ] || { + bridge="$(bridge_interface "$net_cfg")" + append if_up "start_net '$ifname' '$net_cfg'" ";$N" + } [ -z "$nasopts" ] || { - bridge="$(bridge_interface "$ifname")" eval "${vif}_ssid=\"\$ssid\"" mode="-A" [ "$vif" = "$sta_if" ] && mode="-S" @@ -185,8 +207,8 @@ $vif_pre_up up $vif_post_up EOF - eval "$nas_cmd" eval "$if_up" + eval "$nas_cmd" } |