diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-11-11 12:57:23 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-11-11 12:57:23 +0000 |
commit | 11cdd8c18e72bf10191cbea26f5f3edccdd819f1 (patch) | |
tree | 9783e8afaae2c30d274a127e9c51efd874661124 | |
parent | a0bf68dfccc72e6bab8d4a5f36280ac969d9aec1 (diff) |
move two functions from broadcom.sh to /sbin/wifi
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5496 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-x | package/base-files/default/sbin/wifi | 32 | ||||
-rw-r--r-- | package/broadcom-wl/files/lib/wifi/broadcom.sh | 32 |
2 files changed, 33 insertions, 31 deletions
diff --git a/package/base-files/default/sbin/wifi b/package/base-files/default/sbin/wifi index 67ccb8a0b0..e13c3528a9 100755 --- a/package/base-files/default/sbin/wifi +++ b/package/base-files/default/sbin/wifi @@ -3,6 +3,38 @@ . /etc/functions.sh +find_net_config() {( + local vif="$1" + local cfg + local ifname + + config_get cfg "$vif" network + + [ -z "$cfg" ] && { + include /lib/network + scan_interfaces + + 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 +)} + + wifi_up() { for device in ${2:-$DEVICES}; do ( config_get iftype "$device" type diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh index 4f96b251be..27d9ca6be7 100644 --- a/package/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh @@ -1,35 +1,5 @@ append DRIVERS "broadcom" -find_vif_config() {( - local vif="$1" - local cfg - local ifname - - config_get cfg "$vif" network - - [ -z "$cfg" ] && { - include /lib/network - scan_interfaces - - 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" local wds= @@ -180,7 +150,7 @@ enable_broadcom() { config_get ifname "$vif" ifname append if_up "ifconfig $ifname up" ";$N" - net_cfg="$(find_vif_config "$vif")" + net_cfg="$(find_net_config "$vif")" [ -z "$net_cfg" ] || { bridge="$(bridge_interface "$net_cfg")" append if_up "start_net '$ifname' '$net_cfg'" ";$N" |