Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ddi_dev_is_sid.9f
blob4f9ab925136d931c2d929e22304f72e4825a6d07
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH DDI_DEV_IS_SID 9F "Jan 16, 2006"
7 .SH NAME
8 ddi_dev_is_sid \- tell whether a device is self-identifying
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/conf.h>
13 #include <sys/ddi.h>
14 #include <sys/sunddi.h>
18 \fBint\fR \fBddi_dev_is_sid\fR(\fBdev_info_t *\fR\fIdip\fR);
19 .fi
21 .SH INTERFACE LEVEL
22 .sp
23 .LP
24 Solaris DDI specific (Solaris DDI).
25 .SH PARAMETERS
26 .sp
27 .ne 2
28 .na
29 \fB\fIdip\fR\fR
30 .ad
31 .RS 7n
32 A pointer to the device's \fBdev_info\fR structure.
33 .RE
35 .SH DESCRIPTION
36 .sp
37 .LP
38 The \fBddi_dev_is_sid()\fR function tells the caller whether the device
39 described by \fIdip\fR is self-identifying, that is, a device that can
40 unequivocally tell the system that it exists. This is useful for drivers that
41 support both a self-identifying as well as a non-self-identifying variants of a
42 device (and therefore must be probed).
43 .SH RETURN VALUES
44 .sp
45 .ne 2
46 .na
47 \fB\fBDDI_SUCCESS\fR\fR
48 .ad
49 .RS 15n
50 Device is self-identifying.
51 .RE
53 .sp
54 .ne 2
55 .na
56 \fB\fBDDI_FAILURE\fR\fR
57 .ad
58 .RS 15n
59 Device is not self-identifying.
60 .RE
62 .SH CONTEXT
63 .sp
64 .LP
65 The \fBddi_dev_is_sid()\fR function can be called from user, interrupt, or
66 kernel context.
67 .SH EXAMPLES
68 .sp
69 .in +2
70 .nf
71 1   ...
72 2   int
73 3   bz_probe(dev_info_t *dip)
74 4   {
75 5       ...
76 6       if (ddi_dev_is_sid(dip) == DDI_SUCCESS) {
77 7               /*
78 8                * This is the self-identifying version (OpenBoot).
79 9                * No need to probe for it because we know it is there.
80 10               * The existence of dip && ddi_dev_is_sid() proves this.
81 11               */
82 12                      return (DDI_PROBE_DONTCARE);
83 13      }
84 14      /*
85 15       * Not a self-identifying variant of the device. Now we have to
86 16       * do some work to see whether it is really attached to the
87 17       * system.
88 18       */
89 19  ...
90 .fi
91 .in -2
93 .SH SEE ALSO
94 .sp
95 .LP
96 \fBprobe\fR(9E) \fIWriting Device Drivers\fR