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