Author: hpoussin
Date: Mon Jan 7 15:57:32 2008
New Revision: 31639
URL:
http://svn.reactos.org/svn/reactos?rev=31639&view=rev
Log:
Use kernel facilities to change debug level at runtime
Modified:
trunk/reactos/drivers/input/sermouse/detect.c
trunk/reactos/drivers/input/sermouse/readmouse.c
trunk/reactos/drivers/serial/serenum/detect.c
trunk/reactos/drivers/serial/serial/create.c
trunk/reactos/drivers/serial/serial/rw.c
Modified: trunk/reactos/drivers/input/sermouse/detect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/sermouse/det…
==============================================================================
--- trunk/reactos/drivers/input/sermouse/detect.c (original)
+++ trunk/reactos/drivers/input/sermouse/detect.c Mon Jan 7 15:57:32 2008
@@ -141,14 +141,14 @@
if (!NT_SUCCESS(Status)) return mtNone;
/* Reset UART */
- CHECKPOINT;
+ TRACE_(SERMOUSE, "Reset UART\n");
Mcr = 0; /* MCR: DTR/RTS/OUT2 off */
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
&Mcr, sizeof(Mcr), NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Set communications parameters */
- CHECKPOINT;
+ TRACE_(SERMOUSE, "Set communications parameters\n");
/* DLAB off */
Fcr = 0;
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_FIFO_CONTROL,
@@ -168,7 +168,7 @@
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Flush receive buffer */
- CHECKPOINT;
+ TRACE_(SERMOUSE, "Flush receive buffer\n");
Command = SERIAL_PURGE_RXCLEAR;
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
&Command, sizeof(Command), NULL, NULL);
@@ -177,7 +177,7 @@
Wait(100);
/* Enable DTR/RTS */
- CHECKPOINT;
+ TRACE_(SERMOUSE, "Enable DTR/RTS\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -186,7 +186,7 @@
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Set timeout to 500 microseconds */
- CHECKPOINT;
+ TRACE_(SERMOUSE, "Set timeout to 500 microseconds\n");
Timeouts.ReadIntervalTimeout = 100;
Timeouts.ReadTotalTimeoutMultiplier = 0;
Timeouts.ReadTotalTimeoutConstant = 500;
@@ -196,7 +196,7 @@
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Fill the read buffer */
- CHECKPOINT;
+ TRACE_(SERMOUSE, "Fill the read buffer\n");
Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count);
if (!NT_SUCCESS(Status)) goto ByeBye;
Modified: trunk/reactos/drivers/input/sermouse/readmouse.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/sermouse/rea…
==============================================================================
--- trunk/reactos/drivers/input/sermouse/readmouse.c (original)
+++ trunk/reactos/drivers/input/sermouse/readmouse.c Mon Jan 7 15:57:32 2008
@@ -149,8 +149,8 @@
&ioStatus);
if (!Irp)
{
- /* no memory actually, try later */
- CHECKPOINT;
+ /* No memory actually, try later */
+ INFO_(SERMOUSE, "No memory actually, trying again\n");
KeStallExecutionProcessor(10);
continue;
}
Modified: trunk/reactos/drivers/serial/serenum/detect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/serial/serenum/det…
==============================================================================
--- trunk/reactos/drivers/serial/serenum/detect.c (original)
+++ trunk/reactos/drivers/serial/serenum/detect.c Mon Jan 7 15:57:32 2008
@@ -248,7 +248,7 @@
if (!NT_SUCCESS(Status)) goto ByeBye;
/* 1. COM port initialization, check for device enumerate */
- CHECKPOINT;
+ TRACE_(SERENUM, "COM port initialization, check for device enumerate\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -263,7 +263,7 @@
if ((Msr & SERIAL_DSR_STATE) == 0) goto DisconnectIdle;
/* 2. COM port setup, 1st phase */
- CHECKPOINT;
+ TRACE_(SERENUM, "COM port setup, 1st phase\n");
BaudRate = 1200;
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_BAUD_RATE,
&BaudRate, sizeof(BaudRate), NULL, 0);
@@ -287,7 +287,7 @@
Wait(200);
/* 3. Wait for response, 1st phase */
- CHECKPOINT;
+ TRACE_(SERENUM, "Wait for response, 1st phase\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_RTS,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -303,7 +303,7 @@
if (Size != 0) goto CollectPnpComDeviceId;
/* 4. COM port setup, 2nd phase */
- CHECKPOINT;
+ TRACE_(SERENUM, "COM port setup, 2nd phase\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_CLR_DTR,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -317,7 +317,7 @@
Wait(200);
/* 5. Wait for response, 2nd phase */
- CHECKPOINT;
+ TRACE_(SERENUM, "Wait for response, 2nd phase\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -335,7 +335,7 @@
/* 6. Collect PnP COM device ID */
CollectPnpComDeviceId:
- CHECKPOINT;
+ TRACE_(SERENUM, "Collect PnP COM device ID\n");
Timeouts.ReadIntervalTimeout = 200;
Timeouts.ReadTotalTimeoutMultiplier = 0;
Timeouts.ReadTotalTimeoutConstant = 2200;
@@ -374,7 +374,7 @@
/* 7. Verify disconnect */
VerifyDisconnect:
- CHECKPOINT;
+ TRACE_(SERENUM, "Verify disconnect\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -386,7 +386,7 @@
/* 8. Connect idle */
ConnectIdle:
- CHECKPOINT;
+ TRACE_(SERENUM, "Connect idle\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -411,7 +411,7 @@
/* 9. Disconnect idle */
DisconnectIdle:
- CHECKPOINT;
+ TRACE_(SERENUM, "Disconnect idle\n");
/* FIXME: report to OS device removal, if it was present */
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
NULL, 0, NULL, NULL);
@@ -476,14 +476,14 @@
if (!NT_SUCCESS(Status)) return Status;
/* Reset UART */
- CHECKPOINT;
+ TRACE_(SERENUM, "Reset UART\n");
Mcr = 0; /* MCR: DTR/RTS/OUT2 off */
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
&Mcr, sizeof(Mcr), NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Set communications parameters */
- CHECKPOINT;
+ TRACE_(SERENUM, "Set communications parameters\n");
/* DLAB off */
Fcr = 0;
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_FIFO_CONTROL,
@@ -503,7 +503,7 @@
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Flush receive buffer */
- CHECKPOINT;
+ TRACE_(SERENUM, "Flush receive buffer\n");
Command = SERIAL_PURGE_RXCLEAR;
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_MODEM_CONTROL,
&Command, sizeof(Command), NULL, NULL);
@@ -512,7 +512,7 @@
Wait(100);
/* Enable DTR/RTS */
- CHECKPOINT;
+ TRACE_(SERENUM, "Enable DTR/RTS\n");
Status = DeviceIoControl(LowerDevice, IOCTL_SERIAL_SET_DTR,
NULL, 0, NULL, NULL);
if (!NT_SUCCESS(Status)) goto ByeBye;
@@ -521,7 +521,7 @@
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Set timeout to 500 microseconds */
- CHECKPOINT;
+ TRACE_(SERENUM, "Set timeout to 500 microseconds\n");
Timeouts.ReadIntervalTimeout = 100;
Timeouts.ReadTotalTimeoutMultiplier = 0;
Timeouts.ReadTotalTimeoutConstant = 500;
@@ -531,7 +531,7 @@
if (!NT_SUCCESS(Status)) goto ByeBye;
/* Fill the read buffer */
- CHECKPOINT;
+ TRACE_(SERENUM, "Fill the read buffer\n");
Status = ReadBytes(LowerDevice, Buffer, sizeof(Buffer)/sizeof(Buffer[0]), &Count);
if (!NT_SUCCESS(Status)) goto ByeBye;
Modified: trunk/reactos/drivers/serial/serial/create.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/serial/serial/crea…
==============================================================================
--- trunk/reactos/drivers/serial/serial/create.c (original)
+++ trunk/reactos/drivers/serial/serial/create.c Mon Jan 7 15:57:32 2008
@@ -24,7 +24,7 @@
if (Stack->Parameters.Create.Options & FILE_DIRECTORY_FILE)
{
- CHECKPOINT;
+ INFO_(SERIAL, "Not a directory\n");
Status = STATUS_NOT_A_DIRECTORY;
goto ByeBye;
}
Modified: trunk/reactos/drivers/serial/serial/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/serial/serial/rw.c…
==============================================================================
--- trunk/reactos/drivers/serial/serial/rw.c (original)
+++ trunk/reactos/drivers/serial/serial/rw.c Mon Jan 7 15:57:32 2008
@@ -227,8 +227,8 @@
return STATUS_PENDING;
}
- /* insufficient resources, we can't pend the Irp */
- CHECKPOINT;
+ /* Insufficient resources, we can't pend the Irp */
+ INFO_(SERIAL, "Insufficient resources\n");
Status = IoAcquireRemoveLock(&DeviceExtension->RemoveLock,
ULongToPtr(DeviceExtension->ComPort));
if (!NT_SUCCESS(Status))
{