[Debian-eeepc-devel] [PATCH] Remove old hacks for wireless toggle key
Alan Jenkins
alan-jenkins at tuffmail.co.uk
Thu Aug 13 18:30:03 UTC 2009
There is no need to load/unload modules and ifconfig up/down the
wireless interface. PCI hotplug takes care of it.
Tested on 2.6.26-2 (with MadWifi and pciehp.pciehp_force=1)
and 2.6.30-1 (with ath5k and hotplug support in eeepc-laptop)
---
etc/acpi/actions/wireless.sh | 14 --------------
functions.sh | 19 -------------------
2 files changed, 0 insertions(+), 33 deletions(-)
diff --git a/etc/acpi/actions/wireless.sh b/etc/acpi/actions/wireless.sh
index ff714a0..3bc2d08 100755
--- a/etc/acpi/actions/wireless.sh
+++ b/etc/acpi/actions/wireless.sh
@@ -23,24 +23,10 @@ case "$cmd" in
on|enable|1)
if [ "$STATE" = 0 ]; then
echo 1 > $wlan_control
- detect_wlan
- if [ "$WLAN_MOD" = 'ath_pci' ] || [ "$WLAN_MOD" = 'ath5k' ]; then
- # Atheros needs some handholding
- modprobe $WLAN_MOD
- # adding a sleep here, due to some bug the driver loading is not atomic here
- # and could cause ifconfig to fail (at least madwifi, untested with ath5k)
- sleep 1
- if ! ifconfig $WLAN_IF up; then exec $0 off; fi
- fi
fi
;;
off|disable|0)
if [ "$STATE" = 1 ]; then
- detect_wlan
- if [ "$WLAN_MOD" = 'ath_pci' ] || [ "$WLAN_MOD" = 'ath5k' ]; then
- ifdown --force $WLAN_IF
- modprobe -r $WLAN_MOD
- fi
echo 0 > $wlan_control
fi
;;
diff --git a/functions.sh b/functions.sh
index 264af54..838bd84 100644
--- a/functions.sh
+++ b/functions.sh
@@ -1,24 +1,5 @@
# common eeepc-acpi-scripts functions
-# detect the name of the WLAN interface and kernel module
-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
- if lspci -v|grep -q -i 'ath_pci'; then
- WLAN_IF=ath0
- WLAN_MOD=ath_pci
- else
- WLAN_IF=wlan0
- WLAN_MOD=ath5k
- fi
- fi
-
- echo "Detected WLAN module $WLAN_MOD on $WLAN_IF" >&2
-}
-
# detect which rfkill has name=$1
detect_rfkill()
{
--
1.5.6.5
More information about the Debian-eeepc-devel
mailing list