summaryrefslogtreecommitdiffstats
path: root/package/broadcom-wl/files/lib/wifi
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-15 15:27:34 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-10-15 15:27:34 +0000
commitb573d8ec23fe7dcba00cdea3be95608b72f37902 (patch)
tree7d2d7b9f697f0b32614e2772b0315f2b8b81a823 /package/broadcom-wl/files/lib/wifi
parenta454958a86d36508f75febc37ede96243a614fe0 (diff)
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')
-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 435c440e2..1ce85c4c5 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
+}