Commit c84e340a authored by Sritej Velaga's avatar Sritej Velaga Committed by David S. Miller

qlcnic: set driver version in firmware

Signed-off-by: default avatarSritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b640bee6
...@@ -798,6 +798,7 @@ struct qlcnic_mac_list_s { ...@@ -798,6 +798,7 @@ struct qlcnic_mac_list_s {
#define QLCNIC_FW_CAPABILITY_MORE_CAPS BIT_31 #define QLCNIC_FW_CAPABILITY_MORE_CAPS BIT_31
#define QLCNIC_FW_CAPABILITY_2_LRO_MAX_TCP_SEG BIT_2 #define QLCNIC_FW_CAPABILITY_2_LRO_MAX_TCP_SEG BIT_2
#define QLCNIC_FW_CAPABILITY_2_OCBB BIT_5
/* module types */ /* module types */
#define LINKEVENT_MODULE_NOT_PRESENT 1 #define LINKEVENT_MODULE_NOT_PRESENT 1
...@@ -1421,6 +1422,7 @@ void qlcnic_set_multi(struct net_device *netdev); ...@@ -1421,6 +1422,7 @@ void qlcnic_set_multi(struct net_device *netdev);
void qlcnic_free_mac_list(struct qlcnic_adapter *adapter); void qlcnic_free_mac_list(struct qlcnic_adapter *adapter);
int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu); int qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu);
int qlcnic_fw_cmd_set_drv_version(struct qlcnic_adapter *);
int qlcnic_change_mtu(struct net_device *netdev, int new_mtu); int qlcnic_change_mtu(struct net_device *netdev, int new_mtu);
netdev_features_t qlcnic_fix_features(struct net_device *netdev, netdev_features_t qlcnic_fix_features(struct net_device *netdev,
netdev_features_t features); netdev_features_t features);
......
...@@ -160,6 +160,37 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter, ...@@ -160,6 +160,37 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
return cmd->rsp.arg[0]; return cmd->rsp.arg[0];
} }
int qlcnic_fw_cmd_set_drv_version(struct qlcnic_adapter *adapter)
{
struct qlcnic_cmd_args cmd;
u32 arg1, arg2, arg3;
char drv_string[12];
int err = 0;
memset(drv_string, 0, sizeof(drv_string));
snprintf(drv_string, sizeof(drv_string), "%d"".""%d"".""%d",
_QLCNIC_LINUX_MAJOR, _QLCNIC_LINUX_MINOR,
_QLCNIC_LINUX_SUBVERSION);
qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_SET_DRV_VER);
memcpy(&arg1, drv_string, sizeof(u32));
memcpy(&arg2, drv_string + 4, sizeof(u32));
memcpy(&arg3, drv_string + 8, sizeof(u32));
cmd.req.arg[1] = arg1;
cmd.req.arg[2] = arg2;
cmd.req.arg[3] = arg3;
err = qlcnic_issue_cmd(adapter, &cmd);
if (err) {
dev_info(&adapter->pdev->dev,
"Failed to set driver version in firmware\n");
return -EIO;
}
return 0;
}
int int
qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu) qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu)
{ {
......
...@@ -1724,6 +1724,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1724,6 +1724,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
struct qlcnic_adapter *adapter = NULL; struct qlcnic_adapter *adapter = NULL;
struct qlcnic_hardware_context *ahw; struct qlcnic_hardware_context *ahw;
int err, pci_using_dac = -1; int err, pci_using_dac = -1;
u32 capab2;
char board_name[QLCNIC_MAX_BOARD_NAME_LEN]; char board_name[QLCNIC_MAX_BOARD_NAME_LEN];
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
...@@ -1849,6 +1850,14 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1849,6 +1850,14 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err) if (err)
goto err_out_disable_mbx_intr; goto err_out_disable_mbx_intr;
if (qlcnic_82xx_check(adapter)) {
if (ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) {
capab2 = QLCRD32(adapter, CRB_FW_CAPABILITIES_2);
if (capab2 & QLCNIC_FW_CAPABILITY_2_OCBB)
qlcnic_fw_cmd_set_drv_version(adapter);
}
}
pci_set_drvdata(pdev, adapter); pci_set_drvdata(pdev, adapter);
if (qlcnic_82xx_check(adapter)) if (qlcnic_82xx_check(adapter))
......
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