ldi_ev_get_cookie(9f) [opensolaris man page]
ldi_ev_get_cookie(9F) Kernel Functions for Drivers ldi_ev_get_cookie(9F) NAME
ldi_ev_get_cookie - get an LDI event cookie for a specified event SYNOPSIS
#include <sys/sunldi.h> int ldi_ev_get_cookie(ldi_handle_t lh, char *evname, ldi_ev_cookie_t *cookiep); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
ldi_handle_t lh A layered handle representing the device for which the event notification was requested. char *evname The string name of the event. ldi_ev_cookie_t *cookiep A pointer to type ldi_ev_cookie_t. Contains a pointer to the event cookie on return. DESCRIPTION
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 subse- quent 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. LDI_EV_DEGRADE 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). RETURN VALUES
The return values for this function are: LDI_EV_SUCCESS The event cookie was created successfully. LDI_EV_FAILURE An error occurred and the cookie was not created. CONTEXT
This function can be called from user and kernel contexts only. SEE ALSO
ldi_ev_register_callbacks(9F), ldi_ev_remove_callbacks(9F) SunOS 5.11 21 Aug 2007 ldi_ev_get_cookie(9F)
Check Out this Related Man Page
ddi_get_eventcookie(9F) Kernel Functions for Drivers ddi_get_eventcookie(9F) NAME
ddi_get_eventcookie - retrieve a NDI event service cookie handle SYNOPSIS
#include <sys/dditypes.h> #include <sys/sunddi.h> int ddi_get_eventcookie(dev_info_t *dip, char *name, ddi_eventcookie_t *event_cookiep); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
dev_info_t *dip Child device node requesting the cookie. char *name NULL-terminated string containing the name of the event. ddi_eventcookie_t *event_cookiep Pointer to cookie where event cookie will be returned. DESCRIPTION
The ddi_get_eventcookie() 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 a calling up the device tree hierarchy until the request is satisfied by a bus nexus driver, or the top of the dev_info tree is reached. The cookie returned by this function can be used to register a callback handler, unregister a callback handler, or post an event. RETURN VALUES
DDI_SUCCESS Cookie handle is returned. DDI_FAILURE Request was not serviceable by any nexus driver in the driver's ancestral device tree hierarchy. CONTEXT
The ddi_get_eventcookie() function can be called from user and kernel contexts only. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), ddi_add_event_handler(9F), ddi_remove_event_handler(9F) Writing Device Drivers SunOS 5.11 6 Nov 2003 ddi_get_eventcookie(9F)