LCOV - code coverage report
Current view: top level - drivers/common/sfc_efx/base - ef10_intr.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 41 0.0 %
Date: 2024-01-22 15:55:54 Functions: 0 10 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 16 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  *
       3                 :            :  * Copyright(c) 2019-2021 Xilinx, Inc.
       4                 :            :  * Copyright(c) 2012-2019 Solarflare Communications Inc.
       5                 :            :  */
       6                 :            : 
       7                 :            : #include "efx.h"
       8                 :            : #include "efx_impl.h"
       9                 :            : 
      10                 :            : 
      11                 :            : #if EFX_OPTS_EF10()
      12                 :            : 
      13                 :            :         __checkReturn   efx_rc_t
      14                 :          0 : ef10_intr_init(
      15                 :            :         __in            efx_nic_t *enp,
      16                 :            :         __in            efx_intr_type_t type,
      17                 :            :         __in            efsys_mem_t *esmp)
      18                 :            : {
      19                 :            :         _NOTE(ARGUNUSED(enp, type, esmp))
      20                 :          0 :         return (0);
      21                 :            : }
      22                 :            : 
      23                 :            : 
      24                 :            :                         void
      25                 :          0 : ef10_intr_enable(
      26                 :            :         __in            efx_nic_t *enp)
      27                 :            : {
      28                 :            :         _NOTE(ARGUNUSED(enp))
      29                 :          0 : }
      30                 :            : 
      31                 :            : 
      32                 :            :                         void
      33                 :          0 : ef10_intr_disable(
      34                 :            :         __in            efx_nic_t *enp)
      35                 :            : {
      36                 :            :         _NOTE(ARGUNUSED(enp))
      37                 :          0 : }
      38                 :            : 
      39                 :            : 
      40                 :            :                         void
      41                 :          0 : ef10_intr_disable_unlocked(
      42                 :            :         __in            efx_nic_t *enp)
      43                 :            : {
      44                 :            :         _NOTE(ARGUNUSED(enp))
      45                 :          0 : }
      46                 :            : 
      47                 :            : 
      48                 :            : static  __checkReturn   efx_rc_t
      49                 :          0 : efx_mcdi_trigger_interrupt(
      50                 :            :         __in            efx_nic_t *enp,
      51                 :            :         __in            unsigned int level)
      52                 :            : {
      53                 :            :         efx_mcdi_req_t req;
      54                 :          0 :         EFX_MCDI_DECLARE_BUF(payload, MC_CMD_TRIGGER_INTERRUPT_IN_LEN,
      55                 :            :                 MC_CMD_TRIGGER_INTERRUPT_OUT_LEN);
      56                 :            :         efx_rc_t rc;
      57                 :            : 
      58         [ #  # ]:          0 :         EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
      59                 :            : 
      60         [ #  # ]:          0 :         if (level >= enp->en_nic_cfg.enc_intr_limit) {
      61                 :            :                 rc = EINVAL;
      62                 :          0 :                 goto fail1;
      63                 :            :         }
      64                 :            : 
      65                 :          0 :         req.emr_cmd = MC_CMD_TRIGGER_INTERRUPT;
      66                 :          0 :         req.emr_in_buf = payload;
      67                 :          0 :         req.emr_in_length = MC_CMD_TRIGGER_INTERRUPT_IN_LEN;
      68                 :          0 :         req.emr_out_buf = payload;
      69                 :          0 :         req.emr_out_length = MC_CMD_TRIGGER_INTERRUPT_OUT_LEN;
      70                 :            : 
      71                 :          0 :         MCDI_IN_SET_DWORD(req, TRIGGER_INTERRUPT_IN_INTR_LEVEL, level);
      72                 :            : 
      73                 :          0 :         efx_mcdi_execute(enp, &req);
      74                 :            : 
      75         [ #  # ]:          0 :         if (req.emr_rc != 0) {
      76                 :            :                 rc = req.emr_rc;
      77                 :          0 :                 goto fail2;
      78                 :            :         }
      79                 :            : 
      80                 :            :         return (0);
      81                 :            : 
      82                 :            : fail2:
      83                 :            :         EFSYS_PROBE(fail2);
      84                 :            : 
      85                 :            : fail1:
      86                 :            :         EFSYS_PROBE1(fail1, efx_rc_t, rc);
      87                 :            : 
      88                 :            :         return (rc);
      89                 :            : }
      90                 :            : 
      91                 :            :         __checkReturn   efx_rc_t
      92                 :          0 : ef10_intr_trigger(
      93                 :            :         __in            efx_nic_t *enp,
      94                 :            :         __in            unsigned int level)
      95                 :            : {
      96                 :            :         efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
      97                 :            :         efx_rc_t rc;
      98                 :            : 
      99         [ #  # ]:          0 :         if (encp->enc_bug41750_workaround) {
     100                 :            :                 /*
     101                 :            :                  * bug 41750: Test interrupts don't work on Greenport
     102                 :            :                  * bug 50084: Test interrupts don't work on VFs
     103                 :            :                  */
     104                 :            :                 rc = ENOTSUP;
     105                 :          0 :                 goto fail1;
     106                 :            :         }
     107                 :            : 
     108         [ #  # ]:          0 :         if ((rc = efx_mcdi_trigger_interrupt(enp, level)) != 0)
     109                 :          0 :                 goto fail2;
     110                 :            : 
     111                 :            :         return (0);
     112                 :            : 
     113                 :            : fail2:
     114                 :            :         EFSYS_PROBE(fail2);
     115                 :            : fail1:
     116                 :            :         EFSYS_PROBE1(fail1, efx_rc_t, rc);
     117                 :            : 
     118                 :            :         return (rc);
     119                 :            : }
     120                 :            : 
     121                 :            :                         void
     122                 :          0 : ef10_intr_status_line(
     123                 :            :         __in            efx_nic_t *enp,
     124                 :            :         __out           boolean_t *fatalp,
     125                 :            :         __out           uint32_t *qmaskp)
     126                 :            : {
     127                 :            :         efx_dword_t dword;
     128                 :            : 
     129         [ #  # ]:          0 :         EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
     130                 :            : 
     131                 :            :         /* Read the queue mask and implicitly acknowledge the interrupt. */
     132         [ #  # ]:          0 :         EFX_BAR_READD(enp, ER_DZ_BIU_INT_ISR_REG, &dword, B_FALSE);
     133                 :          0 :         *qmaskp = EFX_DWORD_FIELD(dword, EFX_DWORD_0);
     134                 :            : 
     135                 :            :         EFSYS_PROBE1(qmask, uint32_t, *qmaskp);
     136                 :            : 
     137                 :          0 :         *fatalp = B_FALSE;
     138                 :          0 : }
     139                 :            : 
     140                 :            :                         void
     141                 :          0 : ef10_intr_status_message(
     142                 :            :         __in            efx_nic_t *enp,
     143                 :            :         __in            unsigned int message,
     144                 :            :         __out           boolean_t *fatalp)
     145                 :            : {
     146         [ #  # ]:          0 :         EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
     147                 :            : 
     148                 :            :         _NOTE(ARGUNUSED(enp, message))
     149                 :            : 
     150                 :            :         /* EF10 fatal errors are reported via events */
     151                 :          0 :         *fatalp = B_FALSE;
     152                 :          0 : }
     153                 :            : 
     154                 :            :                         void
     155                 :          0 : ef10_intr_fatal(
     156                 :            :         __in            efx_nic_t *enp)
     157                 :            : {
     158                 :            :         /* EF10 fatal errors are reported via events */
     159                 :            :         _NOTE(ARGUNUSED(enp))
     160                 :          0 : }
     161                 :            : 
     162                 :            :                         void
     163                 :          0 : ef10_intr_fini(
     164                 :            :         __in            efx_nic_t *enp)
     165                 :            : {
     166                 :            :         _NOTE(ARGUNUSED(enp))
     167                 :          0 : }
     168                 :            : 
     169                 :            : #endif  /* EFX_OPTS_EF10() */

Generated by: LCOV version 1.14