[ltp] Re: [Ipw2100-devel] Re: [ACPI] ibm-acpi-0.3

James Ketrenos linux-thinkpad@linux-thinkpad.org
Wed, 18 Aug 2004 10:27:24 -0500


Len Brown wrote:

>>http://bkernel.sf.net/tmp/ibm-acpi-0.3.tar.gz
>>    
>>
>
>The radio hot key sends an ACPI event,
>and the acpid example calls this radio.sh:
>
>#!/bin/bash
>
>if ! /sbin/rmmod ipw2100; then
>        /sbin/service network restart
>fi
>
>
>Does this means that the button press magically changed
>the state of the radio in hardware?  I didn't see any
>processing inside the driver to do that.
>  
>
The laptop might not actually have any RF switch circuitry to signal the 
GPIO pin -- so on detection of keypress, it fully removes and reloads 
the module (which will have the result of powering off/on the radio with 
the side effect of loading/unloading any modules  and services also 
listed in the network service)

As of 0.53 (since the proc entries are all broken in 0.52) the script 
could be changed to do something more along these lines (until we change 
from proc to sysfs and from strings to ints):

#!/bin/sh
if grep -q disabled /proc/net/ipw2100/eth1/state; then
    echo 0 > /proc/net/ipw2100/eth1/state
else
    echo 1 > /proc/net/ipw2100/eth1/state
fi

The above will check the state of the RF kill switch.  If the radio is 
disabled, it enables it (by turning off the kill state), etc.  The link 
state will toggle based on whether the device is associated -- and that 
is likely what the various service scripts should be tied to (vs. 
whether or not the module is loaded)

James