'\" te .\" Copyright (c) 2006 Sun Microsystems, Inc. .TH ddi_get_instance 9F "16 Jan 2006" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME ddi_get_instance \- get device instance number .SH SYNOPSIS .LP .nf #include #include \fBint\fR \fBddi_get_instance\fR(\fBdev_info_t *\fR\fIdip\fR); .fi .SH INTERFACE LEVEL .sp .LP Solaris DDI specific (Solaris DDI). .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIdip\fR\fR .ad .RS 7n .rt Pointer to \fBdev_info\fR structure. .RE .SH DESCRIPTION .sp .LP The \fBddi_get_instance()\fR function returns the instance number of the device corresponding to \fIdip\fR. .sp .LP 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. .sp .LP 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 \fBfoo0\fR has been assigned an instance number of \fB0\fR and device \fBfoo1\fR has been assigned an instance number of \fB1\fR, if \fBfoo0\fR is removed, \fBfoo1\fR will continue to be associated with instance number \fB1\fR (even though \fBfoo1\fR is now the only device of its type on the system). .SH RETURN VALUES .sp .LP The \fBddi_get_instance()\fR function returns the instance number of the device corresponding to \fIdip\fR. .SH CONTEXT .sp .LP The \fBddi_get_instance()\fR function can be called from user, interrupt, or kernel context. .SH SEE ALSO .sp .LP \fBpath_to_inst\fR(4) .sp .LP \fIWriting Device Drivers for Oracle Solaris 11.2\fR