summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/mii/acphy.c5
-rw-r--r--sys/dev/mii/amphy.c12
-rw-r--r--sys/dev/mii/bmtphy.c6
-rw-r--r--sys/dev/mii/ciphy.c4
-rw-r--r--sys/dev/mii/dcphy.c19
-rw-r--r--sys/dev/mii/icsphy.c6
-rw-r--r--sys/dev/mii/inphy.c6
-rw-r--r--sys/dev/mii/iophy.c12
-rw-r--r--sys/dev/mii/lxtphy.c5
-rw-r--r--sys/dev/mii/nsgphy.c6
-rw-r--r--sys/dev/mii/nsphy.c11
-rw-r--r--sys/dev/mii/nsphyter.c5
-rw-r--r--sys/dev/mii/qsphy.c6
-rw-r--r--sys/dev/mii/rgephy.c5
-rw-r--r--sys/dev/mii/rlphy.c10
-rw-r--r--sys/dev/mii/sqphy.c5
-rw-r--r--sys/dev/mii/tlphy.c4
-rw-r--r--sys/dev/mii/tqphy.c5
-rw-r--r--sys/dev/mii/ukphy_subr.c10
-rw-r--r--sys/dev/mii/urlphy.c5
20 files changed, 92 insertions, 55 deletions
diff --git a/sys/dev/mii/acphy.c b/sys/dev/mii/acphy.c
index 4a4644b24ed..6e77924360e 100644
--- a/sys/dev/mii/acphy.c
+++ b/sys/dev/mii/acphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acphy.c,v 1.5 2005/03/26 04:40:09 krw Exp $ */
+/* $OpenBSD: acphy.c,v 1.6 2006/12/27 19:11:08 kettenis Exp $ */
/* $NetBSD: acphy.c,v 1.13 2003/04/29 01:49:33 thorpej Exp $ */
/*
@@ -238,8 +238,11 @@ acphy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (dr & DR_DPLX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/amphy.c b/sys/dev/mii/amphy.c
index de748004287..eabe2c5c83f 100644
--- a/sys/dev/mii/amphy.c
+++ b/sys/dev/mii/amphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amphy.c,v 1.13 2005/05/27 08:04:15 brad Exp $ */
+/* $OpenBSD: amphy.c,v 1.14 2006/12/27 19:11:08 kettenis Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -226,15 +226,15 @@ amphy_status(struct mii_softc *sc)
anlpar = PHY_READ(sc, MII_ANAR) &
PHY_READ(sc, MII_ANLPAR);
if (anlpar & ANLPAR_T4)
- mii->mii_media_active |= IFM_100_T4;
+ mii->mii_media_active |= IFM_100_T4|IFM_HDX;
else if (anlpar & ANLPAR_TX_FD)
mii->mii_media_active |= IFM_100_TX|IFM_FDX;
else if (anlpar & ANLPAR_TX)
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
else if (anlpar & ANLPAR_10_FD)
mii->mii_media_active |= IFM_10_T|IFM_FDX;
else if (anlpar & ANLPAR_10)
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
else
mii->mii_media_active |= IFM_NONE;
return;
@@ -247,11 +247,11 @@ amphy_status(struct mii_softc *sc)
if (par & DSCSR_100FDX)
mii->mii_media_active |= IFM_100_TX|IFM_FDX;
else if (par & DSCSR_100HDX)
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
else if (par & DSCSR_10FDX)
mii->mii_media_active |= IFM_10_T|IFM_HDX;
else if (par & DSCSR_10HDX)
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/bmtphy.c b/sys/dev/mii/bmtphy.c
index 759c71a838e..54b5998c157 100644
--- a/sys/dev/mii/bmtphy.c
+++ b/sys/dev/mii/bmtphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bmtphy.c,v 1.15 2005/11/06 22:50:15 brad Exp $ */
+/* $OpenBSD: bmtphy.c,v 1.16 2006/12/27 19:11:08 kettenis Exp $ */
/* $NetBSD: bmtphy.c,v 1.17 2005/01/17 13:17:45 scw Exp $ */
/*-
@@ -234,9 +234,11 @@ bmtphy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (aux_csr & AUX_CSR_FDX)
mii->mii_media_active |= IFM_FDX;
-
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c
index 917cf000354..224b4aa80f0 100644
--- a/sys/dev/mii/ciphy.c
+++ b/sys/dev/mii/ciphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciphy.c,v 1.15 2006/12/23 13:16:32 kettenis Exp $ */
+/* $OpenBSD: ciphy.c,v 1.16 2006/12/27 19:11:08 kettenis Exp $ */
/* $FreeBSD: ciphy.c,v 1.1 2004/09/10 20:57:45 wpaul Exp $ */
/*
* Copyright (c) 2004
@@ -306,6 +306,8 @@ ciphy_status(struct mii_softc *sc)
if (bmsr & CIPHY_AUXCSR_FDX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
gsr = PHY_READ(sc, CIPHY_MII_1000STS);
if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) &&
diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c
index a4662af0b08..a52b001692c 100644
--- a/sys/dev/mii/dcphy.c
+++ b/sys/dev/mii/dcphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcphy.c,v 1.17 2006/08/05 17:01:34 brad Exp $ */
+/* $OpenBSD: dcphy.c,v 1.18 2006/12/27 19:11:08 kettenis Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -338,17 +338,17 @@ dcphy_status(struct mii_softc *sc)
anlpar = tstat >> 16;
if (anlpar & ANLPAR_T4 &&
sc->mii_capabilities & BMSR_100TXHDX)
- mii->mii_media_active |= IFM_100_T4;
+ mii->mii_media_active |= IFM_100_T4|IFM_HDX;
else if (anlpar & ANLPAR_TX_FD &&
sc->mii_capabilities & BMSR_100TXFDX)
mii->mii_media_active |= IFM_100_TX|IFM_FDX;
else if (anlpar & ANLPAR_TX &&
sc->mii_capabilities & BMSR_100TXHDX)
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
else if (anlpar & ANLPAR_10_FD)
mii->mii_media_active |= IFM_10_T|IFM_FDX;
else if (anlpar & ANLPAR_10)
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
else
mii->mii_media_active |= IFM_NONE;
if (DC_IS_INTEL(dc_sc))
@@ -356,6 +356,7 @@ dcphy_status(struct mii_softc *sc)
DC_TCTL_AUTONEGENBL);
return;
}
+
/*
* If the other side doesn't support NWAY, then the
* best we can do is determine if we have a 10Mbps or
@@ -365,9 +366,9 @@ dcphy_status(struct mii_softc *sc)
* change the media settings if we're wrong.
*/
if (!(reg & DC_TSTAT_LS100))
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
else if (!(reg & DC_TSTAT_LS10))
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
else
mii->mii_media_active |= IFM_NONE;
if (DC_IS_INTEL(dc_sc))
@@ -376,15 +377,15 @@ dcphy_status(struct mii_softc *sc)
}
skip:
-
if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_SPEEDSEL)
mii->mii_media_active |= IFM_10_T;
else
mii->mii_media_active |= IFM_100_TX;
+
if (CSR_READ_4(dc_sc, DC_NETCFG) & DC_NETCFG_FULLDUPLEX)
mii->mii_media_active |= IFM_FDX;
-
- return;
+ else
+ mii->mii_media_active |= IFM_HDX;
}
int
diff --git a/sys/dev/mii/icsphy.c b/sys/dev/mii/icsphy.c
index 4d33ff897c4..3f3ced147b8 100644
--- a/sys/dev/mii/icsphy.c
+++ b/sys/dev/mii/icsphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: icsphy.c,v 1.17 2005/02/19 06:00:04 brad Exp $ */
+/* $OpenBSD: icsphy.c,v 1.18 2006/12/27 19:11:08 kettenis Exp $ */
/* $NetBSD: icsphy.c,v 1.17 2000/02/02 23:34:56 thorpej Exp $ */
/*-
@@ -260,12 +260,16 @@ icsphy_status(sc)
mii->mii_media_active |= IFM_NONE;
return;
}
+
if (qpr & QPR_SPEED)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (qpr & QPR_FDX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/inphy.c b/sys/dev/mii/inphy.c
index 2f0861649f4..c11228a53d5 100644
--- a/sys/dev/mii/inphy.c
+++ b/sys/dev/mii/inphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inphy.c,v 1.13 2005/02/19 06:00:04 brad Exp $ */
+/* $OpenBSD: inphy.c,v 1.14 2006/12/27 19:11:08 kettenis Exp $ */
/* $NetBSD: inphy.c,v 1.18 2000/02/02 23:34:56 thorpej Exp $ */
/*-
@@ -257,6 +257,7 @@ inphy_status(sc)
mii->mii_media_active |= IFM_NONE;
return;
}
+
scr = PHY_READ(sc, MII_INPHY_SCR);
if ((bmsr & BMSR_100T4) && (scr & SCR_T4))
mii->mii_media_active |= IFM_100_T4;
@@ -264,8 +265,11 @@ inphy_status(sc)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (scr & SCR_FDX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/iophy.c b/sys/dev/mii/iophy.c
index dada4f88744..89dd6676452 100644
--- a/sys/dev/mii/iophy.c
+++ b/sys/dev/mii/iophy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iophy.c,v 1.12 2005/02/19 06:00:04 brad Exp $ */
+/* $OpenBSD: iophy.c,v 1.13 2006/12/27 19:11:08 kettenis Exp $ */
/* $NetBSD: iophy.c,v 1.8 2000/02/02 23:34:56 thorpej Exp $ */
/*
@@ -254,21 +254,21 @@ iophy_status(sc)
mii->mii_media_active |= IFM_NONE;
return;
}
- ext0 = PHY_READ(sc, MII_IOPHY_EXT0);
+ ext0 = PHY_READ(sc, MII_IOPHY_EXT0);
if (ext0 & EXT0_SPEED) {
if (bmsr & BMSR_100T4) {
mii->mii_media_active |= IFM_100_T4;
return;
- } else {
+ } else
mii->mii_media_active |= IFM_100_TX;
- }
- } else {
+ } else
mii->mii_media_active |= IFM_10_T;
- }
if (ext0 & EXT0_DUPLEX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/lxtphy.c b/sys/dev/mii/lxtphy.c
index d8f8148e097..fa39c9dfea6 100644
--- a/sys/dev/mii/lxtphy.c
+++ b/sys/dev/mii/lxtphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lxtphy.c,v 1.14 2005/02/19 06:00:04 brad Exp $ */
+/* $OpenBSD: lxtphy.c,v 1.15 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: lxtphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -277,8 +277,11 @@ lxtphy_status(sc)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (csr & CSR_DUPLEX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c
index 6fca820315d..678c2eea136 100644
--- a/sys/dev/mii/nsgphy.c
+++ b/sys/dev/mii/nsgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsgphy.c,v 1.17 2006/07/22 04:45:13 brad Exp $ */
+/* $OpenBSD: nsgphy.c,v 1.18 2006/12/27 19:11:09 kettenis Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 2001
@@ -260,9 +260,13 @@ nsgphy_status(struct mii_softc *sc)
default:
mii->mii_media_active |= IFM_NONE;
mii->mii_media_status = 0;
+ return;
}
+
if (physup & PHY_SUP_DUPLEX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c
index 03ea1b3cc12..6500a9b17d5 100644
--- a/sys/dev/mii/nsphy.c
+++ b/sys/dev/mii/nsphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsphy.c,v 1.19 2005/03/26 04:40:09 krw Exp $ */
+/* $OpenBSD: nsphy.c,v 1.20 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -294,11 +294,11 @@ nsphy_status(struct mii_softc *sc)
else if (anlpar & ANLPAR_TX_FD)
mii->mii_media_active |= IFM_100_TX|IFM_FDX;
else if (anlpar & ANLPAR_TX)
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
else if (anlpar & ANLPAR_10_FD)
mii->mii_media_active |= IFM_10_T|IFM_FDX;
else if (anlpar & ANLPAR_10)
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
else
mii->mii_media_active |= IFM_NONE;
return;
@@ -314,10 +314,7 @@ nsphy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_10_T;
else
mii->mii_media_active |= IFM_100_TX;
-#if 0
- if (par & PAR_FDX)
- mii->mii_media_active |= IFM_FDX;
-#endif
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/nsphyter.c b/sys/dev/mii/nsphyter.c
index 604f66ffadc..8dd11b640e7 100644
--- a/sys/dev/mii/nsphyter.c
+++ b/sys/dev/mii/nsphyter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsphyter.c,v 1.12 2006/03/04 03:53:30 brad Exp $ */
+/* $OpenBSD: nsphyter.c,v 1.13 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: nsphyter.c,v 1.5 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -258,8 +258,11 @@ nsphyter_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_10_T;
else
mii->mii_media_active |= IFM_100_TX;
+
if (physts & PHYSTS_DUPLEX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/qsphy.c b/sys/dev/mii/qsphy.c
index 96c45d6490c..ddacc2d38c7 100644
--- a/sys/dev/mii/qsphy.c
+++ b/sys/dev/mii/qsphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qsphy.c,v 1.13 2005/02/19 06:00:04 brad Exp $ */
+/* $OpenBSD: qsphy.c,v 1.14 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: qsphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -248,13 +248,13 @@ qsphy_status(struct mii_softc *sc)
PHY_READ(sc, MII_QSPHY_PCTL);
switch (pctl & PCTL_OPMASK) {
case PCTL_10_T:
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
break;
case PCTL_10_T_FDX:
mii->mii_media_active |= IFM_10_T|IFM_FDX;
break;
case PCTL_100_TX:
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
break;
case PCTL_100_TX_FDX:
mii->mii_media_active |= IFM_100_TX|IFM_FDX;
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c
index 14bf0f4e532..e3a36dee75f 100644
--- a/sys/dev/mii/rgephy.c
+++ b/sys/dev/mii/rgephy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rgephy.c,v 1.19 2006/12/22 14:12:53 kettenis Exp $ */
+/* $OpenBSD: rgephy.c,v 1.20 2006/12/27 19:11:09 kettenis Exp $ */
/*
* Copyright (c) 2003
* Bill Paul <wpaul@windriver.com>. All rights reserved.
@@ -332,8 +332,11 @@ rgephy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_100_TX;
else if (bmsr & RL_GMEDIASTAT_10MBPS)
mii->mii_media_active |= IFM_10_T;
+
if (bmsr & RL_GMEDIASTAT_FDX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
gtsr = PHY_READ(sc, RGEPHY_MII_1000STS);
if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) &&
diff --git a/sys/dev/mii/rlphy.c b/sys/dev/mii/rlphy.c
index db580c4e50f..e4cfd87aacb 100644
--- a/sys/dev/mii/rlphy.c
+++ b/sys/dev/mii/rlphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rlphy.c,v 1.25 2006/11/02 01:27:34 brad Exp $ */
+/* $OpenBSD: rlphy.c,v 1.26 2006/12/27 19:11:09 kettenis Exp $ */
/*
* Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net)
@@ -259,15 +259,15 @@ rlphy_status(struct mii_softc *sc)
if ((anlpar = PHY_READ(sc, MII_ANAR) &
PHY_READ(sc, MII_ANLPAR))) {
if (anlpar & ANLPAR_T4)
- mii->mii_media_active |= IFM_100_T4;
+ mii->mii_media_active |= IFM_100_T4|IFM_HDX;
else if (anlpar & ANLPAR_TX_FD)
mii->mii_media_active |= IFM_100_TX|IFM_FDX;
else if (anlpar & ANLPAR_TX)
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
else if (anlpar & ANLPAR_10_FD)
mii->mii_media_active |= IFM_10_T|IFM_FDX;
else if (anlpar & ANLPAR_10)
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
else
mii->mii_media_active |= IFM_NONE;
return;
@@ -311,7 +311,7 @@ rlphy_status(struct mii_softc *sc)
else
mii->mii_media_active |= IFM_10_T;
}
-
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/sqphy.c b/sys/dev/mii/sqphy.c
index 4d71513fc74..4581709f74d 100644
--- a/sys/dev/mii/sqphy.c
+++ b/sys/dev/mii/sqphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sqphy.c,v 1.14 2005/02/05 04:28:23 brad Exp $ */
+/* $OpenBSD: sqphy.c,v 1.15 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: sqphy.c,v 1.17 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -258,8 +258,11 @@ sqphy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (status & STATUS_DPLX_DET)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c
index 58c4930999f..ad53c38a479 100644
--- a/sys/dev/mii/tlphy.c
+++ b/sys/dev/mii/tlphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tlphy.c,v 1.17 2005/03/26 04:40:09 krw Exp $ */
+/* $OpenBSD: tlphy.c,v 1.18 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: tlphy.c,v 1.26 2000/07/04 03:29:00 thorpej Exp $ */
/*-
@@ -318,6 +318,8 @@ tlphy_status(struct mii_softc *physc)
*/
if (bmcr & BMCR_FDX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
mii->mii_media_active |= IFM_10_T;
}
diff --git a/sys/dev/mii/tqphy.c b/sys/dev/mii/tqphy.c
index 8ecb76f721b..8158c1b00e4 100644
--- a/sys/dev/mii/tqphy.c
+++ b/sys/dev/mii/tqphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tqphy.c,v 1.10 2005/02/19 06:00:04 brad Exp $ */
+/* $OpenBSD: tqphy.c,v 1.11 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: tqphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $ */
/*
@@ -255,8 +255,11 @@ tqphy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (diag & DIAG_DPLX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}
diff --git a/sys/dev/mii/ukphy_subr.c b/sys/dev/mii/ukphy_subr.c
index 5bed84cdad1..9da5fc06b9d 100644
--- a/sys/dev/mii/ukphy_subr.c
+++ b/sys/dev/mii/ukphy_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ukphy_subr.c,v 1.6 2006/12/23 12:34:50 kettenis Exp $ */
+/* $OpenBSD: ukphy_subr.c,v 1.7 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: ukphy_subr.c,v 1.2 1998/11/05 04:08:02 thorpej Exp $ */
/*-
@@ -107,17 +107,17 @@ ukphy_status(struct mii_softc *phy)
mii->mii_media_active |= IFM_1000_T|IFM_FDX;
else if ((gtcr & GTCR_ADV_1000THDX) &&
(gtsr & GTSR_LP_1000THDX))
- mii->mii_media_active |= IFM_1000_T;
+ mii->mii_media_active |= IFM_1000_T|IFM_HDX;
else if (anlpar & ANLPAR_T4)
- mii->mii_media_active |= IFM_100_T4;
+ mii->mii_media_active |= IFM_100_T4|IFM_HDX;
else if (anlpar & ANLPAR_TX_FD)
mii->mii_media_active |= IFM_100_TX|IFM_FDX;
else if (anlpar & ANLPAR_TX)
- mii->mii_media_active |= IFM_100_TX;
+ mii->mii_media_active |= IFM_100_TX|IFM_HDX;
else if (anlpar & ANLPAR_10_FD)
mii->mii_media_active |= IFM_10_T|IFM_FDX;
else if (anlpar & ANLPAR_10)
- mii->mii_media_active |= IFM_10_T;
+ mii->mii_media_active |= IFM_10_T|IFM_HDX;
else
mii->mii_media_active |= IFM_NONE;
diff --git a/sys/dev/mii/urlphy.c b/sys/dev/mii/urlphy.c
index 21e2a620268..ff4048b0681 100644
--- a/sys/dev/mii/urlphy.c
+++ b/sys/dev/mii/urlphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: urlphy.c,v 1.11 2005/05/27 08:04:15 brad Exp $ */
+/* $OpenBSD: urlphy.c,v 1.12 2006/12/27 19:11:09 kettenis Exp $ */
/* $NetBSD: urlphy.c,v 1.1 2002/03/28 21:07:53 ichiro Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -256,8 +256,11 @@ urlphy_status(struct mii_softc *sc)
mii->mii_media_active |= IFM_100_TX;
else
mii->mii_media_active |= IFM_10_T;
+
if (msr & URLPHY_MSR_DUPLEX)
mii->mii_media_active |= IFM_FDX;
+ else
+ mii->mii_media_active |= IFM_HDX;
} else
mii->mii_media_active = ife->ifm_media;
}