[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1580118987-30052-10-git-send-email-michael.chan@broadcom.com>
Date: Mon, 27 Jan 2020 04:56:21 -0500
From: Michael Chan <michael.chan@...adcom.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
Vasundhara Volam <vasundhara-v.volam@...adcom.com>
Subject: [PATCH net-next v2 09/15] bnxt_en: Register devlink irrespective of firmware spec version
From: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
This will allow to register for devlink port and use port features.
Also register params only if firmware spec version is at least 0x10600
which will support reading/setting numbered variables in NVRAM.
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
Signed-off-by: Michael Chan <michael.chan@...adcom.com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 9253eed..a8cdfbdd 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -489,6 +489,9 @@ static int bnxt_dl_params_register(struct bnxt *bp)
{
int rc;
+ if (bp->hwrm_spec_code < 0x10600)
+ return 0;
+
rc = devlink_params_register(bp->dl, bnxt_dl_params,
ARRAY_SIZE(bnxt_dl_params));
if (rc) {
@@ -511,6 +514,9 @@ static int bnxt_dl_params_register(struct bnxt *bp)
static void bnxt_dl_params_unregister(struct bnxt *bp)
{
+ if (bp->hwrm_spec_code < 0x10600)
+ return;
+
devlink_params_unregister(bp->dl, bnxt_dl_params,
ARRAY_SIZE(bnxt_dl_params));
devlink_port_params_unregister(&bp->dl_port, bnxt_dl_port_params,
@@ -522,11 +528,6 @@ int bnxt_dl_register(struct bnxt *bp)
struct devlink *dl;
int rc;
- if (bp->hwrm_spec_code < 0x10600) {
- netdev_warn(bp->dev, "Firmware does not support NVM params");
- return -ENOTSUPP;
- }
-
if (BNXT_PF(bp))
dl = devlink_alloc(&bnxt_dl_ops, sizeof(struct bnxt_dl));
else
--
2.5.1
Powered by blists - more mailing lists