2 * PROJECT: ReactOS ACPI bus driver
3 * FILE: acpi/ospm/include/acpisys.h
4 * PURPOSE: ACPI bus driver definitions
7 extern UNICODE_STRING ProcessorHardwareIds
;
8 extern LPWSTR ProcessorNameString
;
10 typedef enum _DEVICE_PNP_STATE
{
12 NotStarted
= 0, // Not started yet
13 Started
, // Device has received the START_DEVICE IRP
14 StopPending
, // Device has received the QUERY_STOP IRP
15 Stopped
, // Device has received the STOP_DEVICE IRP
16 RemovalPending
, // Device has received the QUERY_REMOVE IRP
17 UnKnown
// Unknown state
22 // A common header for the device extensions of the PDOs and FDO
25 typedef struct _COMMON_DEVICE_DATA
29 DEVICE_PNP_STATE DevicePnPState
;
30 DEVICE_PNP_STATE PreviousPnPState
;
31 SYSTEM_POWER_STATE SystemPowerState
;
32 DEVICE_POWER_STATE DevicePowerState
;
33 } COMMON_DEVICE_DATA
, *PCOMMON_DEVICE_DATA
;
35 typedef struct _PDO_DEVICE_DATA
37 COMMON_DEVICE_DATA Common
;
38 ACPI_HANDLE AcpiHandle
;
39 // A back pointer to the bus
40 PDEVICE_OBJECT ParentFdo
;
41 // An array of (zero terminated wide character strings).
42 // The array itself also null terminated
44 // Link point to hold all the PDOs for a single bus together
46 ULONG InterfaceRefCount
;
47 UNICODE_STRING InterfaceName
;
49 } PDO_DEVICE_DATA
, *PPDO_DEVICE_DATA
;
52 // The device extension of the bus itself. From whence the PDO's are born.
55 typedef struct _FDO_DEVICE_DATA
57 COMMON_DEVICE_DATA Common
;
58 PDEVICE_OBJECT UnderlyingPDO
;
60 // The underlying bus PDO and the actual device object to which our
62 PDEVICE_OBJECT NextLowerDriver
;
64 // List of PDOs created so far
65 LIST_ENTRY ListOfPDOs
;
67 // The PDOs currently enumerated.
70 // A synchronization for access to the device extension.
73 } FDO_DEVICE_DATA
, *PFDO_DEVICE_DATA
;
75 #define FDO_FROM_PDO(pdoData) \
76 ((PFDO_DEVICE_DATA) (pdoData)->ParentFdo->DeviceExtension)
78 #define INITIALIZE_PNP_STATE(_Data_) \
79 (_Data_).DevicePnPState = NotStarted;\
80 (_Data_).PreviousPnPState = NotStarted;
82 #define SET_NEW_PNP_STATE(_Data_, _state_) \
83 (_Data_).PreviousPnPState = (_Data_).DevicePnPState;\
84 (_Data_).DevicePnPState = (_state_);
86 #define RESTORE_PREVIOUS_PNP_STATE(_Data_) \
87 (_Data_).DevicePnPState = (_Data_).PreviousPnPState;\
93 PFDO_DEVICE_DATA DeviceExtension
);
97 Bus_PDO_EvalMethod(PPDO_DEVICE_DATA DeviceData
,
103 PDEVICE_OBJECT DeviceObject
,
109 PDRIVER_OBJECT DriverObject
113 PnPMinorFunctionString (
120 PDRIVER_OBJECT DriverObject
,
121 PDEVICE_OBJECT PhysicalDeviceObject
125 Bus_SendIrpSynchronously (
126 PDEVICE_OBJECT DeviceObject
,
133 PDEVICE_OBJECT DeviceObject
,
139 Bus_CompletionRoutine(
140 PDEVICE_OBJECT DeviceObject
,
148 PFDO_DEVICE_DATA FdoData
154 PFDO_DEVICE_DATA FdoData
159 PDEVICE_OBJECT Device
,
160 PPDO_DEVICE_DATA PdoData
166 PDEVICE_OBJECT DeviceObject
,
168 PIO_STACK_LOCATION IrpStack
,
169 PFDO_DEVICE_DATA DeviceData
175 PFDO_DEVICE_DATA FdoData
,
180 BUS_QUERY_ID_TYPE Type
184 DbgDeviceRelationString(
185 DEVICE_RELATION_TYPE Type
190 PFDO_DEVICE_DATA FdoData
,
196 PPDO_DEVICE_DATA PdoData
,
203 PDEVICE_OBJECT DeviceObject
,
208 PowerMinorFunctionString (
213 DbgSystemPowerString(
214 SYSTEM_POWER_STATE Type
218 DbgDevicePowerString(
219 DEVICE_POWER_STATE Type
224 PDEVICE_OBJECT DeviceObject
,
226 PIO_STACK_LOCATION IrpStack
,
227 PPDO_DEVICE_DATA DeviceData
231 Bus_PDO_QueryDeviceCaps(
232 PPDO_DEVICE_DATA DeviceData
,
236 Bus_PDO_QueryDeviceId(
237 PPDO_DEVICE_DATA DeviceData
,
242 Bus_PDO_QueryDeviceText(
243 PPDO_DEVICE_DATA DeviceData
,
247 Bus_PDO_QueryResources(
248 PPDO_DEVICE_DATA DeviceData
,
252 Bus_PDO_QueryResourceRequirements(
253 PPDO_DEVICE_DATA DeviceData
,
257 Bus_PDO_QueryDeviceRelations(
258 PPDO_DEVICE_DATA DeviceData
,
262 Bus_PDO_QueryBusInformation(
263 PPDO_DEVICE_DATA DeviceData
,
267 Bus_GetDeviceCapabilities(
268 PDEVICE_OBJECT DeviceObject
,
269 PDEVICE_CAPABILITIES DeviceCapabilities
273 Bus_PDO_QueryInterface(
274 PPDO_DEVICE_DATA DeviceData
,
278 Bus_GetCrispinessLevel(
283 Bus_SetCrispinessLevel(
288 Bus_IsSafetyLockEnabled(
292 Bus_InterfaceReference (
296 Bus_InterfaceDereference (