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]
#include <sys/sunldi.h> int ldi_ev_get_cookie(ldi_handle_t lh, char *evname, ldi_ev_cookie_t *cookiep);
Solaris DDI specific (Solaris DDI)
A layered handle representing the device for which the event notification was requested.
The string name of the event.
A pointer to type ldi_ev_cookie_t. Contains a pointer to the event cookie on return.
The ldi_ev_get_cookie() function accepts the string name of a state change event affecting the device represented by the layered driver handle "lh" and returns an opaque cookie on success. The call is successful if the framework supports event notification for the event named by "evname". If successful, the function returns an opaque cookie through the "cookiep" parameter. The cookie is required in subsequent calls for registering callbacks on events.
The following two LDI events are currently defined: LDI_EV_OFFLINE
The device is moving to the offline state.
The device is moving to the degraded state.
ldi_ev_get_cookie() also accepts the string name of any events defined for NDI event services. For such events, ldi_ev_get_cookie() replaces ldi_get_eventcookie(9F) (which is now obsolete).
The return values for this function are: LDI_EV_SUCCESS
The event cookie was created successfully.
An error occurred and the cookie was not created.
This function can be called from user and kernel contexts only.
ldi_ev_register_callbacks(9F), ldi_ev_remove_callbacks(9F)