Browse Prior Art Database

Reversing device enumeration using bitfield rollover

IP.com Disclosure Number: IPCOM000031486D
Original Publication Date: 2004-Sep-27
Included in the Prior Art Database: 2004-Sep-27
Document File: 2 page(s) / 23K

Publishing Venue

IBM

Abstract

Reordering a Multi-Device PCI bridge chip by assigning the bridge device a base device number to value that is the maximum bitfield value (31) to the first bridge device instance and the second device bridge instance becomes 0. So that when a PCI bus walking application scans the bus the second device (0) would precede the first device (31).

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 2

Reversing device enumeration using bitfield rollover

     Enumeration of PCI devices is performed via Firmware or OS bus walk. A basic bus walk will enumerate PCI devices as found by bus number then by device number and finally by function number as these numbers are assigned by Firmware on initial power-up. Intelligent bus walks will find bridge devices and parse the busses behind the bridge before continuing the current bus. In the case of a Bridge chip that contained two PCI bridging devices, one for each of it's two sub busses, the intelligent bus walking mechanism presents the sub bus devices such that bus A devices show up before bus B devices. The area that this became a problem is when due to device physical board design the Ethernet devices on bus A are required to show up in the OS after bus B Ethernet devices to maintain commonality of physical port labeling. The mapping that is desired is as follows:

Bus B Ethernet device 1 function 0 is OS instance /dev/eth0

     Bus B Ethernet device 1 function 1 is OS instance /dev/eth1 Bus A Ethernet device 1 function 0 is OS instance /dev/eth2 Bus A Ethernet device 1 function 1 is OS instance /dev/eth3 Instead the intelligent bus walk created the mapping as follows (prior using bit field rollover):

Bus B Ethernet device 1 function 0 is OS instance /dev/eth2

     Bus B Ethernet device 1 function 1 is OS instance /dev/eth3 Bus A Ethernet device 1 function 0 is OS instance /dev/eth0 Bus A Ethernet device 1 function 1 is OS instance /dev/eth1 Initial workaround was to use standard PCI bus numbering instantiate the PCI bus number of B before A or give B a bus number lower (10) than A (11). However the intelligent bus walk of the OS didn't enumerate based on the bus number but rather by the first bridge device that it found. So the OS scan order would walk bus 0 and find the bridge device 1 which had bus A (11) behind it, enumerate bus A devices, then return to bus 0 finding bridge device 2 (10) that had bus B behind it, and enumerated bus...