1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
'\" te
.\" Copyright (c) 2001, Sun Microsystems, Inc. All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH DI_PROP_BYTES 3DEVINFO "Mar 27, 2001"
.SH NAME
di_prop_bytes, di_prop_devt, di_prop_ints, di_prop_name, di_prop_strings,
di_prop_type, di_prop_int64 \- access property values and attributes
.SH SYNOPSIS
.LP
.nf
\fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ]
#include <libdevinfo.h>
\fBint\fR \fBdi_prop_bytes\fR(\fBdi_prop_t\fR \fIprop\fR, \fBuchar_t **\fR\fIprop_data\fR);
.fi
.LP
.nf
\fBdev_t\fR \fBdi_prop_devt\fR(\fBdi_prop_t\fR \fIprop\fR);
.fi
.LP
.nf
\fBint\fR \fBdi_prop_ints\fR(\fBdi_prop_t\fR \fIprop\fR, \fBint **\fR\fIprop_data\fR);
.fi
.LP
.nf
\fBint\fR \fBdi_prop_int64\fR(\fBdi_prop_t\fR \fIprop\fR, \fBint64_t **\fR\fIprop_data\fR);
.fi
.LP
.nf
\fBchar *\fR\fBdi_prop_name\fR(\fBdi_prop_t\fR \fIprop\fR);
.fi
.LP
.nf
\fBint\fR \fBdi_prop_strings\fR(\fBdi_prop_t\fR \fIprop\fR, \fBchar **\fR\fIprop_data\fR);
.fi
.LP
.nf
\fBint\fR \fBdi_prop_type\fR(\fBdi_prop_t\fR \fIprop\fR);
.fi
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIprop\fR\fR
.ad
.RS 13n
Handle to a property returned by \fBdi_prop_next\fR(3DEVINFO).
.RE
.sp
.ne 2
.na
\fB\fIprop_data\fR\fR
.ad
.RS 13n
For \fBdi_prop_bytes()\fR, the address of a pointer to an unsigned character.
.sp
For \fBdi_prop_ints()\fR, the address of a pointer to an integer.
.sp
For \fBdi_prop_int64()\fR, the address of a pointer to a 64-bit integer.
.sp
For \fBdi_prop_strings()\fR, the address of pointer to a character.
.RE
.SH DESCRIPTION
.sp
.LP
These functions access information associated with property values and
attributes. All memory allocated by these functions is managed by the library
and must not be freed by the caller.
.sp
.LP
The \fBdi_prop_bytes()\fR function returns the property data as a series of
unsigned characters.
.sp
.LP
The \fBdi_prop_devt()\fR function returns the \fBdev_t\fR with which this
property is associated. If the value is \fBDDI_DEV_T_NONE\fR, the property is
not associated with any specific minor node.
.sp
.LP
The \fBdi_prop_ints()\fR function returns the property data as a series of
integers.
.sp
.LP
The \fBdi_prop_int64()\fR function returns the property data as a series of
64-bit integers.
.sp
.LP
The \fBdi_prop_name()\fR function returns the name of the property.
.sp
.LP
The \fBdi_prop_strings()\fR function returns the property data as a
concatenation of null-terminated strings.
.sp
.LP
The \fBdi_prop_type()\fR function returns the type of the property. The type
determines the appropriate interface to access property values. The following
is a list of possible types:
.sp
.ne 2
.na
\fB\fBDI_PROP_TYPE_BOOLEAN\fR\fR
.ad
.RS 25n
There is no interface to call since there is no property data associated with
boolean properties. The existence of the property defines a \fBTRUE\fR value.
.RE
.sp
.ne 2
.na
\fB\fBDI_PROP_TYPE_INT\fR\fR
.ad
.RS 25n
Use \fBdi_prop_ints()\fR to access property data.
.RE
.sp
.ne 2
.na
\fB\fBDI_PROP_TYPE_INT64\fR\fR
.ad
.RS 25n
Use \fBdi_prop_int64()\fR to access property data.
.RE
.sp
.ne 2
.na
\fB\fBDI_PROP_TYPE_STRING\fR\fR
.ad
.RS 25n
Use \fBdi_prop_strings()\fR to access property data.
.RE
.sp
.ne 2
.na
\fB\fBDI_PROP_TYPE_BYTE\fR\fR
.ad
.RS 25n
Use \fBdi_prop_bytes()\fR to access property data.
.RE
.sp
.ne 2
.na
\fB\fBDI_PROP_TYPE_UNKNOWN\fR\fR
.ad
.RS 25n
Use \fBdi_prop_bytes()\fR to access property data. Since the type of property
is unknown, the caller is responsible for interpreting the contents of the
data.
.RE
.sp
.ne 2
.na
\fB\fBDI_PROP_TYPE_UNDEF_IT\fR\fR
.ad
.RS 25n
The property has been undefined by the driver. No property data is available.
.RE
.SH RETURN VALUES
.sp
.LP
Upon successful completion, \fBdi_prop_bytes()\fR, \fBdi_prop_ints()\fR,
\fBdi_prop_int64()\fR, and \fBdi_prop_strings()\fR return a non-negative value,
indicating the number of entries in the property value buffer. See
\fBdi_prom_prop_lookup_bytes\fR(3DEVINFO) for a description of the return
values. Otherwise, -1 is returned and \fIerrno\fR is set to indicate the error.
.sp
.LP
The \fBdi_prop_devt()\fR function returns the \fBdev_t\fR value associated with
the property.
.sp
.LP
The \fBdi_prop_name()\fR function returns a pointer to a string containing the
name of the property.
.sp
.LP
The \fBdi_prop_type()\fR function can return one of types described in the
DESCRIPTION section.
.SH ERRORS
.sp
.LP
These functions will fail if:
.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 10n
Invalid argument. For example, the property type does not match the interface.
.RE
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Evolving
_
MT-Level Safe
.TE
.SH SEE ALSO
.sp
.LP
\fBdi_prom_prop_lookup_bytes\fR(3DEVINFO), \fBdi_prop_next\fR(3DEVINFO),
\fBlibdevinfo\fR(3LIB), \fBattributes\fR(5)
.sp
.LP
\fIWriting Device Drivers\fR
|