diff options
author | arybchik <arybchik@FreeBSD.org> | 2016-01-14 16:08:32 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2016-01-14 16:08:32 +0000 |
commit | dfea4170f51e2472778bfb3d9770387ed468404a (patch) | |
tree | da0002b25db8357873d8bb0e3937b982eb3c6804 /sys/dev/sfxge/common | |
parent | 364f200c1e95c593bb714289488ee7ca4afdd468 (diff) | |
download | FreeBSD-src-dfea4170f51e2472778bfb3d9770387ed468404a.zip FreeBSD-src-dfea4170f51e2472778bfb3d9770387ed468404a.tar.gz |
MFC r293765
sfxge: rework MCDI header version handling
Submitted by: Andy Moreton <amoreton at solarflare.com>
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
Diffstat (limited to 'sys/dev/sfxge/common')
-rw-r--r-- | sys/dev/sfxge/common/efx_mcdi.c | 3 | ||||
-rw-r--r-- | sys/dev/sfxge/common/efx_mcdi.h | 1 | ||||
-rw-r--r-- | sys/dev/sfxge/common/hunt_mcdi.c | 8 | ||||
-rw-r--r-- | sys/dev/sfxge/common/siena_mcdi.c | 3 |
4 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/sfxge/common/efx_mcdi.c b/sys/dev/sfxge/common/efx_mcdi.c index e9912d7..600da9a 100644 --- a/sys/dev/sfxge/common/efx_mcdi.c +++ b/sys/dev/sfxge/common/efx_mcdi.c @@ -643,7 +643,6 @@ efx_mcdi_ev_cpl( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_mcdi_req_t *emrp; int state; @@ -668,7 +667,7 @@ efx_mcdi_ev_cpl( emip->emi_pending_req = NULL; EFSYS_UNLOCK(enp->en_eslp, state); - if (encp->enc_mcdi_max_payload_length > MCDI_CTL_SDU_LEN_MAX_V1) { + if (emip->emi_max_version >= 2) { /* MCDIv2 response details do not fit into an event. */ efx_mcdi_read_response_header(enp, emrp); } else { diff --git a/sys/dev/sfxge/common/efx_mcdi.h b/sys/dev/sfxge/common/efx_mcdi.h index a9a5c09..53f76b3 100644 --- a/sys/dev/sfxge/common/efx_mcdi.h +++ b/sys/dev/sfxge/common/efx_mcdi.h @@ -69,6 +69,7 @@ struct efx_mcdi_req_s { typedef struct efx_mcdi_iface_s { unsigned int emi_port; + unsigned int emi_max_version; unsigned int emi_seq; efx_mcdi_req_t *emi_pending_req; boolean_t emi_ev_cpl; diff --git a/sys/dev/sfxge/common/hunt_mcdi.c b/sys/dev/sfxge/common/hunt_mcdi.c index 590456e..d23259e 100644 --- a/sys/dev/sfxge/common/hunt_mcdi.c +++ b/sys/dev/sfxge/common/hunt_mcdi.c @@ -81,6 +81,7 @@ ef10_mcdi_init( __in efx_nic_t *enp, __in const efx_mcdi_transport_t *emtp) { + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efsys_mem_t *esmp = emtp->emt_dma_mem; efx_dword_t dword; efx_rc_t rc; @@ -89,6 +90,13 @@ ef10_mcdi_init( enp->en_family == EFX_FAMILY_MEDFORD); EFSYS_ASSERT(enp->en_features & EFX_FEATURE_MCDI_DMA); + /* + * All EF10 firmware supports MCDIv2 and MCDIv1. + * Medford BootROM supports MCDIv2 and MCDIv1. + * Huntington BootROM supports MCDIv1 only. + */ + emip->emi_max_version = 2; + /* A host DMA buffer is required for EF10 MCDI */ if (esmp == NULL) { rc = EINVAL; diff --git a/sys/dev/sfxge/common/siena_mcdi.c b/sys/dev/sfxge/common/siena_mcdi.c index a350598..cb62f6d 100644 --- a/sys/dev/sfxge/common/siena_mcdi.c +++ b/sys/dev/sfxge/common/siena_mcdi.c @@ -244,6 +244,9 @@ siena_mcdi_init( goto fail1; } + /* Siena BootROM and firmware only support MCDIv1 */ + emip->emi_max_version = 1; + /* * Wipe the atomic reboot status so subsequent MCDI requests succeed. * BOOT_STATUS is preserved so eno_nic_probe() can boot out of the |