aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_init.c
diff options
context:
space:
mode:
authorDhananjay Phadke <dhananjay@netxen.com>2009-06-22 16:26:21 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-23 07:16:43 -0400
commit96f2ebd2e10417da151202c750d8664767a2194b (patch)
treecfa8b81d1cf4cf61f0e94fe2b34d51b2c01d85fd /drivers/net/netxen/netxen_nic_init.c
parent01542cd1bbf995f951e2c2383d7911e96b12bec6 (diff)
netxen: fix firmware init handshake
Make sure all functions run firmware init handshake. If PCI function 0 fails to initialize firmware, mark the state failed so that other functions on the same board bail out quickly instead of waiting 30s for firmware handshake. Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r--drivers/net/netxen/netxen_nic_init.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index bdb143d2b5c7..055bb61d6e77 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -944,28 +944,31 @@ int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val)
944 u32 val = 0; 944 u32 val = 0;
945 int retries = 60; 945 int retries = 60;
946 946
947 if (!pegtune_val) { 947 if (pegtune_val)
948 do { 948 return 0;
949 val = NXRD32(adapter, CRB_CMDPEG_STATE);
950 949
951 if (val == PHAN_INITIALIZE_COMPLETE || 950 do {
952 val == PHAN_INITIALIZE_ACK) 951 val = NXRD32(adapter, CRB_CMDPEG_STATE);
953 return 0;
954 952
955 msleep(500); 953 switch (val) {
954 case PHAN_INITIALIZE_COMPLETE:
955 case PHAN_INITIALIZE_ACK:
956 return 0;
957 case PHAN_INITIALIZE_FAILED:
958 goto out_err;
959 default:
960 break;
961 }
956 962
957 } while (--retries); 963 msleep(500);
958 964
959 if (!retries) { 965 } while (--retries);
960 pegtune_val = NXRD32(adapter,
961 NETXEN_ROMUSB_GLB_PEGTUNE_DONE);
962 printk(KERN_WARNING "netxen_phantom_init: init failed, "
963 "pegtune_val=%x\n", pegtune_val);
964 return -1;
965 }
966 }
967 966
968 return 0; 967 NXWR32(adapter, CRB_CMDPEG_STATE, PHAN_INITIALIZE_FAILED);
968
969out_err:
970 dev_warn(&adapter->pdev->dev, "firmware init failed\n");
971 return -EIO;
969} 972}
970 973
971static int 974static int