Index: head/sys/dev/sfxge/common/efx_ev.c =================================================================== --- head/sys/dev/sfxge/common/efx_ev.c +++ head/sys/dev/sfxge/common/efx_ev.c @@ -139,20 +139,20 @@ }; #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 @@ #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; Index: head/sys/dev/sfxge/common/hunt_ev.c =================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c +++ head/sys/dev/sfxge/common/hunt_ev.c @@ -54,35 +54,35 @@ 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 @@ __checkReturn efx_rc_t -hunt_ev_init( +ef10_ev_init( __in efx_nic_t *enp) { _NOTE(ARGUNUSED(enp)) @@ -238,14 +238,14 @@ } 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 @@ } /* 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 @@ } 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 @@ } void -hunt_ev_qpost( +ef10_ev_qpost( __in efx_evq_t *eep, __in uint16_t data) { @@ -406,7 +407,7 @@ } __checkReturn efx_rc_t -hunt_ev_qmoderate( +ef10_ev_qmoderate( __in efx_evq_t *eep, __in unsigned int us) { @@ -463,14 +464,10 @@ #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 @@ 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 @@ } 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 @@ } 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 @@ } 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 @@ } 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 @@ } 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 @@ } void -hunt_ev_rxlabel_fini( +ef10_ev_rxlabel_fini( __in efx_evq_t *eep, __in unsigned int label) { Index: head/sys/dev/sfxge/common/hunt_impl.h =================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h +++ head/sys/dev/sfxge/common/hunt_impl.h @@ -56,15 +56,15 @@ /* 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 @@ __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); Index: head/sys/dev/sfxge/common/hunt_rx.c =================================================================== --- head/sys/dev/sfxge/common/hunt_rx.c +++ head/sys/dev/sfxge/common/hunt_rx.c @@ -727,7 +727,7 @@ 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 @@ 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;