00001 #ifndef _LINUX_BUSMOUSE_H
00002 #define _LINUX_BUSMOUSE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #define MOUSE_IRQ 5
00035 #define LOGITECH_BUSMOUSE 0
00036 #define MICROSOFT_BUSMOUSE 2
00037
00038
00039
00040 #define MSE_DATA_PORT 0x23c
00041 #define MSE_SIGNATURE_PORT 0x23d
00042 #define MSE_CONTROL_PORT 0x23e
00043 #define MSE_INTERRUPT_PORT 0x23e
00044 #define MSE_CONFIG_PORT 0x23f
00045
00046 #define MSE_ENABLE_INTERRUPTS 0x00
00047 #define MSE_DISABLE_INTERRUPTS 0x10
00048
00049 #define MSE_READ_X_LOW 0x80
00050 #define MSE_READ_X_HIGH 0xa0
00051 #define MSE_READ_Y_LOW 0xc0
00052 #define MSE_READ_Y_HIGH 0xe0
00053
00054
00055 #define MSE_CONFIG_BYTE 0x91
00056 #define MSE_DEFAULT_MODE 0x90
00057 #define MSE_SIGNATURE_BYTE 0xa5
00058
00059
00060
00061 #define MSE_INT_OFF() outb(MSE_DISABLE_INTERRUPTS, MSE_CONTROL_PORT)
00062 #define MSE_INT_ON() outb(MSE_ENABLE_INTERRUPTS, MSE_CONTROL_PORT)
00063
00064
00065
00066 #define MS_MSE_DATA_PORT 0x23d
00067 #define MS_MSE_SIGNATURE_PORT 0x23e
00068 #define MS_MSE_CONTROL_PORT 0x23c
00069 #define MS_MSE_CONFIG_PORT 0x23f
00070
00071 #define MS_MSE_ENABLE_INTERRUPTS 0x11
00072 #define MS_MSE_DISABLE_INTERRUPTS 0x10
00073
00074 #define MS_MSE_READ_BUTTONS 0x00
00075 #define MS_MSE_READ_X 0x01
00076 #define MS_MSE_READ_Y 0x02
00077
00078 #define MS_MSE_START 0x80
00079 #define MS_MSE_COMMAND_MODE 0x07
00080
00081
00082
00083 #define MS_MSE_INT_OFF() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
00084 outb(MS_MSE_DISABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
00085 #define MS_MSE_INT_ON() {outb(MS_MSE_COMMAND_MODE, MS_MSE_CONTROL_PORT); \
00086 outb(MS_MSE_ENABLE_INTERRUPTS, MS_MSE_DATA_PORT);}
00087
00088
00089 struct mouse_status {
00090 unsigned char buttons;
00091 unsigned char latch_buttons;
00092 int dx;
00093 int dy;
00094 int present;
00095 int ready;
00096 int active;
00097 struct wait_queue *wait;
00098 };
00099
00100
00101 extern long mouse_init(long);
00102
00103 #endif
00104