Module Name: src
Committed By: msaitoh
Date: Mon Apr 1 13:41:38 UTC 2013
Modified Files:
src/sys/dev/mii: brgphy.c
Log Message:
In brgphyattach(), set sc_isbge, sc_isbnx and sc_phyflags before PHY_RESET()
because brgphy_reset() refers those flags.
To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/mii/brgphy.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/brgphy.c
diff -u src/sys/dev/mii/brgphy.c:1.62 src/sys/dev/mii/brgphy.c:1.63
--- src/sys/dev/mii/brgphy.c:1.62 Tue Mar 19 04:10:12 2013
+++ src/sys/dev/mii/brgphy.c Mon Apr 1 13:41:37 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: brgphy.c,v 1.62 2013/03/19 04:10:12 msaitoh Exp $ */
+/* $NetBSD: brgphy.c,v 1.63 2013/04/01 13:41:37 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.62 2013/03/19 04:10:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.63 2013/04/01 13:41:37 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -266,14 +266,6 @@ brgphyattach(device_t parent, device_t s
sc->mii_anegticks = MII_ANEGTICKS;
sc->mii_funcs = &brgphy_funcs;
- PHY_RESET(sc);
-
- sc->mii_capabilities =
- PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
- if (sc->mii_capabilities & BMSR_EXTSTAT)
- sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR);
-
-
if (device_is_a(parent, "bge"))
bsc->sc_isbge = true;
else if (device_is_a(parent, "bnx"))
@@ -289,6 +281,13 @@ brgphyattach(device_t parent, device_t s
aprint_error_dev(self, "failed to get chipid\n");
}
+ PHY_RESET(sc);
+
+ sc->mii_capabilities =
+ PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
+ if (sc->mii_capabilities & BMSR_EXTSTAT)
+ sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR);
+
aprint_normal_dev(self, "");
if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 &&
(sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0)