diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-12-22 14:11:04 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-12-22 14:11:04 +0000 |
commit | 8cf382d0646504e44da82150513d3335af9e4a4e (patch) | |
tree | 626145526e23227cc6b1a8033c57b70eb0c5ff74 | |
parent | c97667e9e92fc7992015f5e34128bd379f1019a6 (diff) |
Set IFM_ETH_MASTER if local PHY configuration resolved to MASTER.
Based on a diff by brad@
-rw-r--r-- | sys/dev/mii/brgphy.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 826d4ec2f93..0023bb98bb1 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brgphy.c,v 1.66 2006/10/22 22:33:49 brad Exp $ */ +/* $OpenBSD: brgphy.c,v 1.67 2006/12/22 14:11:03 kettenis Exp $ */ /* * Copyright (c) 2000 @@ -351,7 +351,7 @@ brgphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - int bmsr, bmcr; + int bmsr, bmcr, gsr; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; @@ -399,6 +399,12 @@ brgphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_NONE; break; } + + gsr = PHY_READ(sc, BRGPHY_MII_1000STS); + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) && + gsr & BRGPHY_1000STS_MSR) + mii->mii_media_active |= IFM_ETH_MASTER; + return; } |