Skip to content

Commit

Permalink
qlcnic: fix defines as per IDC document
Browse files Browse the repository at this point in the history
Different class of drivers co-exist for CNA device,
there is some minimal interaction that will be required amongst
the drivers for performing some device level operations.

All the driver should follow inter driver coexistence document.

Fixing polling interval and spelling mistake.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Amit Kumar Salecha authored and David S. Miller committed Apr 22, 2010
1 parent 8ae6df9 commit bbd8c6a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
22 changes: 11 additions & 11 deletions drivers/net/qlcnic/qlcnic_hdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -694,27 +694,27 @@ enum {
#define QLCNIC_CRB_DRV_STATE (QLCNIC_CAM_RAM(0x144))
#define QLCNIC_CRB_DRV_SCRATCH (QLCNIC_CAM_RAM(0x148))
#define QLCNIC_CRB_DEV_PARTITION_INFO (QLCNIC_CAM_RAM(0x14c))
#define QLCNIC_CRB_DRV_IDC_VER (QLCNIC_CAM_RAM(0x14c))
#define QLCNIC_CRB_DRV_IDC_VER (QLCNIC_CAM_RAM(0x174))
#define QLCNIC_ROM_DEV_INIT_TIMEOUT (0x3e885c)
#define QLCNIC_ROM_DRV_RESET_TIMEOUT (0x3e8860)

/* Device State */
#define QLCNIC_DEV_COLD 1
#define QLCNIC_DEV_INITALIZING 2
#define QLCNIC_DEV_READY 3
#define QLCNIC_DEV_NEED_RESET 4
#define QLCNIC_DEV_NEED_QUISCENT 5
#define QLCNIC_DEV_FAILED 6
/* Device State */
#define QLCNIC_DEV_COLD 0x1
#define QLCNIC_DEV_INITIALIZING 0x2
#define QLCNIC_DEV_READY 0x3
#define QLCNIC_DEV_NEED_RESET 0x4
#define QLCNIC_DEV_NEED_QUISCENT 0x5
#define QLCNIC_DEV_FAILED 0x6
#define QLCNIC_DEV_QUISCENT 0x7

#define QLCNIC_RCODE_DRIVER_INFO 0x20000000
#define QLCNIC_RCODE_DRIVER_CAN_RELOAD 0x40000000
#define QLCNIC_RCODE_FATAL_ERROR 0x80000000
#define QLCNIC_FWERROR_PEGNUM(code) ((code) & 0xff)
#define QLCNIC_FWERROR_CODE(code) ((code >> 8) & 0xfffff)

#define FW_POLL_DELAY (2 * HZ)
#define FW_FAIL_THRESH 3
#define FW_POLL_THRESH 10
#define FW_POLL_DELAY (1 * HZ)
#define FW_FAIL_THRESH 2

#define ISR_MSI_INT_TRIGGER(FUNC) (QLCNIC_PCIX_PS_REG(PCIX_MSI_F(FUNC)))
#define ISR_LEGACY_INT_TRIGGERED(VAL) (((VAL) & 0x300) == 0x200)
Expand Down
9 changes: 7 additions & 2 deletions drivers/net/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,7 @@ qlcnic_can_start_firmware(struct qlcnic_adapter *adapter)
switch (prev_state) {
case QLCNIC_DEV_COLD:
start_fw:
QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_INITALIZING);
QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_INITIALIZING);
qlcnic_api_unlock(adapter);
return 1;

Expand All @@ -2077,6 +2077,10 @@ qlcnic_can_start_firmware(struct qlcnic_adapter *adapter)
case QLCNIC_DEV_FAILED:
qlcnic_api_unlock(adapter);
return -1;

case QLCNIC_DEV_INITIALIZING:
case QLCNIC_DEV_QUISCENT:
break;
}

qlcnic_api_unlock(adapter);
Expand Down Expand Up @@ -2208,7 +2212,8 @@ qlcnic_dev_request_reset(struct qlcnic_adapter *adapter)

state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE);

if (state != QLCNIC_DEV_INITALIZING && state != QLCNIC_DEV_NEED_RESET) {
if (state != QLCNIC_DEV_INITIALIZING &&
state != QLCNIC_DEV_NEED_RESET) {
QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_NEED_RESET);
set_bit(__QLCNIC_START_FW, &adapter->state);
QLCDB(adapter, DRV, "NEED_RESET state set\n");
Expand Down

0 comments on commit bbd8c6a

Please sign in to comment.