Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ldi_prop_exists.9f
blob25cb7aee7d2c4682c8c7d6881d57f09ef29773f4
1 '\" te
2 .\"  Copyright (c) 2003, Sun Microsystems, Inc.,  All Rights Reserved
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 LDI_PROP_EXISTS 9F "Jun 3, 2003"
7 .SH NAME
8 ldi_prop_exists \- Check for the existence of a property
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/sunldi.h>
14 \fBint\fR \fBldi_prop_exists\fR(\fBldi_handle_t\fR \fIlh\fR, \fBuint_t\fR \fIflags\fR, \fBchar *\fR\fIname\fR);
15 .fi
17 .SH INTERFACE LEVEL
18 .sp
19 .LP
20 Solaris DDI specific (Solaris DDI)
21 .SH PARAMETERS
22 .sp
23 .ne 2
24 .na
25 \fB\fIlh\fR\fR
26 .ad
27 .RS 9n
28 Layered handle.
29 .RE
31 .sp
32 .ne 2
33 .na
34 \fB\fIflags\fR\fR
35 .ad
36 .RS 9n
37 Possible flag values are some combination of:
38 .RE
40 .sp
41 .ne 2
42 .na
43 \fBLDI_DEV_T_ANY\fR
44 .ad
45 .RS 21n
46 Match the lookup request independent of the actual dev_t value that was used
47 when the property was created. The flag indicates any dev_t value (including
48 DDI_DEV_T_NONE)  associated with a possible property match satisfies the
49 matching criteria.
50 .RE
52 .sp
53 .ne 2
54 .na
55 \fBDDI_PROP_DONTPASS\fR
56 .ad
57 .RS 21n
58 Do not pass request to parent device information node if the property  is not
59 found.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fBDDI_PROP_NOTPROM\fR
66 .ad
67 .RS 21n
68 Do not look at PROM properties  (ignored  on platforms that do not support PROM
69 properties).
70 .RE
72 .sp
73 .ne 2
74 .na
75 \fB\fIname\fR\fR
76 .ad
77 .RS 21n
78 String containing the name of the property.
79 .RE
81 .SH DESCRIPTION
82 .sp
83 .LP
84 \fBldi_prop_exists()\fR checks for the existence of a property associated with
85 a device represented by the layered driver handle, regardless of the property
86 value data type.
87 .sp
88 .LP
89 Properties are searched for based on the dip and dev_t values associated with
90 the layered handle, and the property name. This  association is handled by the
91 layered driver infrastructure on behalf of the consumers of
92 \fBldi_prop_exists()\fR.
93 .sp
94 .LP
95 The property search order is as follows:
96 .RS +4
97 .TP
99 Search software-properties created by the driver.
101 .RS +4
104 Search the software properties created by the system (or nexus nodes in the
105 device info tree).
107 .RS +4
110 Search the driver global properties list.
112 .RS +4
115 If DDI_PROP_NOTPROM is not set, search the PROM properties (if they exist).
117 .RS +4
120 If DDI_PROP_DONTPASS is not set, pass this request to the parent device
121 information node of the device  represented by the layered handle.
123 .RS +4
126 Return \fB0\fR if not found and \fB1\fR if found.
130 Typically, the specific dev_t value associated with the device represented by
131 the layered handle (ldi_handle_t) is used as a part of the property match
132 criteria. This association is handled by the layered driver infrastructure on
133 behalf of the consumers of the ldi property look up functions.
136 However, if the LDI_DEV_T_ANY flag is used, the ldi property lookup functions
137 will match the request regardless of the dev_t value associated with the
138 property at the time of its creation.  If a property was created with a dev_t
139 set to DDI_DEV_T_NONE, the only way to look up this property is with the
140 LDI_DEV_T_ANY flag.  PROM properties are always created with a dev_t set to
141 DDI_DEV_T_NONE.
144 name must always be set to the name of the property being looked up.
145 .SH RETURN VALUES
148 \fBldi_prop_exists()\fR returns \fB1\fR if the property exists and \fB0\fR
149 otherwise.
150 .SH CONTEXT
153 This function may be called from user or kernel context.
154 .SH EXAMPLE
156 .in +2
158 The following example demonstrates the use of ldi_prop_exists().
160      /* Determine the existence of the "interrupts" property */
161        ldi_prop_exists(lh, LDI_DEV_T_ANY|DDI_PROP_NOTPROM, "interrupts");
163 .in -2
165 .SH SEE ALSO
168 \fBddi_prop_exists(9F)\fR
171 \fIWriting Device Drivers\fR