busmouse.h

Go to the documentation of this file.
00001 #ifndef _LINUX_BUSMOUSE_H
00002 #define _LINUX_BUSMOUSE_H
00003 
00004 /**
00005 *
00006 
00007  * linux/include/linux/mouse.h: header file for Logitech Bus Mouse driver
00008  * by James Banks
00009  *
00010  * based on information gleamed from various mouse drivers on the net
00011  *
00012  * Heavily modified by David giller (rafetmad@oxy.edu)
00013  *
00014  * Minor modifications for Linux 0.96c-pl1 by Nathan Laredo
00015  * gt7080a@prism.gatech.edu (13JUL92)
00016  *
00017  * Microsoft BusMouse support by Teemu Rantanen (tvr@cs.hut.fi) (02AUG92)
00018  *
00019  * Microsoft Bus Mouse support modified by Derrick Cole (cole@concert.net)
00020  *    8/28/92
00021  *
00022  * Microsoft Bus Mouse support folded into 0.97pl4 code
00023  *    by Peter Cervasio (pete%q106fm.uucp@wupost.wustl.edu) (08SEP92)
00024  * Changes:  Logitech and Microsoft support in the same kernel.
00025  *           Defined new constants in busmouse.h for MS mice.
00026  *           Added int mse_busmouse_type to distinguish busmouse types
00027  *           Added a couple of new functions to handle differences in using
00028  *             MS vs. Logitech (where the int variable wasn't appropriate).
00029  *
00030 
00031 
00032 */
00033 
00034 #define MOUSE_IRQ               5
00035 #define LOGITECH_BUSMOUSE       0   ///< Minor device # for Logitech  
00036 #define MICROSOFT_BUSMOUSE      2   ///< Minor device # for Microsoft 
00037 
00038 ///--------- LOGITECH BUSMOUSE ITEMS -------------
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 /// Magic number used to check if the mouse exists 
00055 #define MSE_CONFIG_BYTE         0x91
00056 #define MSE_DEFAULT_MODE        0x90
00057 #define MSE_SIGNATURE_BYTE      0xa5
00058 
00059 /// useful Logitech Mouse macros 
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 ///--------- MICROSOFT BUSMOUSE ITEMS -------------
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 /// useful microsoft busmouse macros 
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 /// Function Prototypes 
00101 extern long mouse_init(long);
00102 
00103 #endif
00104 

Generated on Mon May 1 21:46:59 2006 for KernelAPI by  doxygen 1.4.6-5