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/arb/arb_comn.c
|
|
|
|
* PURPOSE: Common Arbitration Code
|
|
|
|
* 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>
|
|
|
|
|
|
|
|
/* GLOBALS ********************************************************************/
|
|
|
|
|
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
|
|
|
PCHAR PciArbiterNames[] =
|
|
|
|
{
|
|
|
|
"I/O Port",
|
|
|
|
"Memory",
|
|
|
|
"Interrupt",
|
|
|
|
"Bus Number"
|
|
|
|
};
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
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
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
PciArbiterDestructor(IN PPCI_ARBITER_INSTANCE Arbiter)
|
|
|
|
{
|
2013-05-10 10:22:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(Arbiter);
|
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
|
|
|
/* This function is not yet implemented */
|
|
|
|
UNIMPLEMENTED;
|
|
|
|
while (TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciInitializeArbiters(IN PPCI_FDO_EXTENSION FdoExtension)
|
|
|
|
{
|
|
|
|
PPCI_INTERFACE CurrentInterface, *Interfaces;
|
2010-07-17 01:31:26 +00:00
|
|
|
PPCI_PDO_EXTENSION PdoExtension;
|
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
|
|
|
PPCI_ARBITER_INSTANCE ArbiterInterface;
|
|
|
|
NTSTATUS Status;
|
|
|
|
PCI_SIGNATURE ArbiterType;
|
|
|
|
ASSERT_FDO(FdoExtension);
|
|
|
|
|
|
|
|
/* Loop all the arbiters */
|
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
|
|
|
for (ArbiterType = PciArb_Io; ArbiterType <= PciArb_BusNumber; ArbiterType++)
|
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
|
|
|
{
|
|
|
|
/* Check if this is the extension for the Root PCI Bus */
|
|
|
|
if (!PCI_IS_ROOT_FDO(FdoExtension))
|
|
|
|
{
|
|
|
|
/* Get the PDO extension */
|
|
|
|
PdoExtension = FdoExtension->PhysicalDeviceObject->DeviceExtension;
|
|
|
|
ASSERT_PDO(PdoExtension);
|
|
|
|
|
|
|
|
/* Skip this bus if it does subtractive decode */
|
2010-07-17 01:31:26 +00:00
|
|
|
if (PdoExtension->Dependent.type1.SubtractiveDecode)
|
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
|
|
|
{
|
2013-05-10 10:22:01 +00:00
|
|
|
DPRINT1("PCI Not creating arbiters for subtractive bus %u\n",
|
2010-07-17 01:31:26 +00:00
|
|
|
PdoExtension->Dependent.type1.SubtractiveDecode);
|
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
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Query all the registered arbiter interfaces */
|
|
|
|
Interfaces = PciInterfaces;
|
|
|
|
while (*Interfaces)
|
|
|
|
{
|
|
|
|
/* Find the one that matches the arbiter currently being setup */
|
|
|
|
CurrentInterface = *Interfaces;
|
|
|
|
if (CurrentInterface->Signature == ArbiterType) break;
|
|
|
|
Interfaces++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if the required arbiter was not found in the list */
|
|
|
|
if (!*Interfaces)
|
|
|
|
{
|
|
|
|
/* Skip this arbiter and try the next one */
|
2013-05-10 10:22:01 +00:00
|
|
|
DPRINT1("PCI - FDO ext 0x%p no %s arbiter.\n",
|
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
|
|
|
FdoExtension,
|
|
|
|
PciArbiterNames[ArbiterType - PciArb_Io]);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* An arbiter was found, allocate an instance for it */
|
|
|
|
Status = STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
ArbiterInterface = ExAllocatePoolWithTag(PagedPool,
|
|
|
|
sizeof(PCI_ARBITER_INSTANCE),
|
|
|
|
PCI_POOL_TAG);
|
|
|
|
if (!ArbiterInterface) break;
|
|
|
|
|
|
|
|
/* Setup the instance */
|
|
|
|
ArbiterInterface->BusFdoExtension = FdoExtension;
|
|
|
|
ArbiterInterface->Interface = CurrentInterface;
|
|
|
|
swprintf(ArbiterInterface->InstanceName,
|
|
|
|
L"PCI %S (b=%02x)",
|
|
|
|
PciArbiterNames[ArbiterType - PciArb_Io],
|
|
|
|
FdoExtension->BaseBus);
|
|
|
|
|
|
|
|
/* Call the interface initializer for it */
|
|
|
|
Status = CurrentInterface->Initializer(ArbiterInterface);
|
|
|
|
if (!NT_SUCCESS(Status)) break;
|
|
|
|
|
|
|
|
/* Link it with this FDO */
|
|
|
|
PcipLinkSecondaryExtension(&FdoExtension->SecondaryExtension,
|
|
|
|
&FdoExtension->SecondaryExtLock,
|
|
|
|
&ArbiterInterface->Header,
|
|
|
|
ArbiterType,
|
|
|
|
PciArbiterDestructor);
|
|
|
|
|
|
|
|
/* This arbiter is now initialized, move to the next one */
|
2013-05-10 10:22:01 +00:00
|
|
|
DPRINT1("PCI - FDO ext 0x%p %S arbiter initialized (context 0x%p).\n",
|
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
|
|
|
FdoExtension,
|
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
|
|
|
L"ARBITER HEADER MISSING", //ArbiterInterface->CommonInstance.Name,
|
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
|
|
|
ArbiterInterface);
|
|
|
|
Status = STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return to caller */
|
|
|
|
return Status;
|
|
|
|
}
|
2010-07-16 01:14:52 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
PciInitializeArbiterRanges(IN PPCI_FDO_EXTENSION DeviceExtension,
|
|
|
|
IN PCM_RESOURCE_LIST Resources)
|
|
|
|
{
|
2010-07-17 01:31:26 +00:00
|
|
|
PPCI_PDO_EXTENSION PdoExtension;
|
2011-09-11 00:40:20 +00:00
|
|
|
//CM_RESOURCE_TYPE DesiredType;
|
2010-07-16 01:14:52 +00:00
|
|
|
PVOID Instance;
|
|
|
|
PCI_SIGNATURE ArbiterType;
|
|
|
|
|
2013-05-10 10:22:01 +00:00
|
|
|
UNREFERENCED_PARAMETER(Resources);
|
|
|
|
|
2010-07-16 01:14:52 +00:00
|
|
|
/* Arbiters should not already be initialized */
|
|
|
|
if (DeviceExtension->ArbitersInitialized)
|
|
|
|
{
|
|
|
|
/* Duplicated start request, fail initialization */
|
2013-05-10 10:22:01 +00:00
|
|
|
DPRINT1("PCI Warning hot start FDOx %p, resource ranges not checked.\n", DeviceExtension);
|
2010-07-16 01:14:52 +00:00
|
|
|
return STATUS_INVALID_DEVICE_REQUEST;
|
|
|
|
}
|
2010-09-23 13:24:41 +00:00
|
|
|
|
2010-07-16 01:14:52 +00:00
|
|
|
/* Check for non-root FDO */
|
|
|
|
if (!PCI_IS_ROOT_FDO(DeviceExtension))
|
|
|
|
{
|
|
|
|
/* Grab the PDO */
|
|
|
|
PdoExtension = (PPCI_PDO_EXTENSION)DeviceExtension->PhysicalDeviceObject->DeviceExtension;
|
2010-09-23 13:24:41 +00:00
|
|
|
ASSERT_PDO(PdoExtension);
|
2010-07-17 01:31:26 +00:00
|
|
|
|
2010-09-23 13:24:41 +00:00
|
|
|
/* Check if this is a subtractive bus */
|
|
|
|
if (PdoExtension->Dependent.type1.SubtractiveDecode)
|
|
|
|
{
|
|
|
|
/* There is nothing to do regarding arbitration of resources */
|
|
|
|
DPRINT1("PCI Skipping arbiter initialization for subtractive bridge FDOX %p\n", DeviceExtension);
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
2010-07-16 01:14:52 +00:00
|
|
|
}
|
2010-09-23 13:24:41 +00:00
|
|
|
|
2010-07-16 01:14:52 +00:00
|
|
|
/* Loop all arbiters */
|
|
|
|
for (ArbiterType = PciArb_Io; ArbiterType <= PciArb_Memory; ArbiterType++)
|
|
|
|
{
|
|
|
|
/* Pick correct resource type for each arbiter */
|
|
|
|
if (ArbiterType == PciArb_Io)
|
|
|
|
{
|
|
|
|
/* I/O Port */
|
2011-09-11 00:40:20 +00:00
|
|
|
//DesiredType = CmResourceTypePort;
|
2010-07-16 01:14:52 +00:00
|
|
|
}
|
|
|
|
else if (ArbiterType == PciArb_Memory)
|
|
|
|
{
|
|
|
|
/* Device RAM */
|
2011-09-11 00:40:20 +00:00
|
|
|
//DesiredType = CmResourceTypeMemory;
|
2010-07-16 01:14:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Ignore anything else */
|
|
|
|
continue;
|
|
|
|
}
|
2010-09-23 13:24:41 +00:00
|
|
|
|
2010-07-16 01:14:52 +00:00
|
|
|
/* Find an arbiter of this type */
|
|
|
|
Instance = PciFindNextSecondaryExtension(&DeviceExtension->SecondaryExtension,
|
|
|
|
ArbiterType);
|
|
|
|
if (Instance)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Now we should initialize it, not yet implemented because Arb
|
|
|
|
* library isn't yet implemented, not even the headers.
|
|
|
|
*/
|
|
|
|
UNIMPLEMENTED;
|
|
|
|
//while (TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* The arbiter was not found, this is an error! */
|
2013-05-10 10:22:01 +00:00
|
|
|
DPRINT1("PCI - FDO ext 0x%p %s arbiter (REQUIRED) is missing.\n",
|
2010-07-16 01:14:52 +00:00
|
|
|
DeviceExtension,
|
|
|
|
PciArbiterNames[ArbiterType - PciArb_Io]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Arbiters are now initialized */
|
|
|
|
DeviceExtension->ArbitersInitialized = TRUE;
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* EOF */
|