From owner-svn-src-head@freebsd.org Fri Dec 4 06:51:39 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1892A402C6; Fri, 4 Dec 2015 06:51:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC6AC18A9; Fri, 4 Dec 2015 06:51:38 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB46pb1A010591; Fri, 4 Dec 2015 06:51:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB46pbYm010586; Fri, 4 Dec 2015 06:51:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512040651.tB46pbYm010586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 4 Dec 2015 06:51:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291746 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 06:51:39 -0000 Author: arybchik Date: Fri Dec 4 06:51:37 2015 New Revision: 291746 URL: https://svnweb.freebsd.org/changeset/base/291746 Log: sfxge: add additional WRITESIZE value for NVRAM_INFO command Submitted by: Paul Fox Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4353 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/hunt_vpd.c head/sys/dev/sfxge/common/siena_nvram.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Dec 4 05:00:51 2015 (r291745) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Dec 4 06:51:37 2015 (r291746) @@ -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: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Fri Dec 4 05:00:51 2015 (r291745) +++ head/sys/dev/sfxge/common/efx_nvram.c Fri Dec 4 06:51:37 2015 (r291746) @@ -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: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Fri Dec 4 05:00:51 2015 (r291745) +++ head/sys/dev/sfxge/common/hunt_nvram.c Fri Dec 4 06:51:37 2015 (r291746) @@ -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: head/sys/dev/sfxge/common/hunt_vpd.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_vpd.c Fri Dec 4 05:00:51 2015 (r291745) +++ head/sys/dev/sfxge/common/hunt_vpd.c Fri Dec 4 06:51:37 2015 (r291746) @@ -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: head/sys/dev/sfxge/common/siena_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nvram.c Fri Dec 4 05:00:51 2015 (r291745) +++ head/sys/dev/sfxge/common/siena_nvram.c Fri Dec 4 06:51:37 2015 (r291746) @@ -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; }