Commit a88381de authored by Sudarsana Reddy Kalluru's avatar Sudarsana Reddy Kalluru Committed by David S. Miller

qede: Populate mbi version in ethtool driver query data.

The patch adds support to display MBI image version in 'ethtool -i' output.
Signed-off-by: default avatarSudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
Signed-off-by: default avatarMichal Kalderon <mkalderon@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 254c0a2b
...@@ -652,9 +652,9 @@ static void qede_get_drvinfo(struct net_device *ndev, ...@@ -652,9 +652,9 @@ static void qede_get_drvinfo(struct net_device *ndev,
{ {
char mfw[ETHTOOL_FWVERS_LEN], storm[ETHTOOL_FWVERS_LEN]; char mfw[ETHTOOL_FWVERS_LEN], storm[ETHTOOL_FWVERS_LEN];
struct qede_dev *edev = netdev_priv(ndev); struct qede_dev *edev = netdev_priv(ndev);
char mbi[ETHTOOL_FWVERS_LEN];
strlcpy(info->driver, "qede", sizeof(info->driver)); strlcpy(info->driver, "qede", sizeof(info->driver));
strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
snprintf(storm, ETHTOOL_FWVERS_LEN, "%d.%d.%d.%d", snprintf(storm, ETHTOOL_FWVERS_LEN, "%d.%d.%d.%d",
edev->dev_info.common.fw_major, edev->dev_info.common.fw_major,
...@@ -668,13 +668,27 @@ static void qede_get_drvinfo(struct net_device *ndev, ...@@ -668,13 +668,27 @@ static void qede_get_drvinfo(struct net_device *ndev,
(edev->dev_info.common.mfw_rev >> 8) & 0xFF, (edev->dev_info.common.mfw_rev >> 8) & 0xFF,
edev->dev_info.common.mfw_rev & 0xFF); edev->dev_info.common.mfw_rev & 0xFF);
if ((strlen(storm) + strlen(mfw) + strlen("mfw storm ")) < if ((strlen(storm) + strlen(DRV_MODULE_VERSION) + strlen("[storm] ")) <
sizeof(info->fw_version)) { sizeof(info->version))
snprintf(info->version, sizeof(info->version),
"%s [storm %s]", DRV_MODULE_VERSION, storm);
else
snprintf(info->version, sizeof(info->version),
"%s %s", DRV_MODULE_VERSION, storm);
if (edev->dev_info.common.mbi_version) {
snprintf(mbi, ETHTOOL_FWVERS_LEN, "%d.%d.%d",
(edev->dev_info.common.mbi_version &
QED_MBI_VERSION_2_MASK) >> QED_MBI_VERSION_2_OFFSET,
(edev->dev_info.common.mbi_version &
QED_MBI_VERSION_1_MASK) >> QED_MBI_VERSION_1_OFFSET,
(edev->dev_info.common.mbi_version &
QED_MBI_VERSION_0_MASK) >> QED_MBI_VERSION_0_OFFSET);
snprintf(info->fw_version, sizeof(info->fw_version), snprintf(info->fw_version, sizeof(info->fw_version),
"mfw %s storm %s", mfw, storm); "mbi %s [mfw %s]", mbi, mfw);
} else { } else {
snprintf(info->fw_version, sizeof(info->fw_version), snprintf(info->fw_version, sizeof(info->fw_version),
"%s %s", mfw, storm); "mfw %s", mfw);
} }
strlcpy(info->bus_info, pci_name(edev->pdev), sizeof(info->bus_info)); strlcpy(info->bus_info, pci_name(edev->pdev), sizeof(info->bus_info));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment