1ddi_get_instance(9F)     Kernel Functions for Drivers     ddi_get_instance(9F)
2
3
4

NAME

6       ddi_get_instance - get device instance number
7

SYNOPSIS

9       #include <sys/ddi.h>
10       #include <sys/sunddi.h>
11
12
13
14       int ddi_get_instance(dev_info_t *dip);
15
16

INTERFACE LEVEL

18       Solaris DDI specific (Solaris DDI).
19

PARAMETERS

21       dip    Pointer to dev_info structure.
22
23

DESCRIPTION

25       The  ddi_get_instance()  function  returns  the  instance number of the
26       device corresponding to dip.
27
28
29       The system assigns an instance number to every device.   Instance  num‐
30       bers   for  devices  attached to the same driver are unique.  This pro‐
31       vides a way for the system and the driver to uniquely identify  one  or
32       more  devices  of  the same type. The instance number is derived by the
33       system from different properties  for  different  device  types  in  an
34       implementation specific manner.
35
36
37       Once  an  instance number has been assigned to a device, it will remain
38       the same even across reconfigurations and reboots. Therefore,  instance
39       numbers seen by a driver may not appear to be in consecutive order. For
40       example, if device foo0 has been assigned an instance number of  0  and
41       device  foo1  has  been  assigned  an  instance number of 1, if foo0 is
42       removed, foo1 will continue to be associated  with  instance  number  1
43       (even though foo1 is now the only device of its type on the system).
44

RETURN VALUES

46       The  ddi_get_instance()  function  returns  the  instance number of the
47       device corresponding to dip.
48

CONTEXT

50       The ddi_get_instance() function can be called from user, interrupt,  or
51       kernel context.
52

SEE ALSO

54       path_to_inst(4)
55
56
57       Writing Device Drivers
58
59
60
61SunOS 5.11                        16 Jan 2006             ddi_get_instance(9F)
Impressum