[PATCH] debug sysctl for acpi_ibm hiding the event printfs

Markus Brueffer markus at brueffer.de
Sun Feb 12 21:45:14 PST 2006


Am Sunday 12 February 2006 04:03 schrieb Niki Denev:
> For some time i started using my IBM TP X31 with
> the following sysctl enabled :
>
> dev.acpi_ibm.0.events=1
>
> and the following lines in devd.conf :
>
> notify 10 {
>          match "system"          "ACPI";
>          match "subsystem"       "IBM";
>          match "notify"          "0x05";
>          action "/usr/local/sbin/wlan_toggle.sh";
> };
>
> With this stuff i am able to use the wireless/radio (Fn-F5) button on my
>   laptop to enable/disable the wireless interface with the help of a
> simple shell script.
> But as annoying side effect of dev.acpi_ibm.0.events enabled now i get
> printfs with the event codes each time i press a special combination.
> So i decided to hide the printfs in acpi_ibm behind a debug sysctl,
> in my case : dev.acpi_ibm.0.debug
> The patch is attached. (it is for -CURRENT)

Thanks for the patch. I have the debug output handling of acpi_ibm on my todo 
list and will take care of it.

> P.S.: As another side effect of dev.acpi_ibm.0.events enabled i can no
> longer use the suspend (Fn-F4) and display output (Fn-F7) keys because
> now they generate events to devd.

If you set the events sysctl to 1, all possible keys (depending on your model) 
will report acpi events to devd. You can control which keys should raise acpi 
events and which shouldn't via the dev.acpi_ibm.0.eventmask sysctl. See the 
manpage for details.

> This seems a little strange because the brightness and think light
> combinations continue to work and do not generate events. 

It highly depends on your model, which keys are able to generate events and 
which are not. But if brightness and thinklight don't generate events, not 
all is lost: acpi_ibm implements a second method to recognize keypresses on 
special keys (mostly used on older Thinkpads, but still supported on newer 
ones). Take a look at the dev.acpi_ibm.0.hotkey sysctl. To assign actions to 
these keys, you can use the sysutils/tpb port.

Cheers,

Markus

-- 
Markus Brueffer    | GPG-Key: http://people.FreeBSD.org/~markus/markus.asc
markus at brueffer.de | FP: 3F9B EBE8 F290 E5CC 1447 8760 D48D 1072 78F8 A8D4
markus at FreeBSD.org | FreeBSD: The Power to Serve!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-acpi/attachments/20060213/8d666d8c/attachment.bin


More information about the freebsd-acpi mailing list