~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/input/userio.rst

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php