iPXE
|
USB keyboard driver. More...
Go to the source code of this file.
Data Structures | |
struct | usb_keyboard_report |
A USB keyboard report. More... | |
struct | usb_keyboard |
A USB keyboard device. More... | |
Macros | |
#define | USBKBD_PROTOCOL 1 |
Keyboard protocol. More... | |
#define | USBKBD_CTRL ( USBKBD_CTRL_LEFT | USBKBD_CTRL_RIGHT ) |
Either Ctrl key. More... | |
#define | USBKBD_SHIFT ( USBKBD_SHIFT_LEFT | USBKBD_SHIFT_RIGHT ) |
Either Shift key. More... | |
#define | USBKBD_ALT ( USBKBD_ALT_LEFT | USBKBD_ALT_RIGHT ) |
Either Alt key. More... | |
#define | USBKBD_GUI ( USBKBD_GUI_LEFT | USBKBD_GUI_RIGHT ) |
Either GUI key. More... | |
#define | USBKBD_IDLE_DURATION 10 /* 10 x 4ms = 40ms */ |
Keyboard idle duration (in 4ms units) More... | |
#define | USBKBD_HOLDOFF 12 /* 12 x 40ms = 480ms */ |
Keyboard auto-repeat hold-off (in units of USBKBD_IDLE_DURATION) More... | |
#define | USBKBD_INTR_MAX_FILL 8 |
Interrupt endpoint maximum fill level. More... | |
#define | USBKBD_BUFSIZE 8 |
Keyboard buffer size. More... | |
Enumerations | |
enum | usb_keyboard_modifier { USBKBD_CTRL_LEFT = 0x01, USBKBD_SHIFT_LEFT = 0x02, USBKBD_ALT_LEFT = 0x04, USBKBD_GUI_LEFT = 0x08, USBKBD_CTRL_RIGHT = 0x10, USBKBD_SHIFT_RIGHT = 0x20, USBKBD_ALT_RIGHT = 0x40, USBKBD_GUI_RIGHT = 0x80 } |
USB modifier keys. More... | |
enum | usb_keycode { USBKBD_KEY_A = 0x04, USBKBD_KEY_Z = 0x1d, USBKBD_KEY_1 = 0x1e, USBKBD_KEY_0 = 0x27, USBKBD_KEY_ENTER = 0x28, USBKBD_KEY_SPACE = 0x2c, USBKBD_KEY_MINUS = 0x2d, USBKBD_KEY_SLASH = 0x38, USBKBD_KEY_CAPS_LOCK = 0x39, USBKBD_KEY_F1 = 0x3a, USBKBD_KEY_UP = 0x52, USBKBD_KEY_NUM_LOCK = 0x53, USBKBD_KEY_PAD_ENTER = 0x58, USBKBD_KEY_PAD_1 = 0x59, USBKBD_KEY_PAD_DOT = 0x63, USBKBD_KEY_NON_US = 0x64 } |
USB keycodes. More... | |
enum | usb_keyboard_led { USBKBD_LED_NUM_LOCK = 0x01, USBKBD_LED_CAPS_LOCK = 0x02, USBKBD_LED_SCROLL_LOCK = 0x04 } |
USB keyboard LEDs. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static unsigned int | usbkbd_fill (struct usb_keyboard *kbd) |
Calculate keyboard buffer fill level. More... | |
USB keyboard driver.
Definition in file usbkbd.h.
#define USBKBD_CTRL ( USBKBD_CTRL_LEFT | USBKBD_CTRL_RIGHT ) |
#define USBKBD_SHIFT ( USBKBD_SHIFT_LEFT | USBKBD_SHIFT_RIGHT ) |
#define USBKBD_ALT ( USBKBD_ALT_LEFT | USBKBD_ALT_RIGHT ) |
#define USBKBD_GUI ( USBKBD_GUI_LEFT | USBKBD_GUI_RIGHT ) |
#define USBKBD_IDLE_DURATION 10 /* 10 x 4ms = 40ms */ |
#define USBKBD_HOLDOFF 12 /* 12 x 40ms = 480ms */ |
#define USBKBD_INTR_MAX_FILL 8 |
Interrupt endpoint maximum fill level.
When idling, we are likely to poll the USB endpoint at only the 18.2Hz system timer tick rate. With a typical observed bInterval of 10ms (which will be rounded down to 8ms by the HCI drivers), this gives approximately 7 completions per poll.
#define USBKBD_BUFSIZE 8 |
USB modifier keys.
Definition at line 30 of file usbkbd.h.
enum usb_keycode |
USB keycodes.
Definition at line 62 of file usbkbd.h.
enum usb_keyboard_led |
USB keyboard LEDs.
Enumerator | |
---|---|
USBKBD_LED_NUM_LOCK | |
USBKBD_LED_CAPS_LOCK | |
USBKBD_LED_SCROLL_LOCK |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Calculate keyboard buffer fill level.
kbd | USB keyboard |
fill | Keyboard buffer fill level |
Definition at line 165 of file usbkbd.h.
References assert(), usb_keyboard::cons, fill, usb_keyboard::prod, and USBKBD_BUFSIZE.
Referenced by usbkbd_consume(), usbkbd_getchar(), usbkbd_iskey(), and usbkbd_produce().