Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - On ICH8, call wm_gig_downshift_workaround_ich8...



details:   https://anonhg.NetBSD.org/src/rev/9da23d5011f6
branches:  trunk
changeset: 341315:9da23d5011f6
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Oct 30 19:22:01 2015 +0000

description:
- On ICH8, call wm_gig_downshift_workaround_ich8lan() when link changed down.
- Drop PHY_CTRL_GBE_DIS explicitly in wm_lplu_d0_disable() in case BIOS sets
  this bit.
- Fix two bugs in wm_kmrn_lock_loss_workaround_ich8lan(). Now the function
  checks the status correctly but it causes linkdown up to 10 times, so it's
  disabled for the time being.

diffstat:

 sys/dev/pci/if_wm.c |  20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diffs (75 lines):

diff -r 20ebf4ee2dfe -r 9da23d5011f6 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri Oct 30 19:11:57 2015 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Oct 30 19:22:01 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.380 2015/10/30 18:52:15 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.381 2015/10/30 19:22:01 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.380 2015/10/30 18:52:15 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.381 2015/10/30 19:22:01 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -7119,8 +7119,12 @@
                __func__));
 
        if (icr & ICR_LSC) {
-               DPRINTF(WM_DEBUG_LINK,
-                   ("%s: LINK: LSC -> mii_pollstat\n",
+               uint32_t status = CSR_READ(sc, WMREG_STATUS);
+
+               if ((sc->sc_type == WM_T_ICH8) && ((status & STATUS_LU) == 0))
+                       wm_gig_downshift_workaround_ich8lan(sc);
+
+               DPRINTF(WM_DEBUG_LINK, ("%s: LINK: LSC -> mii_pollstat\n",
                        device_xname(sc->sc_dev)));
                mii_pollstat(&sc->sc_mii);
                if (sc->sc_type == WM_T_82543) {
@@ -11421,7 +11425,7 @@
        uint32_t reg;
 
        reg = CSR_READ(sc, WMREG_PHY_CTRL);
-       reg &= ~PHY_CTRL_D0A_LPLU;
+       reg &= ~(PHY_CTRL_GBE_DIS | PHY_CTRL_D0A_LPLU);
        CSR_WRITE(sc, WMREG_PHY_CTRL, reg);
 }
 
@@ -11472,13 +11476,14 @@
 static void
 wm_kmrn_lock_loss_workaround_ich8lan(struct wm_softc *sc)
 {
+#if 0
        int miistatus, active, i;
        int reg;
 
        miistatus = sc->sc_mii.mii_media_status;
 
        /* If the link is not up, do nothing */
-       if ((miistatus & IFM_ACTIVE) != 0)
+       if ((miistatus & IFM_ACTIVE) == 0)
                return;
 
        active = sc->sc_mii.mii_media_active;
@@ -11491,7 +11496,7 @@
                /* read twice */
                reg = wm_gmii_i80003_readreg(sc->sc_dev, 1, IGP3_KMRN_DIAG);
                reg = wm_gmii_i80003_readreg(sc->sc_dev, 1, IGP3_KMRN_DIAG);
-               if ((reg & IGP3_KMRN_DIAG_PCS_LOCK_LOSS) != 0)
+               if ((reg & IGP3_KMRN_DIAG_PCS_LOCK_LOSS) == 0)
                        goto out;       /* GOOD! */
 
                /* Reset the PHY */
@@ -11512,6 +11517,7 @@
 
 out:
        return;
+#endif
 }
 
 /* WOL from S5 stops working */



Home | Main Index | Thread Index | Old Index