Getting bus ID of root bus behind a bridge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a board which sits on PCIe slot of a x86 machine running 2.6 kernel. My 
goal is to get a consistent way of identifying the physical slot ID from the 
pci_dev structure associated with a device on the board (multiple devices). 
When I do an lspci -t , the device shows up this:

  0x1c  ----- 0xa ------- 0x9 
                           |
                           |--device 1
                           |--device 2 and so on
  

When I walk thru the bus with a while loop 

bus = pDev->bus;
do
{
  printk (.... "bus number : %x", bus->number )
  
} while (bus = bus->parent)

I get 0x9 , 0xa , 0x0 

I have tried almost all of the feilds of bus , even tried traversing thru
bus_list, but I cant get that 0x1c programmetically. 0x1c is probably the bus 
number for PCI-PCIe bridge, most fields of bus structure become 0 for this.. Is 
there a easy way to get this via pci_dev structure? 

Thanks

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux