DDI_INTR_GET_CAP(9F) | Kernel Functions for Drivers | DDI_INTR_GET_CAP(9F) |
ddi_intr_get_cap, ddi_intr_set_cap - get or set interrupt capabilities for a given interrupt type
#include <sys/types.h> #include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> int ddi_intr_get_cap(ddi_intr_handle_t h, int *flagsp);
int ddi_intr_set_cap(ddi_intr_handle_t h, int flags);
illumos DDI specific (illumos DDI).
ddi_intr_get_cap()
h
flagsp
ddi_intr_set_cap()
h
flags
The ddi_intr_get_cap() function returns the interrupt capability flags for the interrupt handle h. Upon a successful return, the flags are returned in the integer pointed to by the flagsp argument.
These flags are typically combinations of the following:
DDI_INTR_FLAG_EDGE
DDI_INTR_FLAG_LEVEL
DDI_INTR_FLAG_MASKABLE
DDI_INTR_FLAG_PENDING
DDI_INTR_FLAG_BLOCK
The ddi_intr_set_cap() function allows a driver to specify the capability flags for the interrupt handle h. Only DDI_INTR_FLAG_LEVEL and DDI_INTR_FLAG_EDGE flags can be set. Some devices can support both level and edge capability and either can be set by using the ddi_intr_set_cap() function. Setting the capability flags is device and platform dependent.
The ddi_intr_set_cap() function can be called after interrupts are allocated and prior to adding the interrupt handler. For all other times it returns failure.
The ddi_intr_get_cap() and ddi_intr_set_cap() functions return:
DDI_SUCCESS
DDI_EINVAL
DDI_FAILURE
DDI_ENOTSUP
The ddi_intr_get_cap() and ddi_intr_set_cap() functions can be called from either user or kernel non-interrupt context.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
attributes(7), ddi_intr_alloc(9F), ddi_intr_block_enable(9F), ddi_intr_get_nintrs(9F), ddi_intr_get_pending(9F), ddi_intr_get_supported_types(9F), ddi_intr_set_mask(9F)
Writing Device Drivers
Consumers of these interfaces should verify that the return value is not equal to DDI_SUCCESS. Incomplete checking for failure codes could result in inconsistent behavior among platforms.
April 20, 2005 | OmniOS |