Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Print sc_flags with snprintb().



details:   https://anonhg.NetBSD.org/src/rev/39aa2f9d6557
branches:  trunk
changeset: 354701:39aa2f9d6557
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Jun 26 04:03:34 2017 +0000

description:
Print sc_flags with snprintb().

diffstat:

 sys/dev/pci/if_wm.c    |  23 +++++------------------
 sys/dev/pci/if_wmvar.h |  11 ++++++++++-
 2 files changed, 15 insertions(+), 19 deletions(-)

diffs (90 lines):

diff -r 4a8437bb4841 -r 39aa2f9d6557 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Mon Jun 26 03:16:28 2017 +0000
+++ b/sys/dev/pci/if_wm.c       Mon Jun 26 04:03:34 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.512 2017/06/23 06:10:31 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.513 2017/06/26 04:03:34 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.512 2017/06/23 06:10:31 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.513 2017/06/26 04:03:34 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1674,6 +1674,7 @@
        prop_data_t ea;
        prop_number_t pn;
        uint8_t enaddr[ETHER_ADDR_LEN];
+       char buf[256];
        uint16_t cfg1, cfg2, swdpin, nvmword;
        pcireg_t preg, memtype;
        uint16_t eeprom_data, apme_mask;
@@ -2377,10 +2378,6 @@
        /* Check for WM_F_WOL flag after the setting of the EEPROM stuff */
        if ((eeprom_data & apme_mask) != 0)
                sc->sc_flags |= WM_F_WOL;
-#ifdef WM_DEBUG
-       if ((sc->sc_flags & WM_F_WOL) != 0)
-               printf("WOL\n");
-#endif
 
        if ((sc->sc_type == WM_T_82575) || (sc->sc_type == WM_T_82576)) {
                /* Check NVM for autonegotiation */
@@ -2574,6 +2571,8 @@
                }
                wm_gmii_mediainit(sc, wmp->wmp_product);
        }
+       snprintb(buf, sizeof(buf), WM_FLAGS, sc->sc_flags);
+       aprint_verbose_dev(sc->sc_dev, "%s\n", buf);
 
        ifp = &sc->sc_ethercom.ec_if;
        xname = device_xname(sc->sc_dev);
@@ -13054,18 +13053,6 @@
        if (wm_enable_mng_pass_thru(sc) != 0)
                sc->sc_flags |= WM_F_HAS_MANAGE;
 
-#ifdef WM_DEBUG
-       printf("\n");
-       if ((sc->sc_flags & WM_F_HAS_AMT) != 0)
-               printf("HAS_AMT,");
-       if ((sc->sc_flags & WM_F_ARC_SUBSYS_VALID) != 0)
-               printf("ARC_SUBSYS_VALID,");
-       if ((sc->sc_flags & WM_F_ASF_FIRMWARE_PRES) != 0)
-               printf("ASF_FIRMWARE_PRES,");
-       if ((sc->sc_flags & WM_F_HAS_MANAGE) != 0)
-               printf("HAS_MANAGE,");
-       printf("\n");
-#endif
        /*
         * Note that the WOL flags is set after the resetting of the eeprom
         * stuff
diff -r 4a8437bb4841 -r 39aa2f9d6557 sys/dev/pci/if_wmvar.h
--- a/sys/dev/pci/if_wmvar.h    Mon Jun 26 03:16:28 2017 +0000
+++ b/sys/dev/pci/if_wmvar.h    Mon Jun 26 04:03:34 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wmvar.h,v 1.33 2017/02/01 08:56:41 msaitoh Exp $    */
+/*     $NetBSD: if_wmvar.h,v 1.34 2017/06/26 04:03:34 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -100,6 +100,15 @@
 #define        WM_F_PCS_DIS_AUTONEGO   0x02000000 /* PCS Disable Autonego */
 #define        WM_F_PLL_WA_I210        0x04000000 /* I21[01] PLL workaround */
 
+#define WM_FLAGS "\20" \
+       "\1" "HAS_MII"  "\2" "EECD"     "\3" "SWSM"     "\4" "SWFW"     \
+       "\5" "EXTCNF"   "\6" "EERDEEWR" "\7" "SPI"      "\10" "FLASH"   \
+       "\11" "FLASH_HW" "\12" "INVALID" "\13" "IOH_VALID" "\14" "BUS64" \
+       "\15" "PCIX"    "\16" "CSA"     "\17" "PCIE"    "\20" "SGMII"   \
+       "\21" "NEWQUEUE" "\22" "ASF_FIRM" "\23" "ARC_SUBSYS" "\24" "AMT" \
+       "\25" "MANAGE"  "\26" "WOL"     "\27" "EEE"     "\30" "ATTACHED" \
+       "\31" "INVM"    "\32" "PCS_DIS_AUTONEGO" "\33" "PLLWA"
+
 /*
  * Variations of Intel gigabit Ethernet controller:
  *



Home | Main Index | Thread Index | Old Index