[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    ddi_get_instance(9F) manual page Table of Contents

Name

ddi_get_instance - get device instance number

Synopsis


#include <sys/ddi.h>
#include <sys/sunddi.h>

int ddi_get_instance(dev_info_t *dip);

Interface Level

Solaris DDI specific (Solaris DDI).

Arguments

dip
Pointer to dev_info structure.

Description

ddi_get_instance() returns the instance number of the device corresponding to dip.

The system assigns an instance number to every device. Instance numbers for devices attached to the same driver are unique. This provides a way for the system and the driver to uniquely identify one or more devices of the same type. The instance number is derived by the system from different properties for different device types in an implementation specific manner.

Once an instance number has been assigned to a device, it will remain the same even across reconfigurations and reboots. Therefore, instance numbers seen by a driver may not appear to be in consecutive order. For example, if device foo0 has been assigned an instance number of 0 and device foo1 has been assigned an instance number of 1, if foo0 is removed, foo1 will continue to be associated with instance number 1 (even though foo1 is now the only device of its type on the system).

Return Values

ddi_get_instance() returns the instance number of the device corresponding to dip.

Context

ddi_get_instance() can be called from user or interrupt context.

See Also

path_to_inst(4)


Table of Contents