mirror of
https://github.com/reactos/reactos.git
synced 2024-08-05 11:00:55 +00:00
[ACPI]
- Handle IRP_MN_CANCEL_REMOVE_DEVICE, IRP_MN_QUERY_REMOVE_DEVICE, and IRP_MN_REMOVE_DEVICE for child devices - Fixes issues loading new drivers for ACPI-enumerated devices svn path=/trunk/; revision=63349
This commit is contained in:
parent
0a83347ad4
commit
abcd548308
|
@ -165,6 +165,42 @@ Bus_PDO_PnP (
|
||||||
}
|
}
|
||||||
status = STATUS_SUCCESS;// We must not fail this IRP.
|
status = STATUS_SUCCESS;// We must not fail this IRP.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IRP_MN_REMOVE_DEVICE:
|
||||||
|
//
|
||||||
|
// We handle REMOVE_DEVICE just like STOP_DEVICE. This is because
|
||||||
|
// the device is still physically present (or at least we don't know any better)
|
||||||
|
// so we have to retain the PDO after stopping and removing power from it.
|
||||||
|
//
|
||||||
|
if (DeviceData->InterfaceName.Length != 0)
|
||||||
|
IoSetDeviceInterfaceState(&DeviceData->InterfaceName, FALSE);
|
||||||
|
|
||||||
|
if (DeviceData->AcpiHandle && acpi_bus_power_manageable(DeviceData->AcpiHandle) &&
|
||||||
|
!ACPI_SUCCESS(acpi_bus_set_power(DeviceData->AcpiHandle, ACPI_STATE_D3)))
|
||||||
|
{
|
||||||
|
DPRINT1("Device %x failed to enter D3!\n", DeviceData->AcpiHandle);
|
||||||
|
state.DeviceState = PowerDeviceD3;
|
||||||
|
PoSetPowerState(DeviceData->Common.Self, DevicePowerState, state);
|
||||||
|
DeviceData->Common.DevicePowerState = PowerDeviceD3;
|
||||||
|
}
|
||||||
|
|
||||||
|
SET_NEW_PNP_STATE(DeviceData->Common, Stopped);
|
||||||
|
status = STATUS_SUCCESS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IRP_MN_QUERY_REMOVE_DEVICE:
|
||||||
|
SET_NEW_PNP_STATE(DeviceData->Common, RemovalPending);
|
||||||
|
status = STATUS_SUCCESS;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||||
|
if (RemovalPending == DeviceData->Common.DevicePnPState)
|
||||||
|
{
|
||||||
|
RESTORE_PREVIOUS_PNP_STATE(DeviceData->Common);
|
||||||
|
}
|
||||||
|
status = STATUS_SUCCESS;
|
||||||
|
break;
|
||||||
|
|
||||||
case IRP_MN_QUERY_CAPABILITIES:
|
case IRP_MN_QUERY_CAPABILITIES:
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,6 +13,7 @@ typedef enum _DEVICE_PNP_STATE {
|
||||||
Started, // Device has received the START_DEVICE IRP
|
Started, // Device has received the START_DEVICE IRP
|
||||||
StopPending, // Device has received the QUERY_STOP IRP
|
StopPending, // Device has received the QUERY_STOP IRP
|
||||||
Stopped, // Device has received the STOP_DEVICE IRP
|
Stopped, // Device has received the STOP_DEVICE IRP
|
||||||
|
RemovalPending, // Device has received the QUERY_REMOVE IRP
|
||||||
UnKnown // Unknown state
|
UnKnown // Unknown state
|
||||||
|
|
||||||
} DEVICE_PNP_STATE;
|
} DEVICE_PNP_STATE;
|
||||||
|
|
Loading…
Reference in a new issue