summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-04-25 04:16:45 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-04-25 04:16:45 +0000
commitce8a7f0059fec0ea53cd8c465214c0d6fa416e17 (patch)
tree908beeb6f18532441a3741e42d36a339c23de2eb
parent8fa913136a0e2946ae91af6a524c5189a4a1c0e2 (diff)
add some debug goo to be used soon
-rw-r--r--sys/dev/pci/if_tht.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c
index df8a5447741..4a7678d876d 100644
--- a/sys/dev/pci/if_tht.c
+++ b/sys/dev/pci/if_tht.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tht.c,v 1.58 2007/04/24 08:08:49 dlg Exp $ */
+/* $OpenBSD: if_tht.c,v 1.59 2007/04/25 04:16:44 dlg Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -58,6 +58,21 @@
#include <netinet/if_ether.h>
#endif
+#define THT_DEBUG
+
+#ifdef THT_DEBUG
+#define THT_D_FIFO (1<<0)
+#define THT_D_TX (1<<1)
+#define THT_D_RX (1<<2)
+#define THT_D_INTR (1<<3)
+
+int thtdebug = THT_D_FIFO | THT_D_TX | THT_D_RX | THT_D_INTR;
+
+#define DPRINTF(l, f...) do { if (thtdebug & (l)) printf(f); } while (0)
+#else
+#define DPRINTF(l, f...)
+#endif
+
/* registers */
#define THT_PCI_BAR 0x10