From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0B90BA0495 for ; Mon, 10 Jun 2019 09:42:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AB1721BF50; Mon, 10 Jun 2019 09:39:43 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id BA0231BE95 for ; Mon, 10 Jun 2019 09:38:59 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id D95F8140058 for ; Mon, 10 Jun 2019 07:38:58 +0000 (UTC) Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 10 Jun 2019 00:38:52 -0700 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Mon, 10 Jun 2019 00:38:50 -0700 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id x5A7cnOF008801; Mon, 10 Jun 2019 08:38:49 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 95C361627D7; Mon, 10 Jun 2019 08:38:49 +0100 (BST) From: Andrew Rybchenko To: CC: Richard Houldsworth Date: Mon, 10 Jun 2019 08:38:28 +0100 Message-ID: <1560152324-20538-14-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1560152324-20538-1-git-send-email-arybchenko@solarflare.com> References: <1560152324-20538-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24664.003 X-TM-AS-Result: No-7.004600-4.000000-10 X-TMASE-MatchedRID: eHfivBiCMVlas6sP1BUQLR23b+lJHvPA3V4UShoTXadhGCe0pjZhr8iT Wug2C4DN3iuNqik9NLx7Okmvhl+K960iin8P0KjVPwKTD1v8YV5MkOX0UoduuVVkJxysad/IoLj rCmgL2PUuGBKLx8XK/nk5w+l3wsE1hSCxa/xQsJ9IcJTn2HkqsY7P8sslRxoe5ZPAlhnmbz3D+F 1eEtQinkSP5bfn/F5qWPy/8POTPqDeyYs3+FVYBR/R5SKe31ARNW8jQhzoALXmTInKzpSFSZffm caR0qCL4vM1YF6AJbbCCfuIMF6xLXnN0DN7HnFmw9idgnStJ5R6yzUIet90vmP1zznIEGVbTNoC bKFWxluZfQvK7J3zlJRMZUCEHkRt X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--7.004600-4.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24664.003 X-MDID: 1560152339-m9t5T0jK7If6 Subject: [dpdk-dev] [PATCH 13/29] net/sfc/base: transition to the extensible NVRAM info API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Richard Houldsworth Old NVRAM info API required function prototype too often. Signed-off-by: Richard Houldsworth Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/base/ef10_nvram.c | 20 +++++++++++++------- drivers/net/sfc/base/ef10_vpd.c | 7 +++++-- drivers/net/sfc/base/efx_impl.h | 9 --------- drivers/net/sfc/base/efx_nvram.c | 38 +------------------------------------- drivers/net/sfc/base/siena_nvram.c | 9 +++++---- 5 files changed, 24 insertions(+), 59 deletions(-) diff --git a/drivers/net/sfc/base/ef10_nvram.c b/drivers/net/sfc/base/ef10_nvram.c index a618c75..1fb7185 100644 --- a/drivers/net/sfc/base/ef10_nvram.c +++ b/drivers/net/sfc/base/ef10_nvram.c @@ -1946,11 +1946,13 @@ static uint32_t checksum_tlv_partition( __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: @@ -1967,7 +1969,7 @@ static uint32_t checksum_tlv_partition( { 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) @@ -2080,12 +2082,14 @@ static uint32_t checksum_tlv_partition( __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; @@ -2126,13 +2130,15 @@ static uint32_t checksum_tlv_partition( __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 diff --git a/drivers/net/sfc/base/ef10_vpd.c b/drivers/net/sfc/base/ef10_vpd.c index d56747b..c641936 100644 --- a/drivers/net/sfc/base/ef10_vpd.c +++ b/drivers/net/sfc/base/ef10_vpd.c @@ -79,6 +79,7 @@ __out size_t *sizep) { efx_rc_t rc; + efx_nvram_info_t eni = { 0 }; EFSYS_ASSERT(EFX_FAMILY_IS_EF10(enp)); @@ -88,10 +89,12 @@ * 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: diff --git a/drivers/net/sfc/base/efx_impl.h b/drivers/net/sfc/base/efx_impl.h index 577d5aa..d8cadda 100644 --- a/drivers/net/sfc/base/efx_impl.h +++ b/drivers/net/sfc/base/efx_impl.h @@ -563,15 +563,6 @@ 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 diff --git a/drivers/net/sfc/base/efx_nvram.c b/drivers/net/sfc/base/efx_nvram.c index b817cb6..74dac41 100644 --- a/drivers/net/sfc/base/efx_nvram.c +++ b/drivers/net/sfc/base/efx_nvram.c @@ -691,7 +691,7 @@ } __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) @@ -752,42 +752,6 @@ 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. diff --git a/drivers/net/sfc/base/siena_nvram.c b/drivers/net/sfc/base/siena_nvram.c index 7d423d2..47a8ca2 100644 --- a/drivers/net/sfc/base/siena_nvram.c +++ b/drivers/net/sfc/base/siena_nvram.c @@ -18,16 +18,17 @@ __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); @@ -47,7 +48,7 @@ { 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) -- 1.8.3.1