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;
26 ACPI_STATUS AcpiStatus;
31 DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
33 // Irp->IoStatus.Information = 0;
35 switch (IrpSp->Parameters.QueryId.IdType) {
36 case BusQueryDeviceID:
39 case BusQueryHardwareIDs:
40 case BusQueryCompatibleIDs:
41 case BusQueryInstanceID:
42 case BusQueryDeviceSerialNumber:
44 Status = STATUS_NOT_IMPLEMENTED;
53 IN PDEVICE_OBJECT DeviceObject,
55 PIO_STACK_LOCATION IrpSp)
57 PPDO_DEVICE_EXTENSION DeviceExtension;
58 ACPI_STATUS AcpiStatus;
64 DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
66 if (IrpSp->Parameters.Power.Type == DevicePowerState) {
67 Status = STATUS_SUCCESS;
68 switch (IrpSp->Parameters.Power.State.SystemState) {
70 Status = STATUS_UNSUCCESSFUL;
73 Status = STATUS_UNSUCCESSFUL;
80 /*** PUBLIC ******************************************************************/
85 PDEVICE_OBJECT DeviceObject,
88 * FUNCTION: Handle Plug and Play IRPs for the child device
90 * DeviceObject = Pointer to physical device object of the child device
91 * Irp = Pointer to IRP that should be handled
96 PIO_STACK_LOCATION IrpSp;
101 Status = Irp->IoStatus.Status;
103 IrpSp = IoGetCurrentIrpStackLocation(Irp);
105 switch (IrpSp->MinorFunction) {
106 case IRP_MN_CANCEL_REMOVE_DEVICE:
109 case IRP_MN_CANCEL_STOP_DEVICE:
112 case IRP_MN_DEVICE_USAGE_NOTIFICATION:
118 case IRP_MN_QUERY_BUS_INFORMATION:
121 case IRP_MN_QUERY_CAPABILITIES:
124 case IRP_MN_QUERY_DEVICE_RELATIONS:
125 /* FIXME: Possibly handle for RemovalRelations */
128 case IRP_MN_QUERY_DEVICE_TEXT:
131 case IRP_MN_QUERY_ID:
134 case IRP_MN_QUERY_PNP_DEVICE_STATE:
137 case IRP_MN_QUERY_REMOVE_DEVICE:
140 case IRP_MN_QUERY_RESOURCE_REQUIREMENTS:
143 case IRP_MN_QUERY_RESOURCES:
146 case IRP_MN_QUERY_STOP_DEVICE:
149 case IRP_MN_REMOVE_DEVICE:
152 case IRP_MN_SET_LOCK:
155 case IRP_MN_START_DEVICE:
158 case IRP_MN_STOP_DEVICE:
161 case IRP_MN_SURPRISE_REMOVAL:
165 DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction);
169 if (Status != STATUS_PENDING) {
170 Irp->IoStatus.Status = Status;
171 IoCompleteRequest(Irp, IO_NO_INCREMENT);
174 DPRINT("Leaving. Status 0x%X\n", Status);
182 PDEVICE_OBJECT DeviceObject,
185 * FUNCTION: Handle power management IRPs for the child device
187 * DeviceObject = Pointer to physical device object of the child device
188 * Irp = Pointer to IRP that should be handled
193 PIO_STACK_LOCATION IrpSp;
198 IrpSp = IoGetCurrentIrpStackLocation(Irp);
200 switch (IrpSp->MinorFunction) {
201 case IRP_MN_SET_POWER:
202 Status = PdoSetPower(DeviceObject, Irp, IrpSp);
206 DPRINT("Unknown IOCTL 0x%X\n", IrpSp->MinorFunction);
207 Status = STATUS_NOT_IMPLEMENTED;
211 if (Status != STATUS_PENDING) {
212 Irp->IoStatus.Status = Status;
213 IoCompleteRequest(Irp, IO_NO_INCREMENT);
216 DPRINT("Leaving. Status 0x%X\n", Status);