diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2011-09-27 13:30:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-27 13:30:27 -0400 |
commit | 04b71175f340d4081680440e1b9cbffcd3f4a13c (patch) | |
tree | 8b1b7c359a5cbb6537bf125652fde4f8a03a5f01 /drivers/net/ethernet/emulex/benet/be_ethtool.c | |
parent | 8e7d3f681ef462e6aaa151f231310452dac409ca (diff) |
be2net: Show newly flashed FW ver in ethtool
This fix provides a newly flashed FW version (appended, in braces)
along with the currently running FW version via ethtool. The newly
flashed version runs only after a system reset.
Signed-off-by: Suresh Reddy <Suresh.Reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_ethtool.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c index f144a6f9986..bf8153ea4ed 100644 --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c @@ -118,14 +118,24 @@ static const char et_self_tests[][ETH_GSTRING_LEN] = { #define BE_ONE_PORT_EXT_LOOPBACK 0x2 #define BE_NO_LOOPBACK 0xff -static void -be_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) +static void be_get_drvinfo(struct net_device *netdev, + struct ethtool_drvinfo *drvinfo) { struct be_adapter *adapter = netdev_priv(netdev); + char fw_on_flash[FW_VER_LEN]; + + memset(fw_on_flash, 0 , sizeof(fw_on_flash)); + be_cmd_get_fw_ver(adapter, adapter->fw_ver, fw_on_flash); strcpy(drvinfo->driver, DRV_NAME); strcpy(drvinfo->version, DRV_VER); strncpy(drvinfo->fw_version, adapter->fw_ver, FW_VER_LEN); + if (memcmp(adapter->fw_ver, fw_on_flash, FW_VER_LEN) != 0) { + strcat(drvinfo->fw_version, " ["); + strcat(drvinfo->fw_version, fw_on_flash); + strcat(drvinfo->fw_version, "]"); + } + strcpy(drvinfo->bus_info, pci_name(adapter->pdev)); drvinfo->testinfo_len = 0; drvinfo->regdump_len = 0; |