Module Name: src Committed By: msaitoh Date: Tue Jun 11 07:22:08 UTC 2013
Modified Files: src/sys/dev/mii: ciphy.c ihphy.c tlphy.c Log Message: Update link status quickly. This change is a part of mii_physubr.c rev. 1.77-1.78. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.60 -r1.61 src/sys/dev/mii/tlphy.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/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.23 src/sys/dev/mii/ciphy.c:1.24 --- src/sys/dev/mii/ciphy.c:1.23 Sun Jun 9 09:31:32 2013 +++ src/sys/dev/mii/ciphy.c Tue Jun 11 07:22:08 2013 @@ -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 @@ setit: } /* + * 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); Index: src/sys/dev/mii/ihphy.c diff -u src/sys/dev/mii/ihphy.c:1.5 src/sys/dev/mii/ihphy.c:1.6 --- src/sys/dev/mii/ihphy.c:1.5 Sun Jun 9 09:31:32 2013 +++ src/sys/dev/mii/ihphy.c Tue Jun 11 07:22:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: ihphy.c,v 1.5 2013/06/09 09:31:32 msaitoh Exp $ */ +/* $NetBSD: ihphy.c,v 1.6 2013/06/11 07:22:08 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.5 2013/06/09 09:31:32 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.6 2013/06/11 07:22:08 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -214,19 +214,6 @@ ihphy_service(struct mii_softc *sc, stru if (IFM_INST(ife->ifm_media) != sc->mii_inst) return 0; - /* - * Only used for autonegotiation. - */ - if ((IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) && - (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T)) { - /* - * Reset autonegotiation timer to 0 just to make sure - * the future autonegotiation start with 0. - */ - sc->mii_ticks = 0; - break; - } - if (mii_phy_tick(sc) == EJUSTRETURN) return 0; break; Index: src/sys/dev/mii/tlphy.c diff -u src/sys/dev/mii/tlphy.c:1.60 src/sys/dev/mii/tlphy.c:1.61 --- src/sys/dev/mii/tlphy.c:1.60 Sun Jun 9 09:15:51 2013 +++ src/sys/dev/mii/tlphy.c Tue Jun 11 07:22:08 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: tlphy.c,v 1.60 2013/06/09 09:15:51 msaitoh Exp $ */ +/* $NetBSD: tlphy.c,v 1.61 2013/06/11 07:22:08 msaitoh Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.60 2013/06/09 09:15:51 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.61 2013/06/11 07:22:08 msaitoh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -261,18 +261,6 @@ tlphy_service(struct mii_softc *sc, stru return (0); /* - * Is the interface even up? - */ - if ((mii->mii_ifp->if_flags & IFF_UP) == 0) - return (0); - - /* - * Only used for autonegotiation. - */ - if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) - break; - - /* * XXX WHAT ABOUT CHECKING LINK ON THE BNC/AUI?! */