summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/mii/ciphy.c9
-rw-r--r--sys/dev/mii/ipgphy.c16
2 files changed, 13 insertions, 12 deletions
diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c
index 62c42be29ea..917cf000354 100644
--- a/sys/dev/mii/ciphy.c
+++ b/sys/dev/mii/ciphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciphy.c,v 1.14 2006/10/07 23:44:51 brad Exp $ */
+/* $OpenBSD: ciphy.c,v 1.15 2006/12/23 13:16:32 kettenis Exp $ */
/* $FreeBSD: ciphy.c,v 1.1 2004/09/10 20:57:45 wpaul Exp $ */
/*
* Copyright (c) 2004
@@ -264,7 +264,7 @@ void
ciphy_status(struct mii_softc *sc)
{
struct mii_data *mii = sc->mii_pdata;
- int bmsr, bmcr;
+ int bmsr, bmcr, gsr;
mii->mii_media_status = IFM_AVALID;
mii->mii_media_active = IFM_ETHER;
@@ -306,6 +306,11 @@ ciphy_status(struct mii_softc *sc)
if (bmsr & CIPHY_AUXCSR_FDX)
mii->mii_media_active |= IFM_FDX;
+
+ gsr = PHY_READ(sc, CIPHY_MII_1000STS);
+ if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) &&
+ gsr & CIPHY_1000STS_MSR)
+ mii->mii_media_active |= IFM_ETH_MASTER;
}
void
diff --git a/sys/dev/mii/ipgphy.c b/sys/dev/mii/ipgphy.c
index c986d18523a..a5343d57987 100644
--- a/sys/dev/mii/ipgphy.c
+++ b/sys/dev/mii/ipgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipgphy.c,v 1.2 2006/08/11 19:50:48 brad Exp $ */
+/* $OpenBSD: ipgphy.c,v 1.3 2006/12/23 13:16:32 kettenis Exp $ */
/*-
* Copyright (c) 2006, Pyun YongHyeon <yongari@FreeBSD.org>
@@ -337,6 +337,11 @@ ipgphy_status(struct mii_softc *sc)
else
mii->mii_media_active |= IFM_HDX;
+ stat = PHY_READ(sc, IPGPHY_MII_1000SR);
+ if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) &&
+ stat & IPGPHY_1000SR_MASTER)
+ mii->mii_media_active |= IFM_ETH_MASTER;
+
ar = PHY_READ(sc, IPGPHY_MII_ANAR);
lpar = PHY_READ(sc, IPGPHY_MII_ANLPAR);
@@ -354,15 +359,6 @@ ipgphy_status(struct mii_softc *sc)
(lpar & IPGPHY_ANLPAR_APAUSE)) {
mii->mii_media_active |= IFM_FLAG0;
}
-
- /*
- * FLAG2 : local PHY resolved to MASTER
- */
- if ((mii->mii_media_active & IFM_1000_T) != 0) {
- stat = PHY_READ(sc, IPGPHY_MII_1000SR);
- if ((stat & IPGPHY_1000SR_MASTER) != 0)
- mii->mii_media_active |= IFM_FLAG2;
- }
}
int