mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 02:15:47 +00:00
Reset mouse to detect its type
See issue #2817 for more details. svn path=/trunk/; revision=30470
This commit is contained in:
parent
1971167c46
commit
aa3c97709d
3 changed files with 18 additions and 19 deletions
|
@ -202,22 +202,6 @@ i8042SendHookWorkItem(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#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;
|
WorkItemData->Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -28,14 +28,14 @@ i8042MouIsrWritePort(
|
||||||
|
|
||||||
DeviceExtension = (PI8042_MOUSE_EXTENSION)Context;
|
DeviceExtension = (PI8042_MOUSE_EXTENSION)Context;
|
||||||
|
|
||||||
if (DeviceExtension->MouseHook.IsrWritePort)
|
if (DeviceExtension->MouseHook.IsrWritePort != i8042MouIsrWritePort)
|
||||||
{
|
{
|
||||||
DeviceExtension->MouseHook.IsrWritePort(
|
DeviceExtension->MouseHook.IsrWritePort(
|
||||||
DeviceExtension->MouseHook.CallContext,
|
DeviceExtension->MouseHook.CallContext,
|
||||||
Value);
|
Value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
i8042IsrWritePort(Context, Value, CTRL_WRITE_MOUSE);
|
i8042IsrWritePort(DeviceExtension->Common.PortDeviceExtension, Value, CTRL_WRITE_MOUSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID NTAPI
|
static VOID NTAPI
|
||||||
|
@ -429,6 +429,8 @@ i8042MouInternalDeviceControl(
|
||||||
DeviceExtension->Common.PortDeviceExtension->Flags |= MOUSE_CONNECTED;
|
DeviceExtension->Common.PortDeviceExtension->Flags |= MOUSE_CONNECTED;
|
||||||
|
|
||||||
IoMarkIrpPending(Irp);
|
IoMarkIrpPending(Irp);
|
||||||
|
DeviceExtension->MouseState = MouseResetting;
|
||||||
|
DeviceExtension->MouseResetState = 1100;
|
||||||
DeviceExtension->MouseHook.IsrWritePort = i8042MouIsrWritePort;
|
DeviceExtension->MouseHook.IsrWritePort = i8042MouIsrWritePort;
|
||||||
DeviceExtension->MouseHook.QueueMousePacket = i8042MouQueuePacket;
|
DeviceExtension->MouseHook.QueueMousePacket = i8042MouQueuePacket;
|
||||||
DeviceExtension->MouseHook.CallContext = DeviceExtension;
|
DeviceExtension->MouseHook.CallContext = DeviceExtension;
|
||||||
|
|
|
@ -333,6 +333,19 @@ EnableInterrupts(
|
||||||
|
|
||||||
i8042Flush(DeviceExtension);
|
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 */
|
/* Select the devices we have */
|
||||||
if (DeviceExtension->Flags & KEYBOARD_PRESENT)
|
if (DeviceExtension->Flags & KEYBOARD_PRESENT)
|
||||||
{
|
{
|
||||||
|
@ -533,7 +546,7 @@ i8042PnpStartDevice(
|
||||||
else
|
else
|
||||||
InterruptData.InterruptMode = LevelSensitive;
|
InterruptData.InterruptMode = LevelSensitive;
|
||||||
InterruptData.ShareInterrupt = (ResourceDescriptorTranslated->ShareDisposition == CmResourceShareShared);
|
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;
|
FoundIrq = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue