X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fsfc%2Fbase%2Fsiena_nvram.c;h=51e601ec1902b47018031a6b7f5112bf15606d5b;hb=168c59cfe42b;hp=8cdd2df7012fd4a811c4aafa29740ad3e70dfb61;hpb=8b743724c0e8fda18a60eeb1b709f03f872a75b5;p=dpdk.git diff --git a/drivers/net/sfc/base/siena_nvram.c b/drivers/net/sfc/base/siena_nvram.c index 8cdd2df701..51e601ec19 100644 --- a/drivers/net/sfc/base/siena_nvram.c +++ b/drivers/net/sfc/base/siena_nvram.c @@ -18,16 +18,17 @@ siena_nvram_partn_size( __out size_t *sizep) { efx_rc_t rc; + efx_nvram_info_t eni = { 0 }; if ((1 << partn) & ~enp->en_u.siena.enu_partn_mask) { rc = ENOTSUP; goto fail1; } - if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, - NULL, NULL, NULL)) != 0) { + if ((rc = efx_mcdi_nvram_info(enp, partn, &eni)) != 0) goto fail2; - } + + *sizep = eni.eni_partn_size; return (0); @@ -39,6 +40,29 @@ fail1: return (rc); } + __checkReturn efx_rc_t +siena_nvram_partn_info( + __in efx_nic_t *enp, + __in uint32_t partn, + __out efx_nvram_info_t * enip) +{ + efx_rc_t rc; + + if ((rc = efx_mcdi_nvram_info(enp, partn, enip)) != 0) + goto fail1; + + if (enip->eni_write_size == 0) + enip->eni_write_size = SIENA_NVRAM_CHUNK; + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + __checkReturn efx_rc_t siena_nvram_partn_lock( __in efx_nic_t *enp, @@ -150,6 +174,7 @@ siena_nvram_partn_unlock( __out_opt uint32_t *verify_resultp) { boolean_t reboot; + uint32_t flags = 0; efx_rc_t rc; /* @@ -160,7 +185,8 @@ siena_nvram_partn_unlock( partn == MC_CMD_NVRAM_TYPE_PHY_PORT1 || partn == MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO); - rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, verify_resultp); + rc = efx_mcdi_nvram_update_finish(enp, partn, reboot, flags, + verify_resultp); if (rc != 0) goto fail1; @@ -418,12 +444,11 @@ siena_nvram_get_subtype( __out uint32_t *subtypep) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_BOARD_CFG_IN_LEN, - MC_CMD_GET_BOARD_CFG_OUT_LENMAX)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_BOARD_CFG_IN_LEN, + MC_CMD_GET_BOARD_CFG_OUT_LENMAX); efx_word_t *fw_list; efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_BOARD_CFG; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_BOARD_CFG_IN_LEN;