2010-04-01 19:07:40 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS PCI Bus Driver
|
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
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
|
|
|
* FILE: drivers/bus/pci/intrface/tr_irq.c
|
|
|
|
* PURPOSE: IRQ Translator Interface
|
2010-04-01 19:07:40 +00:00
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
|
|
|
#include <pci.h>
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* GLOBALS ********************************************************************/
|
|
|
|
|
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_INTERFACE TranslatorInterfaceInterrupt =
|
|
|
|
{
|
|
|
|
&GUID_TRANSLATOR_INTERFACE_STANDARD,
|
|
|
|
sizeof(TRANSLATOR_INTERFACE),
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
PCI_INTERFACE_FDO,
|
|
|
|
0,
|
|
|
|
PciTrans_Interrupt,
|
|
|
|
tranirq_Constructor,
|
|
|
|
tranirq_Initializer
|
|
|
|
};
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
|
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
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
tranirq_Initializer(IN PVOID Instance)
|
|
|
|
{
|
|
|
|
/* PnP Interfaces don't get Initialized */
|
|
|
|
ASSERTMSG(FALSE, "PCI tranirq_Initializer, unexpected call.");
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
tranirq_Constructor(IN PVOID DeviceExtension,
|
|
|
|
IN PVOID Instance,
|
|
|
|
IN PVOID InterfaceData,
|
|
|
|
IN USHORT Version,
|
|
|
|
IN USHORT Size,
|
|
|
|
IN PINTERFACE Interface)
|
|
|
|
{
|
|
|
|
PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
|
|
|
|
ULONG BaseBus, ParentBus;
|
|
|
|
INTERFACE_TYPE ParentInterface;
|
|
|
|
ASSERT_FDO(FdoExtension);
|
|
|
|
|
|
|
|
/* Make sure it's the right resource type */
|
|
|
|
if ((ULONG)InterfaceData != CmResourceTypeInterrupt)
|
|
|
|
{
|
|
|
|
/* Fail this invalid request */
|
|
|
|
DPRINT1("PCI - IRQ trans constructor doesn't like %x in InterfaceSpecificData\n",
|
|
|
|
InterfaceData);
|
|
|
|
return STATUS_INVALID_PARAMETER_3;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the bus, and use this as the interface-specific data */
|
|
|
|
BaseBus = FdoExtension->BaseBus;
|
|
|
|
InterfaceData = (PVOID)BaseBus;
|
|
|
|
|
|
|
|
/* Check if this is the root bus */
|
|
|
|
if (PCI_IS_ROOT_FDO(FdoExtension))
|
|
|
|
{
|
|
|
|
/* It is, so there is no parent, and it's connected on the system bus */
|
|
|
|
ParentBus = 0;
|
|
|
|
ParentInterface = Internal;
|
|
|
|
DPRINT1(" Is root FDO\n");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* It's not, so we have to get the root bus' bus number instead */
|
|
|
|
#if 0 // when have PDO commit
|
|
|
|
ParentBus = FdoExtension->PhysicalDeviceObject->DeviceExtension->ParentFdoExtension->BaseBus;
|
|
|
|
ParentInterface = PCIBus;
|
|
|
|
DPRINT1(" Is bridge FDO, parent bus %x, secondary bus %x\n",
|
|
|
|
ParentBus, BaseBus);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Now call the legacy HAL interface to get the correct translator */
|
|
|
|
return HalGetInterruptTranslator(ParentInterface,
|
|
|
|
ParentBus,
|
|
|
|
PCIBus,
|
|
|
|
sizeof(TRANSLATOR_INTERFACE),
|
|
|
|
0,
|
|
|
|
(PTRANSLATOR_INTERFACE)Interface,
|
|
|
|
(PULONG)&InterfaceData);
|
|
|
|
}
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* EOF */
|