2010-04-07 20:19:29 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS ISA PnP Bus driver
|
|
|
|
* FILE: fdo.c
|
|
|
|
* PURPOSE: FDO-specific code
|
|
|
|
* PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
|
2020-03-21 22:08:00 +00:00
|
|
|
* Hervé Poussineau
|
2010-04-07 20:19:29 +00:00
|
|
|
*/
|
2014-02-06 11:18:34 +00:00
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
#include <isapnp.h>
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaFdoStartDevice(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_FDO_EXTENSION FdoExt,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IrpSp)
|
2010-04-07 20:19:29 +00:00
|
|
|
{
|
2020-03-20 18:19:30 +00:00
|
|
|
UNREFERENCED_PARAMETER(Irp);
|
|
|
|
UNREFERENCED_PARAMETER(IrpSp);
|
2013-05-09 14:06:21 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
FdoExt->Common.State = dsStarted;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
return STATUS_SUCCESS;
|
2010-04-07 20:19:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaFdoQueryDeviceRelations(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_FDO_EXTENSION FdoExt,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IrpSp)
|
2010-04-07 20:19:29 +00:00
|
|
|
{
|
2020-03-20 18:19:30 +00:00
|
|
|
if (IrpSp->Parameters.QueryDeviceRelations.Type != BusRelations)
|
|
|
|
return Irp->IoStatus.Status;
|
|
|
|
|
2020-03-16 18:24:07 +00:00
|
|
|
return IsaPnpFillDeviceRelations(FdoExt, Irp, TRUE);
|
2010-04-07 20:19:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
IsaFdoPnp(
|
2020-03-20 18:19:30 +00:00
|
|
|
IN PISAPNP_FDO_EXTENSION FdoExt,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IrpSp)
|
2010-04-07 20:19:29 +00:00
|
|
|
{
|
2020-03-20 18:19:30 +00:00
|
|
|
NTSTATUS Status = Irp->IoStatus.Status;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
switch (IrpSp->MinorFunction)
|
|
|
|
{
|
|
|
|
case IRP_MN_START_DEVICE:
|
|
|
|
Status = IsaForwardIrpSynchronous(FdoExt, Irp);
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
if (NT_SUCCESS(Status))
|
|
|
|
Status = IsaFdoStartDevice(FdoExt, Irp, IrpSp);
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
Irp->IoStatus.Status = Status;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
|
|
return Status;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
case IRP_MN_STOP_DEVICE:
|
|
|
|
FdoExt->Common.State = dsStopped;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
Status = STATUS_SUCCESS;
|
|
|
|
break;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
|
|
|
Status = IsaFdoQueryDeviceRelations(FdoExt, Irp, IrpSp);
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
Irp->IoStatus.Status = Status;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
|
|
return Status;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
case IRP_MN_FILTER_RESOURCE_REQUIREMENTS:
|
|
|
|
DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
|
|
|
|
break;
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
default:
|
|
|
|
DPRINT1("Unknown PnP code: %x\n", IrpSp->MinorFunction);
|
|
|
|
break;
|
|
|
|
}
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2020-03-20 18:19:30 +00:00
|
|
|
return IoCallDriver(FdoExt->Ldo, Irp);
|
2010-04-07 20:19:29 +00:00
|
|
|
}
|