mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 00:55:53 +00:00
Changes based on the patch by Logan_V8_TT.
- Formating changes (TABs/spaces) - Don't set 'Output Line 2' bit while power-uping the mouse during initalization. - Restore 'Line Control' register at the end of mouse detection. - Wait only 150000 millisecons (instead of 500000) for mouse power down. - Enable detection of mouse on COM2 by default. svn path=/trunk/; revision=7786
This commit is contained in:
parent
526b9ea0bc
commit
0d1556f869
1 changed files with 32 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Serial Mouse driver 0.0.8
|
* Serial Mouse driver 0.0.9
|
||||||
* Written by Jason Filby (jasonfilby@yahoo.com)
|
* Written by Jason Filby (jasonfilby@yahoo.com)
|
||||||
* And heavily rewritten by Filip Navara (xnavara@volny.cz)
|
* And heavily rewritten by Filip Navara (xnavara@volny.cz)
|
||||||
* For ReactOS (www.reactos.com)
|
* For ReactOS (www.reactos.com)
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
/* Check for mouse on COM1? */
|
/* Check for mouse on COM1? */
|
||||||
#define SERMOUSE_COM1_SUPPORT
|
#define SERMOUSE_COM1_SUPPORT
|
||||||
/* Check for mouse on COM2? */
|
/* Check for mouse on COM2? */
|
||||||
//#define SERMOUSE_COM2_SUPPORT
|
#define SERMOUSE_COM2_SUPPORT
|
||||||
/* Create \??\Mouse* symlink for device? */
|
/* Create \??\Mouse* symlink for device? */
|
||||||
#define SERMOUSE_MOUSESYMLINK_SUPPORT
|
#define SERMOUSE_MOUSESYMLINK_SUPPORT
|
||||||
|
|
||||||
|
@ -393,18 +393,23 @@ ULONG DetectMicrosoftMouse(ULONG Port)
|
||||||
ULONG TimeOut = 250;
|
ULONG TimeOut = 250;
|
||||||
UCHAR LineControl;
|
UCHAR LineControl;
|
||||||
|
|
||||||
/* Shutdown mouse or something like that */
|
/* Save original control */
|
||||||
LineControl = READ_PORT_UCHAR((PUCHAR)Port + 4);
|
LineControl = READ_PORT_UCHAR((PUCHAR)Port + 4);
|
||||||
|
|
||||||
|
/* Inactivate RTS and set DTR */
|
||||||
WRITE_PORT_UCHAR((PUCHAR)Port + 4, (LineControl & ~0x02) | 0x01);
|
WRITE_PORT_UCHAR((PUCHAR)Port + 4, (LineControl & ~0x02) | 0x01);
|
||||||
KeStallExecutionProcessor(500000);
|
KeStallExecutionProcessor(150000); /* Wait > 100 ms */
|
||||||
|
|
||||||
/* Clear buffer */
|
/* Clear buffer */
|
||||||
while (READ_PORT_UCHAR((PUCHAR)Port + 5) & 0x01)
|
while (READ_PORT_UCHAR((PUCHAR)Port + 5) & 0x01)
|
||||||
(void)READ_PORT_UCHAR((PUCHAR)Port);
|
(void)READ_PORT_UCHAR((PUCHAR)Port);
|
||||||
|
|
||||||
/* Send modem control with 'Data Terminal Ready', 'Request To Send' and
|
/*
|
||||||
* 'Output Line 2' message. This enables mouse to identify. */
|
* Send modem control with 'Data Terminal Ready' and 'Request To Send'
|
||||||
WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x0b);
|
* message. This enables mouse to identify.
|
||||||
|
*/
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)Port + 4, 0x03);
|
||||||
|
|
||||||
/* Wait 10 milliseconds for the mouse getting ready */
|
/* Wait 10 milliseconds for the mouse getting ready */
|
||||||
KeStallExecutionProcessor(10000);
|
KeStallExecutionProcessor(10000);
|
||||||
|
|
||||||
|
@ -421,6 +426,9 @@ ULONG DetectMicrosoftMouse(ULONG Port)
|
||||||
Buffer[i] = READ_PORT_UCHAR((PUCHAR)Port);
|
Buffer[i] = READ_PORT_UCHAR((PUCHAR)Port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Restore control */
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)Port + 4, LineControl);
|
||||||
|
|
||||||
/* Check that four bytes for signs */
|
/* Check that four bytes for signs */
|
||||||
for (i = 0; i < 4; ++i)
|
for (i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
|
@ -594,7 +602,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
||||||
{
|
{
|
||||||
BOOL MouseFound = FALSE;
|
BOOL MouseFound = FALSE;
|
||||||
|
|
||||||
DbgPrint("Serial Mouse Driver 0.0.8\n");
|
DbgPrint("Serial Mouse Driver 0.0.9\n");
|
||||||
#ifdef SERMOUSE_COM1_SUPPORT
|
#ifdef SERMOUSE_COM1_SUPPORT
|
||||||
DbgPrint("Trying to find mouse on COM1\n");
|
DbgPrint("Trying to find mouse on COM1\n");
|
||||||
MouseFound |= InitializeMouse(MOUSE_PORT_COM1, MOUSE_IRQ_COM1, DriverObject);
|
MouseFound |= InitializeMouse(MOUSE_PORT_COM1, MOUSE_IRQ_COM1, DriverObject);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue