ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

tr_irq.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS PCI Bus Driver
00003  * LICENSE:         BSD - See COPYING.ARM in the top level directory
00004  * FILE:            drivers/bus/pci/intrface/tr_irq.c
00005  * PURPOSE:         IRQ Translator Interface
00006  * PROGRAMMERS:     ReactOS Portable Systems Group
00007  */
00008 
00009 /* INCLUDES *******************************************************************/
00010 
00011 #include <pci.h>
00012 #define NDEBUG
00013 #include <debug.h>
00014 
00015 /* GLOBALS ********************************************************************/
00016 
00017 PCI_INTERFACE TranslatorInterfaceInterrupt =
00018 {
00019     &GUID_TRANSLATOR_INTERFACE_STANDARD,
00020     sizeof(TRANSLATOR_INTERFACE),
00021     0,
00022     0,
00023     PCI_INTERFACE_FDO,
00024     0,
00025     PciTrans_Interrupt,
00026     tranirq_Constructor,
00027     tranirq_Initializer
00028 };
00029 
00030 /* FUNCTIONS ******************************************************************/
00031 
00032 NTSTATUS
00033 NTAPI
00034 tranirq_Initializer(IN PVOID Instance)
00035 {
00036     /* PnP Interfaces don't get Initialized */
00037     ASSERTMSG(FALSE, "PCI tranirq_Initializer, unexpected call.");
00038     return STATUS_UNSUCCESSFUL;
00039 }
00040 
00041 NTSTATUS
00042 NTAPI
00043 tranirq_Constructor(IN PVOID DeviceExtension,
00044                     IN PVOID Instance,
00045                     IN PVOID InterfaceData,
00046                     IN USHORT Version,
00047                     IN USHORT Size,
00048                     IN PINTERFACE Interface)
00049 {
00050     PPCI_FDO_EXTENSION FdoExtension = (PPCI_FDO_EXTENSION)DeviceExtension;
00051     ULONG BaseBus, ParentBus;
00052     INTERFACE_TYPE ParentInterface;
00053     ASSERT_FDO(FdoExtension);
00054 
00055     /* Make sure it's the right resource type */
00056     if ((ULONG)InterfaceData != CmResourceTypeInterrupt)
00057     {
00058         /* Fail this invalid request */
00059         DPRINT1("PCI - IRQ trans constructor doesn't like %x in InterfaceSpecificData\n",
00060                 InterfaceData);
00061         return STATUS_INVALID_PARAMETER_3;
00062     }
00063 
00064     /* Get the bus, and use this as the interface-specific data */
00065     BaseBus = FdoExtension->BaseBus;
00066     InterfaceData = (PVOID)BaseBus;
00067 
00068     /* Check if this is the root bus */
00069     if (PCI_IS_ROOT_FDO(FdoExtension))
00070     {
00071         /* It is, so there is no parent, and it's connected on the system bus */
00072         ParentBus = 0;
00073         ParentInterface = Internal;
00074         DPRINT1("      Is root FDO\n");
00075     }
00076     else
00077     {
00078         /* It's not, so we have to get the root bus' bus number instead */
00079         #if 0 // when have PDO commit
00080         ParentBus = FdoExtension->PhysicalDeviceObject->DeviceExtension->ParentFdoExtension->BaseBus;
00081         ParentInterface = PCIBus;
00082         DPRINT1("      Is bridge FDO, parent bus %x, secondary bus %x\n",
00083                 ParentBus, BaseBus);
00084         #endif
00085     }
00086 
00087     /* Now call the legacy HAL interface to get the correct translator */
00088     return HalGetInterruptTranslator(ParentInterface,
00089                                      ParentBus,
00090                                      PCIBus,
00091                                      sizeof(TRANSLATOR_INTERFACE),
00092                                      0,
00093                                      (PTRANSLATOR_INTERFACE)Interface,
00094                                      (PULONG)&InterfaceData);
00095 }
00096 
00097 /* EOF */

Generated on Sun May 27 2012 04:27:29 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.