ReactOS 0.4.16-dev-91-g764881a
tr_irq.c
Go to the documentation of this file.
1/*
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
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <pci.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS ********************************************************************/
17
19{
20 &GUID_TRANSLATOR_INTERFACE_STANDARD,
22 0,
23 0,
25 0,
29};
30
31/* FUNCTIONS ******************************************************************/
32
36{
38 /* PnP Interfaces don't get Initialized */
39 ASSERTMSG("PCI tranirq_Initializer, unexpected call.\n", FALSE);
41}
42
47 IN PVOID InterfaceData,
51{
53 ULONG BaseBus, ParentBus;
54 INTERFACE_TYPE ParentInterface;
56
60
61 /* Make sure it's the right resource type */
62 if ((ULONG_PTR)InterfaceData != CmResourceTypeInterrupt)
63 {
64 /* Fail this invalid request */
65 DPRINT1("PCI - IRQ trans constructor doesn't like %p in InterfaceSpecificData\n",
66 InterfaceData);
68 }
69
70 /* Get the bus, and use this as the interface-specific data */
71 BaseBus = FdoExtension->BaseBus;
72 InterfaceData = UlongToPtr(BaseBus);
73
74 /* Check if this is the root bus */
76 {
77 /* It is, so there is no parent, and it's connected on the system bus */
78 ParentBus = 0;
79 ParentInterface = Internal;
80 DPRINT1(" Is root FDO\n");
81 }
82 else
83 {
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",
89 ParentBus, BaseBus);
90 #endif
91 }
92
93 /* Now call the legacy HAL interface to get the correct translator */
94 return HalGetInterruptTranslator(ParentInterface,
95 ParentBus,
96 PCIBus,
98 0,
100 (PULONG)&InterfaceData);
101}
102
103/* EOF */
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define FALSE
Definition: types.h:117
#define PCI_INTERFACE_FDO
Definition: pci.h:58
#define PCI_IS_ROOT_FDO(x)
Definition: pci.h:32
#define ASSERT_FDO(x)
Definition: pci.h:37
struct _PCI_FDO_EXTENSION * PPCI_FDO_EXTENSION
@ PciTrans_Interrupt
Definition: pci.h:100
#define UlongToPtr(u)
Definition: config.h:106
@ FdoExtension
Definition: precomp.h:48
@ PCIBus
Definition: hwresource.cpp:142
@ Internal
Definition: hwresource.cpp:137
enum _INTERFACE_TYPE INTERFACE_TYPE
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_INVALID_PARAMETER_3
Definition: ntstatus.h:477
unsigned short USHORT
Definition: pedump.c:61
NTSTATUS NTAPI tranirq_Initializer(IN PVOID Instance)
Definition: tr_irq.c:35
PCI_INTERFACE TranslatorInterfaceInterrupt
Definition: tr_irq.c:18
NTSTATUS NTAPI tranirq_Constructor(IN PVOID DeviceExtension, IN PVOID Instance, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface)
Definition: tr_irq.c:45
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481
#define HalGetInterruptTranslator
Definition: haltypes.h:303
struct _TRANSLATOR_INTERFACE TRANSLATOR_INTERFACE