Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/mii - Remove extra delay in brgphy_mii_phy_auto. Sam...



details:   https://anonhg.NetBSD.org/src/rev/1571a9b994bf
branches:  trunk
changeset: 330285:1571a9b994bf
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Jul 02 21:51:36 2014 +0000

description:
- Remove extra delay in brgphy_mii_phy_auto. Same as {Free,Open}BSD.
- s/u_int/uint/
- KNF.

diffstat:

 sys/dev/mii/brgphy.c |  36 +++++++++++-------------------------
 1 files changed, 11 insertions(+), 25 deletions(-)

diffs (114 lines):

diff -r dbae5850c0c8 -r 1571a9b994bf sys/dev/mii/brgphy.c
--- a/sys/dev/mii/brgphy.c      Wed Jul 02 21:22:05 2014 +0000
+++ b/sys/dev/mii/brgphy.c      Wed Jul 02 21:51:36 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: brgphy.c,v 1.72 2014/06/18 06:35:19 msaitoh Exp $      */
+/*     $NetBSD: brgphy.c,v 1.73 2014/07/02 21:51:36 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.72 2014/06/18 06:35:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.73 2014/07/02 21:51:36 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -371,9 +371,7 @@
 
        switch (cmd) {
        case MII_POLLSTAT:
-               /*
-                * If we're not polling our PHY instance, just return.
-                */
+               /* If we're not polling our PHY instance, just return. */
                if (IFM_INST(ife->ifm_media) != sc->mii_inst)
                        return (0);
                break;
@@ -389,9 +387,7 @@
                        return (0);
                }
 
-               /*
-                * If the interface is not up, don't do anything.
-                */
+               /* If the interface is not up, don't do anything. */
                if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
                        break;
 
@@ -448,21 +444,15 @@
                break;
 
        case MII_TICK:
-               /*
-                * If we're not currently selected, just return.
-                */
+               /* If we're not currently selected, just return. */
                if (IFM_INST(ife->ifm_media) != sc->mii_inst)
                        return (0);
 
-               /*
-                * Is the interface even up?
-                */
+               /* Is the interface even up? */
                if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
                        return 0;
 
-               /*
-                * Only used for autonegotiation.
-                */
+               /* Only used for autonegotiation. */
                if ((IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) &&
                    (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T)) {
                        sc->mii_ticks = 0;
@@ -487,9 +477,7 @@
                if (sc->mii_ticks++ == 0)
                        break;
 
-               /*
-                * Only retry autonegotiation every mii_anegticks seconds.
-                */
+               /* Only retry autonegotiation every mii_anegticks seconds. */
                KASSERT(sc->mii_anegticks != 0);
                if (sc->mii_ticks <= sc->mii_anegticks)
                        break;
@@ -824,10 +812,8 @@
                        ktcr |= GTCR_MAN_MS | GTCR_ADV_MS;
                PHY_WRITE(sc, MII_100T2CR, ktcr);
                ktcr = PHY_READ(sc, MII_100T2CR);
-               DELAY(1000);
        }
        PHY_WRITE(sc, MII_ANAR, anar);
-       DELAY(1000);
 
        /* Start autonegotiation */
        PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
@@ -839,7 +825,7 @@
 void
 brgphy_loop(struct mii_softc *sc)
 {
-       u_int32_t bmsr;
+       uint32_t bmsr;
        int i;
 
        PHY_WRITE(sc, MII_BMCR, BMCR_LOOP);
@@ -1248,7 +1234,7 @@
 static void
 brgphy_jumbo_settings(struct mii_softc *sc)
 {
-       u_int32_t val;
+       uint32_t val;
 
        /* Set Jumbo frame settings in the PHY. */
        if ((sc->mii_mpd_oui == MII_OUI_BROADCOM)
@@ -1270,7 +1256,7 @@
 static void
 brgphy_eth_wirespeed(struct mii_softc *sc)
 {
-       u_int32_t val;
+       uint32_t val;
 
        /* Enable Ethernet@Wirespeed */
        PHY_WRITE(sc, BRGPHY_MII_AUXCTL, 0x7007);



Home | Main Index | Thread Index | Old Index