summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/wlan-ng26-utils/wlan
diff options
context:
space:
mode:
authorJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
committerJames Meyer <James.meyer@operamail.com>2008-10-02 03:19:12 (GMT)
commit0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a (patch)
treec0aa2c0b53c317be87eacfcb77b63f53f1f415e7 /abs/core-testing/wlan-ng26-utils/wlan
downloadlinhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.zip
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.gz
linhes_pkgbuild-0e2532d4e8f4eed5e047f1db54d5c03ba849ec0a.tar.bz2
initial import
Diffstat (limited to 'abs/core-testing/wlan-ng26-utils/wlan')
-rw-r--r--abs/core-testing/wlan-ng26-utils/wlan68
1 files changed, 68 insertions, 0 deletions
diff --git a/abs/core-testing/wlan-ng26-utils/wlan b/abs/core-testing/wlan-ng26-utils/wlan
new file mode 100644
index 0000000..6b3252d
--- /dev/null
+++ b/abs/core-testing/wlan-ng26-utils/wlan
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+if [ ! -f /etc/wlan/shared ] ; then
+ echo "/etc/wlan/shared not present"
+ exit 0
+fi
+
+. /etc/wlan/shared
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+ start)
+ # This will implicitly fire off wland via hotplug.
+ stat_busy "Starting WLAN Devices"
+ if ! $MODPROBE p80211; then
+ echo "Failed to load p80211.o."
+ exit 1
+ fi
+
+ # NOTE: We don't explicitly insmod the card driver here. The
+ # best thing to do is to specify an alias in /etc/modules.conf.
+
+ for DEVICE in $WLAN_DEVICES; do
+ $MODPROBE $DEVICE
+ # if we don't have hotplug.. do things the old-fashioned way.
+ if [ $HAS_HOTPLUG = 'n' ] ; then
+ wlan_bring_it_up $DEVICE
+ fi
+ done
+
+ # And hotplug will take care of the rest, namely device
+ # initialization and whatnot.
+
+ add_daemon wlan
+ stat_done
+
+ ;;
+
+ stop)
+ stat_busy "Shutting Down WLAN Devices"
+ # Do a reset on each device to make sure none of them are still
+ # trying to generate interrupts.
+ for DEVICE in $WLAN_DEVICES; do
+ wlan_disable $DEVICE
+ ifconfig $DEVICE down
+ $MODPROBE -r $DEVICE
+ done
+
+ # remove p80211, which will implictly kill wland.
+ $MODPROBE -r p80211
+
+ rm_daemon wlan
+ stat_done
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ EXITCODE=$?
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ ;;
+
+esac
+exit 0