All,
Currently I ran into trouble about ndi_devi_findchild/ndi_devctl_ioctl
APIs in one of my project. The scenario of the issue is as below:
1) nexus driver creates a new dip for a device, sets device unit
address by calling ddi_set_name_addr, then transits dip into driver bound state
by calling ndi_devi_bind_driver.
2) app tries to access the device which will trigger driver attachment
operation. The first time attachment attemp fails due to resource
limitation/confliction. The dip of the device will be transitted in DS_PROTO
state with unit address resetting to NULL.
3) try to reconfigure the device through devctl interface but always
fails. The cause for the failure is: ddi_devctl_ioctl use ndi_devi_findchild to
search target dip, ndi_devi_findchild can never find the dip because it's unit
address field is NULL.
4) So the result is that there's no way to access the device anymore.
A quick fix to this issue it to add FIND_ADDR_BY_INIT flag when
ndi_devi_findchild calls find_sibling but which will change the behavior of
ndi_devi_findchild.
My question here is that whether ndi_devi_findchild is designed to work
without FIND_ADDR_BY_INIT or is it bug?
Thanks!
Liu Jiang (Gerry)
Senior Software Engineer
OpenSolaris, OTC
Tel: (8610)82611515-1643
iNet: 8758-1643
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss