Author: hpoussin
Date: Thu Nov 15 23:13:49 2007
New Revision: 30470
URL:
http://svn.reactos.org/svn/reactos?rev=30470&view=rev
Log:
Reset mouse to detect its type
See issue #2817 for more details.
Modified:
trunk/reactos/drivers/input/i8042prt/i8042prt.c
trunk/reactos/drivers/input/i8042prt/mouse.c
trunk/reactos/drivers/input/i8042prt/pnp.c
Modified: trunk/reactos/drivers/input/i8042prt/i8042prt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/i80…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/i8042prt.c (original)
+++ trunk/reactos/drivers/input/i8042prt/i8042prt.c Thu Nov 15 23:13:49 2007
@@ -202,22 +202,6 @@
}
}
}
-#if 0
- else
- {
- /* Mouse doesn't have this, but we need to send a
- * reset to start the detection.
- */
- KIRQL Irql;
-
- Irql = KeAcquireInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt);
-
- i8042Write(PortDeviceExtension, PortDeviceExtension->ControlPort,
CTRL_WRITE_MOUSE);
- i8042Write(PortDeviceExtension, PortDeviceExtension->DataPort, MOU_CMD_RESET);
-
- KeReleaseInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt, Irql);
- }
-#endif
WorkItemData->Irp->IoStatus.Status = STATUS_SUCCESS;
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 (original)
+++ trunk/reactos/drivers/input/i8042prt/mouse.c Thu Nov 15 23:13:49 2007
@@ -28,14 +28,14 @@
DeviceExtension = (PI8042_MOUSE_EXTENSION)Context;
- if (DeviceExtension->MouseHook.IsrWritePort)
+ if (DeviceExtension->MouseHook.IsrWritePort != i8042MouIsrWritePort)
{
DeviceExtension->MouseHook.IsrWritePort(
DeviceExtension->MouseHook.CallContext,
Value);
}
else
- i8042IsrWritePort(Context, Value, CTRL_WRITE_MOUSE);
+ i8042IsrWritePort(DeviceExtension->Common.PortDeviceExtension, Value,
CTRL_WRITE_MOUSE);
}
static VOID NTAPI
@@ -429,6 +429,8 @@
DeviceExtension->Common.PortDeviceExtension->Flags |= MOUSE_CONNECTED;
IoMarkIrpPending(Irp);
+ DeviceExtension->MouseState = MouseResetting;
+ DeviceExtension->MouseResetState = 1100;
DeviceExtension->MouseHook.IsrWritePort = i8042MouIsrWritePort;
DeviceExtension->MouseHook.QueueMousePacket = i8042MouQueuePacket;
DeviceExtension->MouseHook.CallContext = DeviceExtension;
Modified: trunk/reactos/drivers/input/i8042prt/pnp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/pnp…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/pnp.c (original)
+++ trunk/reactos/drivers/input/i8042prt/pnp.c Thu Nov 15 23:13:49 2007
@@ -332,6 +332,19 @@
UCHAR FlagsToEnable = 0;
i8042Flush(DeviceExtension);
+
+ /* First, reset the mouse (if any) to start the detection */
+ if (DeviceExtension->Flags & MOUSE_PRESENT)
+ {
+ KIRQL Irql;
+
+ Irql = KeAcquireInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt);
+
+ i8042Write(DeviceExtension, DeviceExtension->ControlPort, CTRL_WRITE_MOUSE);
+ i8042Write(DeviceExtension, DeviceExtension->DataPort, MOU_CMD_RESET);
+
+ KeReleaseInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt, Irql);
+ }
/* Select the devices we have */
if (DeviceExtension->Flags & KEYBOARD_PRESENT)
@@ -533,7 +546,7 @@
else
InterruptData.InterruptMode = LevelSensitive;
InterruptData.ShareInterrupt = (ResourceDescriptorTranslated->ShareDisposition ==
CmResourceShareShared);
- DPRINT("Found irq resource: %lu\n",
ResourceDescriptor->u.Interrupt.Vector);
+ DPRINT("Found irq resource: %lu\n",
ResourceDescriptor->u.Interrupt.Level);
FoundIrq = TRUE;
break;
}