aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>2010-05-12 23:07:47 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-14 06:08:00 -0400
commit96f8118c25ea812335986d96a68441c2bcb01fe0 (patch)
treecb8a537baf568dea2b3e303dd5fb0be52dc8abc1 /drivers/net
parent251a84c9272b88eac4888d610c44c821b277c6c9 (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')
-rw-r--r--drivers/net/qlcnic/qlcnic.h1
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c20
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index ed9df150c20f..8a9412fd2ff5 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -53,6 +53,7 @@
53#define _QLCNIC_LINUX_MINOR 0 53#define _QLCNIC_LINUX_MINOR 0
54#define _QLCNIC_LINUX_SUBVERSION 2 54#define _QLCNIC_LINUX_SUBVERSION 2
55#define QLCNIC_LINUX_VERSIONID "5.0.2" 55#define QLCNIC_LINUX_VERSIONID "5.0.2"
56#define QLCNIC_DRV_IDC_VER 0x01
56 57
57#define QLCNIC_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c)) 58#define QLCNIC_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
58#define _major(v) (((v) >> 24) & 0xff) 59#define _major(v) (((v) >> 24) & 0xff)
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
1978static 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
1978static int 1990static int
1979qlcnic_can_start_firmware(struct qlcnic_adapter *adapter) 1991qlcnic_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
2056static void 2072static void