2 .\" Copyright (c) 2001, 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 DI_PROP_BYTES 3DEVINFO "Mar 27, 2001"
8 di_prop_bytes, di_prop_devt, di_prop_ints, di_prop_name, di_prop_strings,
9 di_prop_type, di_prop_int64 \- access property values and attributes
13 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ]
14 #include <libdevinfo.h>
16 \fBint\fR \fBdi_prop_bytes\fR(\fBdi_prop_t\fR \fIprop\fR, \fBuchar_t **\fR\fIprop_data\fR);
21 \fBdev_t\fR \fBdi_prop_devt\fR(\fBdi_prop_t\fR \fIprop\fR);
26 \fBint\fR \fBdi_prop_ints\fR(\fBdi_prop_t\fR \fIprop\fR, \fBint **\fR\fIprop_data\fR);
31 \fBint\fR \fBdi_prop_int64\fR(\fBdi_prop_t\fR \fIprop\fR, \fBint64_t **\fR\fIprop_data\fR);
36 \fBchar *\fR\fBdi_prop_name\fR(\fBdi_prop_t\fR \fIprop\fR);
41 \fBint\fR \fBdi_prop_strings\fR(\fBdi_prop_t\fR \fIprop\fR, \fBchar **\fR\fIprop_data\fR);
46 \fBint\fR \fBdi_prop_type\fR(\fBdi_prop_t\fR \fIprop\fR);
56 Handle to a property returned by \fBdi_prop_next\fR(3DEVINFO).
65 For \fBdi_prop_bytes()\fR, the address of a pointer to an unsigned character.
67 For \fBdi_prop_ints()\fR, the address of a pointer to an integer.
69 For \fBdi_prop_int64()\fR, the address of a pointer to a 64-bit integer.
71 For \fBdi_prop_strings()\fR, the address of pointer to a character.
77 These functions access information associated with property values and
78 attributes. All memory allocated by these functions is managed by the library
79 and must not be freed by the caller.
82 The \fBdi_prop_bytes()\fR function returns the property data as a series of
86 The \fBdi_prop_devt()\fR function returns the \fBdev_t\fR with which this
87 property is associated. If the value is \fBDDI_DEV_T_NONE\fR, the property is
88 not associated with any specific minor node.
91 The \fBdi_prop_ints()\fR function returns the property data as a series of
95 The \fBdi_prop_int64()\fR function returns the property data as a series of
99 The \fBdi_prop_name()\fR function returns the name of the property.
102 The \fBdi_prop_strings()\fR function returns the property data as a
103 concatenation of null-terminated strings.
106 The \fBdi_prop_type()\fR function returns the type of the property. The type
107 determines the appropriate interface to access property values. The following
108 is a list of possible types:
112 \fB\fBDI_PROP_TYPE_BOOLEAN\fR\fR
115 There is no interface to call since there is no property data associated with
116 boolean properties. The existence of the property defines a \fBTRUE\fR value.
122 \fB\fBDI_PROP_TYPE_INT\fR\fR
125 Use \fBdi_prop_ints()\fR to access property data.
131 \fB\fBDI_PROP_TYPE_INT64\fR\fR
134 Use \fBdi_prop_int64()\fR to access property data.
140 \fB\fBDI_PROP_TYPE_STRING\fR\fR
143 Use \fBdi_prop_strings()\fR to access property data.
149 \fB\fBDI_PROP_TYPE_BYTE\fR\fR
152 Use \fBdi_prop_bytes()\fR to access property data.
158 \fB\fBDI_PROP_TYPE_UNKNOWN\fR\fR
161 Use \fBdi_prop_bytes()\fR to access property data. Since the type of property
162 is unknown, the caller is responsible for interpreting the contents of the
169 \fB\fBDI_PROP_TYPE_UNDEF_IT\fR\fR
172 The property has been undefined by the driver. No property data is available.
178 Upon successful completion, \fBdi_prop_bytes()\fR, \fBdi_prop_ints()\fR,
179 \fBdi_prop_int64()\fR, and \fBdi_prop_strings()\fR return a non-negative value,
180 indicating the number of entries in the property value buffer. See
181 \fBdi_prom_prop_lookup_bytes\fR(3DEVINFO) for a description of the return
182 values. Otherwise, -1 is returned and \fIerrno\fR is set to indicate the error.
185 The \fBdi_prop_devt()\fR function returns the \fBdev_t\fR value associated with
189 The \fBdi_prop_name()\fR function returns a pointer to a string containing the
190 name of the property.
193 The \fBdi_prop_type()\fR function can return one of types described in the
198 These functions will fail if:
205 Invalid argument. For example, the property type does not match the interface.
211 See \fBattributes\fR(5) for descriptions of the following attributes:
219 ATTRIBUTE TYPE ATTRIBUTE VALUE
221 Interface Stability Evolving
229 \fBdi_prom_prop_lookup_bytes\fR(3DEVINFO), \fBdi_prop_next\fR(3DEVINFO),
230 \fBlibdevinfo\fR(3LIB), \fBattributes\fR(5)
233 \fIWriting Device Drivers\fR