ReactOS  0.4.13-dev-92-gf251225
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,
21  sizeof(TRANSLATOR_INTERFACE),
22  0,
23  0,
25  0,
29 };
30 
31 /* FUNCTIONS ******************************************************************/
32 
34 NTAPI
36 {
38  /* PnP Interfaces don't get Initialized */
39  ASSERTMSG("PCI tranirq_Initializer, unexpected call.\n", FALSE);
40  return STATUS_UNSUCCESSFUL;
41 }
42 
44 NTAPI
45 tranirq_Constructor(IN PVOID DeviceExtension,
49  IN USHORT Size,
51 {
53  ULONG BaseBus, ParentBus;
54  INTERFACE_TYPE ParentInterface;
56 
60 
61  /* Make sure it's the right resource type */
63  {
64  /* Fail this invalid request */
65  DPRINT1("PCI - IRQ trans constructor doesn't like %p in InterfaceSpecificData\n",
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,
97  sizeof(TRANSLATOR_INTERFACE),
98  0,
101 }
102 
103 /* EOF */
#define IN
Definition: typedefs.h:38
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:359
enum _INTERFACE_TYPE INTERFACE_TYPE
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
#define HalGetInterruptTranslator
Definition: haltypes.h:292
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
#define PCI_INTERFACE_FDO
Definition: pci.h:56
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define ASSERT_FDO(x)
Definition: pci.h:35
NTSTATUS NTAPI tranirq_Initializer(IN PVOID Instance)
Definition: tr_irq.c:35
struct _PCI_FDO_EXTENSION * PPCI_FDO_EXTENSION
#define STATUS_INVALID_PARAMETER_3
Definition: ntstatus.h:463
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define ASSERTMSG(msg, exp)
Definition: nt_native.h:431
#define UlongToPtr(u)
Definition: config.h:106
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
PCI_INTERFACE TranslatorInterfaceInterrupt
Definition: tr_irq.c:18
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define PCI_IS_ROOT_FDO(x)
Definition: pci.h:30
struct _TRANSLATOR_INTERFACE TRANSLATOR_INTERFACE
unsigned short USHORT
Definition: pedump.c:61
unsigned int * PULONG
Definition: retypes.h:1
IN PVOID Instance
Definition: pci.h:359
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
IN PVOID IN PVOID InterfaceData
Definition: pci.h:359