Author: cgutman
Date: Thu Nov 17 21:19:32 2011
New Revision: 54412
URL:
http://svn.reactos.org/svn/reactos?rev=54412&view=rev
Log:
[I8042PRT]
- Discard extra ACK packets from the mouse during reset
- Fixes certain mice that send the ACK out of order
Modified:
trunk/reactos/drivers/input/i8042prt/mouse.c
Modified: trunk/reactos/drivers/input/i8042prt/mouse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/mou…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/mouse.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/i8042prt/mouse.c [iso-8859-1] Thu Nov 17 21:19:32 2011
@@ -458,7 +458,7 @@
IoMarkIrpPending(Irp);
DeviceExtension->MouseState = MouseResetting;
- DeviceExtension->MouseResetState = 1100;
+ DeviceExtension->MouseResetState = ExpectingReset;
DeviceExtension->MouseHook.IsrWritePort = i8042MouIsrWritePort;
DeviceExtension->MouseHook.QueueMousePacket = i8042MouQueuePacket;
DeviceExtension->MouseHook.CallContext = DeviceExtension;
@@ -640,10 +640,13 @@
switch ((ULONG)DeviceExtension->MouseResetState)
{
- case 1100: /* the first ack, drop it. */
- DeviceExtension->MouseResetState = ExpectingReset;
- return TRUE;
case ExpectingReset:
+ if (MOUSE_ACK == Value)
+ {
+ WARN_(I8042PRT, "Dropping extra ACK\n");
+ return TRUE;
+ }
+
/* First, 0xFF is sent. The mouse is supposed to say AA00 if ok, FC00 if not. */
if (0xAA == Value)
{
@@ -657,6 +660,12 @@
}
return TRUE;
case ExpectingResetId:
+ if (MOUSE_ACK == Value)
+ {
+ WARN_(I8042PRT, "Dropping extra ACK #2\n");
+ return TRUE;
+ }
+
if (0x00 == Value)
{
DeviceExtension->MouseResetState++;