summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-04-09 06:33:36 +0000
committerimp <imp@FreeBSD.org>2001-04-09 06:33:36 +0000
commit333537cac41eab8a0ddfc760147e5973a5be95a5 (patch)
treedacc3d35cdfe87b3650efde22edc4028fb81fe96
parent49215b31ce7c8fde1ce23ddfb2ee853697f480bc (diff)
downloadFreeBSD-src-333537cac41eab8a0ddfc760147e5973a5be95a5.zip
FreeBSD-src-333537cac41eab8a0ddfc760147e5973a5be95a5.tar.gz
Two minor fixes:
o Change the number of init tries from 5 to a #define. o Allow up to 5s rather than 2s for commands to complete. This is still much less than 51 minutes, but makes my intel card init with more reliability than before.
-rw-r--r--sys/dev/wi/if_wi.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index 8a527be..49e5a94 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -770,7 +770,7 @@ static int wi_cmd(sc, cmd, val)
int i, s = 0;
/* wait for the busy bit to clear */
- for (i = 200; i > 0; i--) {
+ for (i = 500; i > 0; i--) { /* 5s */
if (!(CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY)) {
break;
}
@@ -814,14 +814,15 @@ static int wi_cmd(sc, cmd, val)
static void wi_reset(sc)
struct wi_softc *sc;
{
+#define WI_INIT_TRIES 5
int i;
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < WI_INIT_TRIES; i++) {
if (wi_cmd(sc, WI_CMD_INI, 0) == 0)
break;
- DELAY(100000);
+ DELAY(50 * 1000); /* 50ms */
}
- if (i == 5)
+ if (i == WI_INIT_TRIES)
device_printf(sc->dev, "init failed\n");
CSR_WRITE_2(sc, WI_INT_EN, 0);
CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF);
OpenPOWER on IntegriCloud