Writing Device Drivers

Device Information

These interfaces provide information to the driver about a device, such as whether the device is self-identifying, what instance number the system has assigned to a device instance, the name of the dev_info node for the device, and the dev_info node of the device's parent.

int ddi_dev_is_sid(dev_info_t *dip);

ddi_dev_is_sid(9F) returns DDI_SUCCESS if the device identified by dip is self-identifying (see "Device Identification"). Otherwise, it returns DDI_FAILURE.

int ddi_get_instance(dev_info_t *dip);

ddi_get_instance(9F) returns the instance number assigned by the system for the device instance specified by dip.

char *ddi_get_name(dev_info_t *dip);

ddi_get_name(9F) returns a pointer to a character string that is the name of the dev_info tree node specified by dip.

char *ddi_binding_name(dev_info_t *dip);

ddi_binding_name(9F) also returns a pointer to a character string that is the name of the dev_info tree node specified by dip.

const char *ddi_driver_name(dev_info_t *devi);

ddi_driver_name(9F) returns the actual name of the driver bound to a device..

dev_info_t *ddi_get_parent(dev_info_t *dip);

ddi_get_parent(9F) returns the dev_info_t pointer for the parent dev_info node of the passed node, identified by dip.

int ddi_slaveonly(dev_info_t *dip);

ddi_slaveonly(9F) returns DDI_SUCCESS if the device indicated by dip is installed in a slave-access only bus slot. It returns DDI_FAILURE otherwise.