mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[I8042PRT]
- Enable all interrupts at the same time to avoid a condition where the controller stops responding to KBD_READ_MODE on some systems - See bug #6271 for details svn path=/trunk/; revision=53911
This commit is contained in:
parent
1ef964c116
commit
47c6809ec3
1 changed files with 25 additions and 19 deletions
|
@ -381,16 +381,6 @@ EnableInterrupts(
|
|||
if (!i8042ChangeMode(DeviceExtension, FlagsToDisable, FlagsToEnable))
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
|
||||
/* Reset the mouse (if any) to start the detection */
|
||||
if (DeviceExtension->Flags & MOUSE_PRESENT)
|
||||
{
|
||||
KIRQL Irql;
|
||||
|
||||
Irql = KeAcquireInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt);
|
||||
i8042IsrWritePort(DeviceExtension, MOU_CMD_RESET, CTRL_WRITE_MOUSE);
|
||||
KeReleaseInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt, Irql);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -401,6 +391,7 @@ StartProcedure(
|
|||
NTSTATUS Status;
|
||||
UCHAR FlagsToDisable = 0;
|
||||
UCHAR FlagsToEnable = 0;
|
||||
KIRQL Irql;
|
||||
|
||||
if (DeviceExtension->DataPort == 0)
|
||||
{
|
||||
|
@ -434,6 +425,25 @@ StartProcedure(
|
|||
|
||||
INFO_(I8042PRT, "Keyboard present: %s\n", DeviceExtension->Flags & KEYBOARD_PRESENT ? "YES" : "NO");
|
||||
INFO_(I8042PRT, "Mouse present : %s\n", DeviceExtension->Flags & MOUSE_PRESENT ? "YES" : "NO");
|
||||
|
||||
TRACE_(I8042PRT, "Enabling i8042 interrupts\n");
|
||||
if (DeviceExtension->Flags & KEYBOARD_PRESENT)
|
||||
{
|
||||
FlagsToDisable |= CCB_KBD_DISAB;
|
||||
FlagsToEnable |= CCB_KBD_INT_ENAB;
|
||||
}
|
||||
if (DeviceExtension->Flags & MOUSE_PRESENT)
|
||||
{
|
||||
FlagsToDisable |= CCB_MOUSE_DISAB;
|
||||
FlagsToEnable |= CCB_MOUSE_INT_ENAB;
|
||||
}
|
||||
|
||||
Status = EnableInterrupts(DeviceExtension, FlagsToDisable, FlagsToEnable);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DeviceExtension->Flags &= ~(KEYBOARD_PRESENT | MOUSE_PRESENT);
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
|
||||
/* Connect interrupts */
|
||||
|
@ -447,8 +457,6 @@ StartProcedure(
|
|||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
DeviceExtension->Flags |= KEYBOARD_INITIALIZED;
|
||||
FlagsToDisable |= CCB_KBD_DISAB;
|
||||
FlagsToEnable |= CCB_KBD_INT_ENAB;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -462,15 +470,13 @@ StartProcedure(
|
|||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
DeviceExtension->Flags |= MOUSE_INITIALIZED;
|
||||
FlagsToDisable |= CCB_MOUSE_DISAB;
|
||||
FlagsToEnable |= CCB_MOUSE_INT_ENAB;
|
||||
}
|
||||
}
|
||||
|
||||
if (FlagsToEnable)
|
||||
Status = EnableInterrupts(DeviceExtension, FlagsToDisable, FlagsToEnable);
|
||||
else
|
||||
Status = STATUS_SUCCESS;
|
||||
/* Start the mouse */
|
||||
Irql = KeAcquireInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt);
|
||||
i8042IsrWritePort(DeviceExtension, MOU_CMD_RESET, CTRL_WRITE_MOUSE);
|
||||
KeReleaseInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt, Irql);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue