1ldi_ev_get_cookie(9F) Kernel Functions for Drivers ldi_ev_get_cookie(9F)
2
3
4
6 ldi_ev_get_cookie - get an LDI event cookie for a specified event
7
9 #include <sys/sunldi.h>
10
11 int ldi_ev_get_cookie(ldi_handle_t lh, char *evname,
12 ldi_ev_cookie_t *cookiep);
13
14
16 Solaris DDI specific (Solaris DDI)
17
19 ldi_handle_t lh
20
21 A layered handle representing the device for which the event noti‐
22 fication was requested.
23
24
25 char *evname
26
27 The string name of the event.
28
29
30 ldi_ev_cookie_t *cookiep
31
32 A pointer to type ldi_ev_cookie_t. Contains a pointer to the event
33 cookie on return.
34
35
37 The ldi_ev_get_cookie() function accepts the string name of a state
38 change event affecting the device represented by the layered driver
39 handle "lh" and returns an opaque cookie on success. The call is suc‐
40 cessful if the framework supports event notification for the event
41 named by "evname". If successful, the function returns an opaque cookie
42 through the "cookiep" parameter. The cookie is required in subsequent
43 calls for registering callbacks on events.
44
45
46 The following two LDI events are currently defined:
47
48 LDI_EV_OFFLINE
49
50 The device is moving to the offline state.
51
52
53 LDI_EV_DEGRADE
54
55 The device is moving to the degraded state.
56
57
58
59 ldi_ev_get_cookie() also accepts the string name of any events defined
60 for NDI event services. For such events, ldi_ev_get_cookie() replaces
61 ldi_get_eventcookie(9F) (which is now obsolete).
62
64 The return values for this function are:
65
66 LDI_EV_SUCCESS
67
68 The event cookie was created successfully.
69
70
71 LDI_EV_FAILURE
72
73 An error occurred and the cookie was not created.
74
75
77 This function can be called from user and kernel contexts only.
78
80 ldi_ev_register_callbacks(9F), ldi_ev_remove_callbacks(9F)
81
82
83
84SunOS 5.11 21 Aug 2007 ldi_ev_get_cookie(9F)