Commit eeb65ced authored by Somnath Kotur's avatar Somnath Kotur Committed by David S. Miller

be2net: cleanup be_get_drvinfo()

Removing the be_cmd_get_fw_ver() query from be_get_drvinfo() and invoking
the same from be_setup() and/or post firmware download.
Signed-off-by: default avatarKalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: default avatarSomnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3fb43eb2
...@@ -397,6 +397,7 @@ struct be_adapter { ...@@ -397,6 +397,7 @@ struct be_adapter {
u32 cmd_privileges; u32 cmd_privileges;
/* Ethtool knobs and info */ /* Ethtool knobs and info */
char fw_ver[FW_VER_LEN]; char fw_ver[FW_VER_LEN];
char fw_on_flash[FW_VER_LEN];
int if_handle; /* Used to configure filtering */ int if_handle; /* Used to configure filtering */
u32 *pmac_id; /* MAC addr handle used by BE card */ u32 *pmac_id; /* MAC addr handle used by BE card */
u32 beacon_state; /* for set_phys_id */ u32 beacon_state; /* for set_phys_id */
......
...@@ -177,19 +177,15 @@ static void be_get_drvinfo(struct net_device *netdev, ...@@ -177,19 +177,15 @@ static void be_get_drvinfo(struct net_device *netdev,
struct ethtool_drvinfo *drvinfo) struct ethtool_drvinfo *drvinfo)
{ {
struct be_adapter *adapter = netdev_priv(netdev); 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);
strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver)); strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
strlcpy(drvinfo->version, DRV_VER, sizeof(drvinfo->version)); strlcpy(drvinfo->version, DRV_VER, sizeof(drvinfo->version));
if (!memcmp(adapter->fw_ver, fw_on_flash, FW_VER_LEN)) if (!memcmp(adapter->fw_ver, adapter->fw_on_flash, FW_VER_LEN))
strlcpy(drvinfo->fw_version, adapter->fw_ver, strlcpy(drvinfo->fw_version, adapter->fw_ver,
sizeof(drvinfo->fw_version)); sizeof(drvinfo->fw_version));
else else
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
"%s [%s]", adapter->fw_ver, fw_on_flash); "%s [%s]", adapter->fw_ver, adapter->fw_on_flash);
strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
sizeof(drvinfo->bus_info)); sizeof(drvinfo->bus_info));
......
...@@ -3193,7 +3193,7 @@ static int be_setup(struct be_adapter *adapter) ...@@ -3193,7 +3193,7 @@ static int be_setup(struct be_adapter *adapter)
if (status) if (status)
goto err; goto err;
be_cmd_get_fw_ver(adapter, adapter->fw_ver, NULL); be_cmd_get_fw_ver(adapter, adapter->fw_ver, adapter->fw_on_flash);
if (adapter->vlans_added) if (adapter->vlans_added)
be_vid_config(adapter); be_vid_config(adapter);
...@@ -3785,6 +3785,10 @@ int be_load_fw(struct be_adapter *adapter, u8 *fw_file) ...@@ -3785,6 +3785,10 @@ int be_load_fw(struct be_adapter *adapter, u8 *fw_file)
else else
status = be_fw_download(adapter, fw); status = be_fw_download(adapter, fw);
if (!status)
be_cmd_get_fw_ver(adapter, adapter->fw_ver,
adapter->fw_on_flash);
fw_exit: fw_exit:
release_firmware(fw); release_firmware(fw);
return status; return status;
......
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