'\" te .\" Copyright (c) 2007, 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] .TH LDI_GET_EVENTCOOKIE 9F "Aug 21, 2007" .SH NAME ldi_get_eventcookie \- retrieve NDI event service cookie .SH SYNOPSIS .LP .nf #include \fBint\fR \fBldi_get_eventcookie\fR(\fBldi_handle_t\fR \fIlh\fR, \fIchar *name\fR \fIddi_eventcookie_t *ecp\fR); .fi .SH INTERFACE LEVEL .sp .LP Obsolete .SH PARAMETERS .sp .ne 2 .na \fB\fIldi_handle_t lh\fR\fR .ad .RS 26n Layered handle. .RE .sp .ne 2 .na \fB\fIchar *name\fR\fR .ad .RS 26n null-terminated string containing the event name. .RE .sp .ne 2 .na \fB\fIddi_eventcookie_t *ecp\fR\fR .ad .RS 26n Pointer to the kernel event cookie. .RE .SH DESCRIPTION .sp .LP This function is obsolete and is only maintained for compatibility. Use of this function is strongly discouraged. For equivalent functionality provided by new interfaces, see \fBldi_ev_get_cookie\fR(9F) and \fBldi_ev_register_callbacks\fR(9F). .sp .LP The \fBldi_get_eventcookie()\fR function queries the device tree for a cookie matching the given event name and returns a reference to that cookie. The search is performed by calling up the device tree hierarchy of the device represented by the layered driver handle until the request is satisfied by a bus nexus driver, or the top of the dev_info tree is reached. .sp .LP The cookie returned by this function can be used to register a callback handler with \fBldi_add_event_handler\fR(9F). .SH RETURN VALUES .sp .ne 2 .na \fB\fBDDI_SUCCESS\fR\fR .ad .RS 15n Cookie handle is returned. .RE .sp .ne 2 .na \fB\fBDDI_FAILURE\fR\fR .ad .RS 15n Request was not serviceable by any nexus driver in the target device's ancestral device tree hierarchy. .RE .SH CONTEXT .sp .LP This function may be called from user or kernel contexts. .SH SEE ALSO .sp .LP .BR ldi_add_event_handler (9F), .BR ldi_ev_get_cookie (9F), .BR ldi_ev_register_callbacks (9F), .BR ldi_remove_event_handler (9F) .sp .LP \fIWriting Device Drivers\fR