make the wait_ready loop use pcic_delay() (thus tsleep) too for cards
that take a while to become ready
This commit is contained in:
parent
6aca67041c
commit
da499b1e3a
|
@ -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 @@ pcic_wait_ready(h)
|
|||
{
|
||||
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;
|
||||
delay(500);
|
||||
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;
|
||||
/* 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
|
||||
|
|
Loading…
Reference in New Issue