summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-26 13:04:00 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-26 13:04:00 +0000
commit37d781de0c90c8782cf14fe6877cdd9a4c6b074e (patch)
tree3243fa393d85afd2456d22871425ca09eb53f967 /sys/arch
parent19a98e59f2c5b32886e36fe47cd4c93bf4283e58 (diff)
Fix a problem where the driver could get stuck in the rx int loop.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sgi/dev/if_mec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/sgi/dev/if_mec.c b/sys/arch/sgi/dev/if_mec.c
index 50ad9322d7d..a90135d84ac 100644
--- a/sys/arch/sgi/dev/if_mec.c
+++ b/sys/arch/sgi/dev/if_mec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mec.c,v 1.3 2004/08/10 19:16:17 deraadt Exp $ */
+/* $OpenBSD: if_mec.c,v 1.4 2004/08/26 13:03:59 pefo Exp $ */
/* $NetBSD: if_mec_mace.c,v 1.5 2004/08/01 06:36:36 tsutsui Exp $ */
/*
@@ -1276,6 +1276,9 @@ mec_rxintr(struct mec_softc *sc, uint32_t stat)
bus_space_write_8(st, sh, MEC_RX_ALIAS, 0);
last = (stat & MEC_INT_RX_MCL_FIFO_ALIAS) >> 8;
+ /* XXX does alias count mod 32 even if 16 descs are set up? */
+ last &= MEC_NRXDESC_MASK;
+
if (stat & MEC_INT_RX_FIFO_UNDERFLOW)
last = (last - 1) & MEC_NRXDESC_MASK;
@@ -1294,8 +1297,8 @@ mec_rxintr(struct mec_softc *sc, uint32_t stat)
(u_int)bus_space_read_8(st, sh, MEC_RX_FIFO)));
if ((rxstat & MEC_RXSTAT_RECEIVED) == 0) {
- MEC_RXSTATSYNC(sc, i, BUS_DMASYNC_PREREAD);
- break;
+ /* Status not received but fifo counted? Drop it! */
+ goto dropit;
}
len = rxstat & MEC_RXSTAT_LEN;