Author: fireball
Date: Mon Nov 13 15:50:53 2006
New Revision: 24745
URL:
http://svn.reactos.org/svn/reactos?rev=24745&view=rev
Log:
Merge r24744 from trunk ("flushing cache" hanging / inability to reboot fix).
Modified:
branches/ros-branch-0_3_1/reactos/drivers/input/i8042prt/i8042prt.c
Modified: branches/ros-branch-0_3_1/reactos/drivers/input/i8042prt/i8042prt.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/driver…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/drivers/input/i8042prt/i8042prt.c (original)
+++ branches/ros-branch-0_3_1/reactos/drivers/input/i8042prt/i8042prt.c Mon Nov 13
15:50:53 2006
@@ -599,6 +599,7 @@
static NTSTATUS STDCALL I8042Initialize(PDEVICE_EXTENSION DevExt)
{
NTSTATUS Status;
+ UCHAR Value = 0;
Status = I8042BasicDetect(DevExt);
if (!NT_SUCCESS(Status)) {
@@ -630,6 +631,32 @@
if (DevExt->MouseExists) {
DPRINT("Mouse detected\n");
I8042MouseEnable(DevExt);
+ }
+
+ /*
+ * Some machines do not reboot if SF is not set.
+ */
+ if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_READ_MODE)) {
+ DPRINT1("Can't read i8042 mode\n");
+ return Status;
+ }
+
+ Status = I8042ReadDataWait(DevExt, &Value);
+ if (!NT_SUCCESS(Status)) {
+ DPRINT1("No response after read i8042 mode\n");
+ return Status;
+ }
+
+ Value |= CCB_SYSTEM_FLAG;
+
+ if (!I8042Write(DevExt, I8042_CTRL_PORT, KBD_WRITE_MODE)) {
+ DPRINT1("Can't set i8042 mode\n");
+ return Status;
+ }
+
+ if (!I8042Write(DevExt, I8042_DATA_PORT, Value)) {
+ DPRINT1("Can't send i8042 mode\n");
+ return Status;
}
return STATUS_SUCCESS;