diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-07-15 13:00:50 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-07-15 13:00:50 +0000 |
commit | 0aaad71a537d184ae03176c93d709458db9e7ca7 (patch) | |
tree | 1cb3466e8b7a63134e6e5b2af299d36dba760e9f | |
parent | cfd87e97256668186128caab6e0715d27aa85b7e (diff) |
Simplify the Rx filter setup. From NetBSD (dyoung)
-rw-r--r-- | sys/dev/ic/atw.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index c3b0b1e84f5..447cd220891 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,5 +1,5 @@ -/* $OpenBSD: atw.c,v 1.13 2004/07/15 12:55:09 millert Exp $ */ -/* $NetBSD: atw.c,v 1.56 2004/07/15 07:10:25 dyoung Exp $ */ +/* $OpenBSD: atw.c,v 1.14 2004/07/15 13:00:49 millert Exp $ */ +/* $NetBSD: atw.c,v 1.57 2004/07/15 07:11:23 dyoung Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ #include <sys/cdefs.h> #if defined(__NetBSD__) -__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.56 2004/07/15 07:10:25 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.57 2004/07/15 07:11:23 dyoung Exp $"); #endif #include "bpfilter.h" @@ -1615,33 +1615,19 @@ atw_rf3000_write(struct atw_softc *sc, u_int addr, u_int val) u_int32_t reg; int i; - for (i = 1000; --i >= 0; ) { - if (ATW_ISSET(sc, ATW_BBPCTL, ATW_BBPCTL_RD|ATW_BBPCTL_WR) == 0) - break; - DELAY(100); - } - - if (i < 0) { - printf("%s: BBPCTL busy (pre-write)\n", sc->sc_dev.dv_xname); - return ETIMEDOUT; - } - reg = sc->sc_bbpctl_wr | LSHIFT(val & 0xff, ATW_BBPCTL_DATA_MASK) | LSHIFT(addr & 0x7f, ATW_BBPCTL_ADDR_MASK); - ATW_WRITE(sc, ATW_BBPCTL, reg); - - for (i = 1000; --i >= 0; ) { - DELAY(100); + for (i = 10; --i >= 0; ) { + ATW_WRITE(sc, ATW_BBPCTL, reg); + DELAY(2000); if (ATW_ISSET(sc, ATW_BBPCTL, ATW_BBPCTL_WR) == 0) break; } - ATW_CLR(sc, ATW_BBPCTL, ATW_BBPCTL_WR); - if (i < 0) { - printf("%s: BBPCTL busy (post-write)\n", sc->sc_dev.dv_xname); + printf("%s: BBPCTL still busy\n", sc->sc_dev.dv_xname); return ETIMEDOUT; } return 0; |