aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-06-21 23:18:59 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-23 16:16:29 -0400
commit900c6cfffac668199aaa30a20e31d07602f8a8ce (patch)
tree237835d27c55be1e80dc3d3bc2213684a1bd70ca /drivers/net/qlcnic
parent9665982885f0e11ea9e3c5d9bfc7ead48d08c83f (diff)
qlcnic: handshake with card after fw load
Instead of delaying rcv handshake till interface comes up, do it just after fw load. 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')
-rw-r--r--drivers/net/qlcnic/qlcnic.h1
-rw-r--r--drivers/net/qlcnic/qlcnic_init.c9
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c6
3 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 86e47811c25b..588b9a9611aa 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -1105,7 +1105,6 @@ int qlcnic_wol_supported(struct qlcnic_adapter *adapter);
1105int qlcnic_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate); 1105int qlcnic_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate);
1106 1106
1107/* Functions from qlcnic_init.c */ 1107/* Functions from qlcnic_init.c */
1108int qlcnic_phantom_init(struct qlcnic_adapter *adapter);
1109int qlcnic_load_firmware(struct qlcnic_adapter *adapter); 1108int qlcnic_load_firmware(struct qlcnic_adapter *adapter);
1110int qlcnic_need_fw_reset(struct qlcnic_adapter *adapter); 1109int qlcnic_need_fw_reset(struct qlcnic_adapter *adapter);
1111void qlcnic_request_firmware(struct qlcnic_adapter *adapter); 1110void qlcnic_request_firmware(struct qlcnic_adapter *adapter);
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 1c3d5a90d21a..d19d0120e5b8 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -1138,7 +1138,7 @@ qlcnic_release_firmware(struct qlcnic_adapter *adapter)
1138 adapter->fw = NULL; 1138 adapter->fw = NULL;
1139} 1139}
1140 1140
1141int qlcnic_phantom_init(struct qlcnic_adapter *adapter) 1141static int qlcnic_cmd_peg_ready(struct qlcnic_adapter *adapter)
1142{ 1142{
1143 u32 val; 1143 u32 val;
1144 int retries = 60; 1144 int retries = 60;
@@ -1163,7 +1163,8 @@ int qlcnic_phantom_init(struct qlcnic_adapter *adapter)
1163 QLCWR32(adapter, CRB_CMDPEG_STATE, PHAN_INITIALIZE_FAILED); 1163 QLCWR32(adapter, CRB_CMDPEG_STATE, PHAN_INITIALIZE_FAILED);
1164 1164
1165out_err: 1165out_err:
1166 dev_err(&adapter->pdev->dev, "firmware init failed\n"); 1166 dev_err(&adapter->pdev->dev, "Command Peg initialization not "
1167 "complete, state: 0x%x.\n", val);
1167 return -EIO; 1168 return -EIO;
1168} 1169}
1169 1170
@@ -1196,6 +1197,10 @@ int qlcnic_init_firmware(struct qlcnic_adapter *adapter)
1196{ 1197{
1197 int err; 1198 int err;
1198 1199
1200 err = qlcnic_cmd_peg_ready(adapter);
1201 if (err)
1202 return err;
1203
1199 err = qlcnic_receive_peg_ready(adapter); 1204 err = qlcnic_receive_peg_ready(adapter);
1200 if (err) 1205 if (err)
1201 return err; 1206 return err;
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 655bccd7f8f4..9658b1849386 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -758,6 +758,7 @@ qlcnic_start_firmware(struct qlcnic_adapter *adapter)
758 758
759 if (first_boot != 0x55555555) { 759 if (first_boot != 0x55555555) {
760 QLCWR32(adapter, CRB_CMDPEG_STATE, 0); 760 QLCWR32(adapter, CRB_CMDPEG_STATE, 0);
761 QLCWR32(adapter, CRB_RCVPEG_STATE, 0);
761 qlcnic_pinit_from_rom(adapter); 762 qlcnic_pinit_from_rom(adapter);
762 msleep(1); 763 msleep(1);
763 } 764 }
@@ -780,7 +781,7 @@ qlcnic_start_firmware(struct qlcnic_adapter *adapter)
780 781
781wait_init: 782wait_init:
782 /* Handshake with the card before we register the devices. */ 783 /* Handshake with the card before we register the devices. */
783 err = qlcnic_phantom_init(adapter); 784 err = qlcnic_init_firmware(adapter);
784 if (err) 785 if (err)
785 goto err_out; 786 goto err_out;
786 787
@@ -962,9 +963,6 @@ qlcnic_attach(struct qlcnic_adapter *adapter)
962 if (adapter->is_up == QLCNIC_ADAPTER_UP_MAGIC) 963 if (adapter->is_up == QLCNIC_ADAPTER_UP_MAGIC)
963 return 0; 964 return 0;
964 965
965 err = qlcnic_init_firmware(adapter);
966 if (err)
967 return err;
968 966
969 err = qlcnic_napi_add(adapter, netdev); 967 err = qlcnic_napi_add(adapter, netdev);
970 if (err) 968 if (err)