1 /* $Id: pdo.c,v 1.2 2003/11/14 17:13:23 weiden Exp $
3 * PROJECT: ReactOS ACPI bus driver
4 * FILE: acpi/ospm/pdo.c
5 * PURPOSE: Child device object dispatch routines
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
8 * 08-08-2001 CSH Created
17 /*** PRIVATE *****************************************************************/
21 IN PDEVICE_OBJECT DeviceObject
,
23 PIO_STACK_LOCATION IrpSp
)
25 PPDO_DEVICE_EXTENSION DeviceExtension
;
30 DeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
32 // Irp->IoStatus.Information = 0;
34 switch (IrpSp
->Parameters
.QueryId
.IdType
) {
35 case BusQueryDeviceID
:
38 case BusQueryHardwareIDs
:
39 case BusQueryCompatibleIDs
:
40 case BusQueryInstanceID
:
41 case BusQueryDeviceSerialNumber
:
43 Status
= STATUS_NOT_IMPLEMENTED
;
52 IN PDEVICE_OBJECT DeviceObject
,
54 PIO_STACK_LOCATION IrpSp
)
56 PPDO_DEVICE_EXTENSION DeviceExtension
;
61 DeviceExtension
= (PPDO_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
;
63 if (IrpSp
->Parameters
.Power
.Type
== DevicePowerState
) {
64 Status
= STATUS_SUCCESS
;
65 switch (IrpSp
->Parameters
.Power
.State
.SystemState
) {
67 Status
= STATUS_UNSUCCESSFUL
;
70 Status
= STATUS_UNSUCCESSFUL
;
77 /*** PUBLIC ******************************************************************/
82 PDEVICE_OBJECT DeviceObject
,
85 * FUNCTION: Handle Plug and Play IRPs for the child device
87 * DeviceObject = Pointer to physical device object of the child device
88 * Irp = Pointer to IRP that should be handled
93 PIO_STACK_LOCATION IrpSp
;
98 Status
= Irp
->IoStatus
.Status
;
100 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
102 switch (IrpSp
->MinorFunction
) {
103 case IRP_MN_CANCEL_REMOVE_DEVICE
:
106 case IRP_MN_CANCEL_STOP_DEVICE
:
109 case IRP_MN_DEVICE_USAGE_NOTIFICATION
:
115 case IRP_MN_QUERY_BUS_INFORMATION
:
118 case IRP_MN_QUERY_CAPABILITIES
:
121 case IRP_MN_QUERY_DEVICE_RELATIONS
:
122 /* FIXME: Possibly handle for RemovalRelations */
125 case IRP_MN_QUERY_DEVICE_TEXT
:
128 case IRP_MN_QUERY_ID
:
131 case IRP_MN_QUERY_PNP_DEVICE_STATE
:
134 case IRP_MN_QUERY_REMOVE_DEVICE
:
137 case IRP_MN_QUERY_RESOURCE_REQUIREMENTS
:
140 case IRP_MN_QUERY_RESOURCES
:
143 case IRP_MN_QUERY_STOP_DEVICE
:
146 case IRP_MN_REMOVE_DEVICE
:
149 case IRP_MN_SET_LOCK
:
152 case IRP_MN_START_DEVICE
:
155 case IRP_MN_STOP_DEVICE
:
158 case IRP_MN_SURPRISE_REMOVAL
:
162 DPRINT("Unknown IOCTL 0x%X\n", IrpSp
->MinorFunction
);
166 if (Status
!= STATUS_PENDING
) {
167 Irp
->IoStatus
.Status
= Status
;
168 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
171 DPRINT("Leaving. Status 0x%X\n", Status
);
179 PDEVICE_OBJECT DeviceObject
,
182 * FUNCTION: Handle power management IRPs for the child device
184 * DeviceObject = Pointer to physical device object of the child device
185 * Irp = Pointer to IRP that should be handled
190 PIO_STACK_LOCATION IrpSp
;
195 IrpSp
= IoGetCurrentIrpStackLocation(Irp
);
197 switch (IrpSp
->MinorFunction
) {
198 case IRP_MN_SET_POWER
:
199 Status
= PdoSetPower(DeviceObject
, Irp
, IrpSp
);
203 DPRINT("Unknown IOCTL 0x%X\n", IrpSp
->MinorFunction
);
204 Status
= STATUS_NOT_IMPLEMENTED
;
208 if (Status
!= STATUS_PENDING
) {
209 Irp
->IoStatus
.Status
= Status
;
210 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);
213 DPRINT("Leaving. Status 0x%X\n", Status
);