summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ixgb.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2008-06-03 12:27:24 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2008-06-03 12:27:24 +0000
commit6eeae112ec159e001a7818cdd1fd7284280fcd52 (patch)
tree1db41286101999d45d0f6d82668006ea358bf6a3 /sys/dev/pci/if_ixgb.c
parent6a28e5a2d59a39a4a042cbe2662868c45a7aace3 (diff)
put code to print periodic debug statistics in #ifdef IXGB_DEBUG, shrinks
the driver for about 990 bytes on i386. ok brad@
Diffstat (limited to 'sys/dev/pci/if_ixgb.c')
-rw-r--r--sys/dev/pci/if_ixgb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c
index e2c4a94780f..9bc53c2b806 100644
--- a/sys/dev/pci/if_ixgb.c
+++ b/sys/dev/pci/if_ixgb.c
@@ -31,14 +31,16 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_ixgb.c,v 1.40 2008/03/02 08:42:42 brad Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.41 2008/06/03 12:27:23 reyk Exp $ */
#include <dev/pci/if_ixgb.h>
+#ifdef IXGB_DEBUG
/*********************************************************************
* Set this to one to display debug statistics
*********************************************************************/
int ixgb_display_debug_stats = 0;
+#endif
/*********************************************************************
* Driver version
@@ -101,7 +103,9 @@ ixgb_transmit_checksum_setup(struct ixgb_softc *,
u_int8_t *);
void ixgb_set_promisc(struct ixgb_softc *);
void ixgb_set_multi(struct ixgb_softc *);
+#ifdef IXGB_DEBUG
void ixgb_print_hw_stats(struct ixgb_softc *);
+#endif
void ixgb_update_link_status(struct ixgb_softc *);
int
ixgb_get_buf(struct ixgb_softc *, int i,
@@ -823,8 +827,10 @@ ixgb_local_timer(void *arg)
ixgb_check_for_link(&sc->hw);
ixgb_update_link_status(sc);
ixgb_update_stats_counters(sc);
+#ifdef IXGB_DEBUG
if (ixgb_display_debug_stats && ifp->if_flags & IFF_RUNNING)
ixgb_print_hw_stats(sc);
+#endif
timeout_add(&sc->timer_handle, hz);
@@ -2035,6 +2041,7 @@ ixgb_update_stats_counters(struct ixgb_softc *sc)
sc->watchdog_events;
}
+#ifdef IXGB_DEBUG
/**********************************************************************
*
* This routine is called only when ixgb_display_debug_stats is enabled.
@@ -2109,3 +2116,4 @@ ixgb_print_hw_stats(struct ixgb_softc *sc)
printf("%s: Jumbo frames Xmtd = %lld\n", unit,
(long long)sc->stats.jptcl);
}
+#endif