1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2019-2020 Xilinx, Inc.
4 * Copyright(c) 2012-2019 Solarflare Communications Inc.
13 __checkReturn efx_rc_t
16 __in efx_intr_type_t type,
17 __in efsys_mem_t *esmp)
19 _NOTE(ARGUNUSED(enp, type, esmp))
41 ef10_intr_disable_unlocked(
48 static __checkReturn efx_rc_t
49 efx_mcdi_trigger_interrupt(
51 __in unsigned int level)
54 EFX_MCDI_DECLARE_BUF(payload, MC_CMD_TRIGGER_INTERRUPT_IN_LEN,
55 MC_CMD_TRIGGER_INTERRUPT_OUT_LEN);
58 EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
60 if (level >= enp->en_nic_cfg.enc_intr_limit) {
65 req.emr_cmd = MC_CMD_TRIGGER_INTERRUPT;
66 req.emr_in_buf = payload;
67 req.emr_in_length = MC_CMD_TRIGGER_INTERRUPT_IN_LEN;
68 req.emr_out_buf = payload;
69 req.emr_out_length = MC_CMD_TRIGGER_INTERRUPT_OUT_LEN;
71 MCDI_IN_SET_DWORD(req, TRIGGER_INTERRUPT_IN_INTR_LEVEL, level);
73 efx_mcdi_execute(enp, &req);
75 if (req.emr_rc != 0) {
86 EFSYS_PROBE1(fail1, efx_rc_t, rc);
91 __checkReturn efx_rc_t
94 __in unsigned int level)
96 efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
99 if (encp->enc_bug41750_workaround) {
101 * bug 41750: Test interrupts don't work on Greenport
102 * bug 50084: Test interrupts don't work on VFs
108 if ((rc = efx_mcdi_trigger_interrupt(enp, level)) != 0)
116 EFSYS_PROBE1(fail1, efx_rc_t, rc);
122 ef10_intr_status_line(
124 __out boolean_t *fatalp,
125 __out uint32_t *qmaskp)
129 EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
131 /* Read the queue mask and implicitly acknowledge the interrupt. */
132 EFX_BAR_READD(enp, ER_DZ_BIU_INT_ISR_REG, &dword, B_FALSE);
133 *qmaskp = EFX_DWORD_FIELD(dword, EFX_DWORD_0);
135 EFSYS_PROBE1(qmask, uint32_t, *qmaskp);
141 ef10_intr_status_message(
143 __in unsigned int message,
144 __out boolean_t *fatalp)
146 EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
148 _NOTE(ARGUNUSED(enp, message))
150 /* EF10 fatal errors are reported via events */
158 /* EF10 fatal errors are reported via events */
159 _NOTE(ARGUNUSED(enp))
166 _NOTE(ARGUNUSED(enp))
169 #endif /* EFX_OPTS_EF10() */