Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / ddi_get_eventcookie.9f
blob5bf9a62dc46b52209becd63f7bec2b230400698b
1 '\" te
2 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH DDI_GET_EVENTCOOKIE 9F "Nov 6, 2003"
7 .SH NAME
8 ddi_get_eventcookie \- retrieve a NDI event service cookie handle
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/dditypes.h>
13 #include <sys/sunddi.h>
15 \fBint\fR \fBddi_get_eventcookie\fR(\fBdev_info_t *\fR\fIdip\fR, \fBchar *\fR\fIname\fR,
16      \fBddi_eventcookie_t *\fR\fIevent_cookiep\fR);
17 .fi
19 .SH INTERFACE LEVEL
20 .sp
21 .LP
22 Solaris DDI specific (Solaris DDI).
23 .SH PARAMETERS
24 .sp
25 .ne 2
26 .na
27 \fB\fBdev_info_t *\fR\fIdip\fR\fR
28 .ad
29 .sp .6
30 .RS 4n
31 Child device node requesting the cookie.
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fBchar *\fR\fIname\fR\fR
38 .ad
39 .sp .6
40 .RS 4n
41 NULL-terminated string containing the name of the event.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fBddi_eventcookie_t *\fR\fIevent_cookiep\fR\fR
48 .ad
49 .sp .6
50 .RS 4n
51 Pointer to cookie where event cookie will be returned.
52 .RE
54 .SH DESCRIPTION
55 .sp
56 .LP
57 The \fBddi_get_eventcookie()\fR function queries the device tree for a cookie
58 matching the given event name and returns a reference to that cookie. The
59 search is performed by a calling up the device tree hierarchy until the request
60 is satisfied by a bus nexus driver, or the top of the \fBdev_info\fR tree is
61 reached.
62 .sp
63 .LP
64 The cookie returned by this function can be used to register a callback
65 handler, unregister a callback handler, or post an event.
66 .SH RETURN VALUES
67 .sp
68 .ne 2
69 .na
70 \fB\fBDDI_SUCCESS\fR\fR
71 .ad
72 .RS 15n
73 Cookie handle is returned.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fBDDI_FAILURE\fR\fR
80 .ad
81 .RS 15n
82 Request was not serviceable by any nexus driver in the driver's ancestral
83 device tree hierarchy.
84 .RE
86 .SH CONTEXT
87 .sp
88 .LP
89 The \fBddi_get_eventcookie()\fR function can be called from user and kernel
90 contexts only.
91 .SH ATTRIBUTES
92 .sp
93 .LP
94 See \fBattributes\fR(5) for a description of the following attributes:
95 .sp
97 .sp
98 .TS
99 box;
100 c | c
101 l | l .
102 ATTRIBUTE TYPE  ATTRIBUTE VALUE
104 Interface Stability     Committed
107 .SH SEE ALSO
110 \fBattributes\fR(5), \fBddi_add_event_handler\fR(9F),
111 \fBddi_remove_event_handler\fR(9F)
114 \fIWriting Device Drivers\fR