Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/mii Update link status quickly. This change is a par...



details:   https://anonhg.NetBSD.org/src/rev/19ae73e42bfe
branches:  trunk
changeset: 787326:19ae73e42bfe
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Jun 11 07:22:07 2013 +0000

description:
Update link status quickly. This change is a part of mii_physubr.c rev.
1.77-1.78.

diffstat:

 sys/dev/mii/ciphy.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r ad257388406c -r 19ae73e42bfe sys/dev/mii/ciphy.c
--- a/sys/dev/mii/ciphy.c       Mon Jun 10 20:33:31 2013 +0000
+++ b/sys/dev/mii/ciphy.c       Tue Jun 11 07:22:07 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.23 2013/06/09 09:31:32 msaitoh Exp $ */
+/* $NetBSD: ciphy.c,v 1.24 2013/06/11 07:22:08 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.23 2013/06/09 09:31:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.24 2013/06/11 07:22:08 msaitoh Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -284,9 +284,17 @@
                }
 
                /*
+                * mii_ticks == 0 means it's the first tick after changing the
+                * media or the link became down since the last tick
+                * (see above), so return with 0 to update the status.
+                */
+               if (sc->mii_ticks++ == 0)
+                       break;
+
+               /*
                 * Only retry autonegotiation every N seconds.
                 */
-               if (++sc->mii_ticks <= MII_ANEGTICKS_GIGE)
+               if (sc->mii_ticks <= MII_ANEGTICKS_GIGE)
                        break;
 
                mii_phy_auto(sc, 0);



Home | Main Index | Thread Index | Old Index