summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Miletich2009-02-27 19:52:03 +0100
committerMarty Connor2009-02-27 19:52:03 +0100
commitafe59d46368e3b6f2b4110e3230c03ed84a2c861 (patch)
tree32296017becdf1790249cebc77dd56f1d606d8f5
parent[infiniband] Kill off obsolete mlx_ipoib directory (diff)
downloadipxe-afe59d46368e3b6f2b4110e3230c03ed84a2c861.tar.gz
ipxe-afe59d46368e3b6f2b4110e3230c03ed84a2c861.tar.xz
ipxe-afe59d46368e3b6f2b4110e3230c03ed84a2c861.zip
[sundance] Add reset completion check
Following the example of the Linux driver, we add a check and delay to make sure that the NIC has finished resetting before the driver issues any additional commands. Signed-off-by: Marty Connor <mdc@etherboot.org>
-rw-r--r--src/drivers/net/sundance.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/drivers/net/sundance.c b/src/drivers/net/sundance.c
index eb750fb1..119c9778 100644
--- a/src/drivers/net/sundance.c
+++ b/src/drivers/net/sundance.c
@@ -691,6 +691,22 @@ static int sundance_probe ( struct nic *nic, struct pci_device *pci ) {
/* Reset the chip to erase previous misconfiguration */
DBG ( "ASIC Control is %#x\n", inl(BASE + ASICCtrl) );
outw(0x007f, BASE + ASICCtrl + 2);
+
+ /*
+ * wait for reset to complete
+ * this is heavily inspired by the linux sundance driver
+ * according to the linux driver it can take up to 1ms for the reset
+ * to complete
+ */
+ i = 0;
+ while(inl(BASE + ASICCtrl) & (ResetBusy << 16)) {
+ if(i++ >= 10) {
+ DBG("sundance: NIC reset did not complete.\n");
+ break;
+ }
+ udelay(100);
+ }
+
DBG ( "ASIC Control is now %#x.\n", inl(BASE + ASICCtrl) );
sundance_reset(nic);