aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mii
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2004-05-29 18:23:26 +0000
committerMarius Strobl <marius@FreeBSD.org>2004-05-29 18:23:26 +0000
commitf0e531572d9dd5057c120928b19b989a4e7e5c32 (patch)
tree7b67d977603246eed635bb613877d6bad800c7f7 /sys/dev/mii
parentb78791d37ed5ec9b41612054ba1e94314af752aa (diff)
Notes
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/nsphy.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c
index 7968498ec733b..70676ddc1e4f5 100644
--- a/sys/dev/mii/nsphy.c
+++ b/sys/dev/mii/nsphy.c
@@ -196,6 +196,7 @@ nsphy_service(sc, mii, cmd)
{
struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
int reg;
+ device_t parent;
switch (cmd) {
case MII_POLLSTAT:
@@ -223,6 +224,8 @@ nsphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
+ parent = device_get_parent(sc->mii_dev);
+
reg = PHY_READ(sc, MII_NSPHY_PCR);
/*
@@ -256,16 +259,20 @@ nsphy_service(sc, mii, cmd)
*/
reg |= 0x0100 | 0x0400;
- if (strcmp(device_get_name(device_get_parent(sc->mii_dev)),
- "fxp") == 0)
+ if (strcmp(device_get_name(parent), "fxp") == 0)
PHY_WRITE(sc, MII_NSPHY_PCR, reg);
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
- * If we're already in auto mode, just return.
+ * If we're already in auto mode and don't hang off
+ * of a hme(4), just return. DP83840A on hme(4) don't
+ * advertise their media capabilities themselves
+ * properly so force writing the ANAR according to
+ * the BMSR by mii_phy_auto() every time.
*/
- if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
+ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 &&
+ strcmp(device_get_name(parent), "hme") != 0)
return (0);
(void) mii_phy_auto(sc);
break;