summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-08-09 03:11:48 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-08-09 03:11:48 +0000
commit46343d001b2e7fc89af378d83acc2c52b4747b27 (patch)
treec493593bbccc843251da2ff936b3834c256242ec /sys
parente1348a373fd1d9ef020a2cf014cd570121cef0b8 (diff)
need to include bpfilter.h for bpf to work (noticed by weissmanndude). put some non-fatal printfs into ifdef debug
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/i82596.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/sys/dev/ic/i82596.c b/sys/dev/ic/i82596.c
index 6f897ca0854..189cc71a92a 100644
--- a/sys/dev/ic/i82596.c
+++ b/sys/dev/ic/i82596.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i82596.c,v 1.20 2003/01/27 20:03:35 jason Exp $ */
+/* $OpenBSD: i82596.c,v 1.21 2003/08/09 03:11:47 mickey Exp $ */
/* $NetBSD: i82586.c,v 1.18 1998/08/15 04:42:42 mycroft Exp $ */
/*-
@@ -141,6 +141,8 @@ Mode of operation:
the synchronization.
*/
+#include "bpfilter.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mbuf.h>
@@ -380,9 +382,13 @@ i82596_cmd_wait(sc)
}
}
- printf("i82596_cmd_wait: timo(%ssync): scb status: %b\n",
- sc->async_cmd_inprogress?"a":"",
- sc->ie_bus_read16(sc, IE_SCB_STATUS(sc->scb)), IE_STAT_BITS);
+#ifdef I82596_DEBUG
+ if (sc->sc_debug & IED_CMDS)
+ printf("i82596_cmd_wait: timo(%ssync): scb status: %b\n",
+ sc->async_cmd_inprogress? "a" : "",
+ sc->ie_bus_read16(sc, IE_SCB_STATUS(sc->scb)),
+ IE_STAT_BITS);
+#endif
return (1); /* Timeout */
}
@@ -569,7 +575,6 @@ reset:
i82596_cmd_wait(sc);
i82596_reset(sc, 1);
goto out;
-
}
/*
@@ -1121,10 +1126,8 @@ i82596_readframe(sc, num)
#if NBPFILTER > 0
/* Check for a BPF filter; if so, hand it up. */
- if (ifp->if_bpf) {
- /* Pass it up. */
+ if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m);
- }
#endif /* NBPFILTER > 0 */
/*
@@ -1204,9 +1207,14 @@ i82596_xmit(sc)
bus_space_barrier(sc->bt, sc->bh, off, 2,
BUS_SPACE_BARRIER_WRITE);
- if (i82596_start_cmd(sc, IE_CUC_START, 0, 0, 1))
- printf("%s: i82596_xmit: start xmit command timed out\n",
- sc->sc_dev.dv_xname);
+ if (i82596_start_cmd(sc, IE_CUC_START, 0, 0, 1)) {
+#ifdef I82596_DEBUG
+ if (sc->sc_debug & IED_XMIT)
+ printf("%s: i82596_xmit: "
+ "start xmit command timed out\n",
+ sc->sc_dev.dv_xname);
+#endif
+ }
}
sc->sc_arpcom.ac_if.if_timer = 5;
@@ -1362,8 +1370,10 @@ i82596_reset(sc, hard)
{
int s = splnet();
+#ifdef I82596_DEBUG
if (hard)
printf("%s: reset\n", sc->sc_dev.dv_xname);
+#endif
/* Clear OACTIVE in case we're called from watchdog (frozen xmit). */
sc->sc_arpcom.ac_if.if_timer = 0;
@@ -1372,8 +1382,11 @@ i82596_reset(sc, hard)
/*
* Stop i82596 dead in its tracks.
*/
- if (i82596_start_cmd(sc, IE_RUC_ABORT | IE_CUC_ABORT, 0, 0, 0))
+ if (i82596_start_cmd(sc, IE_RUC_ABORT | IE_CUC_ABORT, 0, 0, 0)) {
+#ifdef I82596_DEBUG
printf("%s: abort commands timed out\n", sc->sc_dev.dv_xname);
+#endif
+ }
/*
* This can really slow down the i82596_reset() on some cards, but it's