summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2001-03-17 02:50:20 +0000
committerjlemon <jlemon@FreeBSD.org>2001-03-17 02:50:20 +0000
commitb66fe642a945a0134cfbfe33c36dd4fddbaba866 (patch)
treea37143107105ea838a2d9a382d84d4e29b9db38f /sys
parent31a37074ac17e3c8f6fe5f009f24e7a8923955bf (diff)
downloadFreeBSD-src-b66fe642a945a0134cfbfe33c36dd4fddbaba866.zip
FreeBSD-src-b66fe642a945a0134cfbfe33c36dd4fddbaba866.tar.gz
Really fix NWAY negotiation for the 82553 PHY. Locking down the
media interface selection should not imply disabling NWAY negotiaton as well. Problem pointed out by: peter
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/mii/inphy.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/mii/inphy.c b/sys/dev/mii/inphy.c
index 9ac851d..c1046c1 100644
--- a/sys/dev/mii/inphy.c
+++ b/sys/dev/mii/inphy.c
@@ -141,7 +141,7 @@ inphy_attach(device_t dev)
mii_phy_reset(sc);
sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask;
- device_printf(dev, "");
+ device_printf(dev, " ");
if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0)
printf("no media present");
else
@@ -195,11 +195,19 @@ inphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
+#if 0
+ /*
+ * XXX
+ * we need to differentiate between 'auto media'
+ * and "NWAY autonegotiate enabled". For now,
+ * just re-start full autodetect again.
+ */
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
+#endif
(void) mii_phy_auto(sc, 0);
break;
case IFM_100_T4:
@@ -212,7 +220,9 @@ inphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
* BMCR data is stored in the ifmedia entry.
*/
PHY_WRITE(sc, MII_ANAR, mii_anar(ife->ifm_media));
- PHY_WRITE(sc, MII_BMCR, ife->ifm_data);
+ PHY_WRITE(sc, MII_BMCR, ife->ifm_data |
+ (sc->mii_capabilities & BMSR_ANEG ?
+ BMCR_AUTOEN | BMCR_STARTNEG : 0));
}
break;
OpenPOWER on IntegriCloud