1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man9f / ddi_intr_get_cap.9f
blob605ae5339e3dad912a93470b30704bb91fd1cc8e
1 '\" te
2 .\" Copyright (c) 2005, 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_INTR_GET_CAP 9F "Apr 20, 2005"
7 .SH NAME
8 ddi_intr_get_cap, ddi_intr_set_cap \- get or set interrupt capabilities for a
9 given interrupt type
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/types.h>
14 #include <sys/conf.h>
15 #include <sys/ddi.h>
16 #include <sys/sunddi.h>
18 \fBint\fR \fBddi_intr_get_cap\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBint *\fR\fIflagsp\fR);
19 .fi
21 .LP
22 .nf
23 \fBint\fR \fBddi_intr_set_cap\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBint\fR \fIflags\fR);
24 .fi
26 .SH INTERFACE LEVEL
27 .sp
28 .LP
29 Solaris DDI specific (Solaris DDI).
30 .SH PARAMETERS
31 .sp
32 .LP
33 \fBddi_intr_get_cap()\fR
34 .sp
35 .ne 2
36 .na
37 \fB\fIh\fR\fR
38 .ad
39 .RS 10n
40 DDI interrupt handle
41 .RE
43 .sp
44 .ne 2
45 .na
46 \fB\fIflagsp\fR\fR
47 .ad
48 .RS 10n
49 Pointer to the capability flags returned for this handle
50 .RE
52 .sp
53 .LP
54 \fBddi_intr_set_cap()\fR
55 .sp
56 .ne 2
57 .na
58 \fB\fIh\fR\fR
59 .ad
60 .RS 9n
61 DDI interrupt handle
62 .RE
64 .sp
65 .ne 2
66 .na
67 \fB\fIflags\fR\fR
68 .ad
69 .RS 9n
70 Contains the capability flag to be set
71 .RE
73 .SH DESCRIPTION
74 .sp
75 .LP
76 The \fBddi_intr_get_cap()\fR function returns the interrupt capability flags
77 for the interrupt handle \fIh\fR. Upon a successful return, the flags are
78 returned in the integer pointed to by the \fIflagsp\fR argument.
79 .sp
80 .LP
81 These flags are typically combinations of the following:
82 .sp
83 .ne 2
84 .na
85 \fB\fBDDI_INTR_FLAG_EDGE\fR\fR
86 .ad
87 .RS 26n
88 For discrete interrupts, the host supports \fBedge\fR type of trigger. This
89 flag is not returned for \fBDDI_INTR_TYPE_MSI\fR or \fBDDI_INTR_TYPE_MSIX\fR
90 interrupt types. This is a read-write (RW) flag.
91 .RE
93 .sp
94 .ne 2
95 .na
96 \fB\fBDDI_INTR_FLAG_LEVEL\fR\fR
97 .ad
98 .RS 26n
99 For discrete interrupts the host supports \fBlevel\fR, \fBedge\fR, or both
100 types of triggers. This flag is not returned for \fBDDI_INTR_TYPE_MSI\fR or
101 \fBDDI_INTR_TYPE_MSIX\fR interrupt types.
105 .ne 2
107 \fB\fBDDI_INTR_FLAG_MASKABLE\fR\fR
109 .RS 26n
110 The interrupt can be masked either by the device or by the host bridge, or
111 optionally by the host. This is a read-only (\fBRO\fR) flag.
115 .ne 2
117 \fB\fBDDI_INTR_FLAG_PENDING\fR\fR
119 .RS 26n
120 The interrupt supports an interrupt pending bit. This is a read-only (\fBRO\fR)
121 flag.
125 .ne 2
127 \fB\fBDDI_INTR_FLAG_BLOCK\fR\fR
129 .RS 26n
130 All interrupts of the given type must be block-enabled and are not individually
131 maskable. This is a read-only (\fBRO\fR) flag.
136 The \fBddi_intr_set_cap()\fR function allows a driver to specify the capability
137 flags for the interrupt handle \fIh\fR. Only \fBDDI_INTR_FLAG_LEVEL\fR and
138 \fBDDI_INTR_FLAG_EDGE\fR flags can be set. Some devices can support both level
139 and edge capability and either can be set by using the \fBddi_intr_set_cap()\fR
140 function. Setting the capability flags is device and platform dependent.
143 The \fBddi_intr_set_cap()\fR function can be called after interrupts are
144 allocated and prior to adding the interrupt handler. For all other times it
145 returns failure.
146 .SH RETURN VALUES
149 The \fBddi_intr_get_cap()\fR and \fBddi_intr_set_cap()\fR functions return:
151 .ne 2
153 \fB\fBDDI_SUCCESS\fR\fR
155 .RS 15n
156 On success.
160 .ne 2
162 \fB\fBDDI_EINVAL\fR\fR
164 .RS 15n
165 On encountering invalid input parameters.
169 .ne 2
171 \fB\fBDDI_FAILURE\fR\fR
173 .RS 15n
174 On any implementation specific failure.
178 .ne 2
180 \fB\fBDDI_ENOTSUP\fR\fR
182 .RS 15n
183 On device not supporting operation.
186 .SH CONTEXT
189 The \fBddi_intr_get_cap()\fR and \fBddi_intr_set_cap()\fR functions can be
190 called from either user or kernel non-interrupt context.
191 .SH ATTRIBUTES
194 See \fBattributes\fR(5) for descriptions of the following attributes:
199 box;
200 c | c
201 l | l .
202 ATTRIBUTE TYPE  ATTRIBUTE VALUE
204 Interface Stability     Committed
207 .SH SEE ALSO
210 \fBattributes\fR(5), \fBddi_intr_alloc\fR(9F), \fBddi_intr_block_enable\fR(9F),
211 \fBddi_intr_get_nintrs\fR(9F), \fBddi_intr_get_pending\fR(9F),
212 \fBddi_intr_get_supported_types\fR(9F), \fBddi_intr_set_mask\fR(9F)
215 \fIWriting Device Drivers\fR
216 .SH NOTES
219 Consumers of these interfaces should verify that the return value is not equal
220 to \fBDDI_SUCCESS\fR. Incomplete checking for failure codes could result in
221 inconsistent behavior among platforms.