qlcnic: Add FLT entry for CO cards FW image region
authorSritej Velaga <sritej.velaga@qlogic.com>
Mon, 29 Aug 2011 12:50:28 +0000 (12:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Aug 2011 02:52:50 +0000 (22:52 -0400)
The FLT entry for FW image region has changed for C0 cards.
Updated the driver to look at the right region in the FLT.

Signed-off-by: Sritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c

index 53c6e5dcf26c11ba1aa5f16d737f27ec6708b2a0..4118502ef2956ff225ec79aad38f1b54377c91fe 100644 (file)
@@ -73,6 +73,7 @@
        (sizeof(struct cmd_desc_type0) * tx_ring->num_desc)
 
 #define QLCNIC_P3P_A0          0x50
+#define QLCNIC_P3P_C0          0x58
 
 #define QLCNIC_IS_REVISION_P3P(REVISION)     (REVISION >= QLCNIC_P3P_A0)
 
@@ -291,7 +292,8 @@ struct uni_data_desc{
 
 /* Flash Defines and Structures */
 #define QLCNIC_FLT_LOCATION    0x3F1000
-#define QLCNIC_FW_IMAGE_REGION 0x74
+#define QLCNIC_B0_FW_IMAGE_REGION 0x74
+#define QLCNIC_C0_FW_IMAGE_REGION 0x97
 #define QLCNIC_BOOTLD_REGION    0X72
 struct qlcnic_flt_header {
        u16 version;
index b02859c7a23d70d91613050517c578014c9b6304..7f4b8e69079a7e23eafcbae81eb99c690da84fea 100644 (file)
@@ -686,7 +686,13 @@ qlcnic_check_flash_fw_ver(struct qlcnic_adapter *adapter)
        u32 ver = -1, min_ver;
        int ret;
 
-       ret = qlcnic_get_flt_entry(adapter, QLCNIC_FW_IMAGE_REGION, &fw_entry);
+       if (adapter->ahw->revision_id == QLCNIC_P3P_C0)
+               ret = qlcnic_get_flt_entry(adapter, QLCNIC_C0_FW_IMAGE_REGION,
+                                                &fw_entry);
+       else
+               ret = qlcnic_get_flt_entry(adapter, QLCNIC_B0_FW_IMAGE_REGION,
+                                                &fw_entry);
+
        if (!ret)
                /* 0-4:-signature,  4-8:-fw version */
                qlcnic_rom_fast_read(adapter, fw_entry.start_addr + 4,