2010-04-01 19:07:40 +00:00
|
|
|
/*
|
|
|
|
* 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 ******************************************************************/
|
|
|
|
|
2010-09-23 13:24:41 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2010-04-01 19:07:40 +00:00
|
|
|
/* EOF */
|