ReactOS 0.4.16-dev-319-g6cf4263
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
11typedef 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
26typedef struct _COMMON_DEVICE_DATA
27{
35
36typedef 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
56typedef 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
76typedef struct _EVAL_WORKITEM_DATA
77{
82
83#define FDO_FROM_PDO(pdoData) \
84 ((PFDO_DEVICE_DATA) (pdoData)->ParentFdo->DeviceExtension)
85
86#define INITIALIZE_PNP_STATE(_Data_) \
87 (_Data_).DevicePnPState = NotStarted;\
88 (_Data_).PreviousPnPState = NotStarted;
89
90#define SET_NEW_PNP_STATE(_Data_, _state_) \
91 (_Data_).PreviousPnPState = (_Data_).DevicePnPState;\
92 (_Data_).DevicePnPState = (_state_);
93
94#define RESTORE_PREVIOUS_PNP_STATE(_Data_) \
95 (_Data_).DevicePnPState = (_Data_).PreviousPnPState;\
96
97/* acpienum.c */
98
101 PFDO_DEVICE_DATA DeviceExtension);
102
103CODE_SEG("PAGE")
104WORKER_THREAD_ROUTINE Bus_PDO_EvalMethodWorker;
105
106CODE_SEG("PAGE")
108NTAPI
112
114NTAPI
117 PIRP Irp
118 );
119
120VOID
123 );
124
125PCHAR
128);
129
133 PIRP Irp
134 );
135
137NTAPI
138Bus_PnP (
140 PIRP Irp
141 );
142
144NTAPI
147 PIRP Irp,
149 );
150
151VOID
154 PFDO_DEVICE_DATA FdoData
155 );
156
157
158void
160 PFDO_DEVICE_DATA FdoData
161 );
162
166 PPDO_DEVICE_DATA PdoData
167 );
168
169
173 PIRP Irp,
174 PIO_STACK_LOCATION IrpStack,
176 );
177
178
181 PFDO_DEVICE_DATA FdoData,
182 PIRP Irp );
183
184PCHAR
187 );
188
189PCHAR
192 );
193
196 PFDO_DEVICE_DATA FdoData,
197 PIRP Irp
198 );
199
202 PPDO_DEVICE_DATA PdoData,
203 PIRP Irp
204 );
205
207NTAPI
208Bus_Power (
210 PIRP Irp
211 );
212
213PCHAR
216);
217
218PCHAR
221 );
222
223PCHAR
226 );
227
231 PIRP Irp,
232 PIO_STACK_LOCATION IrpStack,
234 );
235
239 PIRP Irp );
240
244 PIRP Irp );
245
246
250 PIRP Irp );
251
255 PIRP Irp );
256
260 PIRP Irp );
261
265 PIRP Irp );
266
270 PIRP Irp );
271
276 );
277
281 PIRP Irp );
282
287 );
292 );
296 );
297VOID
300 );
301VOID
304 );
305
306/* EOF */
#define CODE_SEG(...)
unsigned char BOOLEAN
Type
Definition: Type.h:7
NTSTATUS Bus_DestroyPdo(PDEVICE_OBJECT Device, PPDO_DEVICE_DATA PdoData)
Definition: pnp.c:390
NTSTATUS Bus_FDO_Power(PFDO_DEVICE_DATA FdoData, PIRP Irp)
Definition: power.c:49
NTSTATUS Bus_PDO_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpStack, PPDO_DEVICE_DATA DeviceData)
Definition: buspdo.c:23
_DEVICE_PNP_STATE
Definition: acpisys.h:11
@ Stopped
Definition: acpisys.h:16
@ NotStarted
Definition: acpisys.h:13
@ RemovalPending
Definition: acpisys.h:17
@ StopPending
Definition: acpisys.h:15
@ UnKnown
Definition: acpisys.h:18
@ Started
Definition: acpisys.h:14
struct _COMMON_DEVICE_DATA * PCOMMON_DEVICE_DATA
NTSTATUS Bus_PDO_Power(PPDO_DEVICE_DATA PdoData, PIRP Irp)
Definition: power.c:116
VOID Bus_InterfaceReference(PVOID Context)
NTSTATUS Bus_PDO_QueryResources(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:802
NTSTATUS NTAPI Bus_CreateClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
LPWSTR ProcessorIdString
Definition: main.c:18
PCHAR DbgSystemPowerString(SYSTEM_POWER_STATE Type)
PCHAR DbgDeviceRelationString(DEVICE_RELATION_TYPE Type)
enum _DEVICE_PNP_STATE DEVICE_PNP_STATE
VOID Bus_InitializePdo(PDEVICE_OBJECT Pdo, PFDO_DEVICE_DATA FdoData)
Definition: pnp.c:417
NTSTATUS Bus_PDO_QueryDeviceRelations(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:1830
NTSTATUS NTAPI Bus_PDO_EvalMethod(_In_ PPDO_DEVICE_DATA DeviceData, _Inout_ PIRP Irp)
Definition: eval.c:796
PCHAR DbgDeviceIDString(BUS_QUERY_ID_TYPE Type)
PCHAR PnPMinorFunctionString(UCHAR MinorFunction)
Definition: fbtpnp.c:1831
void Bus_RemoveFdo(PFDO_DEVICE_DATA FdoData)
PCHAR PowerMinorFunctionString(UCHAR MinorFunction)
BOOLEAN Bus_IsSafetyLockEnabled(PVOID Context)
struct _EVAL_WORKITEM_DATA * PEVAL_WORKITEM_DATA
NTSTATUS Bus_PDO_QueryDeviceText(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:689
BOOLEAN Bus_GetCrispinessLevel(PVOID Context, PUCHAR Level)
NTSTATUS Bus_PDO_QueryDeviceId(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:441
NTSTATUS Bus_PDO_QueryInterface(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: interface.c:94
UNICODE_STRING ProcessorHardwareIds
Definition: main.c:17
VOID Bus_DriverUnload(PDRIVER_OBJECT DriverObject)
VOID Bus_InterfaceDereference(PVOID Context)
struct _FDO_DEVICE_DATA * PFDO_DEVICE_DATA
NTSTATUS Bus_FDO_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp, PIO_STACK_LOCATION IrpStack, PFDO_DEVICE_DATA DeviceData)
Definition: pnp.c:72
BOOLEAN Bus_SetCrispinessLevel(PVOID Context, UCHAR Level)
struct _FDO_DEVICE_DATA FDO_DEVICE_DATA
WORKER_THREAD_ROUTINE Bus_PDO_EvalMethodWorker
Definition: acpisys.h:104
NTSTATUS Bus_SendIrpSynchronously(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:322
NTSTATUS NTAPI Bus_Power(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: power.c:8
struct _PDO_DEVICE_DATA PDO_DEVICE_DATA
NTSTATUS NTAPI Bus_PnP(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: pnp.c:25
PCHAR DbgDevicePowerString(DEVICE_POWER_STATE Type)
struct _EVAL_WORKITEM_DATA EVAL_WORKITEM_DATA
NTSTATUS Bus_PDO_QueryResourceRequirements(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:1309
NTSTATUS Bus_PDO_QueryDeviceCaps(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:327
NTSTATUS ACPIEnumerateDevices(PFDO_DEVICE_DATA DeviceExtension)
Definition: acpienum.c:146
LPWSTR ProcessorNameString
Definition: main.c:19
NTSTATUS Bus_PDO_QueryBusInformation(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:1921
NTSTATUS Bus_GetDeviceCapabilities(PDEVICE_OBJECT DeviceObject, PDEVICE_CAPABILITIES DeviceCapabilities)
Definition: buspdo.c:1969
NTSTATUS NTAPI Bus_CompletionRoutine(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
Definition: pnp.c:369
NTSTATUS Bus_StartFdo(PFDO_DEVICE_DATA FdoData, PIRP Irp)
Definition: pnp.c:267
struct _PDO_DEVICE_DATA * PPDO_DEVICE_DATA
struct _COMMON_DEVICE_DATA COMMON_DEVICE_DATA
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define _Inout_
Definition: no_sal2.h:162
#define _In_
Definition: no_sal2.h:158
enum _DEVICE_POWER_STATE DEVICE_POWER_STATE
enum _SYSTEM_POWER_STATE SYSTEM_POWER_STATE
SYSTEM_POWER_STATE SystemPowerState
Definition: acpisys.h:32
DEVICE_POWER_STATE DevicePowerState
Definition: acpisys.h:33
DEVICE_PNP_STATE DevicePnPState
Definition: acpisys.h:30
DEVICE_PNP_STATE PreviousPnPState
Definition: acpisys.h:31
PDEVICE_OBJECT Self
Definition: acpisys.h:28
WORK_QUEUE_ITEM WorkQueueItem
Definition: acpisys.h:80
PPDO_DEVICE_DATA DeviceData
Definition: acpisys.h:78
COMMON_DEVICE_DATA Common
Definition: acpisys.h:58
FAST_MUTEX Mutex
Definition: acpisys.h:72
PDEVICE_OBJECT NextLowerDriver
Definition: acpisys.h:63
LIST_ENTRY ListOfPDOs
Definition: acpisys.h:66
PDEVICE_OBJECT UnderlyingPDO
Definition: acpisys.h:59
ULONG NumPDOs
Definition: acpisys.h:69
Definition: typedefs.h:120
PWCHAR HardwareIDs
Definition: acpisys.h:44
UNICODE_STRING InterfaceName
Definition: acpisys.h:48
ACPI_HANDLE AcpiHandle
Definition: acpisys.h:39
PDEVICE_OBJECT ParentFdo
Definition: acpisys.h:41
ULONG InterfaceRefCount
Definition: acpisys.h:47
LIST_ENTRY Link
Definition: acpisys.h:46
COMMON_DEVICE_DATA Common
Definition: acpisys.h:38
#define NTAPI
Definition: typedefs.h:36
uint16_t * PWCHAR
Definition: typedefs.h:56
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1699
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:72
#define DeviceCapabilities
Definition: wingdi.h:4449
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
FAST_MUTEX
Definition: extypes.h:17
enum _BUS_QUERY_ID_TYPE BUS_QUERY_ID_TYPE
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
unsigned char UCHAR
Definition: xmlstorage.h:181
WCHAR * LPWSTR
Definition: xmlstorage.h:184