Module Name: src Committed By: martin Date: Wed Nov 6 10:23:07 UTC 2019
Modified Files: src/sys/dev/pci [netbsd-8]: if_wm.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.508.4.35 -r1.508.4.36 src/sys/dev/pci/if_wm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/if_wm.c diff -u src/sys/dev/pci/if_wm.c:1.508.4.35 src/sys/dev/pci/if_wm.c:1.508.4.36 --- src/sys/dev/pci/if_wm.c:1.508.4.35 Sun Aug 4 10:59:19 2019 +++ src/sys/dev/pci/if_wm.c Wed Nov 6 10:23:06 2019 @@ -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 @@ wm_flush_desc_rings(struct wm_softc *sc) 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 @@ wm_flush_desc_rings(struct wm_softc *sc) 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 @@ wm_reset(struct wm_softc *sc) 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 @@ wm_linkintr_gmii(struct wm_softc *sc, ui * 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 @@ wm_gmii_reset(struct wm_softc *sc) * 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 @@ wm_gmii_hv_readreg_locked(device_t dev, * 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 @@ wm_gmii_hv_writereg_locked(device_t dev, * 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 @@ wm_gmii_hv_writereg_locked(device_t dev, 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 @@ wm_ich8_cycle_init(struct wm_softc *sc) /* * 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 @@ wm_get_swfw_semaphore(struct wm_softc *s 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 @@ wm_get_swfwhw_semaphore(struct wm_softc 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 @@ wm_get_swflag_ich8lan(struct wm_softc *s 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 @@ wm_get_swflag_ich8lan(struct wm_softc *s 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 @@ wm_put_swflag_ich8lan(struct wm_softc *s 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 @@ wm_init_phy_workarounds_pchlan(struct wm 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 @@ wm_init_phy_workarounds_pchlan(struct wm 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 @@ wm_init_phy_workarounds_pchlan(struct wm * 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 @@ wm_ulp_disable(struct wm_softc *sc) /* 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 @@ wm_phy_is_accessible_pchlan(struct wm_so 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 @@ wm_platform_pm_pch_lpt(struct wm_softc * 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);