Module Name:    src
Committed By:   msaitoh
Date:           Sun Jun  9 09:15:51 UTC 2013

Modified Files:
        src/sys/dev/mii: exphy.c ihphy.c tlphy.c ukphy.c urlphy.c

Log Message:
 Don't "return" but "break" in MII_TICK when the interface isn't doing
autonegotiaton or the link is up to update the status.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/exphy.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/ihphy.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/mii/tlphy.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/mii/ukphy.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/urlphy.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/exphy.c
diff -u src/sys/dev/mii/exphy.c:1.52 src/sys/dev/mii/exphy.c:1.53
--- src/sys/dev/mii/exphy.c:1.52	Mon Oct 19 18:41:13 2009
+++ src/sys/dev/mii/exphy.c	Sun Jun  9 09:15:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: exphy.c,v 1.52 2009/10/19 18:41:13 bouyer Exp $	*/
+/*	$NetBSD: exphy.c,v 1.53 2013/06/09 09:15:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exphy.c,v 1.52 2009/10/19 18:41:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exphy.c,v 1.53 2013/06/09 09:15:51 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -180,7 +180,7 @@ exphy_service(struct mii_softc *sc, stru
 		 * Only used for autonegotiation.
 		 */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
-			return (0);
+			break;
 
 		if (mii_phy_tick(sc) == EJUSTRETURN)
 			return (0);

Index: src/sys/dev/mii/ihphy.c
diff -u src/sys/dev/mii/ihphy.c:1.3 src/sys/dev/mii/ihphy.c:1.4
--- src/sys/dev/mii/ihphy.c:1.3	Sun Jun  9 08:42:16 2013
+++ src/sys/dev/mii/ihphy.c	Sun Jun  9 09:15:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ihphy.c,v 1.3 2013/06/09 08:42:16 msaitoh Exp $	*/
+/*	$NetBSD: ihphy.c,v 1.4 2013/06/09 09:15:51 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.3 2013/06/09 08:42:16 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.4 2013/06/09 09:15:51 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -219,7 +219,7 @@ ihphy_service(struct mii_softc *sc, stru
 		 */
 		if ((IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) &&
 		    (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T))
-			return 0;
+			break;
 
 		if (mii_phy_tick(sc) == EJUSTRETURN)
 			return 0;

Index: src/sys/dev/mii/tlphy.c
diff -u src/sys/dev/mii/tlphy.c:1.59 src/sys/dev/mii/tlphy.c:1.60
--- src/sys/dev/mii/tlphy.c:1.59	Mon Oct 19 18:41:14 2009
+++ src/sys/dev/mii/tlphy.c	Sun Jun  9 09:15:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tlphy.c,v 1.59 2009/10/19 18:41:14 bouyer Exp $	*/
+/*	$NetBSD: tlphy.c,v 1.60 2013/06/09 09:15:51 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.59 2009/10/19 18:41:14 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.60 2013/06/09 09:15:51 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -261,16 +261,16 @@ tlphy_service(struct mii_softc *sc, stru
 			return (0);
 
 		/*
-		 * Only used for autonegotiation.
+		 * Is the interface even up?
 		 */
-		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
+		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			return (0);
 
 		/*
-		 * Is the interface even up?
+		 * Only used for autonegotiation.
 		 */
-		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
-			return (0);
+		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
+			break;
 
 		/*
 		 * XXX WHAT ABOUT CHECKING LINK ON THE BNC/AUI?!

Index: src/sys/dev/mii/ukphy.c
diff -u src/sys/dev/mii/ukphy.c:1.43 src/sys/dev/mii/ukphy.c:1.44
--- src/sys/dev/mii/ukphy.c:1.43	Sun Jun  6 18:58:22 2010
+++ src/sys/dev/mii/ukphy.c	Sun Jun  9 09:15:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ukphy.c,v 1.43 2010/06/06 18:58:22 pgoyette Exp $	*/
+/*	$NetBSD: ukphy.c,v 1.44 2013/06/09 09:15:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ukphy.c,v 1.43 2010/06/06 18:58:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukphy.c,v 1.44 2013/06/09 09:15:51 msaitoh Exp $");
 
 #include "opt_mii.h"
 
@@ -192,7 +192,7 @@ ukphy_service(struct mii_softc *sc, stru
 		 * Only used for autonegotiation.
 		 */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
-			return (0);
+		  	break;
 
 		if (mii_phy_tick(sc) == EJUSTRETURN)
 			return (0);

Index: src/sys/dev/mii/urlphy.c
diff -u src/sys/dev/mii/urlphy.c:1.26 src/sys/dev/mii/urlphy.c:1.27
--- src/sys/dev/mii/urlphy.c:1.26	Thu Jun  6 03:10:48 2013
+++ src/sys/dev/mii/urlphy.c	Sun Jun  9 09:15:51 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: urlphy.c,v 1.26 2013/06/06 03:10:48 msaitoh Exp $	*/
+/*	$NetBSD: urlphy.c,v 1.27 2013/06/09 09:15:51 msaitoh Exp $	*/
 /*
  * Copyright (c) 2001, 2002
  *     Shingo WATANABE <n...@nabechan.org>.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.26 2013/06/06 03:10:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.27 2013/06/09 09:15:51 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -182,12 +182,12 @@ urlphy_service(struct mii_softc *sc, str
 		 * changes.
 		 */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
-			return (0);
+			break;
 
 		/* Read the status register twice; MSR_LINK is latch-low. */
 		reg = PHY_READ(sc, URLPHY_MSR) | PHY_READ(sc, URLPHY_MSR);
 		if (reg & URLPHY_MSR_LINK)
-			return (0);
+			break;
 
 		/*
 		 * Only retry autonegotiation every N seconds.

Reply via email to