diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2013-04-01 13:41:37 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2013-04-01 13:41:37 +0000 |
| commit | e43d748a7dd957831102a4bb0655fcbb2ca7b049 (patch) | |
| tree | e16ff07b5eeaf0075bf00fc27b6eab915b6b1ddc /sys/dev | |
| parent | 3a5f88916f1fb8a01202e57a83615efb720e3d0f (diff) | |
In brgphyattach(), set sc_isbge, sc_isbnx and sc_phyflags before PHY_RESET()
because brgphy_reset() refers those flags.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/mii/brgphy.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 5bb91046ef5..85286eb131d 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -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 self, void *aux) 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 self, void *aux) 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) |
