reactos/drivers/bus/pcix/pci/busno.c

40 lines
1.3 KiB
C
Raw Normal View History

/*
* PROJECT: ReactOS PCI Bus Driver
* LICENSE: BSD - See COPYING.ARM in the top level directory
* FILE: drivers/bus/pci/pci/busno.c
* PURPOSE: Bus Number Management
* PROGRAMMERS: ReactOS Portable Systems Group
*/
/* INCLUDES *******************************************************************/
#include <pci.h>
#define NDEBUG
#include <debug.h>
/* GLOBALS ********************************************************************/
/* FUNCTIONS ******************************************************************/
BOOLEAN
NTAPI
PciAreBusNumbersConfigured(IN PPCI_PDO_EXTENSION PdoExtension)
{
PAGED_CODE();
UCHAR PrimaryBus, BaseBus, SecondaryBus, SubordinateBus;
/* Get all relevant bus number details */
PrimaryBus = PdoExtension->Dependent.type1.PrimaryBus;
BaseBus = PdoExtension->ParentFdoExtension->BaseBus;
SecondaryBus = PdoExtension->Dependent.type1.SecondaryBus;
SubordinateBus = PdoExtension->Dependent.type1.SubordinateBus;
/* The primary bus should be the base bus of the parent */
if ((PrimaryBus != BaseBus) || (SecondaryBus <= PrimaryBus)) return FALSE;
/* The subordinate should be a higher bus number than the secondary */
return SubordinateBus >= SecondaryBus;
}
/* EOF */