The kernel device configuration data may be viewed in two ways, either as a tree of device configuration nodes or as a list of nodes associated with each driver. In the tree view, each node may contain references to its parent, the next sibling in a list of siblings, and the first child of a
list of children. In the per-driver view, each node contains a reference to the next node associated with the same driver. Both views are captured in the snapshot, and the interfaces are provided for node access.
The di_child_node() function obtains a handle to the first child of node. If no child node exists in the snapshot, DI_NODE_NIL is returned and errno is set to ENXIO or ENOTSUP.
The di_parent_node() function obtains a handle to the parent node of node. If no parent node exists in the snapshot, DI_NODE_NIL is returned and errno is set to ENXIO or ENOTSUP.
The di_sibling_node() function obtains a handle to the next sibling node of node. If no next sibling node exists in the snapshot, DI_NODE_NIL is returned and errno is set to ENXIO or ENOTSUP.
The di_drv_first_node() function obtains a handle to the first node associated with the driver specified by drv_name. If there is no such driver, DI_NODE_NIL is returned with errno is set to EINVAL.
If the driver exists but there is no node associated with this driver, DI_NODE_NIL is returned and errno is set to ENXIO or ENOTSUP.
The di_drv_next_node() function returns a handle to the next node bound to the same driver. If no more nodes exist, DI_NODE_NIL is returned.
|