Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
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.
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.
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]
#include <sys/types.h> #include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> int ddi_intr_enable(ddi_intr_handle_t h);
int ddi_intr_block_enable(ddi_intr_handle_t *h_array, int count);
int ddi_intr_disable(ddi_intr_handle_t h);
int ddi_intr_block_disable(ddi_intr_handle_t *h_array, int count);
DDI interrupt handle
ddi_intr_block_enable() h_array
Pointer to an array of DDI interrupt handles
Number of interrupts
ddi_intr_disable() h
DDI interrupt handle
ddi_intr_block_disable() h_array
Pointer to an array of DDI interrupt handles
Number of interrupts
The ddi_intr_block_enable() function enables a range of interrupts given by the count and h_array arguments, where count must be at least 1 and h_array is pointer to a count-sized array of interrupt handles.
The ddi_intr_block_enable() function can be used only if the device or host bridge supports the block enable/disable feature. The ddi_intr_get_cap() function returns the RO flag DDI_INTR_FLAG_BLOCK if the device or host bridge supports the interrupt block enable/disable feature for the given interrupt type. The ddi_intr_block_enable() function is useful for enabling MSI interrupts when the optional per-vector masking capability is not supported.
The ddi_intr_enable() or ddi_intr_block_enable() functions must be called after the required interrupt resources are allocated with ddi_intr_alloc(), the interrupt handlers are added through ddi_intr_add_handler(), and the required locks are initialized by mutex(9F) or rwlock(9F).
Once enabled by either of the enable calls, the interrupt can be taken and passed to the driver's interrupt service routine. Enabling an interrupt implies clearing any system or device mask bits associated with the interrupt.
The ddi_intr_disable() function disables the interrupt given by the interrupt handle h.
The ddi_intr_block_disable() function disables a range of interrupts given by the count and h_array arguments, where count must be at least 1 and h_array is pointer to a count-sized array of interrupt handles.
The ddi_intr_block_disable() function can be used only if the device or host bridge supports the block enable/disable feature. The ddi_intr_get_cap() function returns the RO flag DDI_INTR_FLAG_BLOCK if the device or host bridge supports the interrupt block enable/disable feature for the given interrupt type. The ddi_intr_block_disable() function is useful for disabling MSI interrupts when the optional per-vector masking capability is not supported.
The ddi_intr_disable() or ddi_intr_block_disable() functions must be called before removing the interrupt handler and freeing the corresponding interrupt with ddi_intr_remove_handler() and ddi_intr_free(), respectively. The ddi_intr_block_disable() function should be called if the ddi_intr_block_enable() function was used to enable the interrupts.
On success.
On encountering invalid input parameters.
On any implementation specific failure.
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Committed |
Writing Device Drivers
If a device driver that uses MSI and MSI-X interrupts resets the device, the device might reset its configuration space modifications. Such a reset could cause a device driver to lose any MSI and MSI-X interrupt usage settings that have been applied.