From 8ec91229890dc25f70b4188bff4cdceb65bb38cf Mon Sep 17 00:00:00 2001 From: tmm Date: Fri, 24 May 2002 12:47:41 +0000 Subject: Fully reset a gem on some error conditions; otherwise it would hang in about 1 of 10 cases. Proposed and tested by: phk --- sys/dev/gem/if_gem.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/dev/gem') diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index fe91327..ecff86f 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -1610,11 +1610,15 @@ gem_intr(v) int txstat = bus_space_read_4(t, seb, GEM_MAC_TX_STATUS); if (txstat & ~GEM_MAC_TX_XMIT_DONE) printf("MAC tx fault, status %x\n", txstat); + if (txstat & (GEM_MAC_TX_UNDERRUN | GEM_MAC_TX_PKT_TOO_LONG)) + gem_init(sc); } if (status & GEM_INTR_RX_MAC) { int rxstat = bus_space_read_4(t, seb, GEM_MAC_RX_STATUS); if (rxstat & ~(GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT)) printf("MAC rx fault, status %x\n", rxstat); + if ((rxstat & GEM_MAC_RX_OVERFLOW) != 0) + gem_init(sc); } } -- cgit v1.1