diff options
author | 2011-02-13 19:45:54 +0000 | |
---|---|---|
committer | 2011-02-13 19:45:54 +0000 | |
commit | e2dfd46b4a1d2ba671a544d02ad23bc76bdebd41 (patch) | |
tree | 84c0b2de06b5b6b0f2daf73e515ebe6e56b12f63 /sys/dev/pci/if_em.c | |
parent | fix from pr 6314: allow debug logging before daemonization to help (diff) | |
download | wireguard-openbsd-e2dfd46b4a1d2ba671a544d02ad23bc76bdebd41.tar.xz wireguard-openbsd-e2dfd46b4a1d2ba671a544d02ad23bc76bdebd41.zip |
Do not compile statistics counters code if defined(SMALL_KERNEL). Makes i386
RAMDISKA breathe a bit better.
Diffstat (limited to 'sys/dev/pci/if_em.c')
-rw-r--r-- | sys/dev/pci/if_em.c | 12 |
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 */ |