[ltp] Using rf_kill

Damjan linux-thinkpad@linux-thinkpad.org
Mon, 12 May 2008 23:36:20 +0200


> > Now, switching the rf_kill switch generates an "ibm/hotkey HKEY 00000080
> > 00007000" event, but how do I test the current state of the switch?
> 
> Read the thinkpad-acpi docs.  I even sent them to this list a little
> while ago...

I wass searchi for rf_kill, when it was
/sys/devices/platform/thinkpad_acpi/hotkey_radio_sw

:)

for completness these are the scripts I use now:

# /etc/acpi/events/rf_kill
event=ibm/hotkey HKEY 00000080 00007000
action=/etc/acpi/actions/rf_kill.sh

#!/bin/sh
# /etc/acpi/actions/rf_kill.sh ; chmod 755
# Toggle iwl3945 module status when called
#

CTRL=/sys/devices/platform/thinkpad_acpi/hotkey_radio_sw
STATUS=`cat $CTRL`

if [ $STATUS -eq 0 ]; then
  modprobe -r iwl3945
elif [ $STATUS -eq 1 ]; then
  modprobe iwl3945
else
  logger "Unknown rf_kill status: $STATUS"
fi

-- 
damjan | дамјан
This is my jabber ID -->         damjan@bagra.net.mk 
 -- not my mail address, it's a Jabber ID --^ :)