From patchwork Thu Jul 21 07:21:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12924813 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBD13C43334 for ; Thu, 21 Jul 2022 07:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbiGUHVs (ORCPT ); Thu, 21 Jul 2022 03:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbiGUHVq (ORCPT ); Thu, 21 Jul 2022 03:21:46 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A56913DF21 for ; Thu, 21 Jul 2022 00:21:44 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id z3so1039367plb.1 for ; Thu, 21 Jul 2022 00:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZSJf/HxcK8yohux1eV9nk3dPwfxExoacUIpWsLChZpA=; b=bR47Hx8c0A4Y8Q58uSTeAZuaTWn5Bb6ei6K0/j8Nfor1ak2dnKmiPWkUK2K2pHAGDO N92e+fELtsFAmWxhWTGh6HYUbvaPE2rlChCS2NQOhQB7zx7ZQFhShdqEznFZOGYLhDn6 emdRVJXSReQ6Ar3WwI/BuxgMVaLK9e5elD1sw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZSJf/HxcK8yohux1eV9nk3dPwfxExoacUIpWsLChZpA=; b=DmRLKfcIT4hnh0GVBtqit5pTlfqQXzNv/YNtlGkPvs5TUQHFzY9zhn9FQE7L2N99ja BX1bZ8XRkK0ekTzWFusLQIN1L9QY+7vIRI7u8FanhrtiT5BrCRnc5M+eIz0XLiO6JGKX SACq2XPQoSZxzkaN591dQZCoR5BXXZvjZRhjySG5fvMEzXuM0+33oWUAIzeOI1KxokVq JucnPcj0zQQ7xXYyQdIx3uPs8OtMLT5NL+xjSdjrr1MjgaTsmBWhjd5cdnNZsZ2sZpNW J/Gjz5GnEEXhinTXNnmYAgEFIADRY2mxaK/4vlviBN1MFivgObVnUpQbm4vc4Z/YIkSV cTAA== X-Gm-Message-State: AJIora+rm8N/hX0qNUuuQYNROOhWP/IWOSD7fclSFDzY3ygeC3Lho9SB KGG/jUixYJFDdYjjmoW04hLPhA== X-Google-Smtp-Source: AGRyM1uo5NDbYEexxDTj9rE6ieq8c/aNpF5I0/KCgI44g11xOFz1wmxXDVd9D5DUTFo9pC5IvXgtmA== X-Received: by 2002:a17:902:ce81:b0:16c:4be6:2537 with SMTP id f1-20020a170902ce8100b0016c4be62537mr42330131plg.167.1658388103936; Thu, 21 Jul 2022 00:21:43 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id t8-20020a170902e84800b0016d2959cf37sm823611plg.279.2022.07.21.00.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 00:21:43 -0700 (PDT) From: Vikas Gupta To: jiri@nvidia.com, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net, dsahern@kernel.org, stephen@networkplumber.org, edumazet@google.com, pabeni@redhat.com, ast@kernel.org, leon@kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net, michael.chan@broadcom.com, andrew.gospodarek@broadcom.com, Vikas Gupta Subject: [PATCH net-next v4 2/3] bnxt_en: refactor NVM APIs Date: Thu, 21 Jul 2022 12:51:20 +0530 Message-Id: <20220721072121.43648-3-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220721072121.43648-1-vikas.gupta@broadcom.com> References: <20220718062032.22426-1-vikas.gupta@broadcom.com> <20220721072121.43648-1-vikas.gupta@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org modify declaration for NVM APIs so that they can be used with devlink and ethtool both. Signed-off-by: Vikas Gupta Reviewed-by: Michael Chan Reviewed-by: Andy Gospodarek --- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 24 +++++++++---------- .../net/ethernet/broadcom/bnxt/bnxt_ethtool.h | 12 ++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 7191e5d74208..87eb5362ad70 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -2176,14 +2176,14 @@ static void bnxt_print_admin_err(struct bnxt *bp) netdev_info(bp->dev, "PF does not have admin privileges to flash or reset the device\n"); } -static int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal, - u16 ext, u16 *index, u32 *item_length, - u32 *data_length); +int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal, + u16 ext, u16 *index, u32 *item_length, + u32 *data_length); -static int bnxt_flash_nvram(struct net_device *dev, u16 dir_type, - u16 dir_ordinal, u16 dir_ext, u16 dir_attr, - u32 dir_item_len, const u8 *data, - size_t data_len) +int bnxt_flash_nvram(struct net_device *dev, u16 dir_type, + u16 dir_ordinal, u16 dir_ext, u16 dir_attr, + u32 dir_item_len, const u8 *data, + size_t data_len) { struct bnxt *bp = netdev_priv(dev); struct hwrm_nvm_write_input *req; @@ -2836,8 +2836,8 @@ static int bnxt_get_nvram_directory(struct net_device *dev, u32 len, u8 *data) return rc; } -static int bnxt_get_nvram_item(struct net_device *dev, u32 index, u32 offset, - u32 length, u8 *data) +int bnxt_get_nvram_item(struct net_device *dev, u32 index, u32 offset, + u32 length, u8 *data) { struct bnxt *bp = netdev_priv(dev); int rc; @@ -2871,9 +2871,9 @@ static int bnxt_get_nvram_item(struct net_device *dev, u32 index, u32 offset, return rc; } -static int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal, - u16 ext, u16 *index, u32 *item_length, - u32 *data_length) +int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal, + u16 ext, u16 *index, u32 *item_length, + u32 *data_length) { struct hwrm_nvm_find_dir_entry_output *output; struct hwrm_nvm_find_dir_entry_input *req; diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h index a59284215e78..a8ecef8ab82c 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h @@ -58,5 +58,17 @@ int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware int bnxt_get_pkginfo(struct net_device *dev, char *ver, int size); void bnxt_ethtool_init(struct bnxt *bp); void bnxt_ethtool_free(struct bnxt *bp); +int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal, + u16 ext, u16 *index, u32 *item_length, + u32 *data_length); +int bnxt_find_nvram_item(struct net_device *dev, u16 type, u16 ordinal, + u16 ext, u16 *index, u32 *item_length, + u32 *data_length); +int bnxt_flash_nvram(struct net_device *dev, u16 dir_type, + u16 dir_ordinal, u16 dir_ext, u16 dir_attr, + u32 dir_item_len, const u8 *data, + size_t data_len); +int bnxt_get_nvram_item(struct net_device *dev, u32 index, u32 offset, + u32 length, u8 *data); #endif