xref: /illumos-gate/usr/src/man/man9f/ldi_ident_from_dev.9f (revision 1ed6b69a5ca1ca3ee5e9a4931f74e2237c7e1c9f)
te
Copyright (c) 2009, 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]
LDI_IDENT_FROM_DEV 9F "Mar 26, 2009"
NAME
ldi_ident_from_dev, ldi_ident_from_stream, ldi_ident_from_dip, ldi_ident_release - ldi cookie management
SYNOPSIS

#include <sys/sunldi.h>

int ldi_ident_from_dip(dev_info_t *dip, ldi_ident_t *lip);

int ldi_ident_from_dev(dev_t dev, ldi_ident_t *lip);

int ldi_ident_from_stream(struct queue *sq, ldi_ident_t *lip);

void ldi_ident_release(ldi_ident_t li);
PARAMETERS
li

ldi identifier

lip

ldi identifier pointer

dip

pointer to device info node

dev

device number

sq

pointer to a stream queue

DESCRIPTION

The ldi_ident_from_dev() function allocates and returns an ldi identifier that is associated with the device number specified by dev. The new ldi identifier is returned in the ldi identifier pointer parameter lip.

The ldi_ident_from_dip() function allocates and returns an ldi identifier that is associated with the device info node pointed to by dip. The new ldi identifier is returned in the ldi identifier pointer parameter lip.

The ldi_ident_from_stream() function allocates and returns an ldi identifier that is associated with the stream pointed to by queue. The new ldi identifier is returned in the ldi identifier pointer parameter lip.

The ldi_ident_release() function releases an identifier that was allocated by one of the ldi_ident_from_*() functions.

RETURN VALUES

The ldi_ident_from_dev(), ldi_ident_from_dip(), and ldi_ident_from_stream() functions return 0 upon success.

All of these functions return EINVAL for invalid input parameters.

CONTEXT

These functions can be called from user or kernel context.