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 rationale is that a device driver does not need to, and should not, 
know anything about other devices in the system.

> 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).

Why do you need to know the host bridge type?  (I can imagine reasons, but 
what is the problem in your case?)


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

Reply via email to