Instead of having to fiddle with em_display_debug_stats,
why not have this configurable per interface with IFF_DEBUG?

OK?

Index: if_em.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_em.c,v
retrieving revision 1.249
diff -p -u -p -u -r1.249 if_em.c
--- if_em.c     13 Feb 2011 19:45:54 -0000      1.249
+++ if_em.c     8 Mar 2011 09:00:22 -0000
@@ -37,15 +37,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #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
  *********************************************************************/
@@ -1418,7 +1409,7 @@ em_local_timer(void *arg)
 #ifndef SMALL_KERNEL
        em_update_stats_counters(sc);
 #ifdef EM_DEBUG
-       if (em_display_debug_stats && ifp->if_flags & IFF_RUNNING)
+       if (ifp->if_flags & IFF_DEBUG && ifp->if_flags & IFF_RUNNING)
                em_print_hw_stats(sc);
 #endif
 #endif
@@ -3211,7 +3202,7 @@ em_update_stats_counters(struct em_softc
 #ifdef EM_DEBUG
 /**********************************************************************
  *
- *  This routine is called only when em_display_debug_stats is enabled.
+ *  This routine is called only when IFF_DEBUG is enabled.
  *  This routine provides a way to take a look at important statistics
  *  maintained by the driver and hardware.
  *

Reply via email to