Commit 9ce13ca8 authored by amit salecha's avatar amit salecha Committed by David S. Miller

qlcnic: fix checks for auto_fw_reset

o Remove checks of 1 for auto_fw_reset module parameter.
  auto_fw_reset is of type int and can have value > 1.
o Remove unnecessary #define for 1
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 39fc0ce5
...@@ -867,7 +867,6 @@ struct qlcnic_nic_intr_coalesce { ...@@ -867,7 +867,6 @@ struct qlcnic_nic_intr_coalesce {
#define LINKEVENT_LINKSPEED_MBPS 0 #define LINKEVENT_LINKSPEED_MBPS 0
#define LINKEVENT_LINKSPEED_ENCODED 1 #define LINKEVENT_LINKSPEED_ENCODED 1
#define AUTO_FW_RESET_ENABLED 0x01
/* firmware response header: /* firmware response header:
* 63:58 - message type * 63:58 - message type
* 57:56 - owner * 57:56 - owner
......
...@@ -42,7 +42,7 @@ static int use_msi_x = 1; ...@@ -42,7 +42,7 @@ static int use_msi_x = 1;
module_param(use_msi_x, int, 0444); module_param(use_msi_x, int, 0444);
MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled"); MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled");
static int auto_fw_reset = AUTO_FW_RESET_ENABLED; static int auto_fw_reset = 1;
module_param(auto_fw_reset, int, 0644); module_param(auto_fw_reset, int, 0644);
MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled"); MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled");
...@@ -2959,8 +2959,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter) ...@@ -2959,8 +2959,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
if (adapter->need_fw_reset) if (adapter->need_fw_reset)
goto detach; goto detach;
if (adapter->reset_context && if (adapter->reset_context && auto_fw_reset) {
auto_fw_reset == AUTO_FW_RESET_ENABLED) {
qlcnic_reset_hw_context(adapter); qlcnic_reset_hw_context(adapter);
adapter->netdev->trans_start = jiffies; adapter->netdev->trans_start = jiffies;
} }
...@@ -2973,7 +2972,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter) ...@@ -2973,7 +2972,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
qlcnic_dev_request_reset(adapter); qlcnic_dev_request_reset(adapter);
if ((auto_fw_reset == AUTO_FW_RESET_ENABLED)) if (auto_fw_reset)
clear_bit(__QLCNIC_FW_ATTACHED, &adapter->state); clear_bit(__QLCNIC_FW_ATTACHED, &adapter->state);
dev_info(&netdev->dev, "firmware hang detected\n"); dev_info(&netdev->dev, "firmware hang detected\n");
...@@ -2982,7 +2981,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter) ...@@ -2982,7 +2981,7 @@ qlcnic_check_health(struct qlcnic_adapter *adapter)
adapter->dev_state = (state == QLCNIC_DEV_NEED_QUISCENT) ? state : adapter->dev_state = (state == QLCNIC_DEV_NEED_QUISCENT) ? state :
QLCNIC_DEV_NEED_RESET; QLCNIC_DEV_NEED_RESET;
if ((auto_fw_reset == AUTO_FW_RESET_ENABLED) && if (auto_fw_reset &&
!test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) { !test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) {
qlcnic_schedule_work(adapter, qlcnic_detach_work, 0); qlcnic_schedule_work(adapter, qlcnic_detach_work, 0);
......
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