summaryrefslogtreecommitdiff
path: root/sys/dev/mii/dcphy.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/mii/dcphy.c')
-rw-r--r--sys/dev/mii/dcphy.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c
index 22667f8bdd3..0b68c91cc8b 100644
--- a/sys/dev/mii/dcphy.c
+++ b/sys/dev/mii/dcphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcphy.c,v 1.10 2004/09/27 18:25:48 brad Exp $ */
+/* $OpenBSD: dcphy.c,v 1.11 2004/11/16 14:26:22 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -283,17 +283,22 @@ dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
return (0);
- reg = CSR_READ_4(dc_sc, DC_10BTSTAT) &
- (DC_TSTAT_LS10|DC_TSTAT_LS100);
-
+ reg = CSR_READ_4(dc_sc, DC_10BTSTAT);
if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100))
return (0);
/*
* Only retry autonegotiation every 5 seconds.
+ *
+ * Otherwise, fall through to calling dcphy_status()
+ * since real Intel 21143 chips don't show valid link
+ * status until autonegotiation is switched off, and
+ * that only happens in dcphy_status(). Without this,
+ * successful autonegotation is never recognised on
+ * these chips.
*/
if (++sc->mii_ticks != 50)
- return (0);
+ break;
sc->mii_ticks = 0;
/*if (DC_IS_INTEL(dc_sc))*/
@@ -326,9 +331,7 @@ dcphy_status(struct mii_softc *sc)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
return;
- reg = CSR_READ_4(dc_sc, DC_10BTSTAT) &
- (DC_TSTAT_LS10|DC_TSTAT_LS100);
-
+ reg = CSR_READ_4(dc_sc, DC_10BTSTAT);
if (!(reg & DC_TSTAT_LS10) || !(reg & DC_TSTAT_LS100))
mii->mii_media_status |= IFM_ACTIVE;