Module Name: src
Committed By: msaitoh
Date: Sun Jun 9 09:56:17 UTC 2013
Modified Files:
src/sys/dev/mii: mii_physubr.c urlphy.c
Log Message:
Fix a bug in last commit that mii_ticks isn't inclemented.
To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.28 -r1.29 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/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.77 src/sys/dev/mii/mii_physubr.c:1.78
--- src/sys/dev/mii/mii_physubr.c:1.77 Sun Jun 9 09:31:32 2013
+++ src/sys/dev/mii/mii_physubr.c Sun Jun 9 09:56:17 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: mii_physubr.c,v 1.77 2013/06/09 09:31:32 msaitoh Exp $ */
+/* $NetBSD: mii_physubr.c,v 1.78 2013/06/09 09:56:17 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.77 2013/06/09 09:31:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.78 2013/06/09 09:56:17 msaitoh Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -350,16 +350,13 @@ mii_phy_tick(struct mii_softc *sc)
}
/*
- * mii_tick == 0 means it's the first tick after changing the media or
+ * 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)
+ if (sc->mii_ticks++ == 0)
return (0);
- /* Now increment the tick */
- sc->mii_ticks++;
-
/*
* Only retry autonegotiation every N seconds.
*/
Index: src/sys/dev/mii/urlphy.c
diff -u src/sys/dev/mii/urlphy.c:1.28 src/sys/dev/mii/urlphy.c:1.29
--- src/sys/dev/mii/urlphy.c:1.28 Sun Jun 9 09:31:32 2013
+++ src/sys/dev/mii/urlphy.c Sun Jun 9 09:56:17 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: urlphy.c,v 1.28 2013/06/09 09:31:32 msaitoh Exp $ */
+/* $NetBSD: urlphy.c,v 1.29 2013/06/09 09:56:17 msaitoh Exp $ */
/*
* Copyright (c) 2001, 2002
* Shingo WATANABE <[email protected]>. All rights reserved.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.28 2013/06/09 09:31:32 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.29 2013/06/09 09:56:17 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -197,16 +197,13 @@ urlphy_service(struct mii_softc *sc, str
}
/*
- * mii_tick == 0 means it's the first tick after changing the
+ * 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 break to update the status.
*/
- if (sc->mii_ticks == 0)
+ if (sc->mii_ticks++ == 0)
break;
- /* Now increment the tick */
- sc->mii_ticks++;
-
/*
* Only retry autonegotiation every N seconds.
*/