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 *******************************************************************/
16 /* GLOBALS ********************************************************************/
18 PCI_INTERFACE TranslatorInterfaceInterrupt
=
20 &GUID_TRANSLATOR_INTERFACE_STANDARD
,
21 sizeof(TRANSLATOR_INTERFACE
),
31 /* FUNCTIONS ******************************************************************/
35 tranirq_Initializer(IN PVOID Instance
)
37 UNREFERENCED_PARAMETER(Instance
);
38 /* PnP Interfaces don't get Initialized */
39 ASSERTMSG("PCI tranirq_Initializer, unexpected call.", FALSE
);
40 return STATUS_UNSUCCESSFUL
;
45 tranirq_Constructor(IN PVOID DeviceExtension
,
47 IN PVOID InterfaceData
,
50 IN PINTERFACE Interface
)
52 PPCI_FDO_EXTENSION FdoExtension
= (PPCI_FDO_EXTENSION
)DeviceExtension
;
53 ULONG BaseBus
, ParentBus
;
54 INTERFACE_TYPE ParentInterface
;
55 ASSERT_FDO(FdoExtension
);
57 UNREFERENCED_PARAMETER(Instance
);
58 UNREFERENCED_PARAMETER(Version
);
59 UNREFERENCED_PARAMETER(Size
);
61 /* Make sure it's the right resource type */
62 if ((ULONG
)InterfaceData
!= CmResourceTypeInterrupt
)
64 /* Fail this invalid request */
65 DPRINT1("PCI - IRQ trans constructor doesn't like %p in InterfaceSpecificData\n",
67 return STATUS_INVALID_PARAMETER_3
;
70 /* Get the bus, and use this as the interface-specific data */
71 BaseBus
= FdoExtension
->BaseBus
;
72 InterfaceData
= (PVOID
)BaseBus
;
74 /* Check if this is the root bus */
75 if (PCI_IS_ROOT_FDO(FdoExtension
))
77 /* It is, so there is no parent, and it's connected on the system bus */
79 ParentInterface
= Internal
;
80 DPRINT1(" Is root FDO\n");
84 /* It's not, so we have to get the root bus' bus number instead */
85 #if 0 // when have PDO commit
86 ParentBus
= FdoExtension
->PhysicalDeviceObject
->DeviceExtension
->ParentFdoExtension
->BaseBus
;
87 ParentInterface
= PCIBus
;
88 DPRINT1(" Is bridge FDO, parent bus %x, secondary bus %x\n",
93 /* Now call the legacy HAL interface to get the correct translator */
94 return HalGetInterruptTranslator(ParentInterface
,
97 sizeof(TRANSLATOR_INTERFACE
),
99 (PTRANSLATOR_INTERFACE
)Interface
,
100 (PULONG
)&InterfaceData
);