NetBSD-Bugs archive

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

Re: kern/20700



The following reply was made to PR kern/20700; it has been noted by GNATS.

From: buhrow%lothlorien.nfbcal.org@localhost (Brian Buhrow)
To: gnats%netbsd.org@localhost
Cc: buhrow%lothlorien.nfbcal.org@localhost, darcy%druidvex.net@localhost
Subject: Re: kern/20700
Date: Tue, 29 Nov 2011 18:01:01 -0800

        Hello.  I realize this bug is incredibly old, but I've recently
 written a patch which addresses this very issue.  The patch essentially
 turns on Nway negotiation on a NIC when its mode is set either to auto or
 to 1000baset with any mediaopt options.  This has the nice side effect of
 also allowing a NIC to regain link if a connection is lost after theinitial
 ifconfig is run at boot time or reconfig time.
        If you could try the following patch and see if it makes things work
 better for you, I'll commit and request a pullup for 5.x.  I've tested this
 patch against 4.x and 5.x, and am working on testing against current, but I
 think it will work against 3.x, 2.x, and pretty much anything since we got
 the mii code.
 
        Please let me know what you find.
 
 -thanks
 -Brian
 
 
 --- mii_physubr.c.40   2007-11-15 20:14:47.000000000 -0800
 +++ mii_physubr.c      2011-11-28 13:34:52.000000000 -0800
 @@ -170,9 +170,13 @@
                bmcr |= BMCR_LOOP;
  
        PHY_WRITE(sc, MII_ANAR, anar);
 -      PHY_WRITE(sc, MII_BMCR, bmcr);
        if (sc->mii_flags & MIIF_HAVE_GTCR)
                PHY_WRITE(sc, MII_100T2CR, gtcr);
 +      if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) {
 +              mii_phy_auto(sc, 0);
 +      } else {
 +              PHY_WRITE(sc, MII_BMCR, bmcr);
 +      }
  }
  
  int
 @@ -294,7 +298,8 @@
         * status so we can generate an announcement if the status
         * changes.
         */
 -      if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
 +      if ((IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) &&
 +      (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T))
                return (0);
  
        /* Read the status register twice; BMSR_LINK is latch-low. */
 


Home | Main Index | Thread Index | Old Index