Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/mii In brgphyattach(), set sc_isbge, sc_isbnx and sc...



details:   https://anonhg.NetBSD.org/src/rev/5883d4d47560
branches:  trunk
changeset: 785833:5883d4d47560
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Apr 01 13:41:37 2013 +0000

description:
In brgphyattach(), set sc_isbge, sc_isbnx and sc_phyflags before PHY_RESET()
because brgphy_reset() refers those flags.

diffstat:

 sys/dev/mii/brgphy.c |  19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diffs (47 lines):

diff -r 0045ad4a78eb -r 5883d4d47560 sys/dev/mii/brgphy.c
--- a/sys/dev/mii/brgphy.c      Mon Apr 01 13:28:21 2013 +0000
+++ b/sys/dev/mii/brgphy.c      Mon Apr 01 13:41:37 2013 +0000
@@ -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 @@
        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 @@
                        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)



Home | Main Index | Thread Index | Old Index