summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/mlphy.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2006-12-02 19:36:25 +0000
committermarius <marius@FreeBSD.org>2006-12-02 19:36:25 +0000
commite88fd11fa63919f0d0ba952544f8abe033024e9e (patch)
tree0a8173ea0887896b2cd6a3f0ad42c1684b04c2b4 /sys/dev/mii/mlphy.c
parentc4618bacd39ad5ce8f2fb96309c79e7c9983bdb6 (diff)
downloadFreeBSD-src-e88fd11fa63919f0d0ba952544f8abe033024e9e.zip
FreeBSD-src-e88fd11fa63919f0d0ba952544f8abe033024e9e.tar.gz
Some style changes to a couple of PHY drivers:
- Fix some whitespace nits. - Fix some spelling in comments. - Use MII_ANEGTICKS instead of 5. - Don't define variables in nested scope. - Remove superfluous returns at the end of void functions. - Remove unused static global rgephy_mii_model. - Remove dupe $Id$ in tdkphy(4). - Sort brgphys table. MFC after: 2 weeks
Diffstat (limited to 'sys/dev/mii/mlphy.c')
-rw-r--r--sys/dev/mii/mlphy.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/dev/mii/mlphy.c b/sys/dev/mii/mlphy.c
index 05269f6..d0a549c 100644
--- a/sys/dev/mii/mlphy.c
+++ b/sys/dev/mii/mlphy.c
@@ -174,7 +174,7 @@ mlphy_attach(dev)
printf("\n");
#undef ADD
MIIBUS_MEDIAINIT(sc->mii_dev);
- return(0);
+ return (0);
}
static int
@@ -184,12 +184,11 @@ mlphy_service(xsc, mii, cmd)
int cmd;
{
struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
- int reg;
struct mii_softc *other = NULL;
struct mlphy_softc *msc = (struct mlphy_softc *)xsc;
struct mii_softc *sc = (struct mii_softc *)&msc->ml_mii;
device_t *devlist;
- int devs, i;
+ int devs, i, other_inst, reg;
/*
* See if there's another PHY on this bus with us.
@@ -244,7 +243,7 @@ mlphy_service(xsc, mii, cmd)
}
(void) mii_phy_auto(sc);
msc->ml_linked = 0;
- return(0);
+ return (0);
case IFM_10_T:
/*
* For 10baseT modes, reset and program the
@@ -337,9 +336,9 @@ mlphy_service(xsc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
- if (++sc->mii_ticks <= 5)
+ if (++sc->mii_ticks <= MII_ANEGTICKS)
break;
-
+
sc->mii_ticks = 0;
msc->ml_linked = 0;
mii->mii_media_active = IFM_NONE;
@@ -350,13 +349,12 @@ mlphy_service(xsc, mii, cmd)
PHY_WRITE(other, MII_BMCR, BMCR_ISO);
}
mii_phy_auto(sc);
- return(0);
+ return (0);
}
/* Update the media status. */
if (msc->ml_state == ML_STATE_AUTO_OTHER) {
- int other_inst;
other_inst = other->mii_inst;
other->mii_inst = sc->mii_inst;
(void) (*other->mii_service)(other, mii, MII_POLLSTAT);
@@ -385,8 +383,6 @@ mlphy_reset(sc)
reg = PHY_READ(sc, MII_BMCR);
reg &= ~BMCR_AUTOEN;
PHY_WRITE(sc, MII_BMCR, reg);
-
- return;
}
/*
@@ -431,6 +427,4 @@ mlphy_status(sc)
mii_phy_reset(other);
mii_phy_auto(other);
}
-
- return;
}
OpenPOWER on IntegriCloud