1 #ifndef _LINUX_BUSMOUSE_H
2 #define _LINUX_BUSMOUSE_H
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #define MOUSE_IRQ 5
31 #define LOGITECH_BUSMOUSE 0
32 #define MICROSOFT_BUSMOUSE 2
33
34
35
36 #define MSE_DATA_PORT 0x23c
37 #define MSE_SIGNATURE_PORT 0x23d
38 #define MSE_CONTROL_PORT 0x23e
39 #define MSE_INTERRUPT_PORT 0x23e
40 #define MSE_CONFIG_PORT 0x23f
41
42 #define MSE_ENABLE_INTERRUPTS 0x00
43 #define MSE_DISABLE_INTERRUPTS 0x10
44
45 #define MSE_READ_X_LOW 0x80
46 #define MSE_READ_X_HIGH 0xa0
47 #define MSE_READ_Y_LOW 0xc0
48 #define MSE_READ_Y_HIGH 0xe0
49
50
51 #define MSE_CONFIG_BYTE 0x91
52 #define MSE_DEFAULT_MODE 0x90
53 #define MSE_SIGNATURE_BYTE 0xa5
54
55
56
57 #define MSE_INT_OFF() outb(MSE_DISABLE_INTERRUPTS, MSE_CONTROL_PORT)
58 #define MSE_INT_ON() outb(MSE_ENABLE_INTERRUPTS, MSE_CONTROL_PORT)
59
60
61
62 #define MS_MSE_DATA_PORT 0x23d
63 #define MS_MSE_SIGNATURE_PORT 0x23e
64 #define MS_MSE_CONTROL_PORT 0x23c
65 #define MS_MSE_CONFIG_PORT 0x23f
66
67 #define MS_MSE_ENABLE_INTERRUPTS 0x11
68 #define MS_MSE_DISABLE_INTERRUPTS 0x10
69
70 #define MS_MSE_READ_BUTTONS 0x00
71 #define MS_MSE_READ_X 0x01
72 #define MS_MSE_READ_Y 0x02
73
74 #define MS_MSE_START 0x80
75 #define MS_MSE_COMMAND_MODE 0x07
76
77
78
79 #define MS_MSE_INT_OFF() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
80 outb(MS_MSE_DISABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
81 #define MS_MSE_INT_ON() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
82 outb(MS_MSE_ENABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
83
84
85 struct mouse_status {
86 unsigned char buttons;
87 unsigned char latch_buttons;
88 int dx;
89 int dy;
90 int present;
91 int ready;
92 int active;
93 struct wait_queue *wait;
94 struct fasync_struct *fasyncptr;
95 };
96
97
98
99 #endif
100