Author: hpoussin
Date: Mon Dec 17 00:12:54 2007
New Revision: 31287
URL:
http://svn.reactos.org/svn/reactos?rev=31287&view=rev
Log:
Use kernel facilities to change debug level at runtime
Modified:
trunk/reactos/drivers/input/i8042prt/createclose.c
trunk/reactos/drivers/input/i8042prt/i8042prt.c
trunk/reactos/drivers/input/i8042prt/keyboard.c
trunk/reactos/drivers/input/i8042prt/misc.c
trunk/reactos/drivers/input/i8042prt/mouse.c
trunk/reactos/drivers/input/i8042prt/pnp.c
trunk/reactos/drivers/input/i8042prt/ps2pp.c
trunk/reactos/drivers/input/i8042prt/readwrite.c
trunk/reactos/drivers/input/i8042prt/registry.c
trunk/reactos/drivers/input/i8042prt/setup.c
Modified: trunk/reactos/drivers/input/i8042prt/createclose.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/cre…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/createclose.c (original)
+++ trunk/reactos/drivers/input/i8042prt/createclose.c Mon Dec 17 00:12:54 2007
@@ -17,7 +17,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CREATE\n");
+ TRACE_(I8042PRT, "IRP_MJ_CREATE\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
@@ -30,7 +30,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CLEANUP\n");
+ TRACE_(I8042PRT, "IRP_MJ_CLEANUP\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
@@ -43,7 +43,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- DPRINT("IRP_MJ_CLOSE\n");
+ TRACE_(I8042PRT, "IRP_MJ_CLOSE\n");
Irp->IoStatus.Status = STATUS_SUCCESS;
Irp->IoStatus.Information = 0;
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 Mon Dec 17 00:12:54 2007
@@ -33,7 +33,7 @@
ULONG DeviceExtensionSize;
NTSTATUS Status;
- DPRINT("i8042AddDevice(%p %p)\n", DriverObject, Pdo);
+ TRACE_(I8042PRT, "i8042AddDevice(%p %p)\n", DriverObject, Pdo);
DriverExtension = (PI8042_DRIVER_EXTENSION)IoGetDriverObjectExtension(DriverObject,
DriverObject);
@@ -57,7 +57,7 @@
&Fdo);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "IoCreateDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -70,7 +70,7 @@
Status = IoAttachDeviceToDeviceStackSafe(Fdo, Pdo,
&DeviceExtension->LowerDevice);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoAttachDeviceToDeviceStackSafe() failed with status 0x%08lx\n",
Status);
+ WARN_(I8042PRT, "IoAttachDeviceToDeviceStackSafe() failed with status
0x%08lx\n", Status);
goto cleanup;
}
@@ -107,7 +107,7 @@
PIRP NewIrp;
NTSTATUS Status;
- DPRINT("i8042SendHookWorkItem(%p %p)\n", DeviceObject, Context);
+ TRACE_(I8042PRT, "i8042SendHookWorkItem(%p %p)\n", DeviceObject, Context);
WorkItemData = (PI8042_HOOK_WORKITEM)Context;
FdoDeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
@@ -135,7 +135,7 @@
}
default:
{
- DPRINT1("Unknown FDO type %u\n", FdoDeviceExtension->Type);
+ ERR_(I8042PRT, "Unknown FDO type %u\n", FdoDeviceExtension->Type);
ASSERT(FALSE);
WorkItemData->Irp->IoStatus.Status = STATUS_INTERNAL_ERROR;
goto cleanup;
@@ -158,7 +158,7 @@
if (!NewIrp)
{
- DPRINT("IoBuildDeviceIoControlRequest() failed\n");
+ WARN_(I8042PRT, "IoBuildDeviceIoControlRequest() failed\n");
WorkItemData->Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
}
@@ -176,7 +176,7 @@
}
if (!NT_SUCCESS(Status))
{
- DPRINT("IoCallDriver() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "IoCallDriver() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -196,7 +196,7 @@
FALSE);
if (!NT_SUCCESS(Status))
{
- DPRINT("KeyboardHook.InitializationRoutine() failed with status 0x%08lx\n",
Status);
+ WARN_(I8042PRT, "KeyboardHook.InitializationRoutine() failed with status
0x%08lx\n", Status);
WorkItemData->Irp->IoStatus.Status = Status;
goto cleanup;
}
@@ -229,7 +229,7 @@
i8042KbdStartIo(DeviceObject, Irp);
break;
default:
- DPRINT1("Unknown FDO type %u\n", DeviceExtension->Type);
+ ERR_(I8042PRT, "Unknown FDO type %u\n", DeviceExtension->Type);
ASSERT(FALSE);
break;
}
@@ -251,7 +251,7 @@
Port))
{
/* something is really wrong! */
- DPRINT1("Failed to send packet byte!\n");
+ WARN_(I8042PRT, "Failed to send packet byte!\n");
return FALSE;
}
}
@@ -343,7 +343,7 @@
case Keyboard: DeviceExtension->PacketPort = 0; break;
case Mouse: DeviceExtension->PacketPort = CTRL_WRITE_MOUSE; break;
default:
- DPRINT1("Unknown FDO type %u\n", FdoDeviceExtension->Type);
+ ERR_(I8042PRT, "Unknown FDO type %u\n", FdoDeviceExtension->Type);
ASSERT(FALSE);
Status = STATUS_INTERNAL_ERROR;
goto done;
@@ -401,7 +401,7 @@
PFDO_DEVICE_EXTENSION DeviceExtension;
NTSTATUS Status;
- DPRINT("i8042DeviceControl(%p %p)\n", DeviceObject, Irp);
+ TRACE_(I8042PRT, "i8042DeviceControl(%p %p)\n", DeviceObject, Irp);
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
switch (DeviceExtension->Type)
@@ -425,7 +425,7 @@
ULONG ControlCode;
NTSTATUS Status;
- DPRINT("i8042InternalDeviceControl(%p %p)\n", DeviceObject, Irp);
+ TRACE_(I8042PRT, "i8042InternalDeviceControl(%p %p)\n", DeviceObject, Irp);
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
switch (DeviceExtension->Type)
@@ -442,7 +442,7 @@
Status = i8042MouInternalDeviceControl(DeviceObject, Irp);
break;
default:
- DPRINT1("Unknown IO control code 0x%lx\n", ControlCode);
+ ERR_(I8042PRT, "Unknown IO control code 0x%lx\n", ControlCode);
ASSERT(FALSE);
Status = STATUS_INVALID_DEVICE_REQUEST;
break;
@@ -456,7 +456,7 @@
Status = i8042MouInternalDeviceControl(DeviceObject, Irp);
break;
default:
- DPRINT1("Unknown FDO type %u\n", DeviceExtension->Type);
+ ERR_(I8042PRT, "Unknown FDO type %u\n", DeviceExtension->Type);
ASSERT(FALSE);
Status = STATUS_INTERNAL_ERROR;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
@@ -482,7 +482,7 @@
(PVOID*)&DriverExtension);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoAllocateDriverObjectExtension() failed with status 0x%08lx\n",
Status);
+ WARN_(I8042PRT, "IoAllocateDriverObjectExtension() failed with status
0x%08lx\n", Status);
return Status;
}
RtlZeroMemory(DriverExtension, sizeof(I8042_DRIVER_EXTENSION));
@@ -496,14 +496,14 @@
&DriverExtension->RegistryPath);
if (!NT_SUCCESS(Status))
{
- DPRINT("DuplicateUnicodeString() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "DuplicateUnicodeString() failed with status 0x%08lx\n",
Status);
return Status;
}
Status = ReadRegistryEntries(RegistryPath, &DriverExtension->Port.Settings);
if (!NT_SUCCESS(Status))
{
- DPRINT("ReadRegistryEntries() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "ReadRegistryEntries() failed with status 0x%08lx\n",
Status);
return Status;
}
@@ -523,5 +523,13 @@
if (IsFirstStageSetup())
return i8042AddLegacyKeyboard(DriverObject, RegistryPath);
+ /* ROS Hack: ideally, we shouldn't have to initialize debug level this way */
+#ifndef NDEBUG
+ DbgSetDebugFilterState(
+ DPFLTR_I8042PRT_ID,
+ DPFLTR_ERROR_LEVEL | DPFLTR_WARNING_LEVEL | DPFLTR_TRACE_LEVEL | DPFLTR_INFO_LEVEL,
+ TRUE);
+#endif
+
return STATUS_SUCCESS;
}
Modified: trunk/reactos/drivers/input/i8042prt/keyboard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/key…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/keyboard.c (original)
+++ trunk/reactos/drivers/input/i8042prt/keyboard.c Mon Dec 17 00:12:54 2007
@@ -39,7 +39,7 @@
IN PDEVICE_OBJECT DeviceObject,
IN PVOID Key)
{
- DPRINT("Debug key: %p\n", Key);
+ INFO_(I8042PRT, "Debug key: p\n", Key);
if (!Key)
return;
@@ -85,11 +85,11 @@
DeviceExtension->KeysInBuffer++;
if (DeviceExtension->KeysInBuffer >
DeviceExtension->Common.PortDeviceExtension->Settings.KeyboardDataQueueSize)
{
- DPRINT1("Keyboard buffer overflow\n");
+ WARN_(I8042PRT, "Keyboard buffer overflow\n");
DeviceExtension->KeysInBuffer--;
}
- DPRINT("Irq completes key\n");
+ TRACE_(I8042PRT, "Irq completes key\n");
KeInsertQueueDpc(&DeviceExtension->DpcKeyboard, NULL, NULL);
}
@@ -130,7 +130,7 @@
{
case IOCTL_KEYBOARD_SET_INDICATORS:
{
- DPRINT("IOCTL_KEYBOARD_SET_INDICATORS\n");
+ TRACE_(I8042PRT, "IOCTL_KEYBOARD_SET_INDICATORS\n");
PortDeviceExtension->PacketBuffer[0] = KBD_CMD_SET_LEDS;
PortDeviceExtension->PacketBuffer[1] = 0;
@@ -153,7 +153,7 @@
}
default:
{
- DPRINT("Unknown ioctl code 0x%lx\n",
+ ERR_(I8042PRT, "Unknown ioctl code 0x%lx\n",
Stack->Parameters.DeviceIoControl.IoControlCode);
ASSERT(FALSE);
}
@@ -234,7 +234,7 @@
if (!NT_SUCCESS(Status))
{
/* We can't do more yet, ignore the keypress... */
- DPRINT("IoRegisterDeviceInterface(GUID_DEVICE_SYS_BUTTON) failed with status
0x%08lx\n",
+ WARN_(I8042PRT, "IoRegisterDeviceInterface(GUID_DEVICE_SYS_BUTTON) failed with
status 0x%08lx\n",
Status);
DeviceExtension->PowerInterfaceName.MaximumLength = 0;
return;
@@ -249,7 +249,7 @@
if (!NT_SUCCESS(Status))
{
/* Ignore the key press... */
- DPRINT("Disabling interface %wZ failed with status 0x%08lx\n",
+ WARN_(I8042PRT, "Disabling interface %wZ failed with status 0x%08lx\n",
&DeviceExtension->PowerInterfaceName, Status);
return;
}
@@ -262,7 +262,7 @@
if (!NT_SUCCESS(Status))
{
/* Ignore the key press... */
- DPRINT("Enabling interface %wZ failed with status 0x%08lx\n",
+ WARN_(I8042PRT, "Enabling interface %wZ failed with status 0x%08lx\n",
&DeviceExtension->PowerInterfaceName, Status);
return;
}
@@ -379,12 +379,12 @@
}
}
- DPRINT("Send a key\n");
+ TRACE_(I8042PRT, "Send a key\n");
if (!DeviceExtension->KeyboardData.ClassService)
return;
- DPRINT("Sending %lu key(s)\n", KeysInBufferCopy);
+ INFO_(I8042PRT, "Sending %lu key(s)\n", KeysInBufferCopy);
(*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->KeyboardData.ClassService)(
DeviceExtension->KeyboardData.ClassDeviceObject,
DeviceExtension->KeyboardBuffer,
@@ -418,7 +418,7 @@
{
/* Part of GUID_DEVICE_SYS_BUTTON interface */
PULONG pCaps;
- DPRINT("IOCTL_GET_SYS_BUTTON_CAPS\n");
+ TRACE_(I8042PRT, "IOCTL_GET_SYS_BUTTON_CAPS\n");
if (Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(ULONG))
Status = STATUS_INVALID_PARAMETER;
@@ -436,7 +436,7 @@
{
/* Part of GUID_DEVICE_SYS_BUTTON interface */
PIRP WaitingIrp;
- DPRINT("IOCTL_GET_SYS_BUTTON_EVENT\n");
+ TRACE_(I8042PRT, "IOCTL_GET_SYS_BUTTON_EVENT\n");
if (Stack->Parameters.DeviceIoControl.OutputBufferLength != sizeof(ULONG))
Status = STATUS_INVALID_PARAMETER;
@@ -450,7 +450,7 @@
if (WaitingIrp)
{
/* Unable to have a 2nd pending IRP for this IOCTL */
- DPRINT1("Unable to pend a second IRP for IOCTL_GET_SYS_BUTTON_EVENT\n");
+ WARN_(I8042PRT, "Unable to pend a second IRP for
IOCTL_GET_SYS_BUTTON_EVENT\n");
Status = STATUS_INVALID_PARAMETER;
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
@@ -470,7 +470,7 @@
}
else
{
- DPRINT("Pending IOCTL_GET_SYS_BUTTON_EVENT\n");
+ TRACE_(I8042PRT, "Pending IOCTL_GET_SYS_BUTTON_EVENT\n");
Status = STATUS_PENDING;
Irp->IoStatus.Status = Status;
IoMarkIrpPending(Irp);
@@ -482,7 +482,7 @@
}
default:
{
- DPRINT("IRP_MJ_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
+ ERR_(I8042PRT, "IRP_MJ_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
Stack->Parameters.DeviceIoControl.IoControlCode);
ASSERT(FALSE);
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -522,7 +522,7 @@
PIO_WORKITEM WorkItem = NULL;
PI8042_HOOK_WORKITEM WorkItemData = NULL;
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_KEYBOARD_CONNECT\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_KEYBOARD_CONNECT\n");
if (Stack->Parameters.DeviceIoControl.InputBufferLength != sizeof(CONNECT_DATA))
{
Status = STATUS_INVALID_PARAMETER;
@@ -536,7 +536,7 @@
WorkItem = IoAllocateWorkItem(DeviceObject);
if (!WorkItem)
{
- DPRINT("IoAllocateWorkItem() failed\n");
+ WARN_(I8042PRT, "IoAllocateWorkItem() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
}
@@ -546,7 +546,7 @@
I8042PRT_TAG);
if (!WorkItemData)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(I8042PRT, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -562,7 +562,7 @@
I8042PRT_TAG);
if (!DeviceExtension->KeyboardBuffer)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(I8042PRT, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -574,14 +574,14 @@
DeviceExtension->PowerWorkItem = IoAllocateWorkItem(DeviceObject);
if (!DeviceExtension->PowerWorkItem)
{
- DPRINT("IoAllocateWorkItem() failed\n");
+ WARN_(I8042PRT, "IoAllocateWorkItem() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
}
DeviceExtension->DebugWorkItem = IoAllocateWorkItem(DeviceObject);
if (!DeviceExtension->DebugWorkItem)
{
- DPRINT("IoAllocateWorkItem() failed\n");
+ WARN_(I8042PRT, "IoAllocateWorkItem() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
}
@@ -614,7 +614,7 @@
}
case IOCTL_INTERNAL_KEYBOARD_DISCONNECT:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_KEYBOARD_DISCONNECT\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_KEYBOARD_DISCONNECT\n");
/* MSDN says that operation is to implemented.
* To implement it, we just have to do:
* DeviceExtension->KeyboardData.ClassService = NULL;
@@ -624,14 +624,14 @@
}
case IOCTL_INTERNAL_I8042_HOOK_KEYBOARD:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_I8042_HOOK_KEYBOARD\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_I8042_HOOK_KEYBOARD\n");
/* Nothing to do here */
Status = STATUS_SUCCESS;
break;
}
case IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION\n");
/* We should check the UnitID, but it's kind of pointless as
* all keyboards are supposed to have the same one
@@ -653,7 +653,7 @@
}
case IOCTL_KEYBOARD_QUERY_INDICATORS:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_KEYBOARD_QUERY_INDICATORS\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_KEYBOARD_QUERY_INDICATORS\n");
if (Stack->Parameters.DeviceIoControl.InputBufferLength <
sizeof(KEYBOARD_INDICATOR_PARAMETERS))
{
@@ -672,7 +672,7 @@
}
case IOCTL_KEYBOARD_SET_INDICATORS:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_KEYBOARD_SET_INDICATORS\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_KEYBOARD_SET_INDICATORS\n");
if (Stack->Parameters.DeviceIoControl.InputBufferLength <
sizeof(KEYBOARD_INDICATOR_PARAMETERS))
{
@@ -692,7 +692,7 @@
}
default:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
+ ERR_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code
0x%lx\n",
Stack->Parameters.DeviceIoControl.IoControlCode);
ASSERT(FALSE);
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -765,7 +765,7 @@
Status = i8042ReadStatus(PortDeviceExtension, &PortStatus);
if (!NT_SUCCESS(Status))
{
- DPRINT("i8042ReadStatus() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "i8042ReadStatus() failed with status 0x%08lx\n", Status);
return FALSE;
}
Status = i8042ReadKeyboardData(PortDeviceExtension, &Output);
@@ -776,11 +776,11 @@
}
if (Counter == 0)
{
- DPRINT("Spurious i8042 keyboard interrupt\n");
+ WARN_(I8042PRT, "Spurious i8042 keyboard interrupt\n");
return FALSE;
}
- DPRINT("Got: 0x%02x\n", Output);
+ INFO_(I8042PRT, "Got: 0x%02x\n", Output);
if (PortDeviceExtension->Settings.CrashOnCtrlScroll)
{
@@ -806,14 +806,14 @@
{
if (PortDeviceExtension->PacketComplete)
{
- DPRINT("Packet complete\n");
+ TRACE_(I8042PRT, "Packet complete\n");
KeInsertQueueDpc(&DeviceExtension->DpcKeyboard, NULL, NULL);
}
- DPRINT("Irq eaten by packet\n");
+ TRACE_(I8042PRT, "Irq eaten by packet\n");
return TRUE;
}
- DPRINT("Irq is keyboard input\n");
+ TRACE_(I8042PRT, "Irq is keyboard input\n");
if (DeviceExtension->KeyboardScanState == Normal)
{
Modified: trunk/reactos/drivers/input/i8042prt/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/mis…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/misc.c (original)
+++ trunk/reactos/drivers/input/i8042prt/misc.c Mon Dec 17 00:12:54 2007
@@ -12,45 +12,19 @@
/* FUNCTIONS *****************************************************************/
-static IO_COMPLETION_ROUTINE ForwardIrpAndWaitCompletion;
-
-static NTSTATUS NTAPI
-ForwardIrpAndWaitCompletion(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- IN PVOID Context)
-{
- if (Irp->PendingReturned)
- KeSetEvent((PKEVENT)Context, IO_NO_INCREMENT, FALSE);
- return STATUS_MORE_PROCESSING_REQUIRED;
-}
-
NTSTATUS NTAPI
ForwardIrpAndWait(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PDEVICE_OBJECT LowerDevice =
((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
- KEVENT Event;
- NTSTATUS Status;
ASSERT(LowerDevice);
- KeInitializeEvent(&Event, NotificationEvent, FALSE);
- IoCopyCurrentIrpStackLocationToNext(Irp);
+ if (!IoForwardIrpSynchronously(LowerDevice, Irp))
+ return STATUS_UNSUCCESSFUL;
- DPRINT("Calling lower device %p\n", LowerDevice);
- IoSetCompletionRoutine(Irp, ForwardIrpAndWaitCompletion, &Event, TRUE, TRUE, TRUE);
-
- Status = IoCallDriver(LowerDevice, Irp);
- if (Status == STATUS_PENDING)
- {
- Status = KeWaitForSingleObject(&Event, Suspended, KernelMode, FALSE, NULL);
- if (NT_SUCCESS(Status))
- Status = Irp->IoStatus.Status;
- }
-
- return Status;
+ return Irp->IoStatus.Status;
}
NTSTATUS NTAPI
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 Mon Dec 17 00:12:54 2007
@@ -50,11 +50,11 @@
DeviceExtension->MouseInBuffer++;
if (DeviceExtension->MouseInBuffer >
DeviceExtension->Common.PortDeviceExtension->Settings.MouseDataQueueSize)
{
- DPRINT1("Mouse buffer overflow\n");
+ WARN_(I8042PRT, "Mouse buffer overflow\n");
DeviceExtension->MouseInBuffer--;
}
- DPRINT("Irq completes mouse packet\n");
+ TRACE_(I8042PRT, "Irq completes mouse packet\n");
KeInsertQueueDpc(&DeviceExtension->DpcMouse, NULL, NULL);
}
@@ -75,7 +75,7 @@
* might be lucky and get in sync again
*/
if (!(Output & 8)) {
- DPRINT1("Bad input, dropping..\n");
+ WARN_(I8042PRT, "Bad input, dropping..\n");
return;
}
@@ -172,7 +172,7 @@
break;
default:
- DPRINT1("Unexpected state 0x%u!\n", DeviceExtension->MouseState);
+ ERR_(I8042PRT, "Unexpected state 0x%u!\n", DeviceExtension->MouseState);
ASSERT(FALSE);
}
}
@@ -202,7 +202,7 @@
(((~(NewButtonData)) << 1) & (ButtonDiff << 1)) |
(MouseInput->RawButtons & 0xfc00);
- DPRINT("Left raw/up/down: %u/%u/%u\n",
+ INFO_(I8042PRT, "Left raw/up/down: %u/%u/%u\n",
MouseInput->RawButtons & MOUSE_LEFT_BUTTON_DOWN,
MouseInput->ButtonFlags & MOUSE_LEFT_BUTTON_DOWN,
MouseInput->ButtonFlags & MOUSE_LEFT_BUTTON_UP);
@@ -291,12 +291,12 @@
KeReleaseInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt, Irql);
- DPRINT("Send a mouse packet\n");
+ TRACE_(I8042PRT, "Send a mouse packet\n");
if (!DeviceExtension->MouseData.ClassService)
return;
- DPRINT("Sending %lu mouse move(s)\n", MouseInBufferCopy);
+ INFO_(I8042PRT, "Sending %lu mouse move(s)\n", MouseInBufferCopy);
(*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->MouseData.ClassService)(
DeviceExtension->MouseData.ClassDeviceObject,
DeviceExtension->MouseBuffer,
@@ -333,7 +333,7 @@
Irql = KeAcquireInterruptSpinLock(PortDeviceExtension->HighestDIRQLInterrupt);
- DPRINT1("Mouse initialization timeout! (substate %x). Disabling mouse.\n",
+ WARN_(I8042PRT, "Mouse initialization timeout! (substate %x). Disabling
mouse.\n",
DeviceExtension->MouseResetState);
i8042Flush(PortDeviceExtension);
@@ -369,7 +369,7 @@
PIO_WORKITEM WorkItem = NULL;
PI8042_HOOK_WORKITEM WorkItemData = NULL;
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / IOCTL_INTERNAL_MOUSE_CONNECT\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_MOUSE_CONNECT\n");
if (Stack->Parameters.DeviceIoControl.InputBufferLength != sizeof(CONNECT_DATA))
{
Status = STATUS_INVALID_PARAMETER;
@@ -383,7 +383,7 @@
WorkItem = IoAllocateWorkItem(DeviceObject);
if (!WorkItem)
{
- DPRINT("IoAllocateWorkItem() failed\n");
+ WARN_(I8042PRT, "IoAllocateWorkItem() failed\n");
Status = STATUS_INSUFFICIENT_RESOURCES;
goto cleanup;
}
@@ -393,7 +393,7 @@
I8042PRT_TAG);
if (!WorkItemData)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(I8042PRT, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -409,7 +409,7 @@
I8042PRT_TAG);
if (!DeviceExtension->MouseBuffer)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(I8042PRT, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -452,7 +452,7 @@
}
case IOCTL_INTERNAL_MOUSE_DISCONNECT:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_MOUSE_DISCONNECT\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_MOUSE_DISCONNECT\n");
/* MSDN says that operation is to implemented.
* To implement it, we just have to do:
* DeviceExtension->MouseData.ClassService = NULL;
@@ -462,14 +462,14 @@
}
case IOCTL_INTERNAL_I8042_HOOK_MOUSE:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_I8042_HOOK_MOUSE\n");
+ TRACE_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL /
IOCTL_INTERNAL_I8042_HOOK_MOUSE\n");
/* Nothing to do here */
Status = STATUS_SUCCESS;
break;
}
default:
{
- DPRINT("IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code 0x%lx\n",
+ ERR_(I8042PRT, "IRP_MJ_INTERNAL_DEVICE_CONTROL / unknown ioctl code
0x%lx\n",
Stack->Parameters.DeviceIoControl.IoControlCode);
ASSERT(FALSE);
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -509,7 +509,7 @@
if (Now.QuadPart - DeviceExtension->MousePacketStartTime.QuadPart >
DeviceExtension->Common.PortDeviceExtension->Settings.MouseSynchIn100ns)
{
- DPRINT("Mouse input packet timeout\n");
+ WARN_(I8042PRT, "Mouse input packet timeout\n");
DeviceExtension->MouseState = MouseIdle;
}
}
@@ -588,7 +588,7 @@
{
PortDeviceExtension->Flags &= ~MOUSE_PRESENT;
DeviceExtension->MouseState = MouseIdle;
- DPRINT("Mouse returned bad reset reply: %x (expected aa)\n", Value);
+ WARN_(I8042PRT, "Mouse returned bad reset reply: %x (expected aa)\n",
Value);
}
return TRUE;
case ExpectingResetId:
@@ -602,7 +602,7 @@
{
PortDeviceExtension->Flags &= ~MOUSE_PRESENT;
DeviceExtension->MouseState = MouseIdle;
- DPRINT1("Mouse returned bad reset reply part two: %x (expected 0)\n",
Value);
+ WARN_(I8042PRT, "Mouse returned bad reset reply part two: %x (expected
0)\n", Value);
}
return TRUE;
case ExpectingGetDeviceIdACK:
@@ -614,7 +614,7 @@
{
DeviceExtension->MouseResetState++;
/* Act as if 00 (normal mouse) was received */
- DPRINT("Mouse doesn't support 0xd2, (returns %x, expected %x),
faking\n", Value, MOUSE_ACK);
+ WARN_(I8042PRT, "Mouse doesn't support 0xd2, (returns %x, expected %x),
faking\n", Value, MOUSE_ACK);
i8042MouResetIsr(DeviceExtension, Status, 0);
}
return TRUE;
@@ -787,7 +787,7 @@
DeviceExtension->MouseHook.IsrWritePort(
DeviceExtension->MouseHook.CallContext,
(UCHAR)(PortDeviceExtension->Settings.MouseResolution & 0xff));
- DPRINT("Mouse resolution %lu\n",
+ INFO_(I8042PRT, "Mouse resolution %lu\n",
PortDeviceExtension->Settings.MouseResolution);
DeviceExtension->MouseResetState = ExpectingFinalResolutionValueACK;
return TRUE;
@@ -798,11 +798,11 @@
case ExpectingEnableACK:
DeviceExtension->MouseState = MouseIdle;
DeviceExtension->MouseTimeoutState = TimeoutCancel;
- DPRINT("Mouse type = %u\n", DeviceExtension->MouseType);
+ INFO_(I8042PRT, "Mouse type = %u\n", DeviceExtension->MouseType);
return TRUE;
default:
if (DeviceExtension->MouseResetState < 100 ||
DeviceExtension->MouseResetState > 999)
- DPRINT1("MouseResetState went out of range: %lu\n",
DeviceExtension->MouseResetState);
+ ERR_(I8042PRT, "MouseResetState went out of range: %lu\n",
DeviceExtension->MouseResetState);
return FALSE;
}
}
@@ -827,7 +827,7 @@
Status = i8042ReadStatus(PortDeviceExtension, &PortStatus);
if (!NT_SUCCESS(Status))
{
- DPRINT("i8042ReadStatus() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "i8042ReadStatus() failed with status 0x%08lx\n", Status);
return FALSE;
}
Status = i8042ReadMouseData(PortDeviceExtension, &Output);
@@ -838,30 +838,30 @@
}
if (Counter == 0)
{
- DPRINT("Spurious i8042 mouse interrupt\n");
+ WARN_(I8042PRT, "Spurious i8042 mouse interrupt\n");
return FALSE;
}
- DPRINT("Got: 0x%02x\n", Output);
+ INFO_(I8042PRT, "Got: 0x%02x\n", Output);
if (i8042PacketIsr(PortDeviceExtension, Output))
{
if (PortDeviceExtension->PacketComplete)
{
- DPRINT("Packet complete\n");
+ TRACE_(I8042PRT, "Packet complete\n");
KeInsertQueueDpc(&DeviceExtension->DpcMouse, NULL, NULL);
}
- DPRINT("Irq eaten by packet\n");
+ TRACE_(I8042PRT, "Irq eaten by packet\n");
return TRUE;
}
- DPRINT("Irq is mouse input\n");
+ TRACE_(I8042PRT, "Irq is mouse input\n");
i8042MouInputTestTimeout(DeviceExtension);
if (i8042MouResetIsr(DeviceExtension, PortStatus, Output))
{
- DPRINT("Handled by ResetIsr or hooked Isr\n");
+ TRACE_(I8042PRT, "Handled by ResetIsr or hooked Isr\n");
if (NoChange != DeviceExtension->MouseTimeoutState) {
KeInsertQueueDpc(&DeviceExtension->DpcMouse, NULL, NULL);
}
@@ -1035,10 +1035,10 @@
if (TestMouse(DeviceExtension))
{
- DPRINT("Detected Mouse\n");
+ TRACE_(I8042PRT, "Detected Mouse\n");
if (SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_ENABLE))
- DPRINT1("Failed to enable mouse!\n");
+ WARN_(I8042PRT, "Failed to enable mouse!\n");
}
return TRUE;
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 Mon Dec 17 00:12:54 2007
@@ -41,14 +41,14 @@
if (!i8042Write(DeviceExtension, DeviceExtension->ControlPort, KBD_READ_MODE))
{
- DPRINT1("Can't read i8042 mode\n");
+ WARN_(I8042PRT, "Can't read i8042 mode\n");
return FALSE;
}
Status = i8042ReadDataWait(DeviceExtension, &Value);
if (!NT_SUCCESS(Status))
{
- DPRINT1("No response after read i8042 mode\n");
+ WARN_(I8042PRT, "No response after read i8042 mode\n");
return FALSE;
}
@@ -57,13 +57,13 @@
if (!i8042Write(DeviceExtension, DeviceExtension->ControlPort, KBD_WRITE_MODE))
{
- DPRINT1("Can't set i8042 mode\n");
+ WARN_(I8042PRT, "Can't set i8042 mode\n");
return FALSE;
}
if (!i8042Write(DeviceExtension, DeviceExtension->DataPort, Value))
{
- DPRINT1("Can't send i8042 mode\n");
+ WARN_(I8042PRT, "Can't send i8042 mode\n");
return FALSE;
}
@@ -85,20 +85,20 @@
if (!i8042Write(DeviceExtension, DeviceExtension->ControlPort, CTRL_SELF_TEST))
{
- DPRINT1("Writing CTRL_SELF_TEST command failed\n");
+ WARN_(I8042PRT, "Writing CTRL_SELF_TEST command failed\n");
return STATUS_IO_TIMEOUT;
}
Status = i8042ReadDataWait(DeviceExtension, &Value);
if (!NT_SUCCESS(Status))
{
- DPRINT1("Failed to read CTRL_SELF_TEST response, status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "Failed to read CTRL_SELF_TEST response, status 0x%08lx\n",
Status);
return Status;
}
if (Value != 0x55)
{
- DPRINT1("Got 0x%02x instead of 0x55\n", Value);
+ WARN_(I8042PRT, "Got 0x%02x instead of 0x55\n", Value);
return STATUS_IO_DEVICE_ERROR;
}
@@ -136,13 +136,13 @@
Status = i8042SynchWritePort(DeviceExtension, 0, 0, TRUE);
if (!NT_SUCCESS(Status))
{
- DPRINT("Can't finish SET_LEDS (0x%08lx)\n", Status);
+ WARN_(I8042PRT, "Can't finish SET_LEDS (0x%08lx)\n", Status);
return FALSE;
}
}
else
{
- DPRINT("Warning: can't write SET_LEDS (0x%08lx)\n", Status);
+ WARN_(I8042PRT, "Warning: can't write SET_LEDS (0x%08lx)\n", Status);
}
/* Turn on translation and SF (Some machines don't reboot if SF is not set) */
@@ -167,7 +167,7 @@
if (!i8042Write(DeviceExtension, DeviceExtension->ControlPort, CTRL_WRITE_MOUSE)
||!i8042Write(DeviceExtension, DeviceExtension->DataPort, MOU_CMD_RESET))
{
- DPRINT1("Failed to write reset command to mouse\n");
+ WARN_(I8042PRT, "Failed to write reset command to mouse\n");
goto cleanup;
}
@@ -184,12 +184,12 @@
if (!NT_SUCCESS(Status))
{
- DPRINT1("No ACK after mouse reset, status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "No ACK after mouse reset, status 0x%08lx\n", Status);
goto cleanup;
}
else if (Value != ExpectedReply[ReplyByte])
{
- DPRINT1("Unexpected reply: 0x%02x (expected 0x%02x)\n",
+ WARN_(I8042PRT, "Unexpected reply: 0x%02x (expected 0x%02x)\n",
Value, ExpectedReply[ReplyByte]);
goto cleanup;
}
@@ -210,7 +210,7 @@
i8042Flush(DeviceExtension);
}
- DPRINT("Mouse %sdetected\n", Ok ? "" : "not ");
+ INFO_(I8042PRT, "Mouse %sdetected\n", Ok ? "" : "not ");
return Ok;
}
@@ -223,24 +223,24 @@
KIRQL DirqlMax;
NTSTATUS Status;
- DPRINT("i8042ConnectKeyboardInterrupt()\n");
+ TRACE_(I8042PRT, "i8042ConnectKeyboardInterrupt()\n");
PortDeviceExtension = DeviceExtension->Common.PortDeviceExtension;
DirqlMax = MAX(
PortDeviceExtension->KeyboardInterrupt.Dirql,
PortDeviceExtension->MouseInterrupt.Dirql);
- DPRINT("KeyboardInterrupt.Vector %lu\n",
+ INFO_(I8042PRT, "KeyboardInterrupt.Vector %lu\n",
PortDeviceExtension->KeyboardInterrupt.Vector);
- DPRINT("KeyboardInterrupt.Dirql %lu\n",
+ INFO_(I8042PRT, "KeyboardInterrupt.Dirql %lu\n",
PortDeviceExtension->KeyboardInterrupt.Dirql);
- DPRINT("KeyboardInterrupt.DirqlMax %lu\n",
+ INFO_(I8042PRT, "KeyboardInterrupt.DirqlMax %lu\n",
DirqlMax);
- DPRINT("KeyboardInterrupt.InterruptMode %s\n",
+ INFO_(I8042PRT, "KeyboardInterrupt.InterruptMode %s\n",
PortDeviceExtension->KeyboardInterrupt.InterruptMode == LevelSensitive ?
"LevelSensitive" : "Latched");
- DPRINT("KeyboardInterrupt.ShareInterrupt %s\n",
+ INFO_(I8042PRT, "KeyboardInterrupt.ShareInterrupt %s\n",
PortDeviceExtension->KeyboardInterrupt.ShareInterrupt ? "yes" :
"no");
- DPRINT("KeyboardInterrupt.Affinity 0x%lx\n",
+ INFO_(I8042PRT, "KeyboardInterrupt.Affinity 0x%lx\n",
PortDeviceExtension->KeyboardInterrupt.Affinity);
Status = IoConnectInterrupt(
&PortDeviceExtension->KeyboardInterrupt.Object,
@@ -251,7 +251,7 @@
PortDeviceExtension->KeyboardInterrupt.Affinity, FALSE);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoConnectInterrupt() failed with status 0x%08x\n", Status);
+ WARN_(I8042PRT, "IoConnectInterrupt() failed with status 0x%08x\n", Status);
return Status;
}
@@ -269,7 +269,7 @@
KIRQL DirqlMax;
NTSTATUS Status;
- DPRINT("i8042ConnectMouseInterrupt()\n");
+ TRACE_(I8042PRT, "i8042ConnectMouseInterrupt()\n");
Status = i8042MouInitialize(DeviceExtension);
if (!NT_SUCCESS(Status))
@@ -280,17 +280,17 @@
PortDeviceExtension->KeyboardInterrupt.Dirql,
PortDeviceExtension->MouseInterrupt.Dirql);
- DPRINT("MouseInterrupt.Vector %lu\n",
+ INFO_(I8042PRT, "MouseInterrupt.Vector %lu\n",
PortDeviceExtension->MouseInterrupt.Vector);
- DPRINT("MouseInterrupt.Dirql %lu\n",
+ INFO_(I8042PRT, "MouseInterrupt.Dirql %lu\n",
PortDeviceExtension->MouseInterrupt.Dirql);
- DPRINT("MouseInterrupt.DirqlMax %lu\n",
+ INFO_(I8042PRT, "MouseInterrupt.DirqlMax %lu\n",
DirqlMax);
- DPRINT("MouseInterrupt.InterruptMode %s\n",
+ INFO_(I8042PRT, "MouseInterrupt.InterruptMode %s\n",
PortDeviceExtension->MouseInterrupt.InterruptMode == LevelSensitive ?
"LevelSensitive" : "Latched");
- DPRINT("MouseInterrupt.ShareInterrupt %s\n",
+ INFO_(I8042PRT, "MouseInterrupt.ShareInterrupt %s\n",
PortDeviceExtension->MouseInterrupt.ShareInterrupt ? "yes" :
"no");
- DPRINT("MouseInterrupt.Affinity 0x%lx\n",
+ INFO_(I8042PRT, "MouseInterrupt.Affinity 0x%lx\n",
PortDeviceExtension->MouseInterrupt.Affinity);
Status = IoConnectInterrupt(
&PortDeviceExtension->MouseInterrupt.Object,
@@ -301,7 +301,7 @@
PortDeviceExtension->MouseInterrupt.Affinity, FALSE);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoConnectInterrupt() failed with status 0x%08x\n", Status);
+ WARN_(I8042PRT, "IoConnectInterrupt() failed with status 0x%08x\n", Status);
goto cleanup;
}
@@ -378,21 +378,21 @@
if (!(DeviceExtension->Flags & (KEYBOARD_PRESENT | MOUSE_PRESENT)))
{
/* Try to detect them */
- DPRINT("Check if the controller is really a i8042\n");
+ TRACE_(I8042PRT, "Check if the controller is really a i8042\n");
Status = i8042BasicDetect(DeviceExtension);
if (!NT_SUCCESS(Status))
{
- DPRINT("i8042BasicDetect() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "i8042BasicDetect() failed with status 0x%08lx\n", Status);
return STATUS_UNSUCCESSFUL;
}
- DPRINT("Detecting keyboard\n");
+ TRACE_(I8042PRT, "Detecting keyboard\n");
if (!i8042DetectKeyboard(DeviceExtension))
return STATUS_UNSUCCESSFUL;
- DPRINT("Detecting mouse\n");
+ TRACE_(I8042PRT, "Detecting mouse\n");
if (!i8042DetectMouse(DeviceExtension))
return STATUS_UNSUCCESSFUL;
- DPRINT("Keyboard present: %s\n", DeviceExtension->Flags &
KEYBOARD_PRESENT ? "YES" : "NO");
- DPRINT("Mouse present : %s\n", DeviceExtension->Flags &
MOUSE_PRESENT ? "YES" : "NO");
+ INFO_(I8042PRT, "Keyboard present: %s\n", DeviceExtension->Flags &
KEYBOARD_PRESENT ? "YES" : "NO");
+ INFO_(I8042PRT, "Mouse present : %s\n", DeviceExtension->Flags &
MOUSE_PRESENT ? "YES" : "NO");
}
/* Connect interrupts */
@@ -468,7 +468,7 @@
ULONG i;
NTSTATUS Status;
- DPRINT("i8042PnpStartDevice(%p)\n", DeviceObject);
+ TRACE_(I8042PRT, "i8042PnpStartDevice(%p)\n", DeviceObject);
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
PortDeviceExtension = DeviceExtension->PortDeviceExtension;
@@ -476,12 +476,12 @@
if (!AllocatedResources)
{
- DPRINT("No allocated resources sent to driver\n");
+ WARN_(I8042PRT, "No allocated resources sent to driver\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
if (AllocatedResources->Count != 1)
{
- DPRINT("Wrong number of allocated resources sent to driver\n");
+ WARN_(I8042PRT, "Wrong number of allocated resources sent to driver\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
if (AllocatedResources->List[0].PartialResourceList.Version != 1
@@ -489,7 +489,7 @@
|| AllocatedResourcesTranslated->List[0].PartialResourceList.Version != 1
|| AllocatedResourcesTranslated->List[0].PartialResourceList.Revision != 1)
{
- DPRINT("Revision mismatch: %u.%u != 1.1 or %u.%u != 1.1\n",
+ WARN_(I8042PRT, "Revision mismatch: %u.%u != 1.1 or %u.%u != 1.1\n",
AllocatedResources->List[0].PartialResourceList.Version,
AllocatedResources->List[0].PartialResourceList.Revision,
AllocatedResourcesTranslated->List[0].PartialResourceList.Version,
@@ -515,23 +515,23 @@
if (!FoundDataPort)
{
PortDeviceExtension->DataPort =
ULongToPtr(ResourceDescriptor->u.Port.Start.u.LowPart);
- DPRINT("Found data port: %p\n", PortDeviceExtension->DataPort);
+ INFO_(I8042PRT, "Found data port: %p\n",
PortDeviceExtension->DataPort);
FoundDataPort = TRUE;
}
else if (!FoundControlPort)
{
PortDeviceExtension->ControlPort =
ULongToPtr(ResourceDescriptor->u.Port.Start.u.LowPart);
- DPRINT("Found control port: %p\n", PortDeviceExtension->ControlPort);
+ INFO_(I8042PRT, "Found control port: %p\n",
PortDeviceExtension->ControlPort);
FoundControlPort = TRUE;
}
else
{
- DPRINT("Too much I/O ranges provided: 0x%lx\n",
ResourceDescriptor->u.Port.Length);
+ WARN_(I8042PRT, "Too much I/O ranges provided: 0x%lx\n",
ResourceDescriptor->u.Port.Length);
return STATUS_INVALID_PARAMETER;
}
}
else
- DPRINT1("Invalid I/O range length: 0x%lx\n",
ResourceDescriptor->u.Port.Length);
+ WARN_(I8042PRT, "Invalid I/O range length: 0x%lx\n",
ResourceDescriptor->u.Port.Length);
break;
}
case CmResourceTypeInterrupt:
@@ -546,28 +546,28 @@
else
InterruptData.InterruptMode = LevelSensitive;
InterruptData.ShareInterrupt = (ResourceDescriptorTranslated->ShareDisposition ==
CmResourceShareShared);
- DPRINT("Found irq resource: %lu\n",
ResourceDescriptor->u.Interrupt.Level);
+ INFO_(I8042PRT, "Found irq resource: %lu\n",
ResourceDescriptor->u.Interrupt.Level);
FoundIrq = TRUE;
break;
}
default:
- DPRINT("Unknown resource descriptor type 0x%x\n",
ResourceDescriptor->Type);
+ WARN_(I8042PRT, "Unknown resource descriptor type 0x%x\n",
ResourceDescriptor->Type);
}
}
if (!FoundIrq)
{
- DPRINT("Interrupt resource was not found in allocated resources list\n");
+ WARN_(I8042PRT, "Interrupt resource was not found in allocated resources
list\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
else if (DeviceExtension->Type == Keyboard && (!FoundDataPort ||
!FoundControlPort))
{
- DPRINT("Some required resources were not found in allocated resources
list\n");
+ WARN_(I8042PRT, "Some required resources were not found in allocated resources
list\n");
return STATUS_INSUFFICIENT_RESOURCES;
}
else if (DeviceExtension->Type == Mouse && (FoundDataPort ||
FoundControlPort))
{
- DPRINT("Too much resources were provided in allocated resources list\n");
+ WARN_(I8042PRT, "Too much resources were provided in allocated resources
list\n");
return STATUS_INVALID_PARAMETER;
}
@@ -595,7 +595,7 @@
}
default:
{
- DPRINT1("Unknown FDO type %u\n", DeviceExtension->Type);
+ ERR_(I8042PRT, "Unknown FDO type %u\n", DeviceExtension->Type);
ASSERT(FALSE);
Status = STATUS_INVALID_DEVICE_REQUEST;
}
@@ -626,7 +626,7 @@
{
case IRP_MN_START_DEVICE: /* 0x00 */
{
- DPRINT("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
+ TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
/* Call lower driver (if any) */
if (DeviceType != PhysicalDeviceObject)
@@ -650,7 +650,7 @@
{
PDEVICE_RELATIONS DeviceRelations;
- DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
+ TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
BusRelations\n");
DeviceRelations = ExAllocatePoolWithTag(PagedPool, sizeof(DEVICE_RELATIONS),
I8042PRT_TAG);
if (DeviceRelations)
{
@@ -664,11 +664,11 @@
}
case RemovalRelations:
{
- DPRINT("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
RemovalRelations\n");
+ TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS /
RemovalRelations\n");
return ForwardIrpAndForget(DeviceObject, Irp);
}
default:
- DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type
0x%lx\n",
+ ERR_(I8042PRT, "IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type
0x%lx\n",
Stack->Parameters.QueryDeviceRelations.Type);
ASSERT(FALSE);
return ForwardIrpAndForget(DeviceObject, Irp);
@@ -677,14 +677,14 @@
}
case IRP_MN_FILTER_RESOURCE_REQUIREMENTS: /* (optional) 0x0d */
{
- DPRINT("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
+ TRACE_(I8042PRT, "IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
/* Nothing to do */
Status = Irp->IoStatus.Status;
break;
}
default:
{
- DPRINT1("IRP_MJ_PNP / unknown minor function 0x%x\n", MinorFunction);
+ ERR_(I8042PRT, "IRP_MJ_PNP / unknown minor function 0x%x\n",
MinorFunction);
ASSERT(FALSE);
return ForwardIrpAndForget(DeviceObject, Irp);
}
Modified: trunk/reactos/drivers/input/i8042prt/ps2pp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/ps2…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/ps2pp.c (original)
+++ trunk/reactos/drivers/input/i8042prt/ps2pp.c Mon Dec 17 00:12:54 2007
@@ -88,7 +88,7 @@
(((DeviceExtension->MouseLogiBuffer[1] & 0x0C) >> 2) !=
(DeviceExtension->MouseLogiBuffer[2] & 0x03)))
{
- DPRINT1("Ps2pp packet fails sanity checks\n");
+ WARN_(I8042PRT, "Ps2pp packet fails sanity checks\n");
return;
}
@@ -133,6 +133,6 @@
}
default:
- DPRINT1("Unexpected input state for ps2pp!\n");
+ WARN_(I8042PRT, "Unexpected input state for ps2pp!\n");
}
}
Modified: trunk/reactos/drivers/input/i8042prt/readwrite.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/rea…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/readwrite.c (original)
+++ trunk/reactos/drivers/input/i8042prt/readwrite.c Mon Dec 17 00:12:54 2007
@@ -22,7 +22,7 @@
UCHAR Ignore;
while (NT_SUCCESS(i8042ReadData(DeviceExtension, KBD_OBF | MOU_OBF, &Ignore))) {
- DPRINT("Data flushed\n"); /* drop */
+ INFO_(I8042PRT, "Data flushed\n"); /* drop */
}
}
@@ -59,7 +59,7 @@
if (PortStatus & StatusFlags)
{
*Data = READ_PORT_UCHAR(DeviceExtension->DataPort);
- DPRINT("Read: 0x%02x (status: 0x%x)\n", Data[0], PortStatus);
+ INFO_(I8042PRT, "Read: 0x%02x (status: 0x%x)\n", Data[0], PortStatus);
// If the data is valid (not timeout, not parity error)
if ((PortStatus & KBD_PERR) == 0)
@@ -146,13 +146,13 @@
if (Port)
if (!i8042Write(DeviceExtension, DeviceExtension->DataPort, Port))
{
- DPRINT1("Failed to write Port\n");
+ WARN_(I8042PRT, "Failed to write Port\n");
return STATUS_IO_TIMEOUT;
}
if (!i8042Write(DeviceExtension, DeviceExtension->DataPort, Value))
{
- DPRINT1("Failed to write Value\n");
+ WARN_(I8042PRT, "Failed to write Value\n");
return STATUS_IO_TIMEOUT;
}
@@ -161,19 +161,19 @@
Status = i8042ReadDataWait(DeviceExtension, &Ack);
if (!NT_SUCCESS(Status))
{
- DPRINT1("Failed to read Ack\n");
+ WARN_(I8042PRT, "Failed to read Ack\n");
return Status;
}
if (Ack == KBD_ACK)
return STATUS_SUCCESS;
else if (Ack == KBD_RESEND)
- DPRINT("i8042 asks for a data resend\n");
+ INFO_(I8042PRT, "i8042 asks for a data resend\n");
}
else
{
return STATUS_SUCCESS;
}
- DPRINT("Reiterating\n");
+ TRACE_(I8042PRT, "Reiterating\n");
ResendIterations--;
} while (ResendIterations);
@@ -205,7 +205,7 @@
if (ResendIterations)
{
WRITE_PORT_UCHAR(addr, data);
- DPRINT("Sent 0x%x to port %p\n", data, addr);
+ INFO_(I8042PRT, "Sent 0x%x to port %p\n", data, addr);
return TRUE;
}
return FALSE;
Modified: trunk/reactos/drivers/input/i8042prt/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/reg…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/registry.c (original)
+++ trunk/reactos/drivers/input/i8042prt/registry.c Mon Dec 17 00:12:54 2007
@@ -200,7 +200,7 @@
if (!RtlCreateUnicodeString(&Settings->KeyboardDeviceBaseName,
DefaultKeyboardDeviceBaseName)
|| !RtlCreateUnicodeString(&Settings->PointerDeviceBaseName,
DefaultPointerDeviceBaseName))
{
- DPRINT("RtlCreateUnicodeString() failed\n");
+ WARN_(I8042PRT, "RtlCreateUnicodeString() failed\n");
Status = STATUS_NO_MEMORY;
}
else
@@ -211,20 +211,20 @@
if (NT_SUCCESS(Status))
{
- DPRINT("KeyboardDataQueueSize : 0x%lx\n",
Settings->KeyboardDataQueueSize);
- DPRINT("KeyboardDeviceBaseName : %wZ\n",
&Settings->KeyboardDeviceBaseName);
- DPRINT("MouseDataQueueSize : 0x%lx\n", Settings->MouseDataQueueSize);
- DPRINT("MouseResolution : 0x%lx\n", Settings->MouseResolution);
- DPRINT("MouseSynchIn100ns : %lu\n", Settings->MouseSynchIn100ns);
- DPRINT("NumberOfButtons : 0x%lx\n", Settings->NumberOfButtons);
- DPRINT("PointerDeviceBaseName : %wZ\n",
&Settings->PointerDeviceBaseName);
- DPRINT("PollStatusIterations : 0x%lx\n", Settings->PollStatusIterations);
- DPRINT("OverrideKeyboardType : 0x%lx\n", Settings->OverrideKeyboardType);
- DPRINT("OverrideKeyboardSubtype : 0x%lx\n",
Settings->OverrideKeyboardSubtype);
- DPRINT("PollingIterations : 0x%lx\n", Settings->PollingIterations);
- DPRINT("PollingIterationsMaximum : %lu\n",
Settings->PollingIterationsMaximum);
- DPRINT("ResendIterations : 0x%lx\n", Settings->ResendIterations);
- DPRINT("SampleRate : %lu\n", Settings->SampleRate);
+ INFO_(I8042PRT, "KeyboardDataQueueSize : 0x%lx\n",
Settings->KeyboardDataQueueSize);
+ INFO_(I8042PRT, "KeyboardDeviceBaseName : %wZ\n",
&Settings->KeyboardDeviceBaseName);
+ INFO_(I8042PRT, "MouseDataQueueSize : 0x%lx\n",
Settings->MouseDataQueueSize);
+ INFO_(I8042PRT, "MouseResolution : 0x%lx\n", Settings->MouseResolution);
+ INFO_(I8042PRT, "MouseSynchIn100ns : %lu\n",
Settings->MouseSynchIn100ns);
+ INFO_(I8042PRT, "NumberOfButtons : 0x%lx\n", Settings->NumberOfButtons);
+ INFO_(I8042PRT, "PointerDeviceBaseName : %wZ\n",
&Settings->PointerDeviceBaseName);
+ INFO_(I8042PRT, "PollStatusIterations : 0x%lx\n",
Settings->PollStatusIterations);
+ INFO_(I8042PRT, "OverrideKeyboardType : 0x%lx\n",
Settings->OverrideKeyboardType);
+ INFO_(I8042PRT, "OverrideKeyboardSubtype : 0x%lx\n",
Settings->OverrideKeyboardSubtype);
+ INFO_(I8042PRT, "PollingIterations : 0x%lx\n",
Settings->PollingIterations);
+ INFO_(I8042PRT, "PollingIterationsMaximum : %lu\n",
Settings->PollingIterationsMaximum);
+ INFO_(I8042PRT, "ResendIterations : 0x%lx\n",
Settings->ResendIterations);
+ INFO_(I8042PRT, "SampleRate : %lu\n", Settings->SampleRate);
}
return Status;
Modified: trunk/reactos/drivers/input/i8042prt/setup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/i8042prt/set…
==============================================================================
--- trunk/reactos/drivers/input/i8042prt/setup.c (original)
+++ trunk/reactos/drivers/input/i8042prt/setup.c Mon Dec 17 00:12:54 2007
@@ -42,7 +42,7 @@
if (hSetupKey != (HANDLE)NULL)
ZwClose(hSetupKey);
- DPRINT("IsFirstStageSetup() returns %s\n", ret ? "YES" :
"NO");
+ INFO_(I8042PRT, "IsFirstStageSetup() returns %s\n", ret ? "YES" :
"NO");
return ret;
}
@@ -64,14 +64,14 @@
NTSTATUS Status;
Pdo = (PDEVICE_OBJECT)Context;
- DPRINT("SendStartDevice(%p)\n", Pdo);
+ TRACE_(I8042PRT, "SendStartDevice(%p)\n", Pdo);
/* Create default resource list */
ResourceListSize = sizeof(CM_RESOURCE_LIST) + 3 *
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
AllocatedResources = ExAllocatePoolWithTag(PagedPool, ResourceListSize, I8042PRT_TAG);
if (!AllocatedResources)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(I8042PRT, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -105,7 +105,7 @@
AllocatedResourcesTranslated = ExAllocatePoolWithTag(PagedPool, ResourceListSize,
I8042PRT_TAG);
if (!AllocatedResourcesTranslated)
{
- DPRINT("ExAllocatePoolWithTag() failed\n");
+ WARN_(I8042PRT, "ExAllocatePoolWithTag() failed\n");
Status = STATUS_NO_MEMORY;
goto cleanup;
}
@@ -150,7 +150,7 @@
}
if (!NT_SUCCESS(Status))
{
- DPRINT("IoCallDriver() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "IoCallDriver() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -180,7 +180,7 @@
Status = ZwOpenKey(&hDeviceMapKey, 0, &ObjectAttributes);
if (!NT_SUCCESS(Status))
{
- DPRINT("ZwOpenKey() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "ZwOpenKey() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -189,14 +189,14 @@
Status = ZwCreateKey(&hPortKey, KEY_SET_VALUE, &ObjectAttributes, 0, NULL,
REG_OPTION_VOLATILE, NULL);
if (!NT_SUCCESS(Status))
{
- DPRINT("ZwCreateKey() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "ZwCreateKey() failed with status 0x%08lx\n", Status);
goto cleanup;
}
Status = ZwSetValueKey(hPortKey, DeviceName, 0, REG_SZ, (PVOID)RegistryPath,
wcslen(RegistryPath) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
if (!NT_SUCCESS(Status))
{
- DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "ZwSetValueKey() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -220,7 +220,7 @@
PDEVICE_OBJECT Pdo = NULL;
NTSTATUS Status;
- DPRINT("i8042AddLegacyKeyboard()\n");
+ TRACE_(I8042PRT, "i8042AddLegacyKeyboard()\n");
/* Create a named PDO */
Status = IoCreateDevice(
@@ -233,7 +233,7 @@
&Pdo);
if (!NT_SUCCESS(Status))
{
- DPRINT("IoCreateDevice() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "IoCreateDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}
@@ -247,7 +247,7 @@
Status = i8042AddDevice(DriverObject, Pdo);
if (!NT_SUCCESS(Status))
{
- DPRINT("i8042AddDevice() failed with status 0x%08lx\n", Status);
+ WARN_(I8042PRT, "i8042AddDevice() failed with status 0x%08lx\n", Status);
goto cleanup;
}