Old NVRAM info API required function prototype too often.
Signed-off-by: Richard Houldsworth <rhouldsworth@solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
__out size_t *sizep)
{
efx_rc_t rc;
+ efx_nvram_info_t eni = { 0 };
- if ((rc = efx_mcdi_nvram_info(enp, partn, sizep,
- NULL, NULL, NULL)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp, partn, &eni)) != 0)
goto fail1;
+ *sizep = eni.eni_partn_size;
+
return (0);
fail1:
{
efx_rc_t rc;
- if ((rc = efx_mcdi_nvram_info_ex(enp, partn, enip)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp, partn, enip)) != 0)
goto fail1;
if (enip->eni_write_size == 0)
__in size_t size)
{
efx_rc_t rc;
+ efx_nvram_info_t eni = { 0 };
uint32_t erase_size;
- if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL,
- &erase_size, NULL)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp, partn, &eni)) != 0)
goto fail1;
+ erase_size = eni.eni_erase_size;
+
if (erase_size == 0) {
if ((rc = efx_mcdi_nvram_erase(enp, partn, offset, size)) != 0)
goto fail2;
__in size_t size)
{
size_t chunk;
+ efx_nvram_info_t eni = { 0 };
uint32_t write_size;
efx_rc_t rc;
- if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL,
- NULL, &write_size)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp, partn, &eni)) != 0)
goto fail1;
+ write_size = eni.eni_write_size;
+
if (write_size != 0) {
/*
* Check that the size is a multiple of the write chunk size if
__out size_t *sizep)
{
efx_rc_t rc;
+ efx_nvram_info_t eni = { 0 };
EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp));
* so we just need to return an upper bound on the dynamic vpd,
* which is the size of the DYNAMIC_CONFIG partition.
*/
- if ((rc = efx_mcdi_nvram_info(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG,
- sizep, NULL, NULL, NULL)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp,
+ NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, &eni)) != 0)
goto fail1;
+ *sizep = eni.eni_partn_size;
+
return (0);
fail1:
__checkReturn efx_rc_t
efx_mcdi_nvram_info(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __out_opt size_t *sizep,
- __out_opt uint32_t *addressp,
- __out_opt uint32_t *erase_sizep,
- __out_opt uint32_t *write_sizep);
-
- __checkReturn efx_rc_t
-efx_mcdi_nvram_info_ex(
__in efx_nic_t *enp,
__in uint32_t partn,
__out efx_nvram_info_t *eni);
}
__checkReturn efx_rc_t
-efx_mcdi_nvram_info_ex(
+efx_mcdi_nvram_info(
__in efx_nic_t *enp,
__in uint32_t partn,
__out efx_nvram_info_t *enip)
return (rc);
}
- __checkReturn efx_rc_t
-efx_mcdi_nvram_info(
- __in efx_nic_t *enp,
- __in uint32_t partn,
- __out_opt size_t *sizep,
- __out_opt uint32_t *addressp,
- __out_opt uint32_t *erase_sizep,
- __out_opt uint32_t *write_sizep)
-{
- efx_nvram_info_t eni;
- efx_rc_t rc;
-
- if ((rc = efx_mcdi_nvram_info_ex(enp, partn, &eni)) != 0)
- goto fail1;
-
- if (sizep)
- *sizep = eni.eni_partn_size;
-
- if (addressp)
- *addressp = eni.eni_address;
-
- if (erase_sizep)
- *erase_sizep = eni.eni_erase_size;
-
- if (write_sizep)
- *write_sizep = eni.eni_write_size;
-
- return (0);
-
-fail1:
- EFSYS_PROBE1(fail1, efx_rc_t, rc);
-
- return (rc);
-}
-
-
/*
* MC_CMD_NVRAM_UPDATE_START_V2 must be used to support firmware-verified
* NVRAM updates. Older firmware will ignore the flags field in the request.
__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);
{
efx_rc_t rc;
- if ((rc = efx_mcdi_nvram_info_ex(enp, partn, enip)) != 0)
+ if ((rc = efx_mcdi_nvram_info(enp, partn, enip)) != 0)
goto fail1;
if (enip->eni_write_size == 0)