[Debian-eeepc-devel] [RFC] wireless.sh: remove special treatment for Atheros

Alan Jenkins alan-jenkins at tuffmail.co.uk
Wed Aug 12 13:43:47 UTC 2009


Hi

I'd like to request removal of the special treatment for Atheros (v.s. 
Ralink) wireless.  I don't believe it is necessary, and it confused me 
while trying to debug the wireless toggle.

Currently, wireless.sh will load/unload the ath5k module when the 
wireless is toggled.  It will also sleep for a second and then ifconfig 
up/down the interface.

The module loading seems pretty bogus.  If you have to remove modules, 
it's a kernel bug; I don't know of any such bug in ath5k.  We have pci 
hotplug working, and that will bind / unbind the driver as necessary.  
Attempting to duplicate it in userspace makes the behaviour less clear 
when pci hotplug is broken.  The "wlan0" interface will disappear even 
if the hot-unplug code didn't work.

"ifconfig up" should not be necessary either.  network-manager works 
fine without it on my system.  ifupdown must be able to work without it, 
because the interface starts off as "down" when ath5k is loaded at boot 
time.  If "ifconfig up" is necessary in some setups, I can only think 
that they are broken.

Here's the code I would like to remove.

Regards
Alan


diff -ur eeepc-acpi-scripts/etc/acpi/actions/wireless.sh eeepc-acpi-scripts.new/etc/acpi/actions/wireless.sh
--- eeepc-acpi-scripts/etc/acpi/actions/wireless.sh	2009-06-13 22:55:37.000000000 +0100
+++ eeepc-acpi-scripts.new/etc/acpi/actions/wireless.sh	2009-08-12 14:09:21.000000000 +0100
@@ -23,24 +23,10 @@
     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 -ur eeepc-acpi-scripts/functions.sh eeepc-acpi-scripts.new/functions.sh
--- eeepc-acpi-scripts/functions.sh	2009-06-13 22:55:37.000000000 +0100
+++ eeepc-acpi-scripts.new/functions.sh	2009-08-12 14:09:21.000000000 +0100
@@ -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()
 {





More information about the Debian-eeepc-devel mailing list