diff options
author | Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> | 2010-05-12 23:07:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-14 06:08:00 -0400 |
commit | 96f8118c25ea812335986d96a68441c2bcb01fe0 (patch) | |
tree | cb8a537baf568dea2b3e303dd5fb0be52dc8abc1 /drivers/net/qlcnic/qlcnic_main.c | |
parent | 251a84c9272b88eac4888d610c44c821b277c6c9 (diff) |
qlcnic: check IDC version
Warn user if IDC version mismatch with different class of drivers.
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_main.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 50be833c3767..54a6bb20ec07 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -1975,12 +1975,25 @@ qlcnic_check_drv_state(struct qlcnic_adapter *adapter) | |||
1975 | return 1; | 1975 | return 1; |
1976 | } | 1976 | } |
1977 | 1977 | ||
1978 | static int qlcnic_check_idc_ver(struct qlcnic_adapter *adapter) | ||
1979 | { | ||
1980 | u32 val = QLCRD32(adapter, QLCNIC_CRB_DRV_IDC_VER); | ||
1981 | |||
1982 | if (val != QLCNIC_DRV_IDC_VER) { | ||
1983 | dev_warn(&adapter->pdev->dev, "IDC Version mismatch, driver's" | ||
1984 | " idc ver = %x; reqd = %x\n", QLCNIC_DRV_IDC_VER, val); | ||
1985 | } | ||
1986 | |||
1987 | return 0; | ||
1988 | } | ||
1989 | |||
1978 | static int | 1990 | static int |
1979 | qlcnic_can_start_firmware(struct qlcnic_adapter *adapter) | 1991 | qlcnic_can_start_firmware(struct qlcnic_adapter *adapter) |
1980 | { | 1992 | { |
1981 | u32 val, prev_state; | 1993 | u32 val, prev_state; |
1982 | u8 dev_init_timeo = adapter->dev_init_timeo; | 1994 | u8 dev_init_timeo = adapter->dev_init_timeo; |
1983 | u8 portnum = adapter->portnum; | 1995 | u8 portnum = adapter->portnum; |
1996 | u8 ret; | ||
1984 | 1997 | ||
1985 | if (test_and_clear_bit(__QLCNIC_START_FW, &adapter->state)) | 1998 | if (test_and_clear_bit(__QLCNIC_START_FW, &adapter->state)) |
1986 | return 1; | 1999 | return 1; |
@@ -2000,12 +2013,14 @@ qlcnic_can_start_firmware(struct qlcnic_adapter *adapter) | |||
2000 | switch (prev_state) { | 2013 | switch (prev_state) { |
2001 | case QLCNIC_DEV_COLD: | 2014 | case QLCNIC_DEV_COLD: |
2002 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_INITIALIZING); | 2015 | QLCWR32(adapter, QLCNIC_CRB_DEV_STATE, QLCNIC_DEV_INITIALIZING); |
2016 | QLCWR32(adapter, QLCNIC_CRB_DRV_IDC_VER, QLCNIC_DRV_IDC_VER); | ||
2003 | qlcnic_api_unlock(adapter); | 2017 | qlcnic_api_unlock(adapter); |
2004 | return 1; | 2018 | return 1; |
2005 | 2019 | ||
2006 | case QLCNIC_DEV_READY: | 2020 | case QLCNIC_DEV_READY: |
2021 | ret = qlcnic_check_idc_ver(adapter); | ||
2007 | qlcnic_api_unlock(adapter); | 2022 | qlcnic_api_unlock(adapter); |
2008 | return 0; | 2023 | return ret; |
2009 | 2024 | ||
2010 | case QLCNIC_DEV_NEED_RESET: | 2025 | case QLCNIC_DEV_NEED_RESET: |
2011 | val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE); | 2026 | val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE); |
@@ -2048,9 +2063,10 @@ qlcnic_can_start_firmware(struct qlcnic_adapter *adapter) | |||
2048 | QLC_DEV_CLR_RST_QSCNT(val, portnum); | 2063 | QLC_DEV_CLR_RST_QSCNT(val, portnum); |
2049 | QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val); | 2064 | QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val); |
2050 | 2065 | ||
2066 | ret = qlcnic_check_idc_ver(adapter); | ||
2051 | qlcnic_api_unlock(adapter); | 2067 | qlcnic_api_unlock(adapter); |
2052 | 2068 | ||
2053 | return 0; | 2069 | return ret; |
2054 | } | 2070 | } |
2055 | 2071 | ||
2056 | static void | 2072 | static void |