49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Copyright (c) 2008-2016 Solarflare Communications Inc.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * All rights reserved.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Redistribution and use in source and binary forms, with or without
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * modification, are permitted provided that the following conditions are met:
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * 1. Redistributions of source code must retain the above copyright notice,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * this list of conditions and the following disclaimer.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * 2. Redistributions in binary form must reproduce the above copyright notice,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * this list of conditions and the following disclaimer in the documentation
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * and/or other materials provided with the distribution.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * The views and conclusions contained in the software and documentation are
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * those of the authors and should not be interpreted as representing official
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * policies, either expressed or implied, of the FreeBSD Project.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore/* Interrupt table DMA attributes */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorestatic ddi_device_acc_attr_t sfxge_intr_devacc = {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore DDI_DEVICE_ATTR_V0, /* devacc_attr_version */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore DDI_NEVERSWAP_ACC, /* devacc_attr_endian_flags */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore DDI_STRICTORDER_ACC /* devacc_attr_dataorder */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorestatic ddi_dma_attr_t sfxge_intr_dma_attr = {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore 0, /* dma_attr_addr_lo */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore 0xffffffffffffffffull, /* dma_attr_addr_hi */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore 0xffffffffffffffffull, /* dma_attr_count_max */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore 0xffffffffffffffffull, /* dma_attr_maxxfer */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore 0 /* dma_attr_flags */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorestatic unsigned int
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (index = 0; index < EFX_INTR_NEVQS; index++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * bug15671/bug17203 workaround. Return CLAIMED for the first ISR=0
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * interrupt, and poll all evqs for work. For subsequent ISR=0
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * interrupts (the line must be shared in this case), just rearm the
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * event queues to ensure we don't miss an interrupt.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (index = 0; index < EFX_INTR_NEVQS; index++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (index = 0; index < EFX_INTR_NEVQS; index++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorestatic unsigned int
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amoresfxge_intr_message(caddr_t arg1, caddr_t arg2)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore unsigned int index = (unsigned int)(uintptr_t)arg2;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore ASSERT3U(sip->si_type, ==, EFX_INTR_MESSAGE);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore } while (atomic_cas_64(&(sip->si_mask), mask,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore efx_intr_status_message(enp, index, &fatal);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Serialise all instances to avoid problems seen in bug31184. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_enable: unknown intr type (si_type=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Try to add the handlers */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (add_index = 0; add_index < sip->si_nalloc; add_index++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* This cannot fail unless given invalid inputs. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_get_pri(sip->si_table[add_index], &pri);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore DTRACE_PROBE2(pri, unsigned int, add_index, unsigned int, pri);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_add_handler(sip->si_table[add_index], handler,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (caddr_t)sp, (caddr_t)(uintptr_t)add_index);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_enable: ddi_intr_add_handler failed"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " err=%d (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err, (void *)sip->si_table[add_index], add_index,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Get interrupt capabilities */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_get_cap(sip->si_table[0], &(sip->si_cap));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_enable: ddi_intr_get_cap failed"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " err=%d (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err, (void *)sip->si_table[0], 0, sip->si_nalloc);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Enable interrupts at the bus */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_block_enable(sip->si_table, sip->si_nalloc);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_enable: ddi_intr_block_enable failed"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " err=%d (table=%p nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err, (void *)sip->si_table, sip->si_nalloc);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (en_index = 0; en_index < sip->si_nalloc; en_index++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_enable(sip->si_table[en_index]);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_enable: ddi_intr_enable failed"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " err=%d (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable the enabled handlers */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore while (--en_index >= 0) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_disable(sip->si_table[en_index]);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_enable: ddi_intr_disable"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " failed err=%d (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Remove all handlers */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Remove remaining handlers */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore while (--add_index >= 0) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_remove_handler(sip->si_table[add_index]);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_enable: ddi_intr_remove_handler"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " failed err=%d (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err, (void *)sip->si_table[add_index], add_index,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Serialise all instances to avoid problems seen in bug31184. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable interrupts at the bus */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_block_disable(sip->si_table, sip->si_nalloc);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_disable: ddi_intr_block_disable"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " failed err=%d (table=%p nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err, (void *)sip->si_table, sip->si_nalloc);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore while (--index >= 0) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_disable(sip->si_table[index]);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_disable: ddi_intr_disable"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " failed err=%d (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Remove all handlers */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore while (--index >= 0) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_remove_handler(sip->si_table[index]);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "bus_disable: ddi_intr_remove_handler"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " failed err=%d (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Zero the memory */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Enable interrupts at the NIC */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((rc = efx_intr_init(enp, sip->si_type, esmp)) != 0)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* FIXME FIXME FIXME */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if (sp->s_family == EFX_FAMILY_HUNTINGTON) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable interrupt test until supported on Huntington. */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* FIXME FIXME FIXME */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Test the interrupts */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (index = 0; index < sip->si_nalloc; index++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Wait for the tests to complete */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Spin for 1 ms */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Check to see that all the test interrupts have been
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "Interrupt test failed (mask=%"PRIx64" got=%"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore DTRACE_PROBE2(int_test_fail, uint64_t, mask, uint64_t, sip->si_mask);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable interrupts at the NIC */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable interrupts at the NIC */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amorestatic inline unsigned
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore ASSERT3U(sip->si_state, ==, SFXGE_INTR_UNINITIALIZED);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* PSARC 2007/453 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore (void) ddi_prop_create(DDI_DEV_T_NONE, dip, DDI_PROP_CANSLEEP,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Get the map of supported interrupt types */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_get_supported_types(dip, &types);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "intr_init: ddi_intr_get_supported_types failed err=%d",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Choose most favourable type */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Get the number of available interrupts */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_get_navail(dip, type, &navail);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "intr_init: ddi_intr_get_navail failed err=%d", err);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Double-check */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Allow greater number of MSI-X interrupts than CPUs.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * This can be useful to prevent RX no desc drops; See task 32179.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Limit non MSI-X interrupts to a single instance.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore navail = min(navail, sfxge_rx_scale_prop_get(sp));
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore DTRACE_PROBE1(navail, unsigned int, navail);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Allocate a handle table */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore sip->si_table_size = navail * sizeof (ddi_intr_handle_t);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore sip->si_table = kmem_zalloc(sip->si_table_size, KM_SLEEP);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Allocate interrupt handles.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore * Serialise all device instances to avoid problems seen in bug31184.
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore err = ddi_intr_alloc(dip, sip->si_table, type, 0,
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore navail, &(sip->si_nalloc), DDI_INTR_ALLOC_NORMAL);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "intr_init: ddi_intr_alloc failed err=%d"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " (navail=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Double-check */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Round down to a power of 2 */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Free off any excess handles */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore DTRACE_PROBE1(nalloc, unsigned int, sip->si_nalloc);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore dma_attr.sdba_dattrp = &sfxge_intr_dma_attr;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore dma_attr.sdba_memflags = DDI_DMA_CONSISTENT;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore dma_attr.sdba_bindflags = DDI_DMA_RDWR | DDI_DMA_CONSISTENT;
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((rc = sfxge_dma_buffer_create(esmp, &dma_attr)) != 0)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Store the highest priority for convenience */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore for (index = 0; index < sip->si_nalloc; index++) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore if ((rc = ddi_intr_get_pri(sip->si_table[index], &pri)) != 0)
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Free interrupt handles */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore while (--index >= 0) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "intr_init: ddi_intr_free failed err=%d"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Free the handle table */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore kmem_free(sip->si_table, sip->si_table_size);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Clear the interrupt type */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore ASSERT3U(sip->si_state, ==, SFXGE_INTR_INITIALIZED);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Enable interrupts at the bus */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Enable interrupts at the NIC */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable interrupts at the bus */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore ASSERT3U(sip->si_state, ==, SFXGE_INTR_STARTED);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable interrupts at the NIC */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Disable interrupts at the bus */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore ASSERT3U(sip->si_state, ==, SFXGE_INTR_INITIALIZED);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Tear down dma setup */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Free interrupt handles */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore while (--index >= 0) {
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore "intr_fini: ddi_intr_free failed err=%d"
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore " (h=%p idx=%d nalloc=%d)",
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Free the handle table */
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore kmem_free(sip->si_table, sip->si_table_size);
49ef7e0638c8b771d8a136eae78b1c0f99acc8e0Garrett D'Amore /* Clear the interrupt type */