Delay for tens of milliseconds lot after writing the Network Access

Register.  I am slavishly imitating the reference driver, here.
I will come back and lower the delays later.
This commit is contained in:
dyoung 2004-07-15 06:38:46 +00:00
parent 9bd30b81ae
commit 6e8ef3ee56
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: atw.c,v 1.48 2004/07/15 06:37:22 dyoung Exp $ */
/* $NetBSD: atw.c,v 1.49 2004/07/15 06:38:46 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.48 2004/07/15 06:37:22 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.49 2004/07/15 06:38:46 dyoung Exp $");
#include "bpfilter.h"
@ -2494,6 +2494,7 @@ atw_stop(struct ifnet *ifp, int disable)
/* Stop the transmit and receive processes. */
sc->sc_opmode = 0;
ATW_WRITE(sc, ATW_NAR, 0);
DELAY(20 * 1000);
ATW_WRITE(sc, ATW_TDBD, 0);
ATW_WRITE(sc, ATW_TDBP, 0);
ATW_WRITE(sc, ATW_RDB, 0);
@ -2723,6 +2724,8 @@ atw_intr(void *arg)
* the transmit process.
*/
ATW_WRITE(sc, ATW_NAR, sc->sc_opmode);
DELAY(20 * 1000);
ATW_WRITE(sc, ATW_RDR, 0x1);
/* XXX Log every Nth underrun from
* XXX now on?
*/
@ -2798,12 +2801,13 @@ atw_idle(struct atw_softc *sc, u_int32_t bits)
}
ATW_WRITE(sc, ATW_NAR, opmode);
DELAY(20 * 1000);
for (i = 0; i < 1000; i++) {
for (i = 0; i < 10; i++) {
stsr = ATW_READ(sc, ATW_STSR);
if ((stsr & ackmask) == ackmask)
break;
DELAY(10);
DELAY(1000);
}
ATW_WRITE(sc, ATW_STSR, stsr & ackmask);