summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-02-13 19:45:55 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-02-13 19:45:55 +0000
commit1fa9c9919b3cb5c00bf6ea2012e95aabe9a19b2c (patch)
treed7adb7572d7b1e34a4339678530a651a48e56fda
parent3616ff7a7ad8de5b2ff4ee79a91c06ef1f117043 (diff)
Do not compile statistics counters code if defined(SMALL_KERNEL). Makes i386
RAMDISKA breathe a bit better.
-rw-r--r--sys/dev/pci/if_em.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c
index 1caaf589c08..e2b210494da 100644
--- a/sys/dev/pci/if_em.c
+++ b/sys/dev/pci/if_em.c
@@ -31,18 +31,20 @@ POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.248 2010/09/19 13:10:21 yasuoka Exp $ */
+/* $OpenBSD: if_em.c,v 1.249 2011/02/13 19:45:54 miod Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
#include <dev/pci/if_em_soc.h>
+#ifndef SMALL_KERNEL
#ifdef EM_DEBUG
/*********************************************************************
* Set this to one to display debug statistics
*********************************************************************/
int em_display_debug_stats = 0;
#endif
+#endif
/*********************************************************************
* Driver version
@@ -481,7 +483,9 @@ em_attach(struct device *parent, struct device *self, void *aux)
/* Initialize statistics */
em_clear_hw_cntrs(&sc->hw);
+#ifndef SMALL_KERNEL
em_update_stats_counters(sc);
+#endif
sc->hw.get_link_status = 1;
if (!defer)
em_update_link_status(sc);
@@ -1411,11 +1415,13 @@ em_local_timer(void *arg)
em_check_for_link(&sc->hw);
em_update_link_status(sc);
+#ifndef SMALL_KERNEL
em_update_stats_counters(sc);
#ifdef EM_DEBUG
if (em_display_debug_stats && ifp->if_flags & IFF_RUNNING)
em_print_hw_stats(sc);
#endif
+#endif
em_smartspeed(sc);
timeout_add_sec(&sc->timer_handle, 1);
@@ -2824,8 +2830,10 @@ em_rxeof(struct em_softc *sc, int count)
last_byte = *(mtod(m, caddr_t) + desc_len - 1);
if (TBI_ACCEPT(&sc->hw, status, desc->errors,
pkt_len, last_byte)) {
+#ifndef SMALL_KERNEL
em_tbi_adjust_stats(&sc->hw, &sc->stats,
pkt_len, sc->hw.mac_addr);
+#endif
if (len > 0)
len--;
} else
@@ -3094,6 +3102,7 @@ em_fill_descriptors(u_int64_t address, u_int32_t length,
return desc_array->elements;
}
+#ifndef SMALL_KERNEL
/**********************************************************************
*
* Update the board statistics counters.
@@ -3258,3 +3267,4 @@ em_print_hw_stats(struct em_softc *sc)
(long long)sc->stats.gptc);
}
#endif
+#endif /* !SMALL_KERNEL */