summaryrefslogtreecommitdiff
path: root/package/base-files/default/sbin/wifi
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-11-11 12:57:23 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-11-11 12:57:23 +0000
commitcbe21ae5f5ed4c52138989ecbe6af690e3e58be6 (patch)
treede30a6dbf942f7b0c30028bde404e8ad762253c1 /package/base-files/default/sbin/wifi
parentbc779dc435d8e448b7d203996532772dd0b0fe60 (diff)
downloadmtk-20170518-cbe21ae5f5ed4c52138989ecbe6af690e3e58be6.zip
mtk-20170518-cbe21ae5f5ed4c52138989ecbe6af690e3e58be6.tar.gz
mtk-20170518-cbe21ae5f5ed4c52138989ecbe6af690e3e58be6.tar.bz2
move two functions from broadcom.sh to /sbin/wifi
SVN-Revision: 5496
Diffstat (limited to 'package/base-files/default/sbin/wifi')
-rwxr-xr-xpackage/base-files/default/sbin/wifi32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/base-files/default/sbin/wifi b/package/base-files/default/sbin/wifi
index 67ccb8a..e13c352 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