[Debian-eeepc-devel] [SCM] Maintenance of eeepc-acpi-scripts debian package branch, master, updated. 39be4a1393aa8c913aae8b5ea4a0967d0da49c89

Damyan Ivanov dmn at debian.org
Sat Aug 16 11:53:49 UTC 2008


The following commit has been merged in the master branch:
commit 39be4a1393aa8c913aae8b5ea4a0967d0da49c89
Author: Damyan Ivanov <dmn at debian.org>
Date:   Sat Aug 16 14:54:18 2008 +0300

    wireless.sh: add support for RaLink wireless adapter

diff --git a/actions/wireless.sh b/actions/wireless.sh
index 9a094cc..5e1ee12 100755
--- a/actions/wireless.sh
+++ b/actions/wireless.sh
@@ -3,23 +3,38 @@
 wlan_control=/sys/devices/platform/eeepc/wlan
 [ -e $wlan_control ] || wlan_control=/proc/acpi/asus/wlan # pre-2.6.26
 
+detect_wlan()
+{
+    if lspci|grep -i 'network controller'|grep -q 'RaLink'; then
+        WLAN_IF=ra0
+        WLAN_MOD=rt2860sta
+    elif lspci|grep -i 'atheros'|grep -q -i 'wireless'; then
+        WLAN_IF=ath0
+        WLAN_MOD=ath_pci
+    fi
+
+    echo "Detected WLAN module $WLAN_MOD on $WLAN_IF" >&2
+}
+
 case $1 in
     on|enable)
 	if [ $(cat $wlan_control) = 0 ]; then
 	    modprobe -r pciehp
 	    modprobe pciehp pciehp_force=1
 	    echo 1 > $wlan_control
-	    modprobe ath_pci
+            detect_wlan
+	    modprobe $WLAN_MOD
 	    # adding a sleep here, due to some bug the driver loading is not atomic here
 	    # and could cause ifconfig to fail
 	    sleep 1
-	    if ! ifconfig ath0 up; then exec $0 off; fi
+	    if ! ifconfig $WLAN_IF up; then exec $0 off; fi
 	fi
 	;;
     off|disable)
 	if [ $(cat $wlan_control) = 1 ]; then
-	    ifdown --force ath0
-	    modprobe -r ath_pci
+            detect_wlan
+	    ifdown --force $WLAN_IF
+	    modprobe -r $WLAN_MOD
 	    echo 0 > $wlan_control
 	fi
 	;;

-- 
Maintenance of eeepc-acpi-scripts debian package



More information about the Debian-eeepc-devel mailing list