From patchwork Tue Jun 28 16:42:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas Gupta X-Patchwork-Id: 12898567 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 4C415C43334 for ; Tue, 28 Jun 2022 16:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235492AbiF1Qqm (ORCPT ); Tue, 28 Jun 2022 12:46:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232024AbiF1QpQ (ORCPT ); Tue, 28 Jun 2022 12:45:16 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07FC2C6C for ; Tue, 28 Jun 2022 09:43:38 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id g10-20020a17090a708a00b001ea8aadd42bso13318487pjk.0 for ; Tue, 28 Jun 2022 09:43:38 -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=Za3nP0u103zFZRXt+FpztcfZlOJ+gEqNqaqmISMGzP4=; b=X+WNzndvQvD+Ham7Fnq8desSHqMbxd7oR3UF0VcBGGnLrX+8PdrrWwwO392HHMrgTd grShOsNbOuuaUGb3P4EvLOmXpU6g92vz2EJg0Q2A/hOwm5WUTeU9CsxT83Lmmt3s6iSp oecof0D3/4UI88m10MSpUGiT+BqESINDU5Ge0= 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=Za3nP0u103zFZRXt+FpztcfZlOJ+gEqNqaqmISMGzP4=; b=Ee+HCh0fXTwxVjJjyPOEh/cBDmLVI9Qh1G9XPbsWZKndcm2ifeWKfIRgO7CpUYxIau ypbjGSaIi7wM2dh5VCdkjIiBJHN1F3RYsQWoU6al3h+PYTHGCHi2YuFbvNuHJwQSlkgE 6RyuUQYDKPPQKBE969dtx32jSz/6HmhGKVEKJg+aNWAiV8s+J9TwU9VnnOicHKzrVa11 M8Uuld6G2zHvq7fYr8vAKxDKwbuTZ0URpTKJaInQ7EKZxDC6xOUpIyCJ+NKfbSeOyHV9 DMVFKesA7ZSfPFLxoD3uD/mzd+hj5bAtkSaItfsmCeZFcPKOZIfHYrTUCp3z9h+b4PH0 ABJA== X-Gm-Message-State: AJIora9c4zgK21hLN0Zw0lQ3EDMDlZn4DI/pUY5KY6SWIs+XUCy+SOZZ grFGBmkDb0S2dfPhxCoj7RAq+w== X-Google-Smtp-Source: AGRyM1tWrlBnsos2hlXFF4uKAUuU3CbAxk9xkRu1NCbcdZHGOD/XpIT81diha3B5BBuJS8MFUpPhCg== X-Received: by 2002:a17:902:ef92:b0:16a:1ef1:22db with SMTP id iz18-20020a170902ef9200b0016a1ef122dbmr4481302plb.2.1656434617347; Tue, 28 Jun 2022 09:43:37 -0700 (PDT) Received: from rahul_yocto_ubuntu18.ibn.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id mn9-20020a17090b188900b001ec9d45776bsm38248pjb.42.2022.06.28.09.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jun 2022 09:43:36 -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, michael.chan@broadcom.com, andrew.gospodarek@broadcom.com, Vikas Gupta Subject: [PATCH net-next v1 2/3] bnxt_en: refactor NVM APIs Date: Tue, 28 Jun 2022 22:12:40 +0530 Message-Id: <20220628164241.44360-3-vikas.gupta@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220628164241.44360-1-vikas.gupta@broadcom.com> References: <20220628164241.44360-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