3 #include <ddk/ntddkbd.h>
4 #include <ddk/ntdd8042.h>
6 #define KBD_BUFFER_SIZE 32
7 #define KBD_WRAP_MASK 0x1F
9 /*-----------------------------------------------------
11 * --------------------------------------------------*/
12 typedef struct _DEVICE_EXTENSION
14 PDEVICE_OBJECT I8042Device
;
15 PDEVICE_OBJECT DeviceObject
;
17 KEYBOARD_INPUT_DATA KbdBuffer
[KBD_BUFFER_SIZE
];
21 BOOLEAN AlreadyOpened
;
22 } DEVICE_EXTENSION
, *PDEVICE_EXTENSION
;
24 typedef struct _CONNECT_DATA
{
25 PDEVICE_OBJECT ClassDeviceObject
;
27 } CONNECT_DATA
, *PCONNECT_DATA
;
33 #define IOCTL_INTERNAL_KEYBOARD_CONNECT \
34 CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS)
36 #define KEYBOARD_IRQ 1
38 #define disable() __asm__("cli\n\t")
39 #define enable() __asm__("sti\n\t")
41 #define ALT_PRESSED (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED)
42 #define CTRL_PRESSED (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)
46 * Keyboard controller ports
49 #define KBD_DATA_PORT 0x60
50 #define KBD_CTRL_PORT 0x64
57 #define KBD_READ_MODE 0x20
58 #define KBD_WRITE_MODE 0x60
59 #define KBD_SELF_TEST 0xAA
60 #define KBD_LINE_TEST 0xAB
61 #define KBD_CTRL_ENABLE 0xAE
67 #define KBD_ENABLE 0xF4
68 #define KBD_DISABLE 0xF5
69 #define KBD_RESET 0xFF
77 #define KBD_BATCC 0xAA
81 * Controller status register bits
94 #define KBD_LED_SCROLL 0x01
95 #define KBD_LED_NUM 0x02
96 #define KBD_LED_CAPS 0x04
98 #endif // _KEYBOARD_H_