summaryrefslogtreecommitdiffstats
path: root/sys/dev/sfxge/common/efx_ev.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/sfxge/common/efx_ev.c')
-rw-r--r--sys/dev/sfxge/common/efx_ev.c101
1 files changed, 53 insertions, 48 deletions
diff --git a/sys/dev/sfxge/common/efx_ev.c b/sys/dev/sfxge/common/efx_ev.c
index 9669fc4..037dbfa 100644
--- a/sys/dev/sfxge/common/efx_ev.c
+++ b/sys/dev/sfxge/common/efx_ev.c
@@ -31,12 +31,11 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include "efsys.h"
#include "efx.h"
-#include "efx_types.h"
-#include "efx_regs.h"
#include "efx_impl.h"
+#if EFSYS_OPT_MON_MCDI
#include "mcdi_mon.h"
+#endif
#if EFSYS_OPT_QSTATS
#define EFX_EV_QSTAT_INCR(_eep, _stat) \
@@ -56,7 +55,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_init(
__in efx_nic_t *enp);
@@ -64,7 +63,7 @@ static void
falconsiena_ev_fini(
__in efx_nic_t *enp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -77,7 +76,7 @@ static void
falconsiena_ev_qdestroy(
__in efx_evq_t *eep);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count);
@@ -94,7 +93,7 @@ falconsiena_ev_qpost(
__in efx_evq_t *eep,
__in uint16_t data);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us);
@@ -139,28 +138,28 @@ static efx_ev_ops_t __efx_ev_siena_ops = {
};
#endif /* EFSYS_OPT_SIENA */
-#if EFSYS_OPT_HUNTINGTON
-static efx_ev_ops_t __efx_ev_hunt_ops = {
- hunt_ev_init, /* eevo_init */
- hunt_ev_fini, /* eevo_fini */
- hunt_ev_qcreate, /* eevo_qcreate */
- hunt_ev_qdestroy, /* eevo_qdestroy */
- hunt_ev_qprime, /* eevo_qprime */
- hunt_ev_qpost, /* eevo_qpost */
- hunt_ev_qmoderate, /* eevo_qmoderate */
+#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
+static efx_ev_ops_t __efx_ev_ef10_ops = {
+ ef10_ev_init, /* eevo_init */
+ ef10_ev_fini, /* eevo_fini */
+ ef10_ev_qcreate, /* eevo_qcreate */
+ ef10_ev_qdestroy, /* eevo_qdestroy */
+ ef10_ev_qprime, /* eevo_qprime */
+ ef10_ev_qpost, /* eevo_qpost */
+ ef10_ev_qmoderate, /* eevo_qmoderate */
#if EFSYS_OPT_QSTATS
- hunt_ev_qstats_update, /* eevo_qstats_update */
+ ef10_ev_qstats_update, /* eevo_qstats_update */
#endif
};
-#endif /* EFSYS_OPT_HUNTINGTON */
+#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_init(
__in efx_nic_t *enp)
{
efx_ev_ops_t *eevop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -185,10 +184,16 @@ efx_ev_init(
#if EFSYS_OPT_HUNTINGTON
case EFX_FAMILY_HUNTINGTON:
- eevop = (efx_ev_ops_t *)&__efx_ev_hunt_ops;
+ eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops;
break;
#endif /* EFSYS_OPT_HUNTINGTON */
+#if EFSYS_OPT_MEDFORD
+ case EFX_FAMILY_MEDFORD:
+ eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops;
+ break;
+#endif /* EFSYS_OPT_MEDFORD */
+
default:
EFSYS_ASSERT(0);
rc = ENOTSUP;
@@ -208,7 +213,7 @@ fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
enp->en_eevop = NULL;
enp->en_mod_flags &= ~EFX_MOD_EV;
@@ -235,7 +240,7 @@ efx_ev_fini(
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -247,7 +252,7 @@ efx_ev_qcreate(
efx_ev_ops_t *eevop = enp->en_eevop;
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_evq_t *eep;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV);
@@ -279,7 +284,7 @@ fail2:
EFSYS_PROBE(fail2);
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -301,14 +306,14 @@ efx_ev_qdestroy(
EFSYS_KMEM_FREE(enp->en_esip, sizeof (efx_evq_t), eep);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count)
{
efx_nic_t *enp = eep->ee_enp;
efx_ev_ops_t *eevop = enp->en_eevop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
@@ -325,7 +330,7 @@ efx_ev_qprime(
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -409,14 +414,14 @@ efx_ev_qpost(
eevop->eevo_qpost(eep, data);
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us)
{
efx_nic_t *enp = eep->ee_enp;
efx_ev_ops_t *eevop = enp->en_eevop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
@@ -426,7 +431,7 @@ efx_ev_qmoderate(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -448,7 +453,7 @@ efx_ev_qstats_update(
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_init(
__in efx_nic_t *enp)
{
@@ -492,7 +497,7 @@ falconsiena_ev_rx_not_ok(
EFX_EV_QSTAT_INCR(eep, EV_RX_FRM_TRUNC);
(*flagsp) |= EFX_DISCARD;
-#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER)
+#if EFSYS_OPT_RX_SCATTER
/*
* Lookout for payload queue ran dry errors and ignore them.
*
@@ -507,7 +512,7 @@ falconsiena_ev_rx_not_ok(
(EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) == 0) &&
(EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_BYTE_CNT) == 0))
ignore = B_TRUE;
-#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */
+#endif /* EFSYS_OPT_RX_SCATTER */
}
if (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_ETH_CRC_ERR) != 0) {
@@ -568,10 +573,10 @@ falconsiena_ev_rx(
uint32_t size;
uint32_t label;
boolean_t ok;
-#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER)
+#if EFSYS_OPT_RX_SCATTER
boolean_t sop;
boolean_t jumbo_cont;
-#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */
+#endif /* EFSYS_OPT_RX_SCATTER */
uint32_t hdr_type;
boolean_t is_v6;
uint16_t flags;
@@ -586,10 +591,10 @@ falconsiena_ev_rx(
label = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_Q_LABEL);
ok = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_PKT_OK) != 0);
-#if (EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER)
+#if EFSYS_OPT_RX_SCATTER
sop = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_SOP) != 0);
jumbo_cont = (EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_JUMBO_CONT) != 0);
-#endif /* EFSYS_OPT_RX_HDR_SPLIT || EFSYS_OPT_RX_SCATTER */
+#endif /* EFSYS_OPT_RX_SCATTER */
hdr_type = EFX_QWORD_FIELD(*eqp, FSF_AZ_RX_EV_HDR_TYPE);
@@ -644,13 +649,13 @@ falconsiena_ev_rx(
break;
}
-#if EFSYS_OPT_RX_SCATTER || EFSYS_OPT_RX_HDR_SPLIT
+#if EFSYS_OPT_RX_SCATTER
/* Report scatter and header/lookahead split buffer flags */
if (sop)
flags |= EFX_PKT_START;
if (jumbo_cont)
flags |= EFX_PKT_CONT;
-#endif /* EFSYS_OPT_RX_SCATTER || EFSYS_OPT_RX_HDR_SPLIT */
+#endif /* EFSYS_OPT_RX_SCATTER */
/* Detect errors included in the FSF_AZ_RX_EV_PKT_OK indication */
if (!ok) {
@@ -990,7 +995,7 @@ falconsiena_ev_mcdi(
#if EFSYS_OPT_MON_STATS
efx_mon_stat_t id;
efx_mon_stat_value_t value;
- int rc;
+ efx_rc_t rc;
if ((rc = mcdi_mon_ev(enp, eqp, &id, &value)) == 0)
should_abort = eecp->eec_monitor(arg, id, value);
@@ -1047,7 +1052,7 @@ out:
#endif /* EFSYS_OPT_MCDI */
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count)
@@ -1220,7 +1225,7 @@ falconsiena_ev_qpost(
EFX_BAR_WRITEO(enp, FR_AZ_DRV_EV_REG, &oword);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us)
@@ -1229,7 +1234,7 @@ falconsiena_ev_qmoderate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
unsigned int locked;
efx_dword_t dword;
- int rc;
+ efx_rc_t rc;
if (us > encp->enc_evq_timer_max_us) {
rc = EINVAL;
@@ -1274,12 +1279,12 @@ falconsiena_ev_qmoderate(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
@@ -1291,7 +1296,7 @@ falconsiena_ev_qcreate(
efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
uint32_t size;
efx_oword_t oword;
- int rc;
+ efx_rc_t rc;
EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MAXNEVS));
EFX_STATIC_ASSERT(ISP2(EFX_EVQ_MINNEVS));
@@ -1352,7 +1357,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
OpenPOWER on IntegriCloud