sfxge: rename hunt ev methods to ef10 and use for Medford

Submitted by:   Mark Spender <mspender at solarflare.com>
Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D4869
This commit is contained in:
Andrew Rybchenko 2016-01-12 13:32:04 +00:00
parent 15f20ea67d
commit ad8a32cb5d
4 changed files with 57 additions and 54 deletions

View File

@ -139,20 +139,20 @@ 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 efx_rc_t
@ -185,10 +185,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;

View File

@ -54,35 +54,35 @@ __FBSDID("$FreeBSD$");
static __checkReturn boolean_t
hunt_ev_rx(
ef10_ev_rx(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
__in_opt void *arg);
static __checkReturn boolean_t
hunt_ev_tx(
ef10_ev_tx(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
__in_opt void *arg);
static __checkReturn boolean_t
hunt_ev_driver(
ef10_ev_driver(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
__in_opt void *arg);
static __checkReturn boolean_t
hunt_ev_drv_gen(
ef10_ev_drv_gen(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
__in_opt void *arg);
static __checkReturn boolean_t
hunt_ev_mcdi(
ef10_ev_mcdi(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@ -230,7 +230,7 @@ fail1:
__checkReturn efx_rc_t
hunt_ev_init(
ef10_ev_init(
__in efx_nic_t *enp)
{
_NOTE(ARGUNUSED(enp))
@ -238,14 +238,14 @@ hunt_ev_init(
}
void
hunt_ev_fini(
ef10_ev_fini(
__in efx_nic_t *enp)
{
_NOTE(ARGUNUSED(enp))
}
__checkReturn efx_rc_t
hunt_ev_qcreate(
ef10_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
__in efsys_mem_t *esmp,
@ -272,11 +272,11 @@ hunt_ev_qcreate(
}
/* Set up the handler table */
eep->ee_rx = hunt_ev_rx;
eep->ee_tx = hunt_ev_tx;
eep->ee_driver = hunt_ev_driver;
eep->ee_drv_gen = hunt_ev_drv_gen;
eep->ee_mcdi = hunt_ev_mcdi;
eep->ee_rx = ef10_ev_rx;
eep->ee_tx = ef10_ev_tx;
eep->ee_driver = ef10_ev_driver;
eep->ee_drv_gen = ef10_ev_drv_gen;
eep->ee_mcdi = ef10_ev_mcdi;
/*
* Set up the event queue
@ -299,18 +299,19 @@ fail1:
}
void
hunt_ev_qdestroy(
ef10_ev_qdestroy(
__in efx_evq_t *eep)
{
efx_nic_t *enp = eep->ee_enp;
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON);
EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON ||
enp->en_family == EFX_FAMILY_MEDFORD);
(void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index);
}
__checkReturn efx_rc_t
hunt_ev_qprime(
ef10_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count)
{
@ -390,7 +391,7 @@ fail1:
}
void
hunt_ev_qpost(
ef10_ev_qpost(
__in efx_evq_t *eep,
__in uint16_t data)
{
@ -406,7 +407,7 @@ hunt_ev_qpost(
}
__checkReturn efx_rc_t
hunt_ev_qmoderate(
ef10_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us)
{
@ -463,14 +464,10 @@ fail1:
#if EFSYS_OPT_QSTATS
void
hunt_ev_qstats_update(
ef10_ev_qstats_update(
__in efx_evq_t *eep,
__inout_ecount(EV_NQSTATS) efsys_stat_t *stat)
{
/*
* TBD: Consider a common Siena/Huntington function. The code is
* essentially identical.
*/
unsigned int id;
for (id = 0; id < EV_NQSTATS; id++) {
@ -484,7 +481,7 @@ hunt_ev_qstats_update(
static __checkReturn boolean_t
hunt_ev_rx(
ef10_ev_rx(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@ -691,7 +688,7 @@ hunt_ev_rx(
}
static __checkReturn boolean_t
hunt_ev_tx(
ef10_ev_tx(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@ -726,7 +723,7 @@ hunt_ev_tx(
}
static __checkReturn boolean_t
hunt_ev_driver(
ef10_ev_driver(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@ -776,7 +773,7 @@ hunt_ev_driver(
}
static __checkReturn boolean_t
hunt_ev_drv_gen(
ef10_ev_drv_gen(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@ -804,7 +801,7 @@ hunt_ev_drv_gen(
}
static __checkReturn boolean_t
hunt_ev_mcdi(
ef10_ev_mcdi(
__in efx_evq_t *eep,
__in efx_qword_t *eqp,
__in const efx_ev_callbacks_t *eecp,
@ -1000,7 +997,7 @@ hunt_ev_mcdi(
}
void
hunt_ev_rxlabel_init(
ef10_ev_rxlabel_init(
__in efx_evq_t *eep,
__in efx_rxq_t *erp,
__in unsigned int label)
@ -1017,7 +1014,7 @@ hunt_ev_rxlabel_init(
}
void
hunt_ev_rxlabel_fini(
ef10_ev_rxlabel_fini(
__in efx_evq_t *eep,
__in unsigned int label)
{

View File

@ -56,15 +56,15 @@ extern "C" {
/* EV */
__checkReturn efx_rc_t
hunt_ev_init(
ef10_ev_init(
__in efx_nic_t *enp);
void
hunt_ev_fini(
ef10_ev_fini(
__in efx_nic_t *enp);
__checkReturn efx_rc_t
hunt_ev_qcreate(
ef10_ev_qcreate(
__in efx_nic_t *enp,
__in unsigned int index,
__in efsys_mem_t *esmp,
@ -73,39 +73,39 @@ hunt_ev_qcreate(
__in efx_evq_t *eep);
void
hunt_ev_qdestroy(
ef10_ev_qdestroy(
__in efx_evq_t *eep);
__checkReturn efx_rc_t
hunt_ev_qprime(
ef10_ev_qprime(
__in efx_evq_t *eep,
__in unsigned int count);
void
hunt_ev_qpost(
ef10_ev_qpost(
__in efx_evq_t *eep,
__in uint16_t data);
__checkReturn efx_rc_t
hunt_ev_qmoderate(
ef10_ev_qmoderate(
__in efx_evq_t *eep,
__in unsigned int us);
#if EFSYS_OPT_QSTATS
void
hunt_ev_qstats_update(
ef10_ev_qstats_update(
__in efx_evq_t *eep,
__inout_ecount(EV_NQSTATS) efsys_stat_t *stat);
#endif /* EFSYS_OPT_QSTATS */
void
hunt_ev_rxlabel_init(
ef10_ev_rxlabel_init(
__in efx_evq_t *eep,
__in efx_rxq_t *erp,
__in unsigned int label);
void
hunt_ev_rxlabel_fini(
ef10_ev_rxlabel_fini(
__in efx_evq_t *eep,
__in unsigned int label);

View File

@ -727,7 +727,7 @@ hunt_rx_qcreate(
erp->er_eep = eep;
erp->er_label = label;
hunt_ev_rxlabel_init(eep, erp, label);
ef10_ev_rxlabel_init(eep, erp, label);
return (0);
@ -749,7 +749,7 @@ hunt_rx_qdestroy(
efx_evq_t *eep = erp->er_eep;
unsigned int label = erp->er_label;
hunt_ev_rxlabel_fini(eep, label);
ef10_ev_rxlabel_fini(eep, label);
EFSYS_ASSERT(enp->en_rx_qcount != 0);
--enp->en_rx_qcount;