Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jan 2016 14:34:47 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293944 - stable/10/sys/dev/sfxge/common
Message-ID:  <201601141434.u0EEYlQn026651@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Thu Jan 14 14:34:47 2016
New Revision: 293944
URL: https://svnweb.freebsd.org/changeset/base/293944

Log:
  MFC r291746
  
  sfxge: add additional WRITESIZE value for NVRAM_INFO command
  
  Submitted by:   Paul Fox <pfox at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_nvram.c
  stable/10/sys/dev/sfxge/common/hunt_nvram.c
  stable/10/sys/dev/sfxge/common/hunt_vpd.c
  stable/10/sys/dev/sfxge/common/siena_nvram.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_impl.h	Thu Jan 14 14:33:30 2016	(r293943)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h	Thu Jan 14 14:34:47 2016	(r293944)
@@ -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(

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_nvram.c	Thu Jan 14 14:33:30 2016	(r293943)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c	Thu Jan 14 14:34:47 2016	(r293944)
@@ -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:

Modified: stable/10/sys/dev/sfxge/common/hunt_nvram.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_nvram.c	Thu Jan 14 14:33:30 2016	(r293943)
+++ stable/10/sys/dev/sfxge/common/hunt_nvram.c	Thu Jan 14 14:34:47 2016	(r293944)
@@ -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);

Modified: stable/10/sys/dev/sfxge/common/hunt_vpd.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/hunt_vpd.c	Thu Jan 14 14:33:30 2016	(r293943)
+++ stable/10/sys/dev/sfxge/common/hunt_vpd.c	Thu Jan 14 14:34:47 2016	(r293944)
@@ -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);

Modified: stable/10/sys/dev/sfxge/common/siena_nvram.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/siena_nvram.c	Thu Jan 14 14:33:30 2016	(r293943)
+++ stable/10/sys/dev/sfxge/common/siena_nvram.c	Thu Jan 14 14:34:47 2016	(r293944)
@@ -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;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601141434.u0EEYlQn026651>