This section provides examples for performing the following tasks:
Changing soft interrupt priority
Checking for pending interrupts
Setting interrupt masks
Clearing interrupt masks
Use the ddi_intr_set_softint_pri(9F) function to change the soft interrupt priority to 9.
if (ddi_intr_set_softint_pri(mydev->mydev_softint_hdl, 9) != DDI_SUCCESS) cmn_err (CE_WARN, "ddi_intr_set_softint_pri failed");
Use the ddi_intr_get_pending(9F) function to check whether an interrupt is pending.
if (ddi_intr_get_pending(mydevp->htable[0], &pending) != DDI_SUCCESS) cmn_err(CE_WARN, "ddi_intr_get_pending() failed"); else if (pending) cmn_err(CE_NOTE, "ddi_intr_get_pending(): Interrupt pending");
Use the ddi_intr_set_mask(9F) function to set interrupt masking to prevent the device from receiving interrupts.
if ((ddi_intr_set_mask(mydevp->htable[0]) != DDI_SUCCESS)) cmn_err(CE_WARN, "ddi_intr_set_mask() failed");
Use the ddi_intr_clr_mask(9F) function to clear interrupt masking. The ddi_intr_clr_mask(9F) function fails if the specified interrupt is not enabled. If the ddi_intr_clr_mask(9F) function succeeds, the device starts generating interrupts.
if (ddi_intr_clr_mask(mydevp->htable[0]) != DDI_SUCCESS) cmn_err(CE_WARN, "ddi_intr_clr_mask() failed");