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"
8 ddi_intr_get_cap, ddi_intr_set_cap \- get or set interrupt capabilities for a
13 #include <sys/types.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);
23 \fBint\fR \fBddi_intr_set_cap\fR(\fBddi_intr_handle_t\fR \fIh\fR, \fBint\fR \fIflags\fR);
29 Solaris DDI specific (Solaris DDI).
33 \fBddi_intr_get_cap()\fR
49 Pointer to the capability flags returned for this handle
54 \fBddi_intr_set_cap()\fR
70 Contains the capability flag to be set
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.
81 These flags are typically combinations of the following:
85 \fB\fBDDI_INTR_FLAG_EDGE\fR\fR
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.
96 \fB\fBDDI_INTR_FLAG_LEVEL\fR\fR
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.
107 \fB\fBDDI_INTR_FLAG_MASKABLE\fR\fR
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.
117 \fB\fBDDI_INTR_FLAG_PENDING\fR\fR
120 The interrupt supports an interrupt pending bit. This is a read-only (\fBRO\fR)
127 \fB\fBDDI_INTR_FLAG_BLOCK\fR\fR
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
149 The \fBddi_intr_get_cap()\fR and \fBddi_intr_set_cap()\fR functions return:
153 \fB\fBDDI_SUCCESS\fR\fR
162 \fB\fBDDI_EINVAL\fR\fR
165 On encountering invalid input parameters.
171 \fB\fBDDI_FAILURE\fR\fR
174 On any implementation specific failure.
180 \fB\fBDDI_ENOTSUP\fR\fR
183 On device not supporting operation.
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.
194 See \fBattributes\fR(5) for descriptions of the following attributes:
202 ATTRIBUTE TYPE ATTRIBUTE VALUE
204 Interface Stability Committed
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
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.