Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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