2010-04-01 19:07:40 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS PCI Bus Driver
|
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
|
|
|
* FILE: drivers/bus/pci/dispatch.c
|
|
|
|
* PURPOSE: WDM Dispatch Routines
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <pci.h>
|
2014-01-04 12:05:02 +00:00
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
2013-05-10 10:22:01 +00:00
|
|
|
IO_COMPLETION_ROUTINE PciSetEventCompletion;
|
|
|
|
|
2010-06-30 01:39:21 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciSetEventCompletion(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PVOID Context)
|
|
|
|
{
|
|
|
|
PKEVENT Event = (PVOID)Context;
|
|
|
|
ASSERT(Event);
|
|
|
|
|
2013-05-10 10:22:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(DeviceObject);
|
|
|
|
UNREFERENCED_PARAMETER(Irp);
|
|
|
|
|
2010-06-30 01:39:21 +00:00
|
|
|
/* Set the event and return the appropriate status code */
|
2013-05-31 12:24:23 +00:00
|
|
|
KeSetEvent(Event, IO_NO_INCREMENT, FALSE);
|
2010-06-30 01:39:21 +00:00
|
|
|
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 */
|
2012-03-05 20:43:47 +00:00
|
|
|
Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
|
2010-06-30 01:39:21 +00:00
|
|
|
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);
|
2012-03-05 20:43:47 +00:00
|
|
|
Status = IoCallDriver(DeviceExtension->AttachedDeviceObject, Irp);
|
2010-06-30 01:39:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the status back to the caller */
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciDispatchIrp(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp)
|
|
|
|
{
|
2010-06-30 01:39:21 +00:00
|
|
|
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;
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
PCI_DISPATCH_STYLE DispatchStyle = 0;
|
|
|
|
PCI_DISPATCH_FUNCTION DispatchFunction = NULL;
|
2010-06-30 01:39:21 +00:00
|
|
|
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;
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
MaxMinor = 0xFFFF;
|
2010-06-30 01:39:21 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
/* Unrecognized IRPs */
|
|
|
|
DispatchFunction = IrpDispatchTable->OtherIrpDispatchFunction;
|
|
|
|
DispatchStyle = IrpDispatchTable->OtherIrpDispatchStyle;
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
MaxMinor = 0xFFFF;
|
2010-06-30 01:39:21 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Only deal with recognized IRPs */
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
if (MaxMinor != 0xFFFF)
|
2010-06-30 01:39:21 +00:00
|
|
|
{
|
|
|
|
/* 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 */
|
2012-03-05 20:43:47 +00:00
|
|
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
2010-06-30 01:39:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* And the status returned back to the caller */
|
|
|
|
return Status;
|
Begin implement full PCI Bus Driver. code by me comments by sir_richard to avoid Engrish
DriverEntry full 100% implemented, ACPI WatchDog detect, PCI IRQ Routing detect, PCI errata/hackflag detect (PciGetDebugPorts not support, need PCI Debug Device to test)
Native (S)ATA, PCI BIOS Resource Lock, System Errata/Hackflag also is detect
HAL Hoooking enabled, callbacks stub
Stub PnP Interfaces: PciAddDevice, PciDriverUnload, PciDispatchIrp
PCI utility routines: PciUnicodeStringStrStr, PciStringToUSHORT, PciIsSuiteVersion, PciIsDatacenter, PciOpenKey, PciGetRegistryValue, PciBuildDefaultExclusionList done
PCI Verifier Support for future: PciVerifierInit/PciVerifierProfileChangeCallback (stub)
Thank you for much patience~ This 1200 first codes, have 12000 codes more to come!~~
svn path=/trunk/; revision=47894
2010-06-28 05:23:31 +00:00
|
|
|
}
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciIrpNotSupported(IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension)
|
|
|
|
{
|
2013-05-10 10:22:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(Irp);
|
|
|
|
UNREFERENCED_PARAMETER(IoStackLocation);
|
|
|
|
UNREFERENCED_PARAMETER(DeviceExtension);
|
|
|
|
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
/* Not supported */
|
|
|
|
DPRINT1("WARNING: PCI received unsupported IRP!\n");
|
Fix for code to handle IRP dispatching when unrecognized IRP (Thanks you sir_richard)
Add FDO IRP_MN_QUERY_INTERFACE support (it calls PciQueryInterface)
Add all PCI interface descriptor: PciLocationInterface (GUID_PNP_LOCATION_INTERFACE), PciPmeInterface (GUID_PCI_PME_INTERFACE), PciCardbusPrivateInterface (GUID_PCI_CARDBUS_INTERFACE_PRIVATE), PciLegacyDeviceDetectionInterface (GUID_LEGACY_DEVICE_DETECTION_STANDARD), AgpTargetInterface (GUID_AGP_TARGET_BUS_INTERFACE_STANDARD), PciRoutingInterface (GUID_INT_ROUTE_INTERFACE_STANDARD), BusHandlerInterface (GUID_BUS_INTERFACE_STANDARD) and stub initializer and constructor.
Add missing devhere.c interface file
Add all PCI arbiter descritptor: ArbiterInterfaceBusNumber, ArbiterInterfaceMemory, ArbiterInterfaceIo. Write constructor stub but not handled ArbitersInitialized == TRUE
Also add last-resort PCI interface: TranslatorInterfaceInterrupt (GUID_TRANSLATOR_INTERFACE_STANDARD) and part implement tranirq_Constructor
Add PciQueryInterface to find correct FDO/PDO/ROOT interface for a request and call interface constructor
Fix interface signatures, fix interface constructor type and PCI_INTERFACE, add interface flags (Thanks sir_richard)
Fix Aribtriter code (Thanks sir_richard)
Now another 1200 codes added, soon time for enumeration code!
svn path=/trunk/; revision=48074
2010-07-16 00:39:54 +00:00
|
|
|
//DbgBreakPoint();
|
Implement Root Bus FDO AddDevice codes, get boot config, connect to HAL or ACPI config handlers (PciQueryForPciBusInterface, PciGetConfigHandlers), read BUS FDO hack flag, get _HPP HotPlug PCI ACPI data and initialize arbiter support.
PciGetHotPlugParameters work but no PCI HotPlug support on my machines, so cannot test ACPI data, that part stub now
Add PciFdoDispatchTable, PciFdoDispatchPnpTable, PciFdoDispatchPowerTable but all stub to PciIrpNotSupported however set correct IRP Dispatch Style for the IRPS
Arbiter support in PciInitializeARbiters done, but PciInterfaces array is NULL (stub) at moment
Add PCI_SIGNATURE, PCI_STATE, PCI_DISAPTCH_STYLE type, add PciInitializeState to begin the state support
Add structure for PCI_FDO_EXTENSION, PCI_SECONDARY_EXTENSION, PCI_INTERFACE, PCI_ARBITER_INSTANCE, PCI_DISPATCH_TABLE
PCI utility functions added: PciFindParentPciFdoExtension, PciInsertEntryAtTail, PciInsertEntryAtHead, PcipLinkSecondaryExtension, PciGetDeviceProperty, PciSendIoctl
Need sir_richard to add arbiter.h header to define ARBITER_INSTANCE for finish support
This 1000 more codes done now~
svn path=/trunk/; revision=47898
2010-06-28 17:30:35 +00:00
|
|
|
return STATUS_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
2010-07-17 15:59:09 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciIrpInvalidDeviceRequest(IN PIRP Irp,
|
|
|
|
IN PIO_STACK_LOCATION IoStackLocation,
|
|
|
|
IN PPCI_FDO_EXTENSION DeviceExtension)
|
|
|
|
{
|
2013-05-10 10:22:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(Irp);
|
|
|
|
UNREFERENCED_PARAMETER(IoStackLocation);
|
|
|
|
UNREFERENCED_PARAMETER(DeviceExtension);
|
|
|
|
|
2010-07-17 15:59:09 +00:00
|
|
|
/* Not supported */
|
|
|
|
return STATUS_INVALID_DEVICE_REQUEST;
|
|
|
|
}
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* EOF */
|