From 4d831f2242f8836f8a9efb9b482a47931401bbfd Mon Sep 17 00:00:00 2001 From: Steven Edwards Date: Sun, 16 Jun 2002 04:47:56 +0000 Subject: [PATCH] Fixed building of Serial Mouse driver (still broken) svn path=/trunk/; revision=3099 --- reactos/drivers/input/sermouse/makefile | 5 +- reactos/drivers/input/sermouse/mouse.c | 2 + reactos/drivers/input/sermouse/mouse.h | 12 ++++ reactos/drivers/input/sermouse/sermouse.c | 3 +- reactos/drivers/input/sermouse/sermouse.h | 80 ++++++++++++++++++++++ reactos/drivers/input/sermouse/sermouse.rc | 39 +++++++++++ 6 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 reactos/drivers/input/sermouse/mouse.h create mode 100644 reactos/drivers/input/sermouse/sermouse.h create mode 100644 reactos/drivers/input/sermouse/sermouse.rc diff --git a/reactos/drivers/input/sermouse/makefile b/reactos/drivers/input/sermouse/makefile index 32b5ce0e86f..22657b631bc 100644 --- a/reactos/drivers/input/sermouse/makefile +++ b/reactos/drivers/input/sermouse/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.7 2001/08/21 20:13:15 chorns Exp $ +# $Id: makefile,v 1.8 2002/06/16 04:47:56 sedwards Exp $ PATH_TO_TOP = ../../.. @@ -7,9 +7,10 @@ TARGET_TYPE = driver TARGET_NAME = sermouse TARGET_OBJECTS = \ - mouse.o sermouse.o +#mouse.o - Old Serial mouse driver + include $(PATH_TO_TOP)/rules.mak include $(TOOLS_PATH)/helper.mk diff --git a/reactos/drivers/input/sermouse/mouse.c b/reactos/drivers/input/sermouse/mouse.c index b9da7fb7dd5..d4020623b99 100644 --- a/reactos/drivers/input/sermouse/mouse.c +++ b/reactos/drivers/input/sermouse/mouse.c @@ -9,6 +9,8 @@ ** Known Limitations: ** Only supports mice on COM port 1 + ** Old Driver, We done build it. Just keep for History. (S.E.) + */ #include diff --git a/reactos/drivers/input/sermouse/mouse.h b/reactos/drivers/input/sermouse/mouse.h new file mode 100644 index 00000000000..0532f483c01 --- /dev/null +++ b/reactos/drivers/input/sermouse/mouse.h @@ -0,0 +1,12 @@ +typedef struct _DEVICE_EXTENSION { + + PDEVICE_OBJECT DeviceObject; + ULONG InputDataCount; + PMOUSE_INPUT_DATA MouseInputData; + CLASS_INFORMATION ClassInformation; + + PKINTERRUPT MouseInterrupt; + KDPC IsrDpc; + KDPC IsrDpcRetry; + +} DEVICE_EXTENSION, *PDEVICE_EXTENSION; \ No newline at end of file diff --git a/reactos/drivers/input/sermouse/sermouse.c b/reactos/drivers/input/sermouse/sermouse.c index 04919b6cf9e..3dcb6c5a427 100644 --- a/reactos/drivers/input/sermouse/sermouse.c +++ b/reactos/drivers/input/sermouse/sermouse.c @@ -14,6 +14,7 @@ #include #include "../include/mouse.h" #include "sermouse.h" +#include "mouse.h" #define MOUSE_IRQ_COM1 4 #define MOUSE_IRQ_COM2 3 @@ -24,7 +25,7 @@ #define max_screen_x 79 #define max_screen_y 24 -static unsigned int MOUSE_IRQ=MOUSE_IRQ_COM1; +//static unsigned int MOUSE_IRQ=MOUSE_IRQ_COM1; static unsigned int MOUSE_COM=COM1_PORT; static unsigned int bytepos=0, coordinate; diff --git a/reactos/drivers/input/sermouse/sermouse.h b/reactos/drivers/input/sermouse/sermouse.h new file mode 100644 index 00000000000..5ab0f5f2b58 --- /dev/null +++ b/reactos/drivers/input/sermouse/sermouse.h @@ -0,0 +1,80 @@ +// All or parts of this file are from CHAOS (http://www.se.chaosdev.org/). +// CHAOS is also under the GNU General Public License. + +/* Mouse commands. */ +/* Set resolution. */ + +#define MOUSE_SET_RESOLUTION 0xE8 + +/* Set 1:1 scaling. */ + +#define MOUSE_SET_SCALE11 0xE6 + +/* Set 2:1 scaling. */ + +#define MOUSE_SET_SCALE21 0xE7 + +/* Get scaling factor. */ + +#define MOUSE_GET_SCALE 0xE9 + +/* Set stream mode. */ + +#define MOUSE_SET_STREAM 0xEA + +/* Set sample rate (number of times the controller will poll the port + per second). */ + +#define MOUSE_SET_SAMPLE_RATE 0xF3 + +/* Enable mouse device. */ + +#define MOUSE_ENABLE_DEVICE 0xF4 + +/* Disable mouse device. */ + +#define MOUSE_DISABLE_DEVICE 0xF5 + +/* Reset aux device. */ + +#define MOUSE_RESET 0xFF + +/* Command byte ACK. */ + +#define MOUSE_ACK 0xFA + +#define MOUSE_INTERRUPTS_OFF (CONTROLLER_MODE_KCC | \ + CONTROLLER_MODE_DISABLE_MOUSE | \ + CONTROLLER_MODE_SYS | \ + CONTROLLER_MODE_KEYBOARD_INTERRUPT) + +#define MOUSE_INTERRUPTS_ON (CONTROLLER_MODE_KCC | \ + CONTROLLER_MODE_SYS | \ + CONTROLLER_MODE_MOUSE_INTERRUPT | \ + CONTROLLER_MODE_KEYBOARD_INTERRUPT) + +/* Used with mouse buttons */ + +#define GPM_B_LEFT 4 +#define GPM_B_MIDDLE 2 +#define GPM_B_RIGHT 1 + +/* Some aux operations take long time. */ + +#define MAX_RETRIES 60 + +/* Hardware defines. */ + +#define MOUSE_IRQ 12 +#define MOUSE_WRAP_MASK 0x1F + +static PIRP CurrentIrp; +static ULONG MouseDataRead; +static ULONG MouseDataRequired; +static BOOLEAN AlreadyOpened = FALSE; +static KDPC MouseDpc; + +static VOID MouseDpcRoutine(PKDPC Dpc, + PVOID DeferredContext, + PVOID SystemArgument1, + PVOID SystemArgument2); diff --git a/reactos/drivers/input/sermouse/sermouse.rc b/reactos/drivers/input/sermouse/sermouse.rc new file mode 100644 index 00000000000..15e98a649e4 --- /dev/null +++ b/reactos/drivers/input/sermouse/sermouse.rc @@ -0,0 +1,39 @@ + +#include +#include + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +VS_VERSION_INFO VERSIONINFO + FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD + PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", RES_STR_COMPANY_NAME + VALUE "FileDescription", "Serial Mouse Device Driver\0" + VALUE "FileVersion", "0.0.1\0" + VALUE "InternalName", "sermouse\0" + VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "sermouse.sys\0" + VALUE "ProductName", RES_STR_PRODUCT_NAME + VALUE "ProductVersion", RES_STR_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END +