Package: acpi-support Version: 0.103-1 Severity: important Tags: patch
Content-Type: multipart/mixed; boundary="===============0931502210==" MIME-Version: 1.0 From: Stefan Pampel <[EMAIL PROTECTED]> To: Debian Bug Tracking System <[EMAIL PROTECTED]> Subject: acpi-support: Fn-F5 (start/stop WLAN) does not work with atheros based cards running with madwifi-drivers Message-ID: <[EMAIL PROTECTED]> X-Mailer: reportbug 3.39 Date: Fri, 30 Nov 2007 18:13:13 +0100 This is a multi-part MIME message sent by reportbug. --===============0931502210== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Package: acpi-support Version: 0.103-1 Severity: important Tags: patch wifi cards based on atheros chips running with madwifi-drivers[1] can't diabled by pressing Fn-F5. This comes through a different structure in /sys/class/net/[DEVICE]/* . The script /etc/acpi/ibm-wireless.sh calls a function called toggleAllWirelessStates in the file /usr/share/acpi-support/state-funcs which normaly does the on/off switch. The function gather information out of /sys/class/net/[DEVICE]/device/power/state or /sys/class/net/[DEVICE]/device/rf_kill '0' for off and '1' for on. The madwifi-driver puts the power in fo in a different place /sys/class/net/[DEVICE]/operstate with 'up' and 'down' . Changing the function toggleAllWirelessStates can help to fix this, see the attached patch. [1] http://madwifi.org/ -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (990, 'testing'), (400, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.22-3-vserver-686 (SMP w/1 CPU core) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages acpi-support depends on: ii acpid 1.0.4-7.1 Utilities for using ACPI power man ii dmidecode 2.9-1 Dump Desktop Management Interface ii finger 0.17-11 user information lookup program ii hdparm 7.7-1 tune hard disk parameters for high ii laptop-detect 0.12.1-0.1 attempt to detect a laptop ii libc6 2.6.1-1+b1 GNU C Library: Shared libraries ii lsb-base 3.1-24 Linux Standard Base 3.1 init scrip ii nvclock 0.8b2-1 Allows you to overclock your nVidi ii powermgmt-base 1.29 Common utils and configs for power ii radeontool 1.5-5 utility to control ATI Radeon back ii toshset 1.72-6 Access much of the Toshiba laptop ii vbetool 0.7-1.1 run real-mode video BIOS code to a ii x11-xserver-utils 7.3+1 X server utilities acpi-support recommends no packages. -- no debconf information --===============0931502210== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="state-funcs.patch" --- /tmp/state-funcs 2007-11-30 17:49:54.376884806 +0100 +++ /usr/share/acpi-support/state-funcs 2007-11-30 18:10:14.886571922 +0100 @@ -31,29 +31,42 @@ toggleAllWirelessStates() { for DEVICE in /sys/class/net/* ; do - if [ -d $DEVICE/wireless ] ; then - # $DEVICE is a wireless device. Check if it's powered on: - ON=0 - OFF=1 # 1 for rf_kill, 2 for power/state - for CONTROL in $DEVICE/device/rf_kill $DEVICE/device/power/state ; do - if [ -w $CONTROL ] ; then - # We have a way of controlling the device, lets try - if [ "`cat $CONTROL`" = 0 ] ; then - # It's powered on. Switch it off. - if echo -n $OFF > $CONTROL ; then - break - else - OFF=2 # for power/state, second time around + if [ -d $DEVICE/wireless ] ; then + # $DEVICE is a wireless device. Check if it's powered on: + ON=0 + OFF=1 # 1 for rf_kill, 2 for power/state + for CONTROL in $DEVICE/device/rf_kill $DEVICE/device/power/state $DEVICE/operstate; do + if [ -w $CONTROL ] ; then + # We have a way of controlling the device, lets try + if [ "`cat $CONTROL`" = 0 ] ; then + # It's powered on. Switch it off. + if echo -n $OFF > $CONTROL ; then + break + else + OFF=2 # for power/state, second time around + fi + else + # It's powered off. Switch it on. + if echo -n $ON > $CONTROL ; then + break + fi + fi + # bof: madwifi, operstate + NET_IF=`echo $DEVICE | cut -d \/ -f 5` + if [ "`cat $CONTROL`" = "up" ] ; then + # It's powered on. Switch it off. + ifdown $NET_IF + else + # It's powered off. Switch it on. + ifup $NET_IF + if [ -x /sbin/wpa_cli ] ; then + wpa_cli scan fi - else - # It's powered off. Switch it on. - if echo -n $ON > $CONTROL ; then - break - fi - fi - fi - done - fi + fi + #eof: madwifi operstate + fi + done + fi done } --===============0931502210==-- -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (990, 'testing'), (400, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.22-3-vserver-686 (SMP w/1 CPU core) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages acpi-support depends on: ii acpid 1.0.4-7.1 Utilities for using ACPI power man ii dmidecode 2.9-1 Dump Desktop Management Interface ii finger 0.17-11 user information lookup program ii hdparm 7.7-1 tune hard disk parameters for high ii laptop-detect 0.12.1-0.1 attempt to detect a laptop ii libc6 2.6.1-1+b1 GNU C Library: Shared libraries ii lsb-base 3.1-24 Linux Standard Base 3.1 init scrip ii nvclock 0.8b2-1 Allows you to overclock your nVidi ii powermgmt-base 1.29 Common utils and configs for power ii radeontool 1.5-5 utility to control ATI Radeon back ii toshset 1.72-6 Access much of the Toshiba laptop ii vbetool 0.7-1.1 run real-mode video BIOS code to a ii x11-xserver-utils 7.3+1 X server utilities acpi-support recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]