diff options
-rw-r--r-- | sys/dev/sfxge/common/efx_impl.h | 3 | ||||
-rw-r--r-- | sys/dev/sfxge/common/efx_nvram.c | 14 | ||||
-rw-r--r-- | sys/dev/sfxge/common/hunt_nvram.c | 3 | ||||
-rw-r--r-- | sys/dev/sfxge/common/hunt_vpd.c | 2 | ||||
-rw-r--r-- | sys/dev/sfxge/common/siena_nvram.c | 3 |
5 files changed, 18 insertions, 7 deletions
diff --git a/sys/dev/sfxge/common/efx_impl.h b/sys/dev/sfxge/common/efx_impl.h index 42d0327..8f60532 100644 --- a/sys/dev/sfxge/common/efx_impl.h +++ b/sys/dev/sfxge/common/efx_impl.h @@ -536,7 +536,8 @@ efx_mcdi_nvram_info( __in uint32_t partn, __out_opt size_t *sizep, __out_opt uint32_t *addressp, - __out_opt uint32_t *erase_sizep); + __out_opt uint32_t *erase_sizep, + __out_opt uint32_t *write_sizep); __checkReturn efx_rc_t efx_mcdi_nvram_update_start( diff --git a/sys/dev/sfxge/common/efx_nvram.c b/sys/dev/sfxge/common/efx_nvram.c index c806d68..4d58f69 100644 --- a/sys/dev/sfxge/common/efx_nvram.c +++ b/sys/dev/sfxge/common/efx_nvram.c @@ -567,10 +567,11 @@ efx_mcdi_nvram_info( __in uint32_t partn, __out_opt size_t *sizep, __out_opt uint32_t *addressp, - __out_opt uint32_t *erase_sizep) + __out_opt uint32_t *erase_sizep, + __out_opt uint32_t *write_sizep) { uint8_t payload[MAX(MC_CMD_NVRAM_INFO_IN_LEN, - MC_CMD_NVRAM_INFO_OUT_LEN)]; + MC_CMD_NVRAM_INFO_V2_OUT_LEN)]; efx_mcdi_req_t req; efx_rc_t rc; @@ -579,7 +580,7 @@ efx_mcdi_nvram_info( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_NVRAM_INFO_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_NVRAM_INFO_OUT_LEN; + req.emr_out_length = MC_CMD_NVRAM_INFO_V2_OUT_LEN; MCDI_IN_SET_DWORD(req, NVRAM_INFO_IN_TYPE, partn); @@ -604,6 +605,13 @@ efx_mcdi_nvram_info( if (erase_sizep) *erase_sizep = MCDI_OUT_DWORD(req, NVRAM_INFO_OUT_ERASESIZE); + if (write_sizep) { + *write_sizep = + (req.emr_out_length_used < + MC_CMD_NVRAM_INFO_V2_OUT_LEN) ? + 0 : MCDI_OUT_DWORD(req, NVRAM_INFO_V2_OUT_WRITESIZE); + } + return (0); fail2: diff --git a/sys/dev/sfxge/common/hunt_nvram.c b/sys/dev/sfxge/common/hunt_nvram.c index 3a0cf7f..fa66202 100644 --- a/sys/dev/sfxge/common/hunt_nvram.c +++ b/sys/dev/sfxge/common/hunt_nvram.c @@ -1295,7 +1295,8 @@ hunt_nvram_partn_size( { efx_rc_t rc; - if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, NULL, NULL)) != 0) + if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, + NULL, NULL, NULL)) != 0) goto fail1; return (0); diff --git a/sys/dev/sfxge/common/hunt_vpd.c b/sys/dev/sfxge/common/hunt_vpd.c index 1b3f86b..129167c 100644 --- a/sys/dev/sfxge/common/hunt_vpd.c +++ b/sys/dev/sfxge/common/hunt_vpd.c @@ -113,7 +113,7 @@ hunt_vpd_size( * which is the size of the DYNAMIC_CONFIG partition. */ if ((rc = efx_mcdi_nvram_info(enp, NVRAM_PARTITION_TYPE_DYNAMIC_CONFIG, - sizep, NULL, NULL)) != 0) + sizep, NULL, NULL, NULL)) != 0) goto fail1; return (0); diff --git a/sys/dev/sfxge/common/siena_nvram.c b/sys/dev/sfxge/common/siena_nvram.c index 7eaceee..ecc5195 100644 --- a/sys/dev/sfxge/common/siena_nvram.c +++ b/sys/dev/sfxge/common/siena_nvram.c @@ -54,7 +54,8 @@ siena_nvram_partn_size( goto fail1; } - if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, NULL, NULL)) != 0) { + if ((rc = efx_mcdi_nvram_info(enp, partn, sizep, + NULL, NULL, NULL)) != 0) { goto fail2; } |