* Sync to trunk HEAD (r53298).
[reactos.git] / drivers / bus / pcix / pci / busno.c
1 /*
2 * PROJECT: ReactOS PCI Bus Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/bus/pci/pci/busno.c
5 * PURPOSE: Bus Number Management
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #include <pci.h>
12 #define NDEBUG
13 #include <debug.h>
14
15 /* GLOBALS ********************************************************************/
16
17 /* FUNCTIONS ******************************************************************/
18
19 BOOLEAN
20 NTAPI
21 PciAreBusNumbersConfigured(IN PPCI_PDO_EXTENSION PdoExtension)
22 {
23 UCHAR PrimaryBus, BaseBus, SecondaryBus, SubordinateBus;
24
25 PAGED_CODE();
26
27 /* Get all relevant bus number details */
28 PrimaryBus = PdoExtension->Dependent.type1.PrimaryBus;
29 BaseBus = PdoExtension->ParentFdoExtension->BaseBus;
30 SecondaryBus = PdoExtension->Dependent.type1.SecondaryBus;
31 SubordinateBus = PdoExtension->Dependent.type1.SubordinateBus;
32
33 /* The primary bus should be the base bus of the parent */
34 if ((PrimaryBus != BaseBus) || (SecondaryBus <= PrimaryBus)) return FALSE;
35
36 /* The subordinate should be a higher bus number than the secondary */
37 return SubordinateBus >= SecondaryBus;
38 }
39
40 /* EOF */