2 * Copyright (c) 2007-2016 Solarflare Communications Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
35 __checkReturn efx_rc_t
38 __in efx_intr_type_t type,
39 __in efsys_mem_t *esmp)
41 efx_intr_t *eip = &(enp->en_intr);
42 const efx_intr_ops_t *eiop;
45 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
46 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
48 if (enp->en_mod_flags & EFX_MOD_INTR) {
57 enp->en_mod_flags |= EFX_MOD_INTR;
59 switch (enp->en_family) {
62 EFSYS_ASSERT(B_FALSE);
67 if ((rc = eiop->eio_init(enp, type, esmp)) != 0)
79 EFSYS_PROBE1(fail1, efx_rc_t, rc);
88 efx_intr_t *eip = &(enp->en_intr);
89 const efx_intr_ops_t *eiop = eip->ei_eiop;
91 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
92 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
93 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
97 enp->en_mod_flags &= ~EFX_MOD_INTR;
104 efx_intr_t *eip = &(enp->en_intr);
105 const efx_intr_ops_t *eiop = eip->ei_eiop;
107 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
108 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
110 eiop->eio_enable(enp);
117 efx_intr_t *eip = &(enp->en_intr);
118 const efx_intr_ops_t *eiop = eip->ei_eiop;
120 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
121 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
123 eiop->eio_disable(enp);
127 efx_intr_disable_unlocked(
130 efx_intr_t *eip = &(enp->en_intr);
131 const efx_intr_ops_t *eiop = eip->ei_eiop;
133 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
134 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
136 eiop->eio_disable_unlocked(enp);
140 __checkReturn efx_rc_t
143 __in unsigned int level)
145 efx_intr_t *eip = &(enp->en_intr);
146 const efx_intr_ops_t *eiop = eip->ei_eiop;
148 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
149 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
151 return (eiop->eio_trigger(enp, level));
155 efx_intr_status_line(
157 __out boolean_t *fatalp,
158 __out uint32_t *qmaskp)
160 efx_intr_t *eip = &(enp->en_intr);
161 const efx_intr_ops_t *eiop = eip->ei_eiop;
163 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
164 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
166 eiop->eio_status_line(enp, fatalp, qmaskp);
170 efx_intr_status_message(
172 __in unsigned int message,
173 __out boolean_t *fatalp)
175 efx_intr_t *eip = &(enp->en_intr);
176 const efx_intr_ops_t *eiop = eip->ei_eiop;
178 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
179 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
181 eiop->eio_status_message(enp, message, fatalp);
188 efx_intr_t *eip = &(enp->en_intr);
189 const efx_intr_ops_t *eiop = eip->ei_eiop;
191 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
192 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
194 eiop->eio_fatal(enp);
198 /* ************************************************************************* */
199 /* ************************************************************************* */
200 /* ************************************************************************* */