Oracle Solaris Modular Debugger Guide

Device Drivers and DDI Framework

This section describes dcmds and walkers that are useful for kernel developers as well as third-party device driver developers.

Device Driver Dcmds

address ::binding_hash_entry

Given the address of a kernel name-to-major number binding hash table entry (struct bind), display the node binding name, major number, and pointer to the next element.

::devbindings device-name

Display the list of all instances of the named driver. The output consists of an entry for each instance, beginning with the pointer to the struct dev_info (viewable with $<devinfo or ::devinfo), the driver name, the instance number, and the driver and system properties associated with that instance.

address ::devinfo [ -q ]

Print the system and driver properties associated with a devinfo node. If the -q option is specified, only a quick summary of the device node is shown.

address ::devinfo2driver

Print the name of the driver (if any) associated with the devinfo node.

[ address ] ::devnames [ -v ]

Display the kernel's devnames table along with the dn_head pointer, which points at the driver instance list. If the -v flag is specified, additional information stored at each entry in the devnames table is displayed.

[ devinfo ] ::prtconf [ -cpv ]

Display the kernel device tree starting at the device node specified by devinfo. If devinfo is not provided, the root of the device tree is assumed by default. If the -c option is specified, only children of the given device node are displayed. If the -p option is specified, only ancestors of the given device node are displayed. If -v is specified, the properties associated with each node are displayed.

[ major-num ] ::major2name [ major-num ]

Display the driver name corresponding to the specified major number. The major number can be specified as an expression preceding the dcmd or as a command-line argument.

[ address ] ::modctl2devinfo

Print all of the device nodes that correspond to the specified modctl address.

::name2major driver-name

Given a device driver name, display its major number.

[ address ] ::softstate [ instance-number ]

Given a softstate state pointer (see ddi_soft_state_init(9F)) and a device instance number, display the soft state for that instance.

Device Driver Walkers

binding_hash

Given the address of an array of kernel binding hash table entries (struct bind **), walk all entries in the hash table and return the address of each struct bind.

devinfo

First, iterate over the parents of the given devinfo and return them in order of seniority from most to least senior. Second, return the given devinfo itself. Third, iterate over the children of the given devinfo in order of seniority from most to least senior. The dev_info struct is defined in <sys/ddi_impldefs.h>.

devinfo_children

First, return the given devinfo, then iterate over the children of the given devinfo in order of seniority from most to least senior. The dev_info struct is defined in <sys/ddi_impldefs.h>.

devinfo_parents

Iterate over the parents of the given devinfo in order of seniority from most to least senior, and then return the given devinfo. The dev_info struct is defined in <sys/ddi_impldefs.h>.

devi_next

Iterate over the siblings of the given devinfo. The dev_info struct is defined in <sys/ddi_impldefs.h>.

devnames

Iterate over the entries in the devnames array. This structure is defined in <sys/autoconf.h>.

softstate

Given a softstate pointer (see ddi_soft_state_init(9F)) display all non-NULL pointers to driver state structures.

softstate_all

Given a softstate pointer (see ddi_soft_state_init(9F)) display all pointers to driver state structures. Note that the pointers for unused instances will be NULL.