reactos/drivers/storage/port/scsiport/power.c
Victor Perevertkin a97c6e0aa9
[SCSIPORT] Make the driver PnP-aware
Basic functions are implemented in order to work in PnP stack,
only legacy (non-pnp) miniport drivers are supported.
Tested mostly with uniata

CORE-17132
2020-12-05 22:28:54 +03:00

41 lines
1.1 KiB
C

/*
* PROJECT: ReactOS Storage Stack / SCSIPORT storage port library
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: PnP power handlers
* COPYRIGHT: Copyright 2016 Thomas Faber <thomas.faber@reactos.org>
*/
#include "scsiport.h"
NTSTATUS
NTAPI
ScsiPortDispatchPower(
_In_ PDEVICE_OBJECT DeviceObject,
_Inout_ PIRP Irp)
{
PSCSI_PORT_COMMON_EXTENSION comExt = DeviceObject->DeviceExtension;
if (comExt->IsFDO)
{
PoStartNextPowerIrp(Irp);
IoSkipCurrentIrpStackLocation(Irp);
return PoCallDriver(comExt->LowerDevice, Irp);
}
else
{
PIO_STACK_LOCATION ioStack = IoGetCurrentIrpStackLocation(Irp);
switch (ioStack->MinorFunction)
{
case IRP_MN_SET_POWER:
case IRP_MN_QUERY_POWER:
Irp->IoStatus.Status = STATUS_SUCCESS;
break;
}
NTSTATUS status = Irp->IoStatus.Status;
PoStartNextPowerIrp(Irp);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return status;
}
}