6b3f4dc157
This commit separates the low-level keyboard driver from TTY, putting it in a separate driver (PCKBD). The commit also separates management of raw input devices from TTY, and puts it in a separate server (INPUT). All keyboard and mouse input from hardware is sent by drivers to the INPUT server, which either sends it to a process that has opened a raw input device, or otherwise forwards it to TTY for standard processing. Design by Dirk Vogt. Prototype by Uli Kastlunger. Additional changes made to the prototype: - the event communication is now based on USB HID codes; all input drivers have to use USB codes to describe events; - all TTY keymaps have been converted to USB format, with the effect that a single keymap covers all keys; there is no (static) escaped keymap anymore; - further keymap tweaks now allow remapping of literally all keys; - input device renumbering and protocol rewrite; - INPUT server rewrite, with added support for cancel and select; - PCKBD reimplementation, including PC/AT-to-USB translation; - support for manipulating keyboard LEDs has been added; - keyboard and mouse multiplexer devices have been added to INPUT, primarily so that an X server need only open two devices; - a new "libinputdriver" library abstracts away protocol details from input drivers, and should be used by all future input drivers; - both INPUT and PCKBD can be restarted; - TTY is now scheduled by KERNEL, so that it won't be punished for running a lot; without this, simply running "yes" on the console kills the system; - the KIOCBELL IOCTL has been moved to /dev/console; - support for the SCANCODES termios setting has been removed; - obsolete keymap compression has been removed; - the obsolete Olivetti M24 keymap has been removed. Change-Id: I3a672fb8c4fd566734e4b46d3994b4b7fc96d578
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
#ifndef _SERVERS_INPUT_H
|
|
#define _SERVERS_INPUT_H
|
|
|
|
#include <minix/input.h>
|
|
|
|
/* Configuration. */
|
|
#define EVENTBUF_SIZE 32
|
|
|
|
#define KBDMUX_MINOR 0
|
|
#define KBD0_MINOR 1
|
|
#define KBD_MINORS 4
|
|
|
|
#define MOUSEMUX_MINOR 64
|
|
#define MOUSE0_MINOR 65
|
|
#define MOUSE_MINORS 4
|
|
|
|
/* Constants. */
|
|
#define KBDMUX_DEV 0
|
|
#define FIRST_KBD_DEV 1
|
|
#define LAST_KBD_DEV (FIRST_KBD_DEV + KBD_MINORS - 1)
|
|
|
|
#define MOUSEMUX_DEV (LAST_KBD_DEV + 1)
|
|
#define FIRST_MOUSE_DEV (MOUSEMUX_DEV + 1)
|
|
#define LAST_MOUSE_DEV (FIRST_MOUSE_DEV + MOUSE_MINORS - 1)
|
|
|
|
#define INPUT_DEV_MAX (1 + KBD_MINORS + 1 + MOUSE_MINORS)
|
|
|
|
/* Input device state structure. */
|
|
struct input_dev {
|
|
devminor_t minor; /* minor number of this device */
|
|
endpoint_t owner; /* owning driver endpoint, or NONE */
|
|
char label[DS_MAX_KEYLEN]; /* label of owning driver */
|
|
struct input_event eventbuf[EVENTBUF_SIZE]; /* event ring buffer */
|
|
unsigned int tail; /* tail into ring buffer */
|
|
unsigned int count; /* number of elements in ring buffer */
|
|
int opened; /* has a process opened the device? */
|
|
int suspended; /* is a process suspended on a read? */
|
|
endpoint_t caller; /* endpoint for suspended read */
|
|
cp_grant_id_t grant; /* grant for suspended read */
|
|
cdev_id_t req_id; /* request ID for suspended read */
|
|
endpoint_t selector; /* read-selecting endpoint, or NONE */
|
|
unsigned int leds; /* LED mask - saved across connects */
|
|
};
|
|
|
|
#endif /* !_SERVERS_INPUT_H */
|