1di_prop_bytes(3DEVINFOD)evice Information Library Functiondsi_prop_bytes(3DEVINFO)
2
3
4
6 di_prop_bytes, di_prop_devt, di_prop_ints, di_prop_name,
7 di_prop_strings, di_prop_type, di_prop_int64 - access property values
8 and attributes
9
11 cc [ flag... ] file... -ldevinfo [ library... ]
12 #include <libdevinfo.h>
13
14 int di_prop_bytes(di_prop_t prop, uchar_t **prop_data);
15
16
17 dev_t di_prop_devt(di_prop_t prop);
18
19
20 int di_prop_ints(di_prop_t prop, int **prop_data);
21
22
23 int di_prop_int64(di_prop_t prop, int64_t **prop_data);
24
25
26 char *di_prop_name(di_prop_t prop);
27
28
29 int di_prop_strings(di_prop_t prop, char **prop_data);
30
31
32 int di_prop_type(di_prop_t prop);
33
34
36 prop Handle to a property returned by di_prop_next(3DEVINFO).
37
38
39 prop_data For di_prop_bytes(), the address of a pointer to an
40 unsigned character.
41
42 For di_prop_ints(), the address of a pointer to an inte‐
43 ger.
44
45 For di_prop_int64(), the address of a pointer to a 64-bit
46 integer.
47
48 For di_prop_strings(), the address of pointer to a charac‐
49 ter.
50
51
53 These functions access information associated with property values and
54 attributes. All memory allocated by these functions is managed by the
55 library and must not be freed by the caller.
56
57
58 The di_prop_bytes() function returns the property data as a series of
59 unsigned characters.
60
61
62 The di_prop_devt() function returns the dev_t with which this property
63 is associated. If the value is DDI_DEV_T_NONE, the property is not
64 associated with any specific minor node.
65
66
67 The di_prop_ints() function returns the property data as a series of
68 integers.
69
70
71 The di_prop_int64() function returns the property data as a series of
72 64-bit integers.
73
74
75 The di_prop_name() function returns the name of the property.
76
77
78 The di_prop_strings() function returns the property data as a concate‐
79 nation of null-terminated strings.
80
81
82 The di_prop_type() function returns the type of the property. The type
83 determines the appropriate interface to access property values. The
84 following is a list of possible types:
85
86 DI_PROP_TYPE_BOOLEAN There is no interface to call since there is
87 no property data associated with boolean prop‐
88 erties. The existence of the property defines
89 a TRUE value.
90
91
92 DI_PROP_TYPE_INT Use di_prop_ints() to access property data.
93
94
95 DI_PROP_TYPE_INT64 Use di_prop_int64() to access property data.
96
97
98 DI_PROP_TYPE_STRING Use di_prop_strings() to access property data.
99
100
101 DI_PROP_TYPE_BYTE Use di_prop_bytes() to access property data.
102
103
104 DI_PROP_TYPE_UNKNOWN Use di_prop_bytes() to access property data.
105 Since the type of property is unknown, the
106 caller is responsible for interpreting the
107 contents of the data.
108
109
110 DI_PROP_TYPE_UNDEF_IT The property has been undefined by the driver.
111 No property data is available.
112
113
115 Upon successful completion, di_prop_bytes(), di_prop_ints(),
116 di_prop_int64(), and di_prop_strings() return a non-negative value,
117 indicating the number of entries in the property value buffer. See
118 di_prom_prop_lookup_bytes(3DEVINFO) for a description of the return
119 values. Otherwise, -1 is returned and errno is set to indicate the
120 error.
121
122
123 The di_prop_devt() function returns the dev_t value associated with the
124 property.
125
126
127 The di_prop_name() function returns a pointer to a string containing
128 the name of the property.
129
130
131 The di_prop_type() function can return one of types described in the
132 DESCRIPTION section.
133
135 These functions will fail if:
136
137 EINVAL Invalid argument. For example, the property type does not
138 match the interface.
139
140
142 See attributes(5) for descriptions of the following attributes:
143
144
145
146
147 ┌─────────────────────────────┬─────────────────────────────┐
148 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
149 ├─────────────────────────────┼─────────────────────────────┤
150 │Interface Stability │Evolving │
151 ├─────────────────────────────┼─────────────────────────────┤
152 │MT-Level │Safe │
153 └─────────────────────────────┴─────────────────────────────┘
154
156 di_prom_prop_lookup_bytes(3DEVINFO), di_prop_next(3DEVINFO), libdev‐
157 info(3LIB), attributes(5)
158
159
160 Writing Device Drivers
161
162
163
164SunOS 5.11 27 Mar 2001 di_prop_bytes(3DEVINFO)