Author: cgutman
Date: Thu Nov 17 23:41:18 2011
New Revision: 54415
URL:
http://svn.reactos.org/svn/reactos?rev=54415&view=rev
Log:
[I8042PRT]
- Implement support for hot plugging PS/2 mice if one was present at boot (same
requirement as Windows)
- Fixes bug 1395
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 23:41:18 2011
@@ -361,12 +361,8 @@
Irql = KeAcquireInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt);
- WARN_(I8042PRT, "Mouse initialization timeout! (substate %x). Disabling
mouse.\n",
+ WARN_(I8042PRT, "Mouse initialization timeout! (substate %x)\n",
DeviceExtension->MouseResetState);
-
- i8042Flush(PortDeviceExtension);
- i8042ChangeMode(PortDeviceExtension, CCB_MOUSE_INT_ENAB, CCB_MOUSE_DISAB);
- i8042Flush(PortDeviceExtension);
PortDeviceExtension->Flags &= ~MOUSE_PRESENT;
@@ -633,8 +629,21 @@
if (i8042MouCallIsrHook(DeviceExtension, Status, Value, &ToReturn))
return ToReturn;
- if (MouseResetting != DeviceExtension->MouseState)
+ if (MouseIdle == DeviceExtension->MouseState)
+ {
+ /* Magic packet value that indicates a reset */
+ if (0xAA == Value)
+ {
+ WARN_(I8042PRT, "Hot plugged mouse!\n");
+ DeviceExtension->MouseState = MouseResetting;
+ DeviceExtension->MouseResetState = ExpectingReset;
+ }
+ else
+ return FALSE;
+ }
+ else if (MouseResetting != DeviceExtension->MouseState)
return FALSE;
+
DeviceExtension->MouseTimeoutState = TimeoutStart;
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
@@ -870,6 +879,7 @@
DeviceExtension->MouseResetState = ExpectingEnableACK;
return TRUE;
case ExpectingEnableACK:
+ PortDeviceExtension->Flags |= MOUSE_PRESENT;
DeviceExtension->MouseState = MouseIdle;
DeviceExtension->MouseTimeoutState = TimeoutCancel;
INFO_(I8042PRT, "Mouse type = %u\n", DeviceExtension->MouseType);