branch update for HEAD-2003050101
[reactos.git] / drivers / input / psaux / mouse.h
1 // All or parts of this file are from CHAOS (http://www.se.chaosdev.org/).
2 // CHAOS is also under the GNU General Public License.
3
4 // Mouse commands
5 #define MOUSE_SET_RESOLUTION            0xE8  // Set resolution
6 #define MOUSE_SET_SCALE11               0xE6  // Set 1:1 scaling
7 #define MOUSE_SET_SCALE21               0xE7  // Set 2:1 scaling
8 #define MOUSE_GET_SCALE                 0xE9  // Get scaling factor
9 #define MOUSE_SET_STREAM                0xEA  // Set stream mode
10 #define MOUSE_SET_SAMPLE_RATE           0xF3  /* Set sample rate (number of times
11                                                * the controller will poll the port
12                                                * per second */
13 #define MOUSE_ENABLE_DEVICE             0xF4  // Enable mouse device
14 #define MOUSE_DISABLE_DEVICE            0xF5  // Disable mouse device
15 #define MOUSE_RESET                     0xFF  // Reset aux device
16 #define MOUSE_ACK                       0xFA  // Command byte ACK
17
18 #define MOUSE_INTERRUPTS_OFF            (CONTROLLER_MODE_KCC | \
19                                          CONTROLLER_MODE_DISABLE_MOUSE | \
20                                          CONTROLLER_MODE_SYS | \
21                                          CONTROLLER_MODE_KEYBOARD_INTERRUPT)
22
23 #define MOUSE_INTERRUPTS_ON             (CONTROLLER_MODE_KCC | \
24                                          CONTROLLER_MODE_SYS | \
25                                          CONTROLLER_MODE_MOUSE_INTERRUPT | \
26                                          CONTROLLER_MODE_KEYBOARD_INTERRUPT)
27
28 // Used with mouse buttons
29 #define GPM_B_LEFT      1
30 #define GPM_B_RIGHT     2
31 #define GPM_B_MIDDLE    4
32
33 // Some aux operations take long time
34 #define MAX_RETRIES          60
35
36 // Hardware defines
37 #define MOUSE_IRQ            12
38 #define MOUSE_WRAP_MASK      0x1F
39
40 static PIRP  CurrentIrp;
41 static ULONG MouseDataRead;
42 static ULONG MouseDataRequired;
43 static BOOLEAN AlreadyOpened = FALSE;
44 static KDPC MouseDpc;
45
46 static VOID MouseDpcRoutine(PKDPC Dpc,
47                           PVOID DeferredContext,
48                           PVOID SystemArgument1,
49                           PVOID SystemArgument2);
50