1di_binding_name(3DEVINDFeOv)ice Information Library Functidoin_sbinding_name(3DEVINFO)
2
3
4
6 di_binding_name, di_bus_addr, di_compatible_names, di_devid,
7 di_driver_name, di_driver_ops, di_driver_major, di_instance, di_nodeid,
8 di_node_name - return libdevinfo node information
9
11 cc [ flag... ] file... -ldevinfo [ library... ]
12 #include <libdevinfo.h>
13
14 char *di_binding_name(di_node_t node);
15
16
17 char *di_bus_addr(di_node_t node);
18
19
20 int di_compatible_names(di_node_t node, char **names);
21
22
23 ddi_devid_t di_devid(di_node_t node);
24
25
26 char *di_driver_name(di_node_t node);
27
28
29 uint_t di_driver_ops(di_node_t node);
30
31
32 int di_driver_major(di_node_t node);
33
34
35 int di_instance(di_node_t node);
36
37
38 int di_nodeid(di_node_t node);
39
40
41 char *di_node_name(di_node_t node);
42
43
45 names The address of a pointer.
46
47
48 node A handle to a device node.
49
50
52 These functions extract information associated with a device node.
53
55 The di_binding_name() function returns a pointer to the binding name.
56 The binding name is the name used by the system to select a driver for
57 the device.
58
59
60 The di_bus_addr() function returns a pointer to a null-terminated
61 string containing the assigned bus address for the device. NULL is
62 returned if a bus address has not been assigned to the device. A zero-
63 length string may be returned and is considered a valid bus address.
64
65
66 The return value of di_compatible_names() is the number of compatible
67 names. names is updated to point to a buffer contained within the snap‐
68 shot. The buffer contains a concatenation of null-terminated strings,
69 for example:
70
71 <name1>/0<name2>/0...<namen>/0
72
73
74
75 See the discussion of generic names in Writing Device Drivers for a
76 description of how compatible names are used by Solaris to achieve
77 driver binding for the node.
78
79
80 The di_devid() function returns the device ID for node, if it is regis‐
81 tered. Otherwise, a null pointer is returned. Interfaces in the libde‐
82 vid(3LIB) library may be used to manipulate the handle to the device
83 id. This function is obsolete and might be removed from a future
84 Solaris release. Applications should use the "devid" property instead.
85
86
87 The di_driver_name() function returns the name of the driver bound to
88 the node. A null pointer is returned if node is not bound to any
89 driver.
90
91
92 The di_driver_ops() function returns a bit array of device driver
93 entry points that are supported by the driver bound to this node. Pos‐
94 sible bit fields supported by the driver are DI_CB_OPS, DI_BUS_OPS,
95 DI_STREAM_OPS.
96
97
98 The di_driver_major() function returns the major number associated with
99 the driver bound to node. If there is no driver bound to the node, this
100 function returns −1.
101
102
103 The di_instance() function returns the instance number of the device. A
104 value of -1 indicates an instance number has not been assigned to the
105 device by the system.
106
107
108 The di_nodeid() function returns the type of device, which may be one
109 of the following possible values: DI_PSEUDO_NODEID, DI_PROM_NODEID,
110 and DI_SID_NODEID. Devices of type DI_PROM_NODEID may have additional
111 properties that are defined by the PROM. See di_prom_prop_data(3DEV‐
112 INFO) and di_prom_prop_lookup_bytes(3DEVINFO).
113
114
115 The di_node_name() function returns a pointer to a null-terminated
116 string containing the node name.
117
119 See di_init(3DEVINFO) for an example demonstrating typical use of these
120 functions.
121
123 See attributes(5) for descriptions of the following attributes:
124
125
126
127
128 ┌─────────────────────────────┬──────────────────────────────────┐
129 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
130 ├─────────────────────────────┼──────────────────────────────────┤
131 │Interface Stability │Evolving (di_devid() is obsolete) │
132 ├─────────────────────────────┼──────────────────────────────────┤
133 │MT-Level │Safe │
134 └─────────────────────────────┴──────────────────────────────────┘
135
137 di_init(3DEVINFO), di_prom_init(3DEVINFO), di_prom_prop_data(3DEVINFO),
138 di_prom_prop_lookup_bytes(3DEVINFO), libdevid(3LIB), libdevinfo(3LIB),
139 attributes(5)
140
141
142 Writing Device Drivers
143
144
145
146SunOS 5.11 22 Mar 2004 di_binding_name(3DEVINFO)