aboutsummaryrefslogtreecommitdiffstats
path: root/package/broadcom-wl/files/lib/wifi/broadcom.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-10-15 15:27:34 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-10-15 15:27:34 +0000
commite7bfe6d7a72853067d5f97e4c6b927ec9339bb24 (patch)
tree7d2d7b9f697f0b32614e2772b0315f2b8b81a823 /package/broadcom-wl/files/lib/wifi/broadcom.sh
parentaa0072a9384483960fa6ca67a8d028383786eb53 (diff)
downloadupstream-e7bfe6d7a72853067d5f97e4c6b927ec9339bb24.tar.gz
upstream-e7bfe6d7a72853067d5f97e4c6b927ec9339bb24.tar.bz2
upstream-e7bfe6d7a72853067d5f97e4c6b927ec9339bb24.zip
implement simple device autodetection for wifi drivers
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5113 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/broadcom-wl/files/lib/wifi/broadcom.sh')
-rw-r--r--package/broadcom-wl/files/lib/wifi/broadcom.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/package/broadcom-wl/files/lib/wifi/broadcom.sh b/package/broadcom-wl/files/lib/wifi/broadcom.sh
index 435c440e2e..1ce85c4c5f 100644
--- a/package/broadcom-wl/files/lib/wifi/broadcom.sh
+++ b/package/broadcom-wl/files/lib/wifi/broadcom.sh
@@ -1,3 +1,5 @@
+append DRIVERS "broadcom"
+
bridge_interface() {
(
. /etc/functions.sh
@@ -71,8 +73,12 @@ scan_broadcom() {
esac
}
+disable_broadcom() {
+ wlc down
+ ifconfig wl0 down
+}
-setup_broadcom() {
+enable_broadcom() {
local _c
config_get channel "$device" channel
config_get country "$device" country
@@ -175,3 +181,21 @@ EOF
}
+detect_broadcom() {
+ [ -f /proc/net/wl0 ] || return
+ config_get type wl0 type
+ [ "$type" = broadcom ] && return
+ cat <<EOF
+config wifi-device wl0
+ option type broadcom
+ option channel 5
+
+config wifi-iface
+ option device wl0
+ option mode ap
+ option ssid OpenWrt
+ option hidden 0
+ option encryption none
+
+EOF
+}