Import 2.1.42pre1
[davej-history.git] / include / linux / busmouse.h
blobeb71550d30153bc29de64ab9487388af657c772e
1 #ifndef _LINUX_BUSMOUSE_H
2 #define _LINUX_BUSMOUSE_H
4 /*
5 * linux/include/linux/busmouse.h: header file for Logitech Bus Mouse driver
6 * by James Banks
8 * based on information gleamed from various mouse drivers on the net
10 * Heavily modified by David giller (rafetmad@oxy.edu)
12 * Minor modifications for Linux 0.96c-pl1 by Nathan Laredo
13 * gt7080a@prism.gatech.edu (13JUL92)
15 * Microsoft BusMouse support by Teemu Rantanen (tvr@cs.hut.fi) (02AUG92)
17 * Microsoft Bus Mouse support modified by Derrick Cole (cole@concert.net)
18 * 8/28/92
20 * Microsoft Bus Mouse support folded into 0.97pl4 code
21 * by Peter Cervasio (pete%q106fm.uucp@wupost.wustl.edu) (08SEP92)
22 * Changes: Logitech and Microsoft support in the same kernel.
23 * Defined new constants in busmouse.h for MS mice.
24 * Added int mse_busmouse_type to distinguish busmouse types
25 * Added a couple of new functions to handle differences in using
26 * MS vs. Logitech (where the int variable wasn't appropriate).
30 #define MOUSE_IRQ 5
31 #define LOGITECH_BUSMOUSE 0 /* Minor device # for Logitech */
32 #define MICROSOFT_BUSMOUSE 2 /* Minor device # for Microsoft */
34 /*--------- LOGITECH BUSMOUSE ITEMS -------------*/
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
44 #define MSE_ENABLE_INTERRUPTS 0x00
45 #define MSE_DISABLE_INTERRUPTS 0x10
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
52 /* Magic number used to check if the mouse exists */
53 #define MSE_CONFIG_BYTE 0x91
54 #define MSE_DEFAULT_MODE 0x90
55 #define MSE_SIGNATURE_BYTE 0xa5
57 /* useful Logitech Mouse macros */
59 #define MSE_INT_OFF() outb(MSE_DISABLE_INTERRUPTS, MSE_CONTROL_PORT)
60 #define MSE_INT_ON() outb(MSE_ENABLE_INTERRUPTS, MSE_CONTROL_PORT)
62 /*--------- MICROSOFT BUSMOUSE ITEMS -------------*/
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
71 #define MS_MSE_ENABLE_INTERRUPTS 0x11
72 #define MS_MSE_DISABLE_INTERRUPTS 0x10
74 #define MS_MSE_READ_BUTTONS 0x00
75 #define MS_MSE_READ_X 0x01
76 #define MS_MSE_READ_Y 0x02
78 #define MS_MSE_START 0x80
79 #define MS_MSE_COMMAND_MODE 0x07
81 /* useful microsoft busmouse macros */
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);}
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;
101 /* Function Prototypes */
103 #endif