Input: userio - convert documentation into ReST format
This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
committed by
Dmitry Torokhov
parent
9dc500a325
commit
730518f2c4
@@ -1,37 +1,47 @@
|
|||||||
The userio Protocol
|
.. include:: <isonum.txt>
|
||||||
(c) 2015 Stephen Chandler Paul <thatslyude@gmail.com>
|
|
||||||
Sponsored by Red Hat
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
1. Introduction
|
===================
|
||||||
~~~~~~~~~~~~~~~
|
The userio Protocol
|
||||||
This module is intended to try to make the lives of input driver developers
|
===================
|
||||||
|
|
||||||
|
|
||||||
|
:Copyright: |copy| 2015 Stephen Chandler Paul <thatslyude@gmail.com>
|
||||||
|
|
||||||
|
Sponsored by Red Hat
|
||||||
|
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
=============
|
||||||
|
|
||||||
|
This module is intended to try to make the lives of input driver developers
|
||||||
easier by allowing them to test various serio devices (mainly the various
|
easier by allowing them to test various serio devices (mainly the various
|
||||||
touchpads found on laptops) without having to have the physical device in front
|
touchpads found on laptops) without having to have the physical device in front
|
||||||
of them. userio accomplishes this by allowing any privileged userspace program
|
of them. userio accomplishes this by allowing any privileged userspace program
|
||||||
to directly interact with the kernel's serio driver and control a virtual serio
|
to directly interact with the kernel's serio driver and control a virtual serio
|
||||||
port from there.
|
port from there.
|
||||||
|
|
||||||
2. Usage overview
|
Usage overview
|
||||||
~~~~~~~~~~~~~~~~~
|
==============
|
||||||
In order to interact with the userio kernel module, one simply opens the
|
|
||||||
|
In order to interact with the userio kernel module, one simply opens the
|
||||||
/dev/userio character device in their applications. Commands are sent to the
|
/dev/userio character device in their applications. Commands are sent to the
|
||||||
kernel module by writing to the device, and any data received from the serio
|
kernel module by writing to the device, and any data received from the serio
|
||||||
driver is read as-is from the /dev/userio device. All of the structures and
|
driver is read as-is from the /dev/userio device. All of the structures and
|
||||||
macros you need to interact with the device are defined in <linux/userio.h> and
|
macros you need to interact with the device are defined in <linux/userio.h> and
|
||||||
<linux/serio.h>.
|
<linux/serio.h>.
|
||||||
|
|
||||||
3. Command Structure
|
Command Structure
|
||||||
~~~~~~~~~~~~~~~~~~~~
|
=================
|
||||||
The struct used for sending commands to /dev/userio is as follows:
|
|
||||||
|
The struct used for sending commands to /dev/userio is as follows::
|
||||||
|
|
||||||
struct userio_cmd {
|
struct userio_cmd {
|
||||||
__u8 type;
|
__u8 type;
|
||||||
__u8 data;
|
__u8 data;
|
||||||
};
|
};
|
||||||
|
|
||||||
"type" describes the type of command that is being sent. This can be any one
|
``type`` describes the type of command that is being sent. This can be any one
|
||||||
of the USERIO_CMD macros defined in <linux/userio.h>. "data" is the argument
|
of the USERIO_CMD macros defined in <linux/userio.h>. ``data`` is the argument
|
||||||
that goes along with the command. In the event that the command doesn't have an
|
that goes along with the command. In the event that the command doesn't have an
|
||||||
argument, this field can be left untouched and will be ignored by the kernel.
|
argument, this field can be left untouched and will be ignored by the kernel.
|
||||||
Each command should be sent by writing the struct directly to the character
|
Each command should be sent by writing the struct directly to the character
|
||||||
@@ -39,31 +49,36 @@ device. In the event that the command you send is invalid, an error will be
|
|||||||
returned by the character device and a more descriptive error will be printed
|
returned by the character device and a more descriptive error will be printed
|
||||||
to the kernel log. Only one command can be sent at a time, any additional data
|
to the kernel log. Only one command can be sent at a time, any additional data
|
||||||
written to the character device after the initial command will be ignored.
|
written to the character device after the initial command will be ignored.
|
||||||
To close the virtual serio port, just close /dev/userio.
|
|
||||||
|
|
||||||
4. Commands
|
To close the virtual serio port, just close /dev/userio.
|
||||||
~~~~~~~~~~~
|
|
||||||
|
|
||||||
4.1 USERIO_CMD_REGISTER
|
Commands
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
========
|
||||||
Registers the port with the serio driver and begins transmitting data back and
|
|
||||||
|
USERIO_CMD_REGISTER
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Registers the port with the serio driver and begins transmitting data back and
|
||||||
forth. Registration can only be performed once a port type is set with
|
forth. Registration can only be performed once a port type is set with
|
||||||
USERIO_CMD_SET_PORT_TYPE. Has no argument.
|
USERIO_CMD_SET_PORT_TYPE. Has no argument.
|
||||||
|
|
||||||
4.2 USERIO_CMD_SET_PORT_TYPE
|
USERIO_CMD_SET_PORT_TYPE
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Sets the type of port we're emulating, where "data" is the port type being
|
|
||||||
|
Sets the type of port we're emulating, where ``data`` is the port type being
|
||||||
set. Can be any of the macros from <linux/serio.h>. For example: SERIO_8042
|
set. Can be any of the macros from <linux/serio.h>. For example: SERIO_8042
|
||||||
would set the port type to be a normal PS/2 port.
|
would set the port type to be a normal PS/2 port.
|
||||||
|
|
||||||
4.3 USERIO_CMD_SEND_INTERRUPT
|
USERIO_CMD_SEND_INTERRUPT
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
Sends an interrupt through the virtual serio port to the serio driver, where
|
|
||||||
"data" is the interrupt data being sent.
|
|
||||||
|
|
||||||
5. Userspace tools
|
Sends an interrupt through the virtual serio port to the serio driver, where
|
||||||
~~~~~~~~~~~~~~~~~~
|
``data`` is the interrupt data being sent.
|
||||||
The userio userspace tools are able to record PS/2 devices using some of the
|
|
||||||
|
Userspace tools
|
||||||
|
===============
|
||||||
|
|
||||||
|
The userio userspace tools are able to record PS/2 devices using some of the
|
||||||
debugging information from i8042, and play back the devices on /dev/userio. The
|
debugging information from i8042, and play back the devices on /dev/userio. The
|
||||||
latest version of these tools can be found at:
|
latest version of these tools can be found at:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user