diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-12-20 22:18:06 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-12-20 22:18:06 +0000 |
commit | b3a4dd3dd3adbee8ce4f775794881131ca11202f (patch) | |
tree | 1ec129dbc2d6392ae4006359640cf6b6fadd0b72 | |
parent | c71b519293f0f79add0398916d912c0aebf5f611 (diff) |
Set IFM_ETH_MASTER if local PHY configuration resolved to MASTER.
ok deraadt@, brad@
-rw-r--r-- | sys/dev/mii/rgephy.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c index 0813b3ebdec..6b5874e76e6 100644 --- a/sys/dev/mii/rgephy.c +++ b/sys/dev/mii/rgephy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rgephy.c,v 1.17 2006/10/07 23:44:51 brad Exp $ */ +/* $OpenBSD: rgephy.c,v 1.18 2006/12/20 22:18:05 kettenis Exp $ */ /* * Copyright (c) 2003 * Bill Paul <wpaul@windriver.com>. All rights reserved. @@ -301,7 +301,7 @@ void rgephy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - int bmsr, bmcr; + int bmsr, bmcr, gtsr; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; @@ -334,6 +334,11 @@ rgephy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_10_T; if (bmsr & RL_GMEDIASTAT_FDX) mii->mii_media_active |= IFM_FDX; + + gtsr = PHY_READ(sc, RGEPHY_MII_1000STS); + if ((mii->mii_media_active & IFM_1000_T) && + gtsr & RGEPHY_1000STS_MSR) + mii->mii_media_active |= IFM_ETH_MASTER; } |