Author: yongari
Date: Mon Jan 12 02:07:57 2009
New Revision: 187072
URL: http://svn.freebsd.org/changeset/base/187072

Log:
  MFC r183488-r183491:
  
  r183488:
    Announce link loss right after it happens.
  
  r183489:
    Use mii_anegticks instead of hardcoded MII_ANEGTICKS.
  
  r183490:
    Report current link state while auto-negotiation is in progress.
  
  r183491:
    Explicitly mark IFM_HDX for half-duplex media.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/mii/ciphy.c

Modified: stable/7/sys/dev/mii/ciphy.c
==============================================================================
--- stable/7/sys/dev/mii/ciphy.c        Mon Jan 12 01:36:01 2009        
(r187071)
+++ stable/7/sys/dev/mii/ciphy.c        Mon Jan 12 02:07:57 2009        
(r187072)
@@ -262,15 +262,18 @@ setit:
                if (reg & BMSR_LINK)
                        break;
 
+               /* Announce link loss right after it happens. */
+               if (++sc->mii_ticks == 0)
+                       break;
                /*
-                * Only retry autonegotiation every 5 seconds.
+                * Only retry autonegotiation every mii_anegticks seconds.
                 */
-               if (++sc->mii_ticks <= MII_ANEGTICKS)
+               if (sc->mii_ticks <= sc->mii_anegticks)
                        break;
 
                sc->mii_ticks = 0;
                mii_phy_auto(sc);
-               return (0);
+               break;
        }
 
        /* Update the media status. */
@@ -335,6 +338,8 @@ ciphy_status(struct mii_softc *sc)
 
        if (bmsr & CIPHY_AUXCSR_FDX)
                mii->mii_media_active |= IFM_FDX;
+       else
+               mii->mii_media_active |= IFM_HDX;
 }
 
 static void
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to