summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-10-08 00:06:21 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-10-08 00:06:21 +0000
commitf4cceca2c50a0594b76a344e16bbf9c483d5c286 (patch)
tree0cc32f1b1ec8e5457bbd9a7dca4c0be0ed1447ae /sys
parenta76cfd1eb6597d6a1129ed58022e9a842ecd9c2a (diff)
- g/c unused code.
- only call PHY_RESET if trying to set a valid media type.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/mii/brgphy.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index e2171c568c8..6058e8b68b3 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brgphy.c,v 1.53 2006/10/01 17:29:48 brad Exp $ */
+/* $OpenBSD: brgphy.c,v 1.54 2006/10/08 00:06:20 brad Exp $ */
/*
* Copyright (c) 2000
@@ -214,17 +214,9 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
- PHY_RESET(sc); /* XXX hardware bug work-around */
-
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
-#ifdef foo
- /*
- * If we're already in auto mode, just return.
- */
- if (PHY_READ(sc, BRGPHY_MII_BMCR) & BRGPHY_BMCR_AUTOEN)
- return (0);
-#endif
+ PHY_RESET(sc); /* XXX hardware bug work-around */
(void) brgphy_mii_phy_auto(sc);
break;
case IFM_1000_T:
@@ -239,6 +231,7 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
case IFM_10_T:
speed = BRGPHY_S10;
setit:
+ PHY_RESET(sc); /* XXX hardware bug work-around */
brgphy_loop(sc);
if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) {
speed |= BRGPHY_BMCR_FDX;
@@ -438,9 +431,8 @@ brgphy_loop(struct mii_softc *sc)
PHY_WRITE(sc, BRGPHY_MII_BMCR, BRGPHY_BMCR_LOOP);
for (i = 0; i < 15000; i++) {
bmsr = PHY_READ(sc, BRGPHY_MII_BMSR);
- if (!(bmsr & BRGPHY_BMSR_LINK)) {
+ if (!(bmsr & BRGPHY_BMSR_LINK))
break;
- }
DELAY(10);
}
}