Kernel Functions for Drivers ddigetinstance(9F)
NAME
ddigetinstance - get device instance number
SYNOPSIS
#include
#include
int ddigetinstance(devinfot *dip);
INTERFACE LEVEL
Solaris DI specific (Solaris DI).
PARAMETERS
dip Pointer to devinfo structure.
DESCRIPTION
The ddigetinstance() function 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 dif-
ferent properties for different device types in an implemen-
tation 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 dev-
ice foo0 has been assigned an instance number of 0 and dev-
ice 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
The ddigetinstance() function returns the instance number
of the device corresponding to dip.
CONTEXT
The ddigetinstance() function can be called from user,
interrupt, or kernel context.
SunOS 5.11 Last change: 16 Jan 2006 1
Kernel Functions for Drivers ddigetinstance(9F)
SEE ALSO
pathtoinst(4)
Writing Device Drivers
SunOS 5.11 Last change: 16 Jan 2006 2
|