mirror of
https://github.com/reactos/reactos.git
synced 2024-08-26 05:08:39 +00:00
40 lines
1.2 KiB
C
40 lines
1.2 KiB
C
/*
|
|
* 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>
|
|
|
|
/* FUNCTIONS ******************************************************************/
|
|
|
|
BOOLEAN
|
|
NTAPI
|
|
PciAreBusNumbersConfigured(IN PPCI_PDO_EXTENSION PdoExtension)
|
|
{
|
|
UCHAR PrimaryBus, BaseBus, SecondaryBus, SubordinateBus;
|
|
|
|
PAGED_CODE();
|
|
|
|
/* 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 */
|