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 LOGIBM_BASE 0x23c
37 #define MSE_DATA_PORT 0x23c
38 #define MSE_SIGNATURE_PORT 0x23d
39 #define MSE_CONTROL_PORT 0x23e
40 #define MSE_INTERRUPT_PORT 0x23e
41 #define MSE_CONFIG_PORT 0x23f
42 #define LOGIBM_EXTENT 0x4
43
44 #define MSE_ENABLE_INTERRUPTS 0x00
45 #define MSE_DISABLE_INTERRUPTS 0x10
46
47 #define MSE_READ_X_LOW 0x80
48 #define MSE_READ_X_HIGH 0xa0
49 #define MSE_READ_Y_LOW 0xc0
50 #define MSE_READ_Y_HIGH 0xe0
51
52
53 #define MSE_CONFIG_BYTE 0x91
54 #define MSE_DEFAULT_MODE 0x90
55 #define MSE_SIGNATURE_BYTE 0xa5
56
57
58
59 #define MSE_INT_OFF() outb(MSE_DISABLE_INTERRUPTS, MSE_CONTROL_PORT)
60 #define MSE_INT_ON() outb(MSE_ENABLE_INTERRUPTS, MSE_CONTROL_PORT)
61
62
63
64 #define MSBM_BASE 0x23d
65 #define MS_MSE_DATA_PORT 0x23d
66 #define MS_MSE_SIGNATURE_PORT 0x23e
67 #define MS_MSE_CONTROL_PORT 0x23c
68 #define MS_MSE_CONFIG_PORT 0x23f
69 #define MSBM_EXTENT 0x3
70
71 #define MS_MSE_ENABLE_INTERRUPTS 0x11
72 #define MS_MSE_DISABLE_INTERRUPTS 0x10
73
74 #define MS_MSE_READ_BUTTONS 0x00
75 #define MS_MSE_READ_X 0x01
76 #define MS_MSE_READ_Y 0x02
77
78 #define MS_MSE_START 0x80
79 #define MS_MSE_COMMAND_MODE 0x07
80
81
82
83 #define MS_MSE_INT_OFF() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
84 outb(MS_MSE_DISABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
85 #define MS_MSE_INT_ON() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
86 outb(MS_MSE_ENABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
87
88
89 struct mouse_status {
90 unsigned char buttons;
91 unsigned char latch_buttons;
92 int dx;
93 int dy;
94 int present;
95 int ready;
96 int active;
97 struct wait_queue *wait;
98 struct fasync_struct *fasyncptr;
99 };
100
101
102
103 #endif
104