xref: /reactos/drivers/bus/acpi/interface.c (revision 91323595)
1c2c66affSColin Finck #include "precomp.h"
2c2c66affSColin Finck 
3c2c66affSColin Finck #define NDEBUG
4c2c66affSColin Finck #include <debug.h>
5c2c66affSColin Finck 
6c2c66affSColin Finck VOID
7c2c66affSColin Finck NTAPI
AcpiInterfaceReference(PVOID Context)8c2c66affSColin Finck AcpiInterfaceReference(PVOID Context)
9c2c66affSColin Finck {
10c2c66affSColin Finck   UNIMPLEMENTED;
11c2c66affSColin Finck }
12c2c66affSColin Finck 
13c2c66affSColin Finck VOID
14c2c66affSColin Finck NTAPI
AcpiInterfaceDereference(PVOID Context)15c2c66affSColin Finck AcpiInterfaceDereference(PVOID Context)
16c2c66affSColin Finck {
17c2c66affSColin Finck   UNIMPLEMENTED;
18c2c66affSColin Finck }
19c2c66affSColin Finck 
20c2c66affSColin Finck NTSTATUS
21c2c66affSColin Finck NTAPI
AcpiInterfaceConnectVector(PDEVICE_OBJECT Context,ULONG GpeNumber,KINTERRUPT_MODE Mode,BOOLEAN Shareable,PGPE_SERVICE_ROUTINE ServiceRoutine,PVOID ServiceContext,PVOID ObjectContext)22c2c66affSColin Finck AcpiInterfaceConnectVector(PDEVICE_OBJECT Context,
23c2c66affSColin Finck                            ULONG GpeNumber,
24c2c66affSColin Finck                            KINTERRUPT_MODE Mode,
25c2c66affSColin Finck                            BOOLEAN Shareable,
26c2c66affSColin Finck                            PGPE_SERVICE_ROUTINE ServiceRoutine,
27c2c66affSColin Finck                            PVOID ServiceContext,
28c2c66affSColin Finck                            PVOID ObjectContext)
29c2c66affSColin Finck {
30c2c66affSColin Finck   UNIMPLEMENTED;
31c2c66affSColin Finck 
32c2c66affSColin Finck   return STATUS_NOT_IMPLEMENTED;
33c2c66affSColin Finck }
34c2c66affSColin Finck 
35c2c66affSColin Finck NTSTATUS
36c2c66affSColin Finck NTAPI
AcpiInterfaceDisconnectVector(PVOID ObjectContext)37c2c66affSColin Finck AcpiInterfaceDisconnectVector(PVOID ObjectContext)
38c2c66affSColin Finck {
39c2c66affSColin Finck   UNIMPLEMENTED;
40c2c66affSColin Finck 
41c2c66affSColin Finck   return STATUS_NOT_IMPLEMENTED;
42c2c66affSColin Finck }
43c2c66affSColin Finck 
44c2c66affSColin Finck NTSTATUS
45c2c66affSColin Finck NTAPI
AcpiInterfaceEnableEvent(PDEVICE_OBJECT Context,PVOID ObjectContext)46c2c66affSColin Finck AcpiInterfaceEnableEvent(PDEVICE_OBJECT Context,
47c2c66affSColin Finck                          PVOID ObjectContext)
48c2c66affSColin Finck {
49c2c66affSColin Finck   UNIMPLEMENTED;
50c2c66affSColin Finck 
51c2c66affSColin Finck   return STATUS_NOT_IMPLEMENTED;
52c2c66affSColin Finck }
53c2c66affSColin Finck 
54c2c66affSColin Finck NTSTATUS
55c2c66affSColin Finck NTAPI
AcpiInterfaceDisableEvent(PDEVICE_OBJECT Context,PVOID ObjectContext)56c2c66affSColin Finck AcpiInterfaceDisableEvent(PDEVICE_OBJECT Context,
57c2c66affSColin Finck                           PVOID ObjectContext)
58c2c66affSColin Finck {
59c2c66affSColin Finck   UNIMPLEMENTED;
60c2c66affSColin Finck 
61c2c66affSColin Finck   return STATUS_NOT_IMPLEMENTED;
62c2c66affSColin Finck }
63c2c66affSColin Finck 
64c2c66affSColin Finck NTSTATUS
65c2c66affSColin Finck NTAPI
AcpiInterfaceClearStatus(PDEVICE_OBJECT Context,PVOID ObjectContext)66c2c66affSColin Finck AcpiInterfaceClearStatus(PDEVICE_OBJECT Context,
67c2c66affSColin Finck                          PVOID ObjectContext)
68c2c66affSColin Finck {
69c2c66affSColin Finck   UNIMPLEMENTED;
70c2c66affSColin Finck 
71c2c66affSColin Finck   return STATUS_NOT_IMPLEMENTED;
72c2c66affSColin Finck }
73c2c66affSColin Finck 
74c2c66affSColin Finck NTSTATUS
75c2c66affSColin Finck NTAPI
AcpiInterfaceNotificationsRegister(PDEVICE_OBJECT Context,PDEVICE_NOTIFY_CALLBACK NotificationHandler,PVOID NotificationContext)76c2c66affSColin Finck AcpiInterfaceNotificationsRegister(PDEVICE_OBJECT Context,
77c2c66affSColin Finck                                    PDEVICE_NOTIFY_CALLBACK NotificationHandler,
78c2c66affSColin Finck                                    PVOID NotificationContext)
79c2c66affSColin Finck {
80c2c66affSColin Finck   UNIMPLEMENTED;
81c2c66affSColin Finck 
82*91323595SHervé Poussineau   return STATUS_SUCCESS;
83c2c66affSColin Finck }
84c2c66affSColin Finck 
85c2c66affSColin Finck VOID
86c2c66affSColin Finck NTAPI
AcpiInterfaceNotificationsUnregister(PDEVICE_OBJECT Context,PDEVICE_NOTIFY_CALLBACK NotificationHandler)87c2c66affSColin Finck AcpiInterfaceNotificationsUnregister(PDEVICE_OBJECT Context,
88c2c66affSColin Finck                                      PDEVICE_NOTIFY_CALLBACK NotificationHandler)
89c2c66affSColin Finck {
90c2c66affSColin Finck   UNIMPLEMENTED;
91c2c66affSColin Finck }
92c2c66affSColin Finck 
93c2c66affSColin Finck NTSTATUS
Bus_PDO_QueryInterface(PPDO_DEVICE_DATA DeviceData,PIRP Irp)94c2c66affSColin Finck Bus_PDO_QueryInterface(PPDO_DEVICE_DATA DeviceData,
95c2c66affSColin Finck                        PIRP Irp)
96c2c66affSColin Finck {
97c2c66affSColin Finck   PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
98c2c66affSColin Finck   PACPI_INTERFACE_STANDARD AcpiInterface;
99c2c66affSColin Finck 
100c2c66affSColin Finck   if (IrpSp->Parameters.QueryInterface.Version != 1)
101c2c66affSColin Finck   {
102c2c66affSColin Finck       DPRINT1("Invalid version number: %d\n",
103c2c66affSColin Finck               IrpSp->Parameters.QueryInterface.Version);
104c2c66affSColin Finck       return STATUS_INVALID_PARAMETER;
105c2c66affSColin Finck   }
106c2c66affSColin Finck 
107c2c66affSColin Finck   if (RtlCompareMemory(IrpSp->Parameters.QueryInterface.InterfaceType,
108c2c66affSColin Finck                         &GUID_ACPI_INTERFACE_STANDARD, sizeof(GUID)) == sizeof(GUID))
109c2c66affSColin Finck   {
110c2c66affSColin Finck       DPRINT("GUID_ACPI_INTERFACE_STANDARD\n");
111c2c66affSColin Finck 
112c2c66affSColin Finck       if (IrpSp->Parameters.QueryInterface.Size < sizeof(ACPI_INTERFACE_STANDARD))
113c2c66affSColin Finck       {
114c2c66affSColin Finck           DPRINT1("Buffer too small! (%d)\n", IrpSp->Parameters.QueryInterface.Size);
115c2c66affSColin Finck           return STATUS_BUFFER_TOO_SMALL;
116c2c66affSColin Finck       }
117c2c66affSColin Finck 
118c2c66affSColin Finck      AcpiInterface = (PACPI_INTERFACE_STANDARD)IrpSp->Parameters.QueryInterface.Interface;
119c2c66affSColin Finck 
120c2c66affSColin Finck      AcpiInterface->InterfaceReference = AcpiInterfaceReference;
121c2c66affSColin Finck      AcpiInterface->InterfaceDereference = AcpiInterfaceDereference;
122c2c66affSColin Finck      AcpiInterface->GpeConnectVector = AcpiInterfaceConnectVector;
123c2c66affSColin Finck      AcpiInterface->GpeDisconnectVector = AcpiInterfaceDisconnectVector;
124c2c66affSColin Finck      AcpiInterface->GpeEnableEvent = AcpiInterfaceEnableEvent;
125c2c66affSColin Finck      AcpiInterface->GpeDisableEvent = AcpiInterfaceDisableEvent;
126c2c66affSColin Finck      AcpiInterface->GpeClearStatus = AcpiInterfaceClearStatus;
127c2c66affSColin Finck      AcpiInterface->RegisterForDeviceNotifications = AcpiInterfaceNotificationsRegister;
128c2c66affSColin Finck      AcpiInterface->UnregisterForDeviceNotifications = AcpiInterfaceNotificationsUnregister;
129c2c66affSColin Finck 
130c2c66affSColin Finck      return STATUS_SUCCESS;
131c2c66affSColin Finck   }
132c2c66affSColin Finck   else
133c2c66affSColin Finck   {
134c2c66affSColin Finck       DPRINT1("Invalid GUID\n");
135c2c66affSColin Finck       return STATUS_NOT_SUPPORTED;
136c2c66affSColin Finck   }
137c2c66affSColin Finck }
138