2 * PROJECT: ReactOS PCI Bus Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/bus/pci/intrface/tr_irq.c
5 * PURPOSE: IRQ Translator Interface
6 * PROGRAMMERS: ReactOS Portable Systems Group
9 /* INCLUDES *******************************************************************/
15 /* GLOBALS ********************************************************************/
17 PCI_INTERFACE TranslatorInterfaceInterrupt
=
19 &GUID_TRANSLATOR_INTERFACE_STANDARD
,
20 sizeof(TRANSLATOR_INTERFACE
),
30 /* FUNCTIONS ******************************************************************/
34 tranirq_Initializer(IN PVOID Instance
)
36 /* PnP Interfaces don't get Initialized */
37 ASSERTMSG(FALSE
, "PCI tranirq_Initializer, unexpected call.");
38 return STATUS_UNSUCCESSFUL
;
43 tranirq_Constructor(IN PVOID DeviceExtension
,
45 IN PVOID InterfaceData
,
48 IN PINTERFACE Interface
)
50 PPCI_FDO_EXTENSION FdoExtension
= (PPCI_FDO_EXTENSION
)DeviceExtension
;
51 ULONG BaseBus
, ParentBus
;
52 INTERFACE_TYPE ParentInterface
;
53 ASSERT_FDO(FdoExtension
);
55 /* Make sure it's the right resource type */
56 if ((ULONG
)InterfaceData
!= CmResourceTypeInterrupt
)
58 /* Fail this invalid request */
59 DPRINT1("PCI - IRQ trans constructor doesn't like %x in InterfaceSpecificData\n",
61 return STATUS_INVALID_PARAMETER_3
;
64 /* Get the bus, and use this as the interface-specific data */
65 BaseBus
= FdoExtension
->BaseBus
;
66 InterfaceData
= (PVOID
)BaseBus
;
68 /* Check if this is the root bus */
69 if (PCI_IS_ROOT_FDO(FdoExtension
))
71 /* It is, so there is no parent, and it's connected on the system bus */
73 ParentInterface
= Internal
;
74 DPRINT1(" Is root FDO\n");
78 /* It's not, so we have to get the root bus' bus number instead */
79 #if 0 // when have PDO commit
80 ParentBus
= FdoExtension
->PhysicalDeviceObject
->DeviceExtension
->ParentFdoExtension
->BaseBus
;
81 ParentInterface
= PCIBus
;
82 DPRINT1(" Is bridge FDO, parent bus %x, secondary bus %x\n",
87 /* Now call the legacy HAL interface to get the correct translator */
88 return HalGetInterruptTranslator(ParentInterface
,
91 sizeof(TRANSLATOR_INTERFACE
),
93 (PTRANSLATOR_INTERFACE
)Interface
,
94 (PULONG
)&InterfaceData
);