Index: head/sys/dev/sfxge/common/efx_mcdi.c =================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c +++ head/sys/dev/sfxge/common/efx_mcdi.c @@ -52,9 +52,9 @@ siena_mcdi_fini, /* emco_fini */ siena_mcdi_fw_update_supported, /* emco_fw_update_supported */ siena_mcdi_macaddr_change_supported, - /* emco_macaddr_change_supported */ + /* emco_macaddr_change_supported */ siena_mcdi_link_control_supported, - /* emco_link_control_supported */ + /* emco_link_control_supported */ }; #endif /* EFSYS_OPT_SIENA */ @@ -70,9 +70,9 @@ hunt_mcdi_fini, /* emco_fini */ hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */ hunt_mcdi_macaddr_change_supported, - /* emco_macaddr_change_supported */ + /* emco_macaddr_change_supported */ hunt_mcdi_link_control_supported, - /* emco_link_control_supported */ + /* emco_link_control_supported */ }; #endif /* EFSYS_OPT_HUNTINGTON */ Index: head/sys/dev/sfxge/common/hunt_mcdi.c =================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c +++ head/sys/dev/sfxge/common/hunt_mcdi.c @@ -274,6 +274,18 @@ #endif /* EFSYS_OPT_MCDI_LOGGING */ } +static __checkReturn boolean_t +hunt_mcdi_poll_response( + __in efx_nic_t *enp) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efsys_mem_t *esmp = emtp->emt_dma_mem; + efx_dword_t hdr; + + EFSYS_MEM_READD(esmp, 0, &hdr); + return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); +} + __checkReturn boolean_t hunt_mcdi_request_poll( __in efx_nic_t *enp) @@ -301,13 +313,15 @@ offset = 0; - /* Read the command header */ - EFSYS_MEM_READD(esmp, offset, &hdr[0]); - offset += sizeof (efx_dword_t); - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_RESPONSE) == 0) { + /* Check if a response is available */ + if (hunt_mcdi_poll_response(enp) == B_FALSE) { EFSYS_UNLOCK(enp->en_eslp, state); return (B_FALSE); } + + /* Read the response header */ + EFSYS_MEM_READD(esmp, offset, &hdr[0]); + offset += sizeof (efx_dword_t); if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { EFSYS_MEM_READD(esmp, offset, &hdr[1]); offset += sizeof (efx_dword_t); Index: head/sys/dev/sfxge/common/siena_mcdi.c =================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c +++ head/sys/dev/sfxge/common/siena_mcdi.c @@ -191,6 +191,21 @@ #endif } +static __checkReturn boolean_t +siena_mcdi_poll_response( + __in efx_nic_t *enp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_dword_t hdr; + unsigned int pdur; + + EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); + pdur = SIENA_MCDI_PDU(emip); + + EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); + return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); +} + __checkReturn boolean_t siena_mcdi_request_poll( __in efx_nic_t *enp) @@ -229,13 +244,15 @@ EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); pdur = SIENA_MCDI_PDU(emip); - /* Read the command header */ - EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) == 0) { + /* Check if a response is available */ + if (siena_mcdi_poll_response(enp) == B_FALSE) { EFSYS_UNLOCK(enp->en_eslp, state); return (B_FALSE); } + /* Read the response header */ + EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); + /* Request complete */ emip->emi_pending_req = NULL; seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ);