From: Andy Moreton Date: Thu, 16 Nov 2017 08:03:54 +0000 (+0000) Subject: net/sfc/base: extend NVRAM RW finish to return verify result X-Git-Tag: spdx-start~679 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=79e2a9d018585c13b92a91616c022ebf241b8709;p=dpdk.git net/sfc/base: extend NVRAM RW finish to return verify result Extend efx_nvram_rw_finish() to return firmware verify result code. Signed-off-by: Andy Moreton Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/base/efx.h b/drivers/net/sfc/base/efx.h index 57fba05209..3bde46f489 100644 --- a/drivers/net/sfc/base/efx.h +++ b/drivers/net/sfc/base/efx.h @@ -1411,7 +1411,8 @@ efx_nvram_rw_start( extern __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type); + __in efx_nvram_type_t type, + __out_opt uint32_t *verify_resultp); extern __checkReturn efx_rc_t efx_nvram_get_version( diff --git a/drivers/net/sfc/base/efx_bootcfg.c b/drivers/net/sfc/base/efx_bootcfg.c index d589c86a4b..c47d16bc0b 100644 --- a/drivers/net/sfc/base/efx_bootcfg.c +++ b/drivers/net/sfc/base/efx_bootcfg.c @@ -345,11 +345,11 @@ efx_bootcfg_read( if ((rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset, (caddr_t)payload, sector_length)) != 0) { - (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL); goto fail6; } - if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) goto fail7; /* Verify that the area is correctly formatted and checksummed */ @@ -521,7 +521,7 @@ efx_bootcfg_write( 0, (caddr_t)partn_data, partn_length)) != 0) goto fail11; - if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG)) != 0) + if ((rc = efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0) goto fail12; EFSYS_KMEM_FREE(enp->en_esip, partn_length, partn_data); @@ -537,7 +537,7 @@ fail10: fail9: EFSYS_PROBE(fail9); - (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG); + (void) efx_nvram_rw_finish(enp, EFX_NVRAM_BOOTROM_CFG, NULL); fail8: EFSYS_PROBE(fail8); diff --git a/drivers/net/sfc/base/efx_nvram.c b/drivers/net/sfc/base/efx_nvram.c index 773bc10539..6e18e44239 100644 --- a/drivers/net/sfc/base/efx_nvram.c +++ b/drivers/net/sfc/base/efx_nvram.c @@ -362,11 +362,12 @@ fail1: __checkReturn efx_rc_t efx_nvram_rw_finish( __in efx_nic_t *enp, - __in efx_nvram_type_t type) + __in efx_nvram_type_t type, + __out_opt uint32_t *verify_resultp) { const efx_nvram_ops_t *envop = enp->en_envop; uint32_t partn; - uint32_t verify_result; + uint32_t verify_result = 0; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -385,6 +386,9 @@ efx_nvram_rw_finish( enp->en_nvram_locked = EFX_NVRAM_INVALID; + if (verify_resultp != NULL) + *verify_resultp = verify_result; + return (0); fail2: @@ -394,6 +398,10 @@ fail2: fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* Always report verification result */ + if (verify_resultp != NULL) + *verify_resultp = verify_result; + return (rc); }