netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query.
@ 2018-11-27  6:25 Sudarsana Reddy Kalluru
  2018-11-27  6:25 ` [PATCH net-next 1/2] bnx2x: Add MBI version to ethtool driver query output Sudarsana Reddy Kalluru
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-11-27  6:25 UTC (permalink / raw)
  To: davem; +Cc: netdev, Ariel.Elior, Sudarsana Reddy Kalluru

From: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>

The patch series populates MBI and storm firware versions in the ethtool
driver info query.

Please consider applying it to 'net-next' tree.

Sudarsana Reddy Kalluru (2):
  bnx2x: Add MBI version to ethtool driver query output.
  bnx2x: Add storm FW version to ethtool driver query output.

 .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c    | 30 +++++++++++++++++++++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h    |  5 ++++
 2 files changed, 34 insertions(+), 1 deletion(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] bnx2x: Add MBI version to ethtool driver query output.
  2018-11-27  6:25 [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query Sudarsana Reddy Kalluru
@ 2018-11-27  6:25 ` Sudarsana Reddy Kalluru
  2018-11-27  6:25 ` [PATCH net-next 2/2] bnx2x: Add storm FW " Sudarsana Reddy Kalluru
  2018-11-28  0:41 ` [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-11-27  6:25 UTC (permalink / raw)
  To: davem; +Cc: netdev, Ariel.Elior

The patch populates the MBI version in the ethtool driver query data.
Adding 'extended_dev_info_shared_cfg' structure describing the nvram
structure, this is required to access the mbi version string.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
---
 .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c    | 24 +++++++++++++++++++++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h    |  5 +++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index a4a90b6c..68aae3e 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -1105,11 +1105,33 @@ static void bnx2x_get_drvinfo(struct net_device *dev,
 			      struct ethtool_drvinfo *info)
 {
 	struct bnx2x *bp = netdev_priv(dev);
+	char version[ETHTOOL_FWVERS_LEN];
+	int ext_dev_info_offset;
+	u32 mbi;
 
 	strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
 	strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
 
-	bnx2x_fill_fw_str(bp, info->fw_version, sizeof(info->fw_version));
+	if (SHMEM2_HAS(bp, extended_dev_info_shared_addr)) {
+		ext_dev_info_offset = SHMEM2_RD(bp,
+						extended_dev_info_shared_addr);
+		mbi = REG_RD(bp, ext_dev_info_offset +
+			     offsetof(struct extended_dev_info_shared_cfg,
+				      mbi_version));
+		if (mbi) {
+			memset(version, 0, sizeof(version));
+			snprintf(version, ETHTOOL_FWVERS_LEN, "mbi %d.%d.%d ",
+				 (mbi & 0xff000000) >> 24,
+				 (mbi & 0x00ff0000) >> 16,
+				 (mbi & 0x0000ff00) >> 8);
+			strlcpy(info->fw_version, version,
+				sizeof(info->fw_version));
+		}
+	}
+
+	memset(version, 0, sizeof(version));
+	bnx2x_fill_fw_str(bp, version, ETHTOOL_FWVERS_LEN);
+	strlcat(info->fw_version, version, sizeof(info->fw_version));
 
 	strlcpy(info->bus_info, pci_name(bp->pdev), sizeof(info->bus_info));
 }
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
index f8b8103..d9057c8 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h
@@ -1140,6 +1140,11 @@ struct shm_dev_info {				/* size */
 
 };
 
+struct extended_dev_info_shared_cfg {
+	u32 reserved[18];
+	u32 mbi_version;
+	u32 mbi_date;
+};
 
 #if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
 	#error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] bnx2x: Add storm FW version to ethtool driver query output.
  2018-11-27  6:25 [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query Sudarsana Reddy Kalluru
  2018-11-27  6:25 ` [PATCH net-next 1/2] bnx2x: Add MBI version to ethtool driver query output Sudarsana Reddy Kalluru
@ 2018-11-27  6:25 ` Sudarsana Reddy Kalluru
  2018-11-28  0:41 ` [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Sudarsana Reddy Kalluru @ 2018-11-27  6:25 UTC (permalink / raw)
  To: davem; +Cc: netdev, Ariel.Elior

The patch populates the Storm FW version in the ethtool driver query data.

Signed-off-by: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 68aae3e..749d0ef 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -1112,6 +1112,12 @@ static void bnx2x_get_drvinfo(struct net_device *dev,
 	strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
 	strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
 
+	memset(version, 0, sizeof(version));
+	snprintf(version, ETHTOOL_FWVERS_LEN, " storm %d.%d.%d.%d",
+		 BCM_5710_FW_MAJOR_VERSION, BCM_5710_FW_MINOR_VERSION,
+		 BCM_5710_FW_REVISION_VERSION, BCM_5710_FW_ENGINEERING_VERSION);
+	strlcat(info->version, version, sizeof(info->version));
+
 	if (SHMEM2_HAS(bp, extended_dev_info_shared_addr)) {
 		ext_dev_info_offset = SHMEM2_RD(bp,
 						extended_dev_info_shared_addr);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query.
  2018-11-27  6:25 [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query Sudarsana Reddy Kalluru
  2018-11-27  6:25 ` [PATCH net-next 1/2] bnx2x: Add MBI version to ethtool driver query output Sudarsana Reddy Kalluru
  2018-11-27  6:25 ` [PATCH net-next 2/2] bnx2x: Add storm FW " Sudarsana Reddy Kalluru
@ 2018-11-28  0:41 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-11-28  0:41 UTC (permalink / raw)
  To: sudarsana.kalluru; +Cc: netdev, Ariel.Elior

From: Sudarsana Reddy Kalluru <sudarsana.kalluru@cavium.com>
Date: Mon, 26 Nov 2018 22:25:55 -0800

> From: Sudarsana Reddy Kalluru <Sudarsana.Kalluru@cavium.com>
> 
> The patch series populates MBI and storm firware versions in the ethtool
> driver info query.
> 
> Please consider applying it to 'net-next' tree.

Series applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-28 11:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-27  6:25 [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query Sudarsana Reddy Kalluru
2018-11-27  6:25 ` [PATCH net-next 1/2] bnx2x: Add MBI version to ethtool driver query output Sudarsana Reddy Kalluru
2018-11-27  6:25 ` [PATCH net-next 2/2] bnx2x: Add storm FW " Sudarsana Reddy Kalluru
2018-11-28  0:41 ` [PATCH net-next 0/2] bnx2x: Popoulate firmware versions in driver info query David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).