diff options
author | brian <brian@FreeBSD.org> | 2002-04-10 03:13:28 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2002-04-10 03:13:28 +0000 |
commit | ef68f6f3c9847179f76c02d7a2013b31b1f0272f (patch) | |
tree | 1e53a48155290a45873c816d8372ad3b021639f1 /sys/dev/digi/digi.c | |
parent | 5f28b9b6a5fe32a27c2265e004f7282ac2b1910d (diff) | |
download | FreeBSD-src-ef68f6f3c9847179f76c02d7a2013b31b1f0272f.zip FreeBSD-src-ef68f6f3c9847179f76c02d7a2013b31b1f0272f.tar.gz |
Add a digi_delay() function and use it instead of tsleep() when polling
the card for command completion.
digi_delay() uses either tsleep() or DELAY() depending on the value of
``cold''.
Pointed in the right direction by: jhb
Diffstat (limited to 'sys/dev/digi/digi.c')
-rw-r--r-- | sys/dev/digi/digi.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c index df13183..f7e7334 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -221,6 +221,15 @@ digi_bcopy(const void *vfrom, void *vto, size_t sz) return (1); } +static void +digi_delay(struct digi_softc *sc, const char *txt) +{ + if (cold) + DELAY(5000); + else + tsleep(sc, PUSER | PCATCH, txt, 5); +} + static int digi_init(struct digi_softc *sc) { @@ -310,7 +319,7 @@ digi_init(struct digi_softc *sc) sc->res.unit, sc->name); return (EIO); } - tsleep(sc, PUSER | PCATCH, "digiinit0", 1); + digi_delay(sc, "digiinit0"); } DLOG(DIGIDB_INIT, (sc->dev, "Got init reset after %d us\n", i)); @@ -366,7 +375,7 @@ digi_init(struct digi_softc *sc) sc->res.unit); return (EIO); } - tsleep(sc, PUSER | PCATCH, "digibios0", 1); + digi_delay(sc, "digibios0"); } DLOG(DIGIDB_INIT, (sc->dev, "BIOS started after %d us\n", i)); @@ -378,7 +387,7 @@ digi_init(struct digi_softc *sc) sc->res.unit, vW(ptr), *(u_short *)"GD"); return (EIO); } - tsleep(sc, PUSER | PCATCH, "digibios1", 1); + digi_delay(sc, "digibios1"); } DLOG(DIGIDB_INIT, (sc->dev, "BIOS booted after %d iterations\n", i)); @@ -418,7 +427,7 @@ digi_init(struct digi_softc *sc) sc->hidewin(sc); return (EIO); } - tsleep(sc, PUSER | PCATCH, "digifep0", 1); + digi_delay(sc, "digifep0"); } DLOG(DIGIDB_INIT, (sc->dev, "FEP/OS moved after %d iterations\n", i)); @@ -504,7 +513,7 @@ digi_init(struct digi_softc *sc) sc->hidewin(sc); return (EIO); } - tsleep(sc, PUSER | PCATCH, "digifep1", 1); + digi_delay(sc, "digifep1"); } DLOG(DIGIDB_INIT, (sc->dev, "FEP/OS started after %d iterations\n", i)); |