From 23b4ebaf890f907a76f406fa5c8971b64a1c9b53 Mon Sep 17 00:00:00 2001 From: evb Date: Wed, 30 Jun 2010 01:39:21 +0000 Subject: [PATCH] Implemented IRP dispatch to work in new PCI driver (PciDispatchIrp), fill out FDO IRP handlers which all stubs now, make up/down-call work (PciPassIrpFromFdoToPdo, PciPassDownIrp) Added the helper debug routines PCI driver receive IRP_QUERY_INTERFACE now and hit stub svn path=/trunk/; revision=47912 --- reactos/drivers/bus/pcix/debug.c | 165 ++++++++++++++++++++ reactos/drivers/bus/pcix/dispatch.c | 233 +++++++++++++++++++++++++++- reactos/drivers/bus/pcix/fdo.c | 175 +++++++++++++++++++-- reactos/drivers/bus/pcix/init.c | 2 +- reactos/drivers/bus/pcix/pci.h | 142 +++++++++++++++++ reactos/drivers/bus/pcix/power.c | 33 ++++ 6 files changed, 729 insertions(+), 21 deletions(-) diff --git a/reactos/drivers/bus/pcix/debug.c b/reactos/drivers/bus/pcix/debug.c index 2185b02482a..0b61df2cacc 100644 --- a/reactos/drivers/bus/pcix/debug.c +++ b/reactos/drivers/bus/pcix/debug.c @@ -14,6 +14,171 @@ /* GLOBALS ********************************************************************/ +PCHAR PnpCodes[] = +{ + "START_DEVICE", + "QUERY_REMOVE_DEVICE", + "REMOVE_DEVICE", + "CANCEL_REMOVE_DEVICE", + "STOP_DEVICE", + "QUERY_STOP_DEVICE", + "CANCEL_STOP_DEVICE", + "QUERY_DEVICE_RELATIONS", + "QUERY_INTERFACE", + "QUERY_CAPABILITIES", + "QUERY_RESOURCES", + "QUERY_RESOURCE_REQUIREMENTS", + "QUERY_DEVICE_TEXT", + "FILTER_RESOURCE_REQUIREMENTS", + "** UNKNOWN PNP IRP Minor Code **", + "READ_CONFIG", + "WRITE_CONFIG", + "EJECT", + "SET_LOCK", + "QUERY_ID", + "QUERY_PNP_DEVICE_STATE", + "QUERY_BUS_INFORMATION", + "DEVICE_USAGE_NOTIFICATION" +}; + +PCHAR PoCodes[] = +{ + "WAIT_WAKE", + "POWER_SEQUENCE", + "SET_POWER", + "QUERY_POWER", +}; + +ULONG PciBreakOnPdoPowerIrp, PciBreakOnFdoPowerIrp; +ULONG PciBreakOnPdoPnpIrp, PciBreakOnFdoPnpIrp; + /* FUNCTIONS ******************************************************************/ +PCHAR +NTAPI +PciDebugPnpIrpTypeToText(IN USHORT MinorFunction) +{ + PCHAR Text; + + /* Catch invalid code */ + if (MinorFunction >= IRP_MN_SURPRISE_REMOVAL) + { + /* New version of Windows? Or driver bug */ + Text = "** UNKNOWN PNP IRP Minor Code **"; + } + else + { + /* Get the right text for it */ + Text = PnpCodes[MinorFunction]; + } + + /* Return the symbolic name for the IRP */ + return Text; +} + +PCHAR +NTAPI +PciDebugPoIrpTypeToText(IN USHORT MinorFunction) +{ + PCHAR Text; + + /* Catch invalid code */ + if (MinorFunction >= IRP_MN_QUERY_POWER) + { + /* New version of Windows? Or driver bug */ + Text = "** UNKNOWN PO IRP Minor Code **"; + } + else + { + /* Get the right text for it */ + Text = PoCodes[MinorFunction]; + } + + /* Return the symbolic name for the IRP */ + return Text; +} + +BOOLEAN +NTAPI +PciDebugIrpDispatchDisplay(IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension, + IN USHORT MaxMinor) +{ + //PPCI_PDO_EXTENSION PdoDeviceExtension; + ULONG BreakMask, DebugLevel = 0; + PCHAR IrpString; + + /* Only two functions are recognized */ + switch (IoStackLocation->MajorFunction) + { + case IRP_MJ_POWER: + + /* Get the string and the correct break mask for the extension */ + BreakMask = (DeviceExtension->ExtensionType == PciPdoExtensionType) ? + PciBreakOnPdoPowerIrp : PciBreakOnFdoPowerIrp; + IrpString = PciDebugPoIrpTypeToText(IoStackLocation->MinorFunction); + break; + + case IRP_MJ_PNP: + + /* Get the string and the correct break mask for the extension */ + BreakMask = (DeviceExtension->ExtensionType == PciFdoExtensionType) ? + PciBreakOnPdoPnpIrp : PciBreakOnFdoPnpIrp; + IrpString = PciDebugPnpIrpTypeToText(IoStackLocation->MinorFunction); + break; + + default: + + /* Other functions are not decoded */ + BreakMask = FALSE; + IrpString = ""; + break; + } + + /* Check if this is a PDO */ + if (DeviceExtension->ExtensionType == PciPdoExtensionType) + { + /* Choose the correct debug level based on which function this is */ + if (IoStackLocation->MajorFunction == IRP_MJ_POWER) + { + DebugLevel = 0x500; + } + else if (IoStackLocation->MajorFunction == IRP_MJ_PNP) + { + DebugLevel = 0x200; + } +#if 0 // after commit PDO support + /* For a PDO, print out the bus, device, and function number */ + PdoDeviceExtension = (PVOID)DeviceExtension; + DPRINT1("PDO(b=0x%x, d=0x%x, f=0x%x)<-%s\n", + PdoDeviceExtension->ParentFdoExtension->BaseBus, + PdoDeviceExtension->Slot.u.bits.DeviceNumber, + PdoDeviceExtension->Slot.u.bits.FunctionNumber, + IrpString); +#endif + } + else if (DeviceExtension->ExtensionType == PciFdoExtensionType) + { + /* Choose the correct debug level based on which function this is */ + if (IoStackLocation->MajorFunction == IRP_MJ_POWER) + { + DebugLevel = 0x400; + } + else if (IoStackLocation->MajorFunction == IRP_MJ_PNP) + { + DebugLevel = 0x100; + } + + /* For an FDO, just dump the extension pointer and IRP string */ + DPRINT1("FDO(%x)<-%s\n", DeviceExtension, IrpString); + } + + /* If the function is illegal for this extension, complain */ + if (IoStackLocation->MinorFunction > MaxMinor) + DPRINT1("Unknown IRP, minor = 0x%x\n", IoStackLocation->MinorFunction); + + /* Return whether or not the debugger should be broken into for this IRP */ + return ((1 << IoStackLocation->MinorFunction) & BreakMask); +} + /* EOF */ diff --git a/reactos/drivers/bus/pcix/dispatch.c b/reactos/drivers/bus/pcix/dispatch.c index dd40f1063cc..c30322d6603 100644 --- a/reactos/drivers/bus/pcix/dispatch.c +++ b/reactos/drivers/bus/pcix/dispatch.c @@ -16,15 +16,240 @@ /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PciSetEventCompletion(IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PVOID Context) +{ + PKEVENT Event = (PVOID)Context; + ASSERT(Event); + + /* Set the event and return the appropriate status code */ + KeSetEvent(Event, FALSE, IO_NO_INCREMENT); + return STATUS_MORE_PROCESSING_REQUIRED; +} + +NTSTATUS +NTAPI +PciCallDownIrpStack(IN PPCI_FDO_EXTENSION DeviceExtension, + IN PIRP Irp) +{ + NTSTATUS Status; + KEVENT Event; + PAGED_CODE(); + DPRINT1("PciCallDownIrpStack ...\n"); + ASSERT_FDO(DeviceExtension); + + /* Initialize the wait event */ + KeInitializeEvent(&Event, SynchronizationEvent, 0); + + /* Setup a completion routine */ + IoCopyCurrentIrpStackLocationToNext(Irp); + IoSetCompletionRoutine(Irp, PciSetEventCompletion, &Event, TRUE, TRUE, TRUE); + + /* Call the attached device */ + Status = IofCallDriver(DeviceExtension->AttachedDeviceObject, Irp); + if (Status == STATUS_PENDING) + { + /* Wait for it to complete the request, and get its status */ + KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); + Status = Irp->IoStatus.Status; + } + + /* Return that status back to the caller */ + return Status; +} + +NTSTATUS +NTAPI +PciPassIrpFromFdoToPdo(IN PPCI_FDO_EXTENSION DeviceExtension, + IN PIRP Irp) +{ + PIO_STACK_LOCATION IoStackLocation; + NTSTATUS Status; + DPRINT1("Pci PassIrp ...\n"); + + /* Get the stack location to check which function this is */ + IoStackLocation = IoGetCurrentIrpStackLocation(Irp); + if (IoStackLocation->MajorFunction == IRP_MJ_POWER) + { + /* Power IRPs are special since we have to notify the Power Manager */ + IoCopyCurrentIrpStackLocationToNext(Irp); + PoStartNextPowerIrp(Irp); + Status = PoCallDriver(DeviceExtension->AttachedDeviceObject, Irp); + } + else + { + /* For a normal IRP, just call the next driver in the stack */ + IoSkipCurrentIrpStackLocation(Irp); + Status = IofCallDriver(DeviceExtension->AttachedDeviceObject, Irp); + } + + /* Return the status back to the caller */ + return Status; +} + NTSTATUS NTAPI PciDispatchIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - /* This function is not yet implemented */ - UNIMPLEMENTED; - while (TRUE); - return STATUS_SUCCESS; + PPCI_FDO_EXTENSION DeviceExtension; + PIO_STACK_LOCATION IoStackLocation; + PPCI_MJ_DISPATCH_TABLE IrpDispatchTable; + BOOLEAN PassToPdo; + NTSTATUS Status; + PPCI_MN_DISPATCH_TABLE TableArray = NULL, Table; + USHORT MaxMinor; + PCI_DISPATCH_STYLE DispatchStyle; + PCI_DISPATCH_FUNCTION DispatchFunction; + DPRINT1("PCI: Dispatch IRP\n"); + + /* Get the extension and I/O stack location for this IRP */ + DeviceExtension = (PPCI_FDO_EXTENSION)DeviceObject->DeviceExtension; + IoStackLocation = IoGetCurrentIrpStackLocation(Irp); + ASSERT((DeviceExtension->ExtensionType == PciPdoExtensionType) || + (DeviceExtension->ExtensionType == PciFdoExtensionType)); + + /* Deleted extensions don't respond to IRPs */ + if (DeviceExtension->DeviceState == PciDeleted) + { + /* Fail this IRP */ + Status = STATUS_NO_SUCH_DEVICE; + PassToPdo = FALSE; + } + else + { + /* Otherwise, get the dispatch table for the extension */ + IrpDispatchTable = DeviceExtension->IrpDispatchTable; + + /* And choose which function table to use */ + switch (IoStackLocation->MajorFunction) + { + case IRP_MJ_POWER: + + /* Power Manager IRPs */ + TableArray = IrpDispatchTable->PowerIrpDispatchTable; + MaxMinor = IrpDispatchTable->PowerIrpMaximumMinorFunction; + break; + + case IRP_MJ_PNP: + + /* Plug-and-Play Manager IRPs */ + TableArray = IrpDispatchTable->PnpIrpDispatchTable; + MaxMinor = IrpDispatchTable->PnpIrpMaximumMinorFunction; + break; + + case IRP_MJ_SYSTEM_CONTROL: + + /* WMI IRPs */ + DispatchFunction = IrpDispatchTable->SystemControlIrpDispatchFunction; + DispatchStyle = IrpDispatchTable->SystemControlIrpDispatchStyle; + MaxMinor = -1; + break; + + default: + + /* Unrecognized IRPs */ + DispatchFunction = IrpDispatchTable->OtherIrpDispatchFunction; + DispatchStyle = IrpDispatchTable->OtherIrpDispatchStyle; + MaxMinor = -1; + break; + } + + /* Only deal with recognized IRPs */ + if (MaxMinor != -1) + { + /* Make sure the function is recognized */ + if (IoStackLocation->MinorFunction > MaxMinor) + { + /* Pick the terminator, which should return unrecognized */ + Table = &TableArray[MaxMinor + 1]; + } + else + { + /* Pick the appropriate table for this function */ + Table = &TableArray[IoStackLocation->MinorFunction]; + } + + /* From that table, get the function code and dispatch style */ + DispatchStyle = Table->DispatchStyle; + DispatchFunction = Table->DispatchFunction; + } + + /* Print out debugging information, and see if we should break */ + if (PciDebugIrpDispatchDisplay(IoStackLocation, + DeviceExtension, + MaxMinor)) + { + /* The developer/user wants us to break for this IRP, do it */ + DbgBreakPoint(); + } + + /* Check if this IRP should be sent up the stack first */ + if (DispatchStyle == IRP_UPWARD) + { + /* Do it now before handling it ourselves */ + PciCallDownIrpStack(DeviceExtension, Irp); + } + + /* Call the our driver's handler for this IRP and deal with the IRP */ + Status = DispatchFunction(Irp, IoStackLocation, DeviceExtension); + switch (DispatchStyle) + { + /* Complete IRPs are completely immediately by our driver */ + case IRP_COMPLETE: + PassToPdo = FALSE; + break; + + /* Downward IRPs are send to the attached FDO */ + case IRP_DOWNWARD: + PassToPdo = TRUE; + break; + + /* Upward IRPs are completed immediately by our driver */ + case IRP_UPWARD: + PassToPdo = FALSE; + break; + + /* Dispatch IRPs are immediately returned */ + case IRP_DISPATCH: + return Status; + + /* There aren't any other dispatch styles! */ + default: + ASSERT(FALSE); + return Status; + } + } + + /* Pending IRPs are returned immediately */ + if (Status == STATUS_PENDING) return Status; + + /* Handled IRPs return their status in the status block */ + if (Status != STATUS_NOT_SUPPORTED) Irp->IoStatus.Status = Status; + + /* Successful, or unhandled IRPs that are "DOWNWARD" are sent to the PDO */ + if ((PassToPdo) && ((NT_SUCCESS(Status)) || (Status == STATUS_NOT_SUPPORTED))) + { + /* Let the PDO deal with it */ + Status = PciPassIrpFromFdoToPdo(DeviceExtension, Irp); + } + else + { + /* Otherwise, the IRP is returned with its status */ + Status = Irp->IoStatus.Status; + + /* Power IRPs need to notify the Power Manager that the next IRP can go */ + if (IoStackLocation->MajorFunction == IRP_MJ_POWER) PoStartNextPowerIrp(Irp); + + /* And now this IRP can be completed */ + IofCompleteRequest(Irp, IO_NO_INCREMENT); + } + + /* And the status returned back to the caller */ + return Status; } NTSTATUS diff --git a/reactos/drivers/bus/pcix/fdo.c b/reactos/drivers/bus/pcix/fdo.c index 6ba70d34fa4..d7c51150830 100644 --- a/reactos/drivers/bus/pcix/fdo.c +++ b/reactos/drivers/bus/pcix/fdo.c @@ -19,27 +19,25 @@ BOOLEAN PciBreakOnDefault; PCI_MN_DISPATCH_TABLE PciFdoDispatchPowerTable[] = { - {IRP_DISPATCH, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DISPATCH, PciFdoWaitWake}, {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_DOWNWARD, PciFdoSetPowerState}, + {IRP_DOWNWARD, PciFdoIrpQueryPower}, {IRP_DOWNWARD, PciIrpNotSupported} }; PCI_MN_DISPATCH_TABLE PciFdoDispatchPnpTable[] = { - {IRP_UPWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DISPATCH, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DISPATCH, PciIrpNotSupported}, - {IRP_UPWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_UPWARD, PciFdoIrpStartDevice}, + {IRP_DOWNWARD, PciFdoIrpQueryRemoveDevice}, + {IRP_DISPATCH, PciFdoIrpRemoveDevice}, + {IRP_DOWNWARD, PciFdoIrpCancelRemoveDevice}, + {IRP_DOWNWARD, PciFdoIrpStopDevice}, + {IRP_DOWNWARD, PciFdoIrpQueryStopDevice}, + {IRP_DOWNWARD, PciFdoIrpCancelStopDevice}, + {IRP_DOWNWARD, PciFdoIrpQueryDeviceRelations}, + {IRP_DISPATCH, PciFdoIrpQueryInterface}, + {IRP_UPWARD, PciFdoIrpQueryCapabilities}, {IRP_DOWNWARD, PciIrpNotSupported}, {IRP_DOWNWARD, PciIrpNotSupported}, {IRP_DOWNWARD, PciIrpNotSupported}, @@ -50,9 +48,11 @@ PCI_MN_DISPATCH_TABLE PciFdoDispatchPnpTable[] = {IRP_DOWNWARD, PciIrpNotSupported}, {IRP_DOWNWARD, PciIrpNotSupported}, {IRP_DOWNWARD, PciIrpNotSupported}, - {IRP_UPWARD, PciIrpNotSupported}, {IRP_DOWNWARD, PciIrpNotSupported}, {IRP_DOWNWARD, PciIrpNotSupported}, + {IRP_UPWARD, PciFdoIrpDeviceUsageNotification}, + {IRP_DOWNWARD, PciFdoIrpSurpriseRemoval}, + {IRP_DOWNWARD, PciFdoIrpQueryLegacyBusInformation}, {IRP_DOWNWARD, PciIrpNotSupported} }; @@ -70,6 +70,149 @@ PCI_MJ_DISPATCH_TABLE PciFdoDispatchTable = /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PciFdoIrpStartDevice(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpQueryRemoveDevice(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpRemoveDevice(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpCancelRemoveDevice(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpStopDevice(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpQueryStopDevice(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpCancelStopDevice(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpQueryDeviceRelations(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpQueryInterface(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpQueryCapabilities(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpDeviceUsageNotification(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpSurpriseRemoval(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpQueryLegacyBusInformation(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + VOID NTAPI PciGetHotPlugParameters(IN PPCI_FDO_EXTENSION FdoExtension) diff --git a/reactos/drivers/bus/pcix/init.c b/reactos/drivers/bus/pcix/init.c index 5fd7e4b8f90..07f226a279b 100644 --- a/reactos/drivers/bus/pcix/init.c +++ b/reactos/drivers/bus/pcix/init.c @@ -389,7 +389,7 @@ PciGetIrqRoutingTableFromRegistry(OUT PPCI_IRQ_ROUTING_TABLE *PciRoutingTable) Length, &NumberOfBytes); if (Status == STATUS_NO_MORE_ENTRIES) break; - + /* Null-terminate the keyname, because the kernel does not */ KeyInfo->Name[KeyInfo->NameLength / sizeof(WCHAR)] = UNICODE_NULL; diff --git a/reactos/drivers/bus/pcix/pci.h b/reactos/drivers/bus/pcix/pci.h index 8bfd101885e..5065d8156d3 100644 --- a/reactos/drivers/bus/pcix/pci.h +++ b/reactos/drivers/bus/pcix/pci.h @@ -288,6 +288,33 @@ PciIrpNotSupported( IN PPCI_FDO_EXTENSION DeviceExtension ); +// +// Power Routines +// +NTSTATUS +NTAPI +PciFdoWaitWake( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoSetPowerState( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpQueryPower( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + // // Bus FDO Routines // @@ -298,6 +325,110 @@ PciAddDevice( IN PDEVICE_OBJECT PhysicalDeviceObject ); +NTSTATUS +NTAPI +PciFdoIrpStartDevice( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpQueryRemoveDevice( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpRemoveDevice( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpCancelRemoveDevice( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpStopDevice( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpQueryStopDevice( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpCancelStopDevice( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpQueryDeviceRelations( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpQueryInterface( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpQueryCapabilities( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpDeviceUsageNotification( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpSurpriseRemoval( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + +NTSTATUS +NTAPI +PciFdoIrpQueryLegacyBusInformation( + IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension +); + // // HAL Callback/Hook Routines // @@ -438,6 +569,17 @@ PciInitializeArbiters( IN PPCI_FDO_EXTENSION FdoExtension ); +// +// Debug Helpers +// +BOOLEAN +NTAPI +PciDebugIrpDispatchDisplay( + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension, + IN USHORT MaxMinor +); + // // External Resources // diff --git a/reactos/drivers/bus/pcix/power.c b/reactos/drivers/bus/pcix/power.c index 71a745b8fdf..426d39d6a3d 100644 --- a/reactos/drivers/bus/pcix/power.c +++ b/reactos/drivers/bus/pcix/power.c @@ -16,4 +16,37 @@ /* FUNCTIONS ******************************************************************/ +NTSTATUS +NTAPI +PciFdoWaitWake(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoSetPowerState(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + +NTSTATUS +NTAPI +PciFdoIrpQueryPower(IN PIRP Irp, + IN PIO_STACK_LOCATION IoStackLocation, + IN PPCI_FDO_EXTENSION DeviceExtension) +{ + UNIMPLEMENTED; + while (TRUE); + return STATUS_NOT_SUPPORTED; +} + /* EOF */ -- 2.17.1