Author: cgutman
Date: Tue Mar 23 04:05:57 2010
New Revision: 46353
URL:
http://svn.reactos.org/svn/reactos?rev=46353&view=rev
Log:
[ACPI]
- Add stubs for ACPI_INTERFACE_STANDARD and write all of the glue code for
IRP_MN_QUERY_INTERFACE
Added:
trunk/reactos/drivers/bus/acpi/interface.c (with props)
Modified:
trunk/reactos/drivers/bus/acpi/acpi.rbuild
trunk/reactos/drivers/bus/acpi/buspdo.c
Modified: trunk/reactos/drivers/bus/acpi/acpi.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpi.rbui…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/acpi.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/acpi.rbuild [iso-8859-1] Tue Mar 23 04:05:57 2010
@@ -26,6 +26,7 @@
</directory>
<file>osl.c</file>
<file>acpienum.c</file>
+ <file>interface.c</file>
<file>pnp.c</file>
<file>power.c</file>
<file>buspdo.c</file>
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 Mar 23 04:05:57 2010
@@ -173,6 +173,12 @@
case IRP_MN_QUERY_BUS_INFORMATION:
status = Bus_PDO_QueryBusInformation(DeviceData, Irp);
+
+ break;
+
+ case IRP_MN_QUERY_INTERFACE:
+
+ status = Bus_PDO_QueryInterface(DeviceData, Irp);
break;
Added: trunk/reactos/drivers/bus/acpi/interface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/interface…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/interface.c (added)
+++ trunk/reactos/drivers/bus/acpi/interface.c [iso-8859-1] Tue Mar 23 04:05:57 2010
@@ -1,0 +1,138 @@
+#include <ntddk.h>
+
+#include <acpi.h>
+
+#include <acpisys.h>
+#include <acpi_bus.h>
+#include <acpi_drivers.h>
+
+#include <wdmguid.h>
+#define NDEBUG
+#include <debug.h>
+
+VOID
+NTAPI
+AcpiInterfaceReference(PVOID Context)
+{
+ UNIMPLEMENTED
+}
+
+VOID
+NTAPI
+AcpiInterfaceDereference(PVOID Context)
+{
+ UNIMPLEMENTED
+}
+
+NTSTATUS
+AcpiInterfaceConnectVector(PDEVICE_OBJECT Context,
+ ULONG GpeNumber,
+ KINTERRUPT_MODE Mode,
+ BOOLEAN Shareable,
+ PGPE_SERVICE_ROUTINE ServiceRoutine,
+ PVOID ServiceContext,
+ PVOID *ObjectContext)
+{
+ UNIMPLEMENTED
+
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+AcpiInterfaceDisconnectVector(PDEVICE_OBJECT Context,
+ PVOID ObjectContext)
+{
+ UNIMPLEMENTED
+
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+AcpiInterfaceEnableEvent(PDEVICE_OBJECT Context,
+ PVOID ObjectContext)
+{
+ UNIMPLEMENTED
+
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+AcpiInterfaceDisableEvent(PDEVICE_OBJECT Context,
+ PVOID ObjectContext)
+{
+ UNIMPLEMENTED
+
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+AcpiInterfaceClearStatus(PDEVICE_OBJECT Context,
+ PVOID ObjectContext)
+{
+ UNIMPLEMENTED
+
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTSTATUS
+AcpiInterfaceNotificationsRegister(PDEVICE_OBJECT Context,
+ PDEVICE_NOTIFY_CALLBACK NotificationHandler,
+ PVOID NotificationContext)
+{
+ UNIMPLEMENTED
+
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+VOID
+AcpiInterfaceNotificationsUnregister(PDEVICE_OBJECT Context,
+ PDEVICE_NOTIFY_CALLBACK NotificationHandler)
+{
+ UNIMPLEMENTED
+}
+
+NTSTATUS
+Bus_PDO_QueryInterface(PPDO_DEVICE_DATA DeviceData,
+ PIRP Irp)
+{
+ PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
+ PACPI_INTERFACE_STANDARD AcpiInterface;
+
+ if (IrpSp->Parameters.QueryInterface.Version != 1)
+ {
+ DPRINT1("Invalid version number: %d\n",
+ IrpSp->Parameters.QueryInterface.Version);
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (RtlCompareMemory(IrpSp->Parameters.QueryInterface.InterfaceType,
+ &GUID_ACPI_INTERFACE_STANDARD, sizeof(GUID)) ==
sizeof(GUID))
+ {
+ DPRINT("GUID_ACPI_INTERFACE_STANDARD\n");
+
+ if (IrpSp->Parameters.QueryInterface.Size < sizeof(ACPI_INTERFACE_STANDARD))
+ {
+ DPRINT1("Buffer too small! (%d)\n",
IrpSp->Parameters.QueryInterface.Size);
+ return STATUS_BUFFER_TOO_SMALL;
+ }
+
+ AcpiInterface =
(PACPI_INTERFACE_STANDARD)IrpSp->Parameters.QueryInterface.Interface;
+
+ AcpiInterface->InterfaceReference = AcpiInterfaceReference;
+ AcpiInterface->InterfaceDereference = AcpiInterfaceDereference;
+ AcpiInterface->GpeConnectVector = AcpiInterfaceConnectVector;
+ AcpiInterface->GpeDisconnectVector = AcpiInterfaceDisconnectVector;
+ AcpiInterface->GpeEnableEvent = AcpiInterfaceEnableEvent;
+ AcpiInterface->GpeDisableEvent = AcpiInterfaceDisableEvent;
+ AcpiInterface->GpeClearStatus = AcpiInterfaceClearStatus;
+ AcpiInterface->RegisterForDeviceNotifications =
AcpiInterfaceNotificationsRegister;
+ AcpiInterface->UnregisterForDeviceNotifications =
AcpiInterfaceNotificationsUnregister;
+
+ return STATUS_SUCCESS;
+ }
+ else
+ {
+ DPRINT1("Invalid GUID\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+}
Propchange: trunk/reactos/drivers/bus/acpi/interface.c
------------------------------------------------------------------------------
svn:eol-style = native