Abstract:
A Plug-and-Play (PnP) configuration driver initilization routine and PnP configuration utility for use in PCI bus architectures supporting dynamic I/O bus configurations. The PnP configuration driver includes a logical-to-physical PCI bus mapping scheme maintaining a PCI bus mapping table, and creating a logical-to-physical map table at start-of-day. PCI device drivers access devices through the logical bus numbers, thereby avoiding errors resulting when physical bus numbers change as a result of the addition or removal of buses within a computer system supporting dynamic I/O bus configurations.

Description:
The present invention relates to Peripheral Component Interconnect (PCI) based computer systems and, more particularly, to a method for assigning logical bus numbers to multiple PCI busses within a computer system. 
     BACKGROUND OF THE INVENTION 
     Many computer system operating systems, such as NCR Corporation UNIX MP-RAS operating system, Microsoft Corporation WINDOWS NT operating system, and SCO Inc. UnixWare 2.0 operating system access peripheral devices based on their I/O Bus number, Controller number, PUN (Physical Unit Number), and LUN (Logical Unit Number). As long as these four parameters are held constant from one hardware configuration to another, an operating system will be able to access any previously installed device with a direct correlation between the operating system minor number and the physical address. This is the case for Micro Channel Architecture (MCA) and Enhanced Industry Standard Architecture (EISA) I/O Bus architectures which have a fixed number of I/O Busses. However, this is not the case for PCI Bus architectures which support dynamic I/O Bus configurations. When a PCI-to-PCI bridge is added to a system, system Basic Input/Output Software (BIOS) can, and currently does, reassign I/O Bus numbers possibly invalidating previously installed devices that were addressed based on previously assigned I/O Bus number. This is one of the many Plug-and-Play (PnP) issues that operating systems will have to address. Reassignment of I/O bus numbers by the system BIOS can result in a no-boot condition, wherein a boot device may not be recognized by the system. 
     The Peripheral Component Interconnect (PCI) architecture uses a connector, referred to above as a bridge, to connect two computer busses together to enable communication between the busses. Several types of bridges may exist in a system, such as: a host microprocessor to PCI bus bridge, a PCI bus to standard (ISA) bus, and PCI to PCI bridges. FIG. 1 provides a simple block diagram illustration of a computer system including multiple busses connected through various types of bridges. 
     The computer system illustrated in FIG. 1 includes a central processor 101 and main memory 103 connected by a memory bus 105. Two PCI busses, PCI Bus 0 and PCI Bus 4 are shown connected through Bridge 0 and Bridge 4, respectively, to memory bus 105. Additional PCI busses PCI Bus 1 and PCI Bus 3, and a standard bus 117 are connected in a hierarchical arrangement through Bridge 1, Bridge 3 and bridge 127 to PCI Bus 0. PCI Bus 2 is connected with PCI Bus 1 via Bridge 2. A sixth PCI bus, PCI Bus 5 is connected with PCI Bus 4 via Bridge 5. 
     A multiple bus architecture, such as shown in FIG. 1, is used for several reasons, e.g., to isolate the bandwidth of a high speed device from the rest of the system, to allow an intelligent controller to have a local PCI bus, or to support more devices than can be directly connected to one PCI bus. As will be explained further below, there exists two methods for interconnecting multiple PCI busses--as peers or hierarchically. 
     In FIG. 1, Bridge 0 and Bridge 4 are peers, as are Bridge 1 and Bridge 3. Bridge 0, Bridge 1, and Bridge 2 are arranged hierarchically. The number of each PCI-to-PCI bridge corresponds to the PCI bus beneath it. This hard-coded bridge numbering convention allows software to operate transparently across multiple PCI busses. The design of a bus configuration, whether peer or hierarchical configurations, is determined through evaluation of factors ranging from the I/O patterns of the system to the electrical loading characteristics of the processor bus. If I/O patterns tend to be from one PCI device to another, then a hierarchical configuration makes sense because I/O traffic occurs away from the processor bus. However, having more than two levels of hierarchy does not provide much benefit and should be avoided. If most I/O traffic is directed into and out of memory, then peer busses may make the most sense. However, peer busses require multiple bridges on the processor bus that may affect bus loading. Another factor to consider is cost; host bridges are more expensive than PCI-to-PCI bridges. 
     In accordance with the standard convention for numbering PCI busses, the first PCI Bus found in the system is assigned number 0. This is typically the first PCI bus off the system bus to PCI bus bridge. Then a slot by slot search for a bridge on PCI Bus 0 is made until a bridge found. If a PCI-to PCI bridge is found, the PCI bridge and connected PCI bus are assigned the next PCI number. The newly assigned bus is thereafter searched slot by slot for bridges. When all PCI slots have been searched, the search drops back to the parent PCI bus and the search continues on the next slot. Upon completion of all PCI Bus 0 slots, a search is made for any peer PCI Busses. If a peer is found the peer bus is assigned the next PCI number and the recursive search continues until all PCI busses are found. 
     As previously stated, the PCI architecture allows a user to change the hardware configuration, thereby changing the physical PCI bus numbering. However, the UNIX MP-RAS operating system, WINDOWS NT operating system, and UnixWare 2.0 operating system use the PCI Bus number as a means of addressing PCI devices or bus agents. Therefore, when an adapter card with a PCI-to-PCI bridge is inserted into or removed from the system, the physical PCI bus numbers are reassigned, and previously created minor numbers generated to address PCI devices or bus agents no longer correctly map to previously installed devices. 
     Take for example, a system including peer PCI busses with a boot/root device installed on the second PCI peer bus. FIG. 2 shows the backpanel 201 for such a system. The backpanel is seen to include card slots for a first peer PCI bus PEER-0, several card slots for an EISA bus, card slots for a second peer PCI bus PEER-1, and a boot controller 203 associated with PCI bus PEER-1. A minor number, utilized by the system to identify the boot device, could be represented by the value c100t0d0s0, where c100 represents PCI bus PEER-1, controller 0, and channel 0. 
     Should a host adapter that implements a PCI-to-PCI Bridge, such as an Adaptec AHA-3940 Host Adapter 305, be installed into PCI bus PEER-0, as shown in FIG. 3, system PCI configuration software (BIOS) will remap the PCI Busses so that the boot/root controller, formerly addressed by minor number c100t0d0s0, would have to be addressed by the minor number c200t0d0s0. This situation may require the system user to reinstall the operating system. 
     OBJECTS OF THE INVENTION 
     It is therefore an object of the present invention to provide a new and useful bus addressing scheme for a computer system including multiple busses. 
     It is another object of the present invention to provide a new and useful method for avoiding errors which would otherwise result when physical bus numbers change as a result of the addition or removal of buses within a computer system supporting dynamic I/O bus configurations. 
     It a further object of the present invention to provide a new and useful method for assigning logical bus numbers to the physical busses within a computer system supporting dynamic I/O bus configurations. 
     It is an additional object of the present invention to provide such a method which establishes a logical-to-physical PCI bus map to maintain a consistent bus addressing scheme within the computer system. 
     It is a further object of the present invention to provide such a method which includes a new and useful utility for updating the logical-to-physical bus map following the addition or removal of a bus from the computer system. 
     SUMMARY OF THE INVENTION 
     There is provided, in accordance with the present invention, a method for addressing bus devices within a computer system supporting dynamic I/O bus configurations wherein the computer system assigns a physical bus number to each bus within the system during system boot-up or start-of-day operations. The method comprising the steps of (1) assigning a distinct logical bus number to each bus within the computer system, the logical bus number assigned to each bus remaining unchanged following a bus configuration alteration producing a change in the physical bus numbers assigned to said busses, such as the addition or removal of a bus; and (2) generating an address value or minor number for each one of the bus devices, the minor number including a portion identifying the logical bus number of the bus to which the one of the bus devices is connected. 
     In the described embodiment, the method generates and saves a bus mapping table including a field identifying the physical bus numbers of each bus in the computer system, a field identifying the logical bus number of each bus in said computer system, and additional information such bus type (PCI peer, PCI bridge, EISA, etc.), parent bus number, and parent bus slot number. During system start of day, the current physical bus numbers assigned by the computer system to the busses during system boot-up are compared to the physical bus numbers contained within the bus mapping table to generate a logical-to-physical map table for translating logical bus numbers to current physical bus numbers. Thereafter, bus devices addressed through use of minor numbers based upon logical bus numbers can be addressed successfully even though the physical bus number associated with the bus device has been changed. 
     A utility for updating the contents of the bus mapping table is also provided by the present invention. 
     The above and other objects, features, and advantages of the present invention will become apparent from the following description and the attached drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a simplified block diagram of a computer system employing peer and hierarchical PCI busses, as well as standard non-PCI busses. 
     FIG. 2 is an illustration of a backpanel for a computer system including two peer PCI busses with a boot/root device installed on the second PCI peer bus. 
     FIG. 3 is an illustration of the backpanel of FIG. 2, further including the connection of a PCI-to-PCI bridge to the first PCI peer bus. 
     FIG. 4 is an illustration of the backpanel of FIG. 2, together with a table illustrating physical to I/O bus mapping and the generation of minor numbers identifying locations of devices residing on the busses. 
     FIG. 5 is an illustration of the backpanel of FIG. 3, together with a table illustrating physical to I/O bus mapping and the generation of minor numbers identifying locations of devices residing on the busses. 
     FIG. 6 is an illustration of the backpanel of FIG. 2, together with a PCI Bus Mapping Table and a Logical-to-Physical Map Table generated in accordance with the present invention. 
     FIG. 7 is an illustration of the backpanel of FIG. 3, together with a PCI Bus Mapping Table and a Logical-to-Physical Map Table generated through use of the PCI Configuration Driver init routine of the present invention. 
     FIG. 8 is an illustration of the backpanel of FIG. 3, together with a PCI Bus Mapping Table and a Logical-to-Physical Map Table generated through use of the PCI Configuration utility of the present invention. 
     FIGS. 9A and 9B provide a flowchart illustrating the operation of the PCI Configuration init routine, PCI --  Init ( ). 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     FIGS. 2 and 3, discussed earlier, illustrate the manner in which PCI bridge and bus numbers and minor numbers are determined in a system including multiple PCI busses. According to the above discussion concerning FIGS. 2, the minor number for a boot/root device installed on the second PCI bus PEER-1 could be represented by c1αβt0d0s0, where c1αβ represents I/O Bus 1, controller α, and channel β. In many current systems, the operating system utilizes a mapping scheme which uses the physical PCI bus number as the I/O bus number. This mapping scheme is illustrated in FIGS. 4 and 5 for the systems shown in FIGS. 2 and 3, respectively. 
     FIG. 4 shows backpanel 201 of FIG. 2, together with a table 403 illustrating physical to I/O bus mapping and the generation of minor numbers identifying locations of devices residing on the busses. It is seen that the physical bus numbers for the two PCI peer busses, 0 and 1, translate directly to I/O bus numbers 0 and 1, and to minor numbers c0αβt0d0s0 and c1αβt0d0s0, respectively. 
     Similarly, FIG. 5 shows the backpanel of FIG. 3 and a table 503 illustrating physical to I/O bus mapping for the system as shown. As discussed earlier, the system illustrated in FIG. 5 includes a host adapter that implements a PCI-to-PCI Bridge plugged into the bus PCI PEER-0. The PCI Configuration Software(BIOS) remaps the PCI Bus Numbers so that PCI bus PEER-0 is assigned physical bus number 0, the new PCI bus connected via the PCI-to-PCI bridge to PCI PEER-0 is assigned physical bus number 1, and the PCI bus PEER-1 is assigned physical bus number 2. Table 503 shows that the physical bus numbers for these three PCI busses translate directly to I/O bus numbers 0, 1 and 2, and to minor numbers c0αβt0d0s0, c1αβt0d0s0, and c2αβt0d0s0, respectively. As discussed earlier, a boot/root controller residing on bus PCI PEER-1 and addressed by minor number c100t0d0s0 prior to installation of the PCI-to-PCI bridge to PCI PEER-0, would no longer be accessible by that minor number following the installation of the PCI-to-PCI bridge to PCI PEER-0. 
     PCI Configuration Driver 
     To solve the PCI bus numbering problem identified above, a physical-to-logical PCI bus mapping scheme is provided by the present invention. A PCI Configuration Driver has been developed to effectuate all PCI Bus physical-to-logical conversions by detecting changes in configurations and prevent the operating system from becoming unbootable. At the heart of the PCI Configuration Driver is a PCI Bus Mapping Table which resides in a file referred to as the PCI Configuration Driver space.c file. The table includes the five fields shown in the sample bus mapping table provided below. Descriptions of the five fields shown are provided following the table. 
     
         ______________________________________PCI Bus Mapping TableLogical Bus    Physical  Parent Bus SlotNumber   Bus Number              Number     Number Bus Type______________________________________0        0         0          0      PEER1        1         0          0      PEER2        None      0          0      EISA______________________________________ 
    
     Logical Bus Number--This number is used by the PCI device drivers to map to devices on a specific PCI Bus. 
     Physical Bus Number--This is the number assigned to a PCI Bus by the PCI Configuration Software. 
     Parent Bus Number--This is the physical PCI Bus number that the PCI-to-PCI bridge is configured on. 
     Slot Number--This is the slot number of the Parent Bus that the Bridge is located. 
     Bus Type--This describes the type of I/O bus that is found off the PCI Bridge. 
     At start-of-day, i.e., at system boot-up, the PCI Configuration Driver init routine compares the actual hardware configuration of the system to the PCI Bus Mapping Table to create a Logical-to-Physical Map Table, as illustrated below. A description of the three fields illustrated is provided following the table. 
     
         ______________________________________Logical-to-Physical Map TableArray index = Logical Number             Bus Type Physical Number______________________________________0                 PCI-Peer 01                 PCI-Peer 12                 EISA-Bus None______________________________________ 
    
     Logical Bus Number--This number is used by the PCI device drivers to map to devices on a specific PCI Bus. 
     Bus Type--This describes the type of I/O bus that is found off the PCI Bridge. 
     Physical Bus Number--This is the number assigned to a PCI Bus by the PCI Configuration Software. 
     The Logical Bus Number is utilized to maintain a consistent PCI Bus addressing scheme while PCI Busses are added and removed from the system. PCI Device Drivers directly access the Logical-to-Physical map to acquire a Physical Bus Number and Bus Type. The PCI Device Drivers use the Logical Bus Numbers as their I/O Bus Numbers, therefore all previously built minor numbers will properly address corresponding previously installed devices. All inserted or removed PCI Busses are flagged as non-configured PCI busses and added to an Unconfigured PCI Bus Table. 
     
         ______________________________________Unconfigured PCI Bus Table______________________________________PCI#   Parent Bus Number                 Slot Number                           Add or Deleted______________________________________ 
    
     PCI Number--This is the number assigned to a PCI Bus by the PCI Configuration Software. 
     Parent Bus Number--This is the physical PCI Bus number that the PCI-to-PCI bridge is configured on. 
     Slot Number--This is the slot number of the Parent Bus that the Bridge is located in. 
     Added --  or --  Deleted--This describes if the PCI bus was added into the hardware system configuration but not in the PCI Bus Mapping Table, or if there is an entry in the PCI Bus Mapping Table but the hardware PCI Bus has been removed. 
     From the previous example, a boot/root device installed on the second PCI peer bus, PCI PEER-1, may have a minor number represented by c100t0d0s0, where c100 represents I/O Bus 1, controller 0, and channel 0. FIG. 6 shows the backpanel of FIG. 2, together with PCI Bus Mapping Table 603 and Logical-to-Physical Map Table 605 which would be generated utilizing the system described herein for generating logical PCI bus numbers. It is seen that the physical bus numbers for the two PCI peer busses, 0 and 1, translate to logical I/O bus numbers 0 and 1, and to minor numbers c0αβt0d0 s0 and c1αβt0d0s0, respectively. The minor number c2αβt0d0s0 corresponds to the EISA bus. 
     Following installation of a PCI-to-PCI host adapter into bus PCI PEER-0 as shown in FIG. 3, and prior to execution of the PCI Configuration Utility discussed below, the PCI Bus Mapping Table, Logical-to-Physical Map Table, and minor numbers corresponding to the system busses would be as shown in FIG. 7. As is shown by Logical-to-Physical Map Table 705 and minor numbers table 707, the peer PCI busses PCI PEER-0 and PCI PEER-1 maintain the same logical bus numbers and minor numbers as is shown in FIG. 6. 
     During execution of the PCI Configuration Driver init routine the PCI Bus Mapping Table is compared to the hardware configuration. The logical number of the PCI busses is maintained so that the boot/root Controller residing on PCI PEER-1 would still be addressed by the minor number c100t0d0. A Configuration Warning, such as is shown immediately below, is provided to the system user informing the user to run the PCI Configuration Utility. 
     
         ______________________________________Warning  A PCI Bus was added into the hardware system configuration  on PCI Bus 0, Slot 1  Please run the PCI Configuration Utility to add this______________________________________  device 
    
     Following addition of the new PCI bus and execution of the PCI Configuration Utility, the PCI Bus Mapping Table, Logical-to-Physical Map Table and minor numbers would appear as is shown in FIG. 8. 
     PCI Configuration Driver Supported Functions 
     Descriptions of PCI Configuration Driver supported functions, identified by bold italicized type, together with pseudo-code listings for those functions are provided below. 
     PCI --  Init() 
     Description 
     This function is called once at the start-of-day. It compares the hardware configuration to the PCI Bus Mapping Table that reside in the PCI Configuration Driver space.c file. This function copies the current PCI Bus Mapping Table into kernel memory space and modify it while creating two other tables: the Logical-to-Physical Map and the Unconfigured PCI Bus Table. The Logical-to-Physical Map is used by PCI Device drivers to map the logical PCI Bus Numbers to physical PCI Bus Numbers. The Unconfigured PCI Bus Table is used by the PCI Configuration Utility. 
     Logical input parameters: 
     none 
     Return Codes 
     none. 
     A flow chart illustrating the operation of the PCI Configuration init routine, PCI --  Init (), is shown in FIG. 9. A description of the steps shown in the flow chart of FIGS. 9A and 9B is provided below. 
     
         ______________________________________StepNumber Description of Operation______________________________________901   Start902   Read the current PCI Bus Mapping Table into memory.903   Initialize Logical-to-Physical Map by copying the first entry of the PCI Bus Mapping Table (known to be PCI Bus 0). Set PCI# to 1. Set PCI Bus Mapping Table Index to 1.904   Copy PCI Bus Mapping Table (PCI Bus Mapping Table Index) Parent and Slot into Bridge to Find Structure.905   Search slot by slot to find the next PCI Bridge up to and including the Bus and Slot in the Bridge to Find Structure, but not beyond this point.906   Check to see if a PCI Bridge was found.907   Check to see if the Bridge found was equal to the Bridge copied from the PCI Bus Mapping Table.908   If it is the same Bridge, add it to the Logical-to-Physical Map.909   Increment the PCI # and the PCI Bus Mapping Table Index.910   If the Bridge was not equal to the Bridge to Find Structure then an inserted Bridge has been encountered. Increment all Physical# and Parent Bus # in the current PCI Bus Mapping Table that are greater than or equal to the current PCI# from the current PCI Bus Mapping Table Index to the end of the table.911   Increment the current PCI#.912   Add the inserted Bridge to the Non Configured Bridge list.913   If no PCI bridge was found at the expected location in the Bridge to Find Structure, then remove all bridges that were children of the missing parent bridge. Subtract the number of removed bridges from all Physical# and Parent Bus # in the current PCI Bus Mapping Table that are greater than or equal to the current PCI# from the current PCI Bus Mapping Table Index to the end of the table.914   Check to see if all possible Busses and Slots have been searched.915   Add the number of removed bridges to PCI Bus Mapping Table Index.916   Check to see if all Configuration entries in the PCI Bus Mapping Table have been searched for.917   Complete an exhaustive search for any other added PCI Busses and add them to the Non Configured List.918   Print out a warning List of Non Configured PCI Busses.919   End______________________________________ 
    
     Pseudo Code 
     
         __________________________________________________________________________Init( )CurrentConfigurationTable= GetCurrentConfiguration()Initialize PCI Bridge Number to 0Initialize Search From Here structureSet the first entry in the Physical to Logical for Bridge-I/O Bus 0Increment the PCI Bridge NumberIncrement the CurrentConfigurationTable.sub.-- Indexwhile there are more bridges to findcopy CurrentConfigurationTable CurrentConfigurationTable.sub.-- Index!into Next Bridge tofind structureBridge Found structure = inclusive search for bridge(Search from here, toNext Bridge tofind, PCI Bridge Number)if Bridge to find is not presentAdjust CurrentConfigurationTable Bridge(s) have been removed ( )else if bridge found is not equal to Bridge to find ( we found a bridgeinserted beforeBridge to find )Adjust CurrentConfigurationTable Bridge has been inserted ( )add additional bridge to NonConfiged tableIncrement PCI Bridge numberelse ( found the bridge to find )add entry to Physical to Logical map tableIncrement CurrentConfigurationTable.sub.-- IndexIncrement PCI Bridge numberend whileif there are more slots and busses to searchcomplete an exhaustive search for bridgesif bridge foundadd bridge to NonConfiged tableendifendiffor all NonConfiged bridges foundprint out warning messageif there is a NonConfigured bridge in the systemgive the option to run the PCI Configuration UtilityAdjust CurrentConfigurationTable Bridge(s) have been removed( )save current CurrentConfigurationTable.sub.-- Indexcount the Missing.sub.-- number of bridges that were configured offmissing bridgeadd all missing bridges to Nonconfiged tablewhile not at end of CurrentConfigurationTableSubtract Missing.sub.-- number fromCurrentConfigurationTable CurrentConfigurationTable.sub.-- Index !.PCINumberif CurrentConfigurationTable CurrentConfigurationTable.sub.-- Index!.Parent Bus Number&gt;=PCI Bridge NumberSubtract Missing.sub.-- number fromCurrentConfigurationTable CurrentConfigurationTable.sub.-- Index !.ParentBus#Increment CurrentConfigurationTable.sub.-- Indexrestore CurrentConfigurationTable.sub.-- IndexAdd Missing.sub.-- number to CurrentConfigurationTable.sub.-- IndexAdjust CurrentConfigurationTable Bridge has been inserted ( )save current CurrentConfigurationTable.sub.-- Indexwhile not at end of CurrentConfigurationTableIncrement CurrentConfigurationTable CurrentConfigurationTable.sub.--Index !.PCI Numberif CurrentConfigurationTable CurrentConfigurationTable.sub.-- Index!.Parent Bus Number&gt;=PCI Bridge NumberIncrement CurrentConfigurationTable CurrentConfigurationTable.sub.--Index !.ParentBus#Increment CurrentConfigurationTable.sub.-- Indexrestore CurrentConfigurationTable.sub.-- IndexInclusiveSearchForBridge (From PCI Bridge, Next Bridge to find, PCINumber)Initialize All Possible Slots Searched = FALSEInitialize Bridge Found = FALSEInitialize Bridge Found structure = 0while (Not All Possible Slots Searched and       Bridge not Found and         (From Bus and Slot to search from &lt;= to Find Bus and         Slot))If PCI Device(From Bus and Slot ) Equal PCI BridgeBridge Found = TRUEBridge Found structure.PCI = PCI NumberBridge Found structure.Parent Bus = From PCI Bridge BusBridge Found structure.Slot = From PCI Bridge SlotIncrement From PCI Bridge LevelFrom PCI Bridge From PCI Bridge Level!.ParentBus=PCI NumberFrom PCI Bridge From PCI Bridge Level!.Slot=First slotelseAll Possible Slots Searched = Get next Bus and Slot (From PCI Bridge,PCINumber)If NOT All Possible Slots Searched and From PCI Bridge Equal Peer     Bridge Found = TRUE     Bridge Found structure.PCI = PCI Number     Bridge Found structure.Parent Bus = From PCI Bridge Bus     Bridge Found structure.Slot = From PCI Bridge Slotend whilereturn (Bridge Found structure)Get next Bus Slot (From PCI Bridge, PCI Number)IF From PCI Bridge Slot Equal MAX SLOTIF From PCI Bridge Level Equal 0From PCI Bridge Bus = PCI NumberFrom PCI Bridge Slot = First SlotSearch for next PEERIf No PEER Found     All Possible Slots Searched = TRUEelse     All Possible Slots Searched = FALSEelseDecrement From PCI Bridge LevelAll Possible Slots Searched = Get next Bus and Slot (From PCI Bridge,PCINumber)elseIncrement From PCI Bridge Slotreturn (All Possible Slots Searched)Pseudo Code Structure DefinitionsParentBus.sub.-- andSlot       {         Parent.sub.-- Number         Slot.sub.-- Number        }Bridge.sub.-- To.sub.-- Find.sub.-- Info        {           PCI.sub.-- Number           ParentBus.sub.-- andSlot         }Bridge.sub.-- Found.sub.-- Info       {         Return Code         PCI.sub.-- Number         ParentBus.sub.-- andSlot        }Search.sub.-- From.sub.-- Here       {         Level         ParentBus.sub.-- andSlot  MAX.sub.-- PCI.sub.-- LEVELS!        }NonConfig.sub.-- Table  MAX.sub.-- BRIDGE.sub.-- NUMBER!PCI #ParentBus.sub.-- andSlotAdded.sub.-- or.sub.-- Deleted}Physical.sub.-- to.sub.-- Logical.sub.-- Map MAX.sub.-- BRIDGE.sub.--NUMBER!{Physical numberLogical number}__________________________________________________________________________ 
    
     PCI --  Open () 
     Description 
     This function will search for the presence of any PCI I/O Bus in the system. 
     Logical input parameters: 
     none 
     Return Codes 
     ENOERR if one or more PCI Busses are found. 
     ENXIO if no PCI Bus is found 
     PCI --  Close () 
     Description 
     This function does nothing. 
     Logical input parameters: 
     none 
     Return Code 
     Always 0. 
     PCI --  Ioctl() 
     GetHardwareConfig 
     Description 
     This function will return the hardware configuration. This function returns the actual PCI Bus configuration as seen by the PCI Configuration Driver at start-of-day. The format returned will be in the PCI Bus Mapping Table format. 
     Logical input parameters: 
     none 
     Return Code 
     A pointer to a PCI --  Bus --  Mapping --  Table structure. 
     GetLogicalToPhysicalMap 
     Description 
     This function return Logical to Physical Map. This function returns the actual Logical to Physical Map that device drivers use to initialize at start-of-day. The format returned will be in the Logical-to-Physical Map Table format. 
     Logical input parameters: 
     none 
     Return Code 
     A pointer to a Logical --  to --  Physical --  Map structure. 
     GetPCIMappingTable () 
     Description 
     This function will return the PCI Bus Mapping Table. This function returns the initial PCI Bus configuration that is located in the PCI Configuration Driver space.c file. The format returned will be in the PCI Bus Mapping Table format. 
     Logical input parameters: 
     none 
     Return Code 
     A pointer to a PCI --  Bus --  Mapping --  Table structure. 
     GetPCIBusNonConfigList () 
     Description 
     This function will return the list of PCI Bus found in the system but were not yet configured into the system. That is there was no entry in the space.c PCI Bus Mapping Table. 
     Logical input parameters: 
     none 
     Return Code 
     A pointer to a Unconfigured --  PCI --  Bus --  Table structure. 
     Driver Interfaces () 
     These are the functions that all PCI Device drivers will use to get a Physical PCI Bus Number from a PCI Logical Bus Number or visa versa. And the Device drivers will also need to know what type the I/O bus is configured. 
     GetPhysicalBus (unsigned char Logical) 
     Description 
     This function will return a Physical PCI Bus number the corresponds to the passed in Logical PCI number found in the PCI Bus Mapping Table. 
     
         ______________________________________Logical input parameters:______________________________________Logical            PCI Logical Bus number.______________________________________ 
    
     Return Code 
     unsigned char Physical--the Physical PCI Bus Number. 
     GetLogicalBus (unsigned char Physical) 
     Description 
     This function will return a Logical PCI Bus number the corresponds to the passed in Physical PCI number found in the PCI Bus Mapping Table. 
     
         ______________________________________Logical input parameters:______________________________________Physical           PCI Physical Bus number.______________________________________ 
    
     Return Code 
     unsigned char Logical--the Logical PCI Bus Number. 
     GetBusType (unsigned char Logical) 
     Description 
     This function will return a PCI Bus Type number that corresponds to the passed in Logical PCI number found in the PCI Bus Mapping Table. 
     
         ______________________________________Logical input parameters:Logical            PCI Logical Bus number.PCI Bus Types:PCI-Peer           0PCI-to-PCI Bridge  1EISA               2ISA                3MCA                4SMCA               5______________________________________ 
    
     Return Code 
     unsigned char Type--the Type of PCI Bus located at the Logical PCI Bus Number. 
     PCI Configuration Driver Table Definition 
     PCI Bus Mapping Table 
     
         ______________________________________PCI Bus Mapping TableLogical Bus    Physical  Parent Bus SlotNumber   Bus Number              Number     Number Bus Type______________________________________0        0         0          0      PEER1        1         0          0      PEER2        None      0          0      EISA______________________________________ 
    
     
         ______________________________________Typedef struct PCI.sub.-- Bus.sub.-- Mapping.sub.-- Table  {        unsigned char Logical Number        unsigned char Physical Number        unsigned char Parent Number        unsigned char Slot Number        unsigned char Type      }PCI Bus Types:PCI-Peer          0PCI-to-PCI Bridge 1EISA              2ISA               3MCA               4SMCA              5______________________________________ 
    
     Logical-to-Physical Map 
     
         ______________________________________Logical-to-Physical Map TableArray index = Logical Number             Bus Type Physical Number______________________________________0                 PCI-Peer 01                 PCI-Peer 12                 EISA-Bus None______________________________________ 
    
     
         ______________________________________Typedef struct Logical.sub.-- to.sub.-- Physical.sub.-- Map  {        unsigned char Logical Number        unsigned char Type        unsigned char Physical Number      }PCI Bus Types:PCI-Peer          0PCI-to-PCI Bridge 1EISA              2ISA               3MCA               4SMCA              5______________________________________ 
    
     Unconfigured PCI Bus Table 
     
         ______________________________________Unconfigured PCI Bus Table______________________________________PCI#   Parent Bus Number                 Slot Number                           Add or Deleted______________________________________ 
    
     
         ______________________________________Typedef struct Unconfigured.sub.-- PCI.sub.-- Bus.sub.-- Table  {        unsigned char Physical Number        unsigned char Parent Number        unsigned char Slot Number        unsigned char Added.sub.-- or.sub.-- Deleted      }Define TypesAdded             0Deleted           1______________________________________ 
    
     PCI Configuration Utility 
     The PCI Configuration Utility provides a simple means to update the PCI Bus Mapping Table whenever the PCI Bus configuration changes. Whenever a controller is plugged into a PCI expansion slot that implements its own local PCI bus, this utility should be run to configure the new PCI bus and kernel relink, and the system rebooted. This will allow device drivers to obtain the correct logical/physical mapping. Details of the PCI Configuration Utility /sbin/pci --  config are provided below. 
     Name 
     pci --  config--Configure PCI busses and devices. 
     Synopsis 
     pci --  config  -hlmu!  -a logical physical parent slot type!  -r logical!  -f file! 
     Description 
     The pci --  config command is used to change the PCI Bus Configuration as specified by the PCI Bus Mapping Table which is located in the file /etc/conf/pack.d/pci/space.c. The PCI Bus Mapping Table maps physical PCI bus numbers to logical bus numbers. It is the logical bus numbers which are used by drivers to define minor numbers. When the system is booted, the PCI Configuration Driver compares the PCI Bus Mapping Table to the current hardware configuration and builds a Logical to Physical Map Table. Drivers use this table to obtain physical PCI bus numbers given a logical number. The Logical to Physical Map will return the correct PCI Bus number even if the Bus number is changed via a PCI Bus configuration change. Newly added or removed busses are placed in the Unconfigured PCI Bus Table. Unconfigured busses need to be resolved, kernel relinked, and rebooted for the new configuration to be used. 
     -h Get hardware configuration. This option returns the actual PCI Bus configuration as seen by the PCI Configuration Driver at start-of-day. The format returned will be in the PCI Bus Mapping Table format. 
     -I Get Logical to Physical Map. This option returns the actual Logical to Physical Map that device drivers use to initialize at start-of-day. The format returned will be in the Logical-to-Physical Map Table format. 
     -m Get PCI Bus Mapping Table. This option returns the PCI Bus Mapping Table as linked into the kernel. The format returned will be in the PCI Bus Mapping Table format. 
     -u Get Unconfigured Busses. This option returns all unconfigured PCI busses (added or removed) in the Unconfigured PCI Bus Table format. 
     -a Add an entry to the PCI Bus Mapping Table. This option allows an entry to be added to the PCI Bus Mapping Table in the file /etc/conf/pack.d/pci/space.c. Each entry must the following fields, logical is the logical bus number which will be used to map to minor numbers, physical is the PCI Bus number, parent is the PCI bus number of the bus&#39; parent, slot is the PCI device number of the PCI bridge device located on the parent&#39;s PCI bus, and type specifies the type of bus (PCI --  PEER, PCI --  BRIDGE, EISA, ISA, MCA). The kernel requires to be relinked and rebooted for the new values to take effect. 
     -r Remove an entry from the PCI Bus Mapping Table. This option allows an entry to be removed from the PCI Bus Mapping Table in the file /etc/conf/pack.d/pci/space.c. The entry associated with the logical bus number as specified by logical is removed. 
     -f Send output data to a file as specified by file. 
     Files 
     /etc/conf/pack.d/pci/space.c 
     It can thus be seen that there has been provided by the present invention a new and useful bus addressing scheme for a computer system including multiple PCI busses. The bus addressing scheme assigns a constant logical bus number to each physical bus within the system. Addressing the busses by their logical bus numbers avoids errors which would otherwise result when physical bus numbers change as a result of the addition or removal of buses within the computer system. 
     Although the presently preferred embodiment of the invention has been described, it will be understood that various changes may be made within the scope of the appended claims.