Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/pci Pull up the following revisions, requested by...



details:   https://anonhg.NetBSD.org/src/rev/02b41a597590
branches:  netbsd-8
changeset: 852622:02b41a597590
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Nov 06 10:23:06 2019 +0000

description:
Pull up the following revisions, requested by msaitoh in ticket #1428:

        sys/dev/pci/if_wm.c                     1.647, 1.649 via patch

- Use device_printf() instead of printf().
- Fix typo in comment.

diffstat:

 sys/dev/pci/if_wm.c |  62 ++++++++++++++++++++++++++--------------------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diffs (220 lines):

diff -r f2f2a5ccaef6 -r 02b41a597590 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Nov 06 10:04:46 2019 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Nov 06 10:23:06 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin Exp $  */
+/*     $NetBSD: if_wm.c,v 1.508.4.36 2019/11/06 10:23:06 martin Exp $  */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.35 2019/08/04 10:59:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.36 2019/11/06 10:23:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -4549,8 +4549,8 @@
                return;
 
        /* TX */
-       printf("%s: Need TX flush (reg = %08x, len = %u)\n",
-           device_xname(sc->sc_dev), preg, reg);
+       device_printf(sc->sc_dev, "Need TX flush (reg = %08x, len = %u)\n",
+           preg, reg);
        reg = CSR_READ(sc, WMREG_TCTL);
        CSR_WRITE(sc, WMREG_TCTL, reg | TCTL_EN);
 
@@ -4577,8 +4577,7 @@
                return;
 
        /* RX */
-       printf("%s: Need RX flush (reg = %08x)\n",
-           device_xname(sc->sc_dev), preg);
+       device_printf(sc->sc_dev, "Need RX flush (reg = %08x)\n", preg);
        rctl = CSR_READ(sc, WMREG_RCTL);
        CSR_WRITE(sc, WMREG_RCTL, rctl & ~RCTL_EN);
        CSR_WRITE_FLUSH(sc);
@@ -4818,7 +4817,7 @@
                        reg |= CTRL_PHY_RESET;
                        phy_reset = 1;
                } else
-                       printf("XXX reset is blocked!!!\n");
+                       device_printf(sc->sc_dev, "XXX reset is blocked!!!\n");
                sc->phy.acquire(sc);
                CSR_WRITE(sc, WMREG_CTRL, reg);
                /* Don't insert a completion barrier when reset */
@@ -8962,7 +8961,8 @@
                                 * Fiber?
                                 * Shoud not enter here.
                                 */
-                               printf("unknown media (%x)\n", active);
+                               device_printf(sc->sc_dev,
+                                   "unknown media (%x)\n", active);
                                break;
                        }
                        if (active & IFM_FDX)
@@ -9705,7 +9705,7 @@
  * result might be incorrect.
  *
  *  In the second call, PHY OUI and model is used to identify PHY type.
- * It might not be perfpect because of the lack of compared entry, but it
+ * It might not be perfect because of the lack of compared entry, but it
  * would be better than the first call.
  *
  *  If the detected new result and previous assumption is different,
@@ -10916,7 +10916,7 @@
         * own func
         */
        if ((page > 0) && (page < HV_INTC_FC_PAGE_START)) {
-               printf("gmii_hv_readreg!!!\n");
+               device_printf(dev, "gmii_hv_readreg!!!\n");
                return 0;
        }
 
@@ -10984,7 +10984,7 @@
         * own func
         */
        if ((page > 0) && (page < HV_INTC_FC_PAGE_START)) {
-               printf("gmii_hv_writereg!!!\n");
+               device_printf(dev, "gmii_hv_writereg!!!\n");
                return -1;
        }
 
@@ -11008,7 +11008,7 @@
                        if ((child != NULL) && (child->mii_mpd_rev >= 1)
                            && (phy == 2) && ((regnum & MII_ADDRMASK) == 0)
                            && ((val & (1 << 11)) != 0)) {
-                               printf("XXX need workaround\n");
+                               device_printf(dev, "XXX need workaround\n");
                        }
                }
 
@@ -12550,12 +12550,12 @@
        /*
         * Either we should have a hardware SPI cycle in progress bit to check
         * against, in order to start a new cycle or FDONE bit should be
-        * changed in the hardware so that it is 1 after harware reset, which
+        * changed in the hardware so that it is 1 after hardware reset, which
         * can then be used as an indication whether a cycle is in progress or
         * has been completed .. we should also have some software semaphore
         * mechanism to guard FDONE or the cycle in progress bit so that two
         * threads access to those bits can be sequentiallized or a way so that
-        * 2 threads dont start the cycle at the same time
+        * 2 threads don't start the cycle at the same time
         */
 
        if ((hsfsts & HSFSTS_FLINPRO) == 0) {
@@ -13569,8 +13569,9 @@
                delay(5000);
                timeout--;
        }
-       printf("%s: failed to get swfw semaphore mask 0x%x swfw 0x%x\n",
-           device_xname(sc->sc_dev), mask, swfw_sync);
+       device_printf(sc->sc_dev,
+           "failed to get swfw semaphore mask 0x%x swfw 0x%x\n",
+           mask, swfw_sync);
        return 1;
 }
 
@@ -13716,8 +13717,8 @@
                        return 0;
                delay(5000);
        }
-       printf("%s: failed to get swfwhw semaphore ext_ctrl 0x%x\n",
-           device_xname(sc->sc_dev), ext_ctrl);
+       device_printf(sc->sc_dev,
+           "failed to get swfwhw semaphore ext_ctrl 0x%x\n", ext_ctrl);
        mutex_exit(sc->sc_ich_phymtx); /* Use PHY mtx for both PHY and NVM */
        return 1;
 }
@@ -13753,8 +13754,8 @@
                delay(1000);
        }
        if (timeout >= WM_PHY_CFG_TIMEOUT) {
-               printf("%s: SW has already locked the resource\n",
-                   device_xname(sc->sc_dev));
+               device_printf(sc->sc_dev,
+                   "SW has already locked the resource\n");
                goto out;
        }
 
@@ -13767,8 +13768,7 @@
                delay(1000);
        }
        if (timeout >= 1000) {
-               printf("%s: failed to acquire semaphore\n",
-                   device_xname(sc->sc_dev));
+               device_printf(sc->sc_dev, "failed to acquire semaphore\n");
                ext_ctrl &= ~EXTCNFCTR_MDIO_SW_OWNERSHIP;
                CSR_WRITE(sc, WMREG_EXTCNFCTR, ext_ctrl);
                goto out;
@@ -13792,8 +13792,7 @@
                ext_ctrl &= ~EXTCNFCTR_MDIO_SW_OWNERSHIP;
                CSR_WRITE(sc, WMREG_EXTCNFCTR, ext_ctrl);
        } else {
-               printf("%s: Semaphore unexpectedly released\n",
-                   device_xname(sc->sc_dev));
+               device_printf(sc->sc_dev, "Semaphore unexpectedly released\n");
        }
 
        mutex_exit(sc->sc_ich_phymtx);
@@ -14149,7 +14148,7 @@
                                break;
 
                if (wm_phy_resetisblocked(sc) == true) {
-                       printf("XXX reset is blocked(3)\n");
+                       device_printf(sc->sc_dev, "XXX reset is blocked(3)\n");
                        break;
                }
 
@@ -14182,7 +14181,7 @@
        if (rv == 0) {
                /* Check to see if able to reset PHY.  Print error if not */
                if (wm_phy_resetisblocked(sc)) {
-                       printf("XXX reset is blocked(4)\n");
+                       device_printf(sc->sc_dev, "XXX reset is blocked(4)\n");
                        goto out;
                }
 
@@ -14201,7 +14200,7 @@
                 *  the PHY is in.
                 */
                if (wm_phy_resetisblocked(sc))
-                       printf("XXX reset is blocked(4)\n");
+                       device_printf(sc->sc_dev, "XXX reset is blocked(4)\n");
        }
 
 out:
@@ -14337,7 +14336,8 @@
                /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */
                while ((CSR_READ(sc, WMREG_FWSM) & FWSM_ULP_CFG_DONE) != 0) {
                        if (i++ == 30) {
-                               printf("%s timed out\n", __func__);
+                               device_printf(sc->sc_dev, "%s timed out\n",
+                                   __func__);
                                return -1;
                        }
                        delay(10 * 1000);
@@ -15445,7 +15445,7 @@
                sc->phy.acquire(sc);
        }
        if (MII_INVALIDID(id1) || MII_INVALIDID(id2)) {
-               printf("XXX return with false\n");
+               device_printf(sc->sc_dev, "XXX return with false\n");
                return false;
        }
 out:
@@ -15569,8 +15569,8 @@
                        value = howmany(value, __BIT(5));
                }
                if (scale > LTRV_SCALE_MAX) {
-                       printf("%s: Invalid LTR latency scale %d\n",
-                           device_xname(sc->sc_dev), scale);
+                       device_printf(sc->sc_dev,
+                           "Invalid LTR latency scale %d\n", scale);
                        return -1;
                }
                lat_enc = (uint16_t)(__SHIFTIN(scale, LTRV_SCALE) | value);



Home | Main Index | Thread Index | Old Index