Joachim Worringen wrote:
> James C. McPherson schrieb:
>   
>> Baolu Lu wrote:
>>     
>>> Hi,
>>>
>>> I am going to write a kernel component, which will interact with the 
>>> kernel PCI subsystem. This part of code will call the PCI interface to
>>>
>>> 1. traverse the pci device tree
>>> 2. locate seg,bus,dev,fn
>>> 3. locate parent p2p bridge
>>>
>>> Any reference for this?
>>>       
>> Writing Device Drivers, publication 819-3196 on docs.sun.com
>>     
>
> The problem with the public DDI interface for walking the (PCI) device 
> tree is that, starting from your own dev_info_t, you can only go up 
> using ddi_get_parent(). All other related functions 
> (ddi_get_{sibbling,child}()) are not part of the public DDI interface 
> according to the man pages.
>
> What is the rational behind this? 

The tree is not locked.  You can look at your parent, because your 
parent can be ripped away while you're holding the child node.  But 
siblings can be removed at any time by dynamic reconfiguration.

I believe that this is the reason that these are not in the DDI.

    -- Garrett

> My specific problem is that I would 
> like the type (device ID) of the hostbridge behind which my device is 
> operating. I can not detect it using ddi_get_parent() alone; I would 
> need to look sideways in the tree at some point (near the root).
>
>   Joachim
>
>   

_______________________________________________
driver-discuss mailing list
driver-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/driver-discuss

Reply via email to