Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Mauro Carvalho Chehab and committed by
Dmitry Torokhov
730518f2 9dc500a3

+46 -31
+46 -31
Documentation/input/userio.txt
··· 1 - The userio Protocol 2 - (c) 2015 Stephen Chandler Paul <thatslyude@gmail.com> 3 - Sponsored by Red Hat 4 - -------------------------------------------------------------------------------- 1 + .. include:: <isonum.txt> 5 2 6 - 1. Introduction 7 - ~~~~~~~~~~~~~~~ 8 - This module is intended to try to make the lives of input driver developers 3 + =================== 4 + The userio Protocol 5 + =================== 6 + 7 + 8 + :Copyright: |copy| 2015 Stephen Chandler Paul <thatslyude@gmail.com> 9 + 10 + Sponsored by Red Hat 11 + 12 + 13 + Introduction 14 + ============= 15 + 16 + This module is intended to try to make the lives of input driver developers 9 17 easier by allowing them to test various serio devices (mainly the various 10 18 touchpads found on laptops) without having to have the physical device in front 11 19 of them. userio accomplishes this by allowing any privileged userspace program 12 20 to directly interact with the kernel's serio driver and control a virtual serio 13 21 port from there. 14 22 15 - 2. Usage overview 16 - ~~~~~~~~~~~~~~~~~ 17 - In order to interact with the userio kernel module, one simply opens the 23 + Usage overview 24 + ============== 25 + 26 + In order to interact with the userio kernel module, one simply opens the 18 27 /dev/userio character device in their applications. Commands are sent to the 19 28 kernel module by writing to the device, and any data received from the serio 20 29 driver is read as-is from the /dev/userio device. All of the structures and 21 30 macros you need to interact with the device are defined in <linux/userio.h> and 22 31 <linux/serio.h>. 23 32 24 - 3. Command Structure 25 - ~~~~~~~~~~~~~~~~~~~~ 26 - The struct used for sending commands to /dev/userio is as follows: 33 + Command Structure 34 + ================= 35 + 36 + The struct used for sending commands to /dev/userio is as follows:: 27 37 28 38 struct userio_cmd { 29 39 __u8 type; 30 40 __u8 data; 31 41 }; 32 42 33 - "type" describes the type of command that is being sent. This can be any one 34 - of the USERIO_CMD macros defined in <linux/userio.h>. "data" is the argument 43 + ``type`` describes the type of command that is being sent. This can be any one 44 + of the USERIO_CMD macros defined in <linux/userio.h>. ``data`` is the argument 35 45 that goes along with the command. In the event that the command doesn't have an 36 46 argument, this field can be left untouched and will be ignored by the kernel. 37 47 Each command should be sent by writing the struct directly to the character ··· 49 39 returned by the character device and a more descriptive error will be printed 50 40 to the kernel log. Only one command can be sent at a time, any additional data 51 41 written to the character device after the initial command will be ignored. 52 - To close the virtual serio port, just close /dev/userio. 53 42 54 - 4. Commands 55 - ~~~~~~~~~~~ 43 + To close the virtual serio port, just close /dev/userio. 56 44 57 - 4.1 USERIO_CMD_REGISTER 58 - ~~~~~~~~~~~~~~~~~~~~~~~ 59 - Registers the port with the serio driver and begins transmitting data back and 45 + Commands 46 + ======== 47 + 48 + USERIO_CMD_REGISTER 49 + ~~~~~~~~~~~~~~~~~~~ 50 + 51 + Registers the port with the serio driver and begins transmitting data back and 60 52 forth. Registration can only be performed once a port type is set with 61 53 USERIO_CMD_SET_PORT_TYPE. Has no argument. 62 54 63 - 4.2 USERIO_CMD_SET_PORT_TYPE 64 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 65 - Sets the type of port we're emulating, where "data" is the port type being 55 + USERIO_CMD_SET_PORT_TYPE 56 + ~~~~~~~~~~~~~~~~~~~~~~~~ 57 + 58 + Sets the type of port we're emulating, where ``data`` is the port type being 66 59 set. Can be any of the macros from <linux/serio.h>. For example: SERIO_8042 67 60 would set the port type to be a normal PS/2 port. 68 61 69 - 4.3 USERIO_CMD_SEND_INTERRUPT 70 - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 - Sends an interrupt through the virtual serio port to the serio driver, where 72 - "data" is the interrupt data being sent. 62 + USERIO_CMD_SEND_INTERRUPT 63 + ~~~~~~~~~~~~~~~~~~~~~~~~~ 73 64 74 - 5. Userspace tools 75 - ~~~~~~~~~~~~~~~~~~ 76 - The userio userspace tools are able to record PS/2 devices using some of the 65 + Sends an interrupt through the virtual serio port to the serio driver, where 66 + ``data`` is the interrupt data being sent. 67 + 68 + Userspace tools 69 + =============== 70 + 71 + The userio userspace tools are able to record PS/2 devices using some of the 77 72 debugging information from i8042, and play back the devices on /dev/userio. The 78 73 latest version of these tools can be found at: 79 74