diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-11-08 03:03:51 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-11-08 03:03:51 +0000 |
commit | 3129d31703c65e585169a720c03ce855777329c6 (patch) | |
tree | b79c4653114a34220d5d6d08233cc589fc083d12 /sys/dev/mii/brgphy.c | |
parent | c58662ff4552c2d9bacd9737745805f79d8b1e9d (diff) |
Add additional link status checking for for the BCM5906 PHY.
Based on info from the Linux tg3 driver.
Diffstat (limited to 'sys/dev/mii/brgphy.c')
-rw-r--r-- | sys/dev/mii/brgphy.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 4a997ab7cf5..18e8f76ea08 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brgphy.c,v 1.83 2008/11/08 01:50:48 brad Exp $ */ +/* $OpenBSD: brgphy.c,v 1.84 2008/11/08 03:03:50 brad Exp $ */ /* * Copyright (c) 2000 @@ -398,14 +398,17 @@ brgphy_copper_status(struct mii_softc *sc) mii->mii_media_active |= IFM_LOOP; if (bmcr & BRGPHY_BMCR_AUTOEN) { + int auxsts; + if ((bmsr & BRGPHY_BMSR_ACOMP) == 0) { /* Erg, still trying, I guess... */ mii->mii_media_active |= IFM_NONE; return; } - switch (PHY_READ(sc, BRGPHY_MII_AUXSTS) & - BRGPHY_AUXSTS_AN_RES) { + auxsts = PHY_READ(sc, BRGPHY_MII_AUXSTS); + + switch (auxsts & BRGPHY_AUXSTS_AN_RES) { case BRGPHY_RES_1000FD: mii->mii_media_active |= IFM_1000_T | IFM_FDX; break; @@ -428,6 +431,13 @@ brgphy_copper_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T | IFM_HDX; break; default: + if (sc->mii_model == MII_MODEL_BROADCOM2_BCM5906) { + mii->mii_media_active |= (auxsts & + BRGPHY_RES_100) ? IFM_100_TX : IFM_10_T; + mii->mii_media_active |= (auxsts & + BRGPHY_RES_FULL) ? IFM_FDX : IFM_HDX; + break; + } mii->mii_media_active |= IFM_NONE; return; } |