Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic make the wait_ready loop use pcic_delay() (thus t...



details:   https://anonhg.NetBSD.org/src/rev/c4e6614f7dd9
branches:  trunk
changeset: 481294:c4e6614f7dd9
user:      chopps <chopps%NetBSD.org@localhost>
date:      Tue Jan 25 19:38:18 2000 +0000

description:
make the wait_ready loop use pcic_delay() (thus tsleep) too for cards
that take a while to become ready

diffstat:

 sys/dev/ic/i82365.c |  13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r a25e6a5a153f -r c4e6614f7dd9 sys/dev/ic/i82365.c
--- a/sys/dev/ic/i82365.c       Tue Jan 25 19:29:17 2000 +0000
+++ b/sys/dev/ic/i82365.c       Tue Jan 25 19:38:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82365.c,v 1.30 2000/01/25 09:17:35 enami Exp $        */
+/*     $NetBSD: i82365.c,v 1.31 2000/01/25 19:38:18 chopps Exp $       */
 
 #define        PCICDEBUG
 
@@ -1295,13 +1295,18 @@
 {
        int i;
 
-       for (i = 0; i < 10000; i++) {
+       /* wait an initial 10ms for quick cards */
+       if (pcic_read(h, PCIC_IF_STATUS) & PCIC_IF_STATUS_READY)
+               return;
+       pcic_delay(h, 10, "wait_ready initial");
+       for (i = 0; i < 50; i++) {
                if (pcic_read(h, PCIC_IF_STATUS) & PCIC_IF_STATUS_READY)
                        return;
-               delay(500);
+               /* wait .1s (100ms) each iteration now */
+               pcic_delay(h, 100, "wait_ready loop");
 #ifdef PCICDEBUG
                if (pcic_debug) {
-                       if ((i>5000) && (i%100 == 99))
+                       if ((i>20) && (i%100 == 99))
                                printf(".");
                }
 #endif



Home | Main Index | Thread Index | Old Index