Author: cgutman
Date: Tue Aug 23 05:17:41 2011
New Revision: 53394
URL:
http://svn.reactos.org/svn/reactos?rev=53394&view=rev
Log:
[HAL]
- Fix device reporting to work with the IoReportDetectedDevice patch
[HAL/ACPI]
- Turn debugging off
Modified:
trunk/reactos/drivers/bus/acpi/acpienum.c
trunk/reactos/drivers/bus/acpi/buspdo.c
trunk/reactos/drivers/bus/acpi/main.c
trunk/reactos/drivers/bus/acpi/pnp.c
trunk/reactos/hal/halx86/generic/acpi/halacpi.c
trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c
Modified: trunk/reactos/drivers/bus/acpi/acpienum.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpienum.…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpienum.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/acpienum.c [iso-8859-1] Tue Aug 23 05:17:41 2011
@@ -13,7 +13,7 @@
#include <acpi_drivers.h>
#include <list.h>
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
#define HAS_CHILDREN(d) ((d)->children.next != &((d)->children))
Modified: trunk/reactos/drivers/bus/acpi/buspdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/buspdo.c?…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] Tue Aug 23 05:17:41 2011
@@ -11,7 +11,7 @@
#include <initguid.h>
#include <poclass.h>
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
#ifdef ALLOC_PRAGMA
Modified: trunk/reactos/drivers/bus/acpi/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/main.c?re…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/main.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/main.c [iso-8859-1] Tue Aug 23 05:17:41 2011
@@ -9,7 +9,7 @@
#include <acpiioct.h>
#include <poclass.h>
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
NTSTATUS
Modified: trunk/reactos/drivers/bus/acpi/pnp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/pnp.c?rev…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/pnp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/pnp.c [iso-8859-1] Tue Aug 23 05:17:41 2011
@@ -7,7 +7,7 @@
#include <acpi_drivers.h>
#include <wdmguid.h>
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
NTSTATUS
Modified: trunk/reactos/hal/halx86/generic/acpi/halacpi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
==============================================================================
--- trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/acpi/halacpi.c [iso-8859-1] Tue Aug 23 05:17:41 2011
@@ -9,7 +9,7 @@
/* INCLUDES *******************************************************************/
#include <hal.h>
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
Modified: trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/acpi/ha…
==============================================================================
--- trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/acpi/halpnpdd.c [iso-8859-1] Tue Aug 23 05:17:41
2011
@@ -9,7 +9,7 @@
/* INCLUDES *******************************************************************/
#include <hal.h>
-//#define NDEBUG
+#define NDEBUG
#include <debug.h>
typedef enum _EXTENSION_TYPE
@@ -563,6 +563,10 @@
switch (IdType)
{
case BusQueryDeviceID:
+ /* HACK */
+ Id = L"Root\\ACPI_HAL";
+ break;
+
case BusQueryHardwareIDs:
/* This is our hardware ID */
@@ -607,21 +611,6 @@
/* Return status */
return Status;
-}
-
-NTSTATUS
-NTAPI
-HalpPassIrpFromFdoToPdo(IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp)
-{
- PFDO_EXTENSION FdoExtension;
-
- /* Get the extension */
- FdoExtension = DeviceObject->DeviceExtension;
-
- /* Pass it to the attached device (our PDO) */
- IoSkipCurrentIrpStackLocation(Irp);
- return IoCallDriver(FdoExtension->AttachedDeviceObject, Irp);
}
NTSTATUS
@@ -682,22 +671,11 @@
/* Pass it to the PDO */
DPRINT("Other IRP: %lx\n", Minor);
- return HalpPassIrpFromFdoToPdo(DeviceObject, Irp);
+ Status = Irp->IoStatus.Status;
+ break;
}
-
- /* What happpened? */
- if ((NT_SUCCESS(Status)) || (Status == STATUS_NOT_SUPPORTED))
- {
- /* Set the IRP status, unless this isn't understood */
- if (Status != STATUS_NOT_SUPPORTED) Irp->IoStatus.Status = Status;
-
- /* Pass it on */
- DPRINT("Passing IRP to PDO\n");
- return HalpPassIrpFromFdoToPdo(DeviceObject, Irp);
- }
-
- /* Otherwise, we failed, so set the status and complete the request */
- DPRINT1("IRP failed with status: %lx\n", Status);
+
+ /* Nowhere for the IRP to go since we also own the PDO */
Irp->IoStatus.Status = Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
@@ -834,20 +812,42 @@
{
NTSTATUS Status;
PDEVICE_OBJECT TargetDevice = NULL;
+
DPRINT("HAL: PnP Driver ENTRY!\n");
/* This is us */
HalpDriverObject = DriverObject;
-
+
/* Set up add device */
DriverObject->DriverExtension->AddDevice = HalpAddDevice;
-
+
/* Set up the callouts */
DriverObject->MajorFunction[IRP_MJ_PNP] = HalpDispatchPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] = HalpDispatchPower;
DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = HalpDispatchWmi;
-
- /* Tell the PnP about us */
+
+ /* Create the PDO */
+ Status = IoCreateDevice(DriverObject,
+ 0,
+ NULL,
+ FILE_DEVICE_CONTROLLER,
+ 0,
+ FALSE,
+ &TargetDevice);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ TargetDevice->Flags &= ~DO_DEVICE_INITIALIZING;
+
+ /* Set up the device stack */
+ Status = HalpAddDevice(DriverObject, TargetDevice);
+ if (!NT_SUCCESS(Status))
+ {
+ IoDeleteDevice(TargetDevice);
+ return Status;
+ }
+
+ /* Tell the PnP manager about us */
Status = IoReportDetectedDevice(DriverObject,
InterfaceTypeUndefined,
-1,
@@ -857,9 +857,6 @@
FALSE,
&TargetDevice);
- /* Now add us */
- if (NT_SUCCESS(Status)) Status = HalpAddDevice(DriverObject, TargetDevice);
-
/* Return to kernel */
return Status;
}