ReactOS  0.4.14-dev-376-gaedba84
acpisys.h
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS ACPI bus driver
3  * FILE: acpi/ospm/include/acpisys.h
4  * PURPOSE: ACPI bus driver definitions
5  */
6 
10 
11 typedef enum _DEVICE_PNP_STATE {
12 
13  NotStarted = 0, // Not started yet
14  Started, // Device has received the START_DEVICE IRP
15  StopPending, // Device has received the QUERY_STOP IRP
16  Stopped, // Device has received the STOP_DEVICE IRP
17  RemovalPending, // Device has received the QUERY_REMOVE IRP
18  UnKnown // Unknown state
19 
21 
22 //
23 // A common header for the device extensions of the PDOs and FDO
24 //
25 
26 typedef struct _COMMON_DEVICE_DATA
27 {
35 
36 typedef struct _PDO_DEVICE_DATA
37 {
40  // A back pointer to the bus
42  // An array of (zero terminated wide character strings).
43  // The array itself also null terminated
45  // Link point to hold all the PDOs for a single bus together
49 
51 
52 //
53 // The device extension of the bus itself. From whence the PDO's are born.
54 //
55 
56 typedef struct _FDO_DEVICE_DATA
57 {
60 
61  // The underlying bus PDO and the actual device object to which our
62  // FDO is attached
64 
65  // List of PDOs created so far
67 
68  // The PDOs currently enumerated.
70 
71  // A synchronization for access to the device extension.
73 
75 
76 #define FDO_FROM_PDO(pdoData) \
77  ((PFDO_DEVICE_DATA) (pdoData)->ParentFdo->DeviceExtension)
78 
79 #define INITIALIZE_PNP_STATE(_Data_) \
80  (_Data_).DevicePnPState = NotStarted;\
81  (_Data_).PreviousPnPState = NotStarted;
82 
83 #define SET_NEW_PNP_STATE(_Data_, _state_) \
84  (_Data_).PreviousPnPState = (_Data_).DevicePnPState;\
85  (_Data_).DevicePnPState = (_state_);
86 
87 #define RESTORE_PREVIOUS_PNP_STATE(_Data_) \
88  (_Data_).DevicePnPState = (_Data_).PreviousPnPState;\
89 
90 /* acpienum.c */
91 
94  PFDO_DEVICE_DATA DeviceExtension);
95 
97 NTAPI
99  PIRP Irp);
100 
101 NTSTATUS
102 NTAPI
105  PIRP Irp
106  );
107 
108 VOID
111  );
112 
113 PCHAR
116 );
117 
118 NTSTATUS
119 NTAPI
123  );
124 
125 NTSTATUS
128  PIRP Irp
129  );
130 
131 NTSTATUS
132 NTAPI
133 Bus_PnP (
135  PIRP Irp
136  );
137 
138 NTSTATUS
139 NTAPI
142  PIRP Irp,
143  PVOID Context
144  );
145 
146 VOID
149  PFDO_DEVICE_DATA FdoData
150  );
151 
152 
153 void
155  PFDO_DEVICE_DATA FdoData
156  );
157 
158 NTSTATUS
161  PPDO_DEVICE_DATA PdoData
162  );
163 
164 
165 NTSTATUS
166 Bus_FDO_PnP (
168  PIRP Irp,
169  PIO_STACK_LOCATION IrpStack,
171  );
172 
173 
174 NTSTATUS
175 Bus_StartFdo (
176  PFDO_DEVICE_DATA FdoData,
177  PIRP Irp );
178 
179 PCHAR
182  );
183 
184 PCHAR
187  );
188 
189 NTSTATUS
191  PFDO_DEVICE_DATA FdoData,
192  PIRP Irp
193  );
194 
195 NTSTATUS
197  PPDO_DEVICE_DATA PdoData,
198  PIRP Irp
199  );
200 
201 NTSTATUS
202 NTAPI
203 Bus_Power (
205  PIRP Irp
206  );
207 
208 PCHAR
211 );
212 
213 PCHAR
216  );
217 
218 PCHAR
221  );
222 
223 NTSTATUS
224 Bus_PDO_PnP (
226  PIRP Irp,
227  PIO_STACK_LOCATION IrpStack,
229  );
230 
231 NTSTATUS
234  PIRP Irp );
235 
236 NTSTATUS
239  PIRP Irp );
240 
241 
242 NTSTATUS
245  PIRP Irp );
246 
247 NTSTATUS
250  PIRP Irp );
251 
252 NTSTATUS
255  PIRP Irp );
256 
257 NTSTATUS
260  PIRP Irp );
261 
262 NTSTATUS
265  PIRP Irp );
266 
267 NTSTATUS
271  );
272 
273 NTSTATUS
276  PIRP Irp );
277 
278 BOOLEAN
280  PVOID Context,
281  PUCHAR Level
282  );
283 BOOLEAN
285  PVOID Context,
286  UCHAR Level
287  );
288 BOOLEAN
290  PVOID Context
291  );
292 VOID
294  PVOID Context
295  );
296 VOID
298  PVOID Context
299  );
300 
301 /* EOF */
signed char * PCHAR
Definition: retypes.h:7
NTSTATUS Bus_PDO_QueryResources(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:793
DEVICE_POWER_STATE DevicePowerState
Definition: acpisys.h:33
NTSTATUS Bus_PDO_Power(PPDO_DEVICE_DATA PdoData, PIRP Irp)
Definition: power.c:116
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
void Bus_RemoveFdo(PFDO_DEVICE_DATA FdoData)
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
Type
Definition: Type.h:6
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
_In_ PIRP Irp
Definition: csq.h:116
PCHAR PnPMinorFunctionString(UCHAR MinorFunction)
Definition: fbtpnp.c:1831
DEVICE_PNP_STATE PreviousPnPState
Definition: acpisys.h:31
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN Bus_GetCrispinessLevel(PVOID Context, PUCHAR Level)
NTSTATUS NTAPI Bus_AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT PhysicalDeviceObject)
Definition: main.c:31
UNICODE_STRING InterfaceName
Definition: acpisys.h:48
NTSTATUS Bus_PDO_QueryDeviceRelations(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:1800
NTSTATUS NTAPI Bus_Power(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: power.c:8
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
NTSTATUS Bus_PDO_QueryResourceRequirements(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:1299
uint16_t * PWCHAR
Definition: typedefs.h:54
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1122
NTSTATUS Bus_PDO_QueryBusInformation(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:1891
VOID Bus_DriverUnload(PDRIVER_OBJECT DriverObject)
NTSTATUS Bus_SendIrpSynchronously(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:322
PDEVICE_OBJECT UnderlyingPDO
Definition: acpisys.h:59
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
NTSTATUS ACPIEnumerateDevices(PFDO_DEVICE_DATA DeviceExtension)
Definition: acpienum.c:146
_DEVICE_PNP_STATE
Definition: acpisys.h:11
PDEVICE_OBJECT Self
Definition: acpisys.h:28
VOID Bus_InterfaceDereference(PVOID Context)
NTSTATUS Bus_PDO_QueryDeviceText(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:680
struct _COMMON_DEVICE_DATA COMMON_DEVICE_DATA
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
struct _COMMON_DEVICE_DATA * PCOMMON_DEVICE_DATA
SYSTEM_POWER_STATE SystemPowerState
Definition: acpisys.h:32
FAST_MUTEX Mutex
Definition: acpisys.h:72
PWCHAR HardwareIDs
Definition: acpisys.h:44
BOOLEAN Bus_IsSafetyLockEnabled(PVOID Context)
unsigned char BOOLEAN
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define DeviceCapabilities
Definition: wingdi.h:4444
NTSTATUS Bus_GetDeviceCapabilities(PDEVICE_OBJECT DeviceObject, PDEVICE_CAPABILITIES DeviceCapabilities)
Definition: buspdo.c:1939
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
LIST_ENTRY ListOfPDOs
Definition: acpisys.h:66
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
FAST_MUTEX
Definition: extypes.h:17
struct _PDO_DEVICE_DATA * PPDO_DEVICE_DATA
LPWSTR ProcessorIdString
Definition: main.c:25
NTSTATUS Bus_FDO_Power(PFDO_DEVICE_DATA FdoData, PIRP Irp)
Definition: power.c:49
DEVICE_PNP_STATE DevicePnPState
Definition: acpisys.h:30
VOID Bus_InterfaceReference(PVOID Context)
NTSTATUS Bus_PDO_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpStack, PPDO_DEVICE_DATA DeviceData)
Definition: buspdo.c:22
NTSTATUS Bus_StartFdo(PFDO_DEVICE_DATA FdoData, PIRP Irp)
Definition: pnp.c:267
unsigned char UCHAR
Definition: xmlstorage.h:181
LPWSTR ProcessorNameString
Definition: main.c:26
COMMON_DEVICE_DATA Common
Definition: acpisys.h:58
Definition: typedefs.h:117
BOOLEAN Bus_SetCrispinessLevel(PVOID Context, UCHAR Level)
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
* PDEVICE_CAPABILITIES
Definition: iotypes.h:928
PCHAR DbgSystemPowerString(SYSTEM_POWER_STATE Type)
NTSTATUS Bus_FDO_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpStack, PFDO_DEVICE_DATA DeviceData)
Definition: pnp.c:72
NTSTATUS Bus_DestroyPdo(PDEVICE_OBJECT Device, PPDO_DEVICE_DATA PdoData)
Definition: pnp.c:390
struct _FDO_DEVICE_DATA * PFDO_DEVICE_DATA
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSTATUS Bus_PDO_QueryDeviceId(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:432
PDEVICE_OBJECT ParentFdo
Definition: acpisys.h:41
ULONG NumPDOs
Definition: acpisys.h:69
ACPI_HANDLE AcpiHandle
Definition: acpisys.h:39
NTSTATUS NTAPI Bus_CompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
Definition: pnp.c:369
NTSTATUS NTAPI Bus_PDO_EvalMethod(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: eval.c:85
UNICODE_STRING ProcessorHardwareIds
Definition: main.c:24
struct _FDO_DEVICE_DATA FDO_DEVICE_DATA
PCHAR DbgDeviceIDString(BUS_QUERY_ID_TYPE Type)
NTSTATUS NTAPI Bus_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:25
PDEVICE_OBJECT NextLowerDriver
Definition: acpisys.h:63
PCHAR PowerMinorFunctionString(UCHAR MinorFunction)
ULONG InterfaceRefCount
Definition: acpisys.h:47
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS Bus_PDO_QueryInterface(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: interface.c:94
VOID Bus_InitializePdo(PDEVICE_OBJECT Pdo, PFDO_DEVICE_DATA FdoData)
Definition: pnp.c:417
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LIST_ENTRY Link
Definition: acpisys.h:46
enum _DEVICE_PNP_STATE DEVICE_PNP_STATE
struct _PDO_DEVICE_DATA PDO_DEVICE_DATA
PCHAR DbgDeviceRelationString(DEVICE_RELATION_TYPE Type)
NTSTATUS NTAPI Bus_CreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
COMMON_DEVICE_DATA Common
Definition: acpisys.h:38
PCHAR DbgDevicePowerString(DEVICE_POWER_STATE Type)
NTSTATUS Bus_PDO_QueryDeviceCaps(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:318