Specifications
CHAPTER 5. IMPLEMENTATION 54
The member raw is not available for ACPI events since they have no numeric representation.
Hence, the value of raw is set to -1 for all events. Once the abstract input event event is set
up by acpi event send(), it sends the event to the Input Abstraction Layer’s output interface
by invoking the library’s function event send().
5.7 Toshiba Module
The Toshiba module libial toshiba is applicable for most recent Toshiba laptops (Ap-
pendix C, §C.8). It translates input events of function and multimedia keys found on these
laptops to abstract input events. It depends on the Toshiba ACPI driver discussed in Chap-
ter 2, §2.6. The Toshiba module needs to poll the user space interface of the driver to receive
input events. The prefix libial toshiba is common for all files belonging to the Toshiba
module. It resides in the directory modules. The following source code is an excerpt of the
Toshiba module’s data structures:
ModuleOption mod_options[] = {
{"disable", "false", "disable=(true|false)"},
{"poll_freq", "250", "poll_freq=n (n: polling frequency in ms)"},
{NULL}
};
ModuleData mod_data = {
.name = "Toshiba Input Abstraction Layer Module",
.token = "toshiba",
.options = mod_options,
.load = mod_load,
.unload = mod_unload
};
The module has two configuration options: disable and poll freq. The option disable
defines whether the module is enabled or disabled. By default, disable is set to false. The
second configuration option, poll freq, specifies the interval the module is polling the driver’s
user space interface. The measuring unit for poll freq is the millisecond. By default, the
module polls the driver’s interface every 250 milliseconds. This value exceeds the performance
requirement (Chapter 3, §3.3). Choosing a shorter polling interval improves the latency be-
tween the user action and the delivery of the input event. In the course of choosing a shorter
polling interval, the latency is lowered on the expense of system resources.
Since the module relies on polling the interface it can not define a combination of a
GIOContainer and a watch, which is associated with the event loop. The module is required
to register a callback function utilizing the function g timeout add() provided by GLib. The
callback function toshiba key poll() is added to the event loop with the interval specified
by the configuration option poll freq.
Each time
toshiba
key poll()
is invoked, it evaluates if a function key event has hap-
pened. This evaluation is realized by the module’s function toshiba key ready(), and im-
plements the procedure described in Chapter 2, §2.6. If a function key event was obtained,
the module verifies if a translation for the function key event is available. This translation