2 .\" Copyright (c) 2003, 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 LDI_GET_DEV 9F "Jun 3, 2003"
8 ldi_get_dev, ldi_get_otyp, ldi_get_devid, ldi_get_minor_name \- Extract
9 information from a layered handle
13 #include <sys/sunldi.h>
15 \fBint\fR \fBldi_get_dev\fR(\fBldi_handle_t lh\fR, \fBdev_t *\fR\fIdevp\fR);
20 \fBint\fR \fBldi_get_otyp\fR(\fBldi_handle_t lh\fR, \fBint *\fR\fIotyp\fR);
25 \fBint\fR \fBldi_get_devid\fR(\fBldi_handle_t lh\fR, \fBddi_devid_t *\fR\fIdevid\fR);
30 \fBint\fR \fBldi_get_minor_name\fR(\fBldi_handle_t lh\fR, \fBchar **\fR\fIminor_name\fR);
49 Indicates on which interface the driver was opened. Valid settings are:
56 Open device block interface.
65 Open device character interface.
76 Pointer to a device number.
91 \fB\fIminor_name\fR \fR
94 Minor device node name.
100 The \fBldi_get_dev()\fR function retrieves the \fBdev_t\fR associated with a
104 The \fBldi_get_otyp()\fR retrieves the open flag that was used to open the
105 device associated with the layered handle.
108 The \fBldi_get_devid()\fR function retrieves a \fIdevid\fR for the device
109 associated with the layered handle. The caller should use
110 \fBddi_devid_free()\fR to free the devid when done with it.
113 The \fBldi_get_minor_name()\fR function retrieves the name of the minor node
114 opened for the device associated with the layered handle.
115 \fBldi_get_minor_name()\fR allocates a buffer containing the minor node name
116 and returns it via the \fIminor_name\fR parameter. The caller should use
117 \fBkmem_free()\fR to release the buffer when done with it.
121 The \fBldi_get_dev()\fR, \fBldi_get_otyp()\fR, \fBldi_get_devid()\fR, and
122 \fBldi_get_devid()\fR functions return \fB0\fR upon success.
125 In case of an error, the following values may be returned:
132 Invalid input parameters.
141 The operation is not supported for this device.
147 These functions may be called from user or kernel context.