Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man3devinfo / di_binding_name.3devinfo
blob13e57f1ed302e1bfd9773276dd804a09baca11cc
1 '\" te
2 .\" Copyright (c) 2004, 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_BINDING_NAME 3DEVINFO "Mar 22, 2004"
7 .SH NAME
8 di_binding_name, di_bus_addr, di_compatible_names, di_devid, di_driver_name,
9 di_driver_ops, di_driver_major, di_instance, di_nodeid, di_node_name \- return
10 libdevinfo node information
11 .SH SYNOPSIS
12 .LP
13 .nf
14 \fBcc\fR [ \fIflag\fR... ] \fIfile\fR... \fB-ldevinfo\fR [ \fIlibrary\fR... ]
15 #include <libdevinfo.h>
17 \fBchar *\fR\fBdi_binding_name\fR(\fBdi_node_t\fR \fInode\fR);
18 .fi
20 .LP
21 .nf
22 \fBchar *\fR\fBdi_bus_addr\fR(\fBdi_node_t\fR \fInode\fR);
23 .fi
25 .LP
26 .nf
27 \fBint\fR \fBdi_compatible_names\fR(\fBdi_node_t\fR \fInode\fR, \fBchar **\fR\fInames\fR);
28 .fi
30 .LP
31 .nf
32 \fBddi_devid_t\fR \fBdi_devid\fR(\fBdi_node_t\fR \fInode\fR);
33 .fi
35 .LP
36 .nf
37 \fBchar *\fR\fBdi_driver_name\fR(\fBdi_node_t\fR \fInode\fR);
38 .fi
40 .LP
41 .nf
42 \fBuint_t\fR \fBdi_driver_ops\fR(\fBdi_node_t\fR \fInode\fR);
43 .fi
45 .LP
46 .nf
47 \fBint\fR \fBdi_driver_major\fR(\fBdi_node_t\fR \fInode\fR);
48 .fi
50 .LP
51 .nf
52 \fBint\fR \fBdi_instance\fR(\fBdi_node_t\fR \fInode\fR);
53 .fi
55 .LP
56 .nf
57 \fBint\fR \fBdi_nodeid\fR(\fBdi_node_t\fR \fInode\fR);
58 .fi
60 .LP
61 .nf
62 \fBchar *\fR\fBdi_node_name\fR(\fBdi_node_t\fR \fInode\fR);
63 .fi
65 .SH PARAMETERS
66 .sp
67 .ne 2
68 .na
69 \fB\fInames\fR\fR
70 .ad
71 .RS 9n
72 The address of a pointer.
73 .RE
75 .sp
76 .ne 2
77 .na
78 \fB\fInode\fR\fR
79 .ad
80 .RS 9n
81 A  handle to a device  node.
82 .RE
84 .SH DESCRIPTION
85 .sp
86 .LP
87 These functions extract information associated with a device node.
88 .SH RETURN VALUES
89 .sp
90 .LP
91 The \fBdi_binding_name()\fR function returns a pointer to the binding name. The
92 binding name is the name used by the system to select a driver for the device.
93 .sp
94 .LP
95 The \fBdi_bus_addr()\fR function returns a pointer to a null-terminated string
96 containing the assigned bus address for the device. \fBNULL\fR is returned if a
97 bus address has not been assigned to the device. A zero-length string may be
98 returned and is considered a valid bus address.
99 .sp
101 The return value of \fBdi_compatible_names()\fR is the number of compatible
102 names. \fInames\fR is updated to point to a buffer contained within the
103 snapshot. The buffer contains a concatenation of null-terminated strings, for
104 example:
106 .in +2
108 <\fIname1\fR>/0<\fIname2\fR>/0...<\fInamen\fR>/0
110 .in -2
114 See the discussion of generic names in \fIWriting Device Drivers\fR for a
115 description of how compatible names are used by Solaris to achieve driver
116 binding for the node.
119 The \fBdi_devid()\fR function returns the device \fBID\fR for \fInode\fR, if it
120 is registered. Otherwise, a null pointer is returned. Interfaces in the
121 \fBlibdevid\fR(3LIB) library may be used to manipulate the handle to the device
122 id. This function is obsolete and might be removed from a future Solaris
123 release. Applications should use the "devid" property instead.
126 The \fBdi_driver_name()\fR function returns the name of the driver bound to the
127 \fInode\fR. A null pointer is returned if  \fInode\fR is not bound to any
128 driver.
131 The \fBdi_driver_ops()\fR function returns a bit array of  device driver entry
132 points that are supported by the driver bound to this \fInode\fR. Possible bit
133 fields supported by the driver are \fBDI_CB_OPS\fR, \fBDI_BUS_OPS\fR,
134 \fBDI_STREAM_OPS\fR.
137 The \fBdi_driver_major()\fR function returns the major number associated with
138 the driver bound to \fInode\fR. If there is no driver bound to the node, this
139 function returns \(mi1.
142 The \fBdi_instance()\fR function returns the instance number of the device. A
143 value of \fB-1\fR indicates an instance number has not been assigned to the
144 device by the system.
147 The \fBdi_nodeid()\fR function returns  the type of device, which may be one of
148 the following possible values: \fBDI_PSEUDO_NODEID\fR, \fBDI_PROM_NODEID\fR,
149 and \fBDI_SID_NODEID\fR. Devices of type \fBDI_PROM_NODEID\fR may have
150 additional properties that are defined by the \fBPROM\fR. See
151 \fBdi_prom_prop_data\fR(3DEVINFO) and
152 \fBdi_prom_prop_lookup_bytes\fR(3DEVINFO).
155 The \fBdi_node_name()\fR function returns a pointer to a null-terminated string
156 containing the node name.
157 .SH EXAMPLES
160 See \fBdi_init\fR(3DEVINFO) for an example demonstrating typical use of these
161 functions.
162 .SH ATTRIBUTES
165 See \fBattributes\fR(5)  for descriptions of the following attributes:
170 box;
171 c | c
172 l | l .
173 ATTRIBUTE TYPE  ATTRIBUTE VALUE
175 Interface Stability     Evolving (\fBdi_devid()\fR is obsolete)
177 MT-Level        Safe
180 .SH SEE ALSO
183 \fBdi_init\fR(3DEVINFO), \fBdi_prom_init\fR(3DEVINFO),
184 \fBdi_prom_prop_data\fR(3DEVINFO), \fBdi_prom_prop_lookup_bytes\fR(3DEVINFO),
185 \fBlibdevid\fR(3LIB), \fBlibdevinfo\fR(3LIB), \fBattributes\fR(5)
188 \fIWriting Device Drivers\fR