summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/mii/bmtphy.c5
-rw-r--r--sys/dev/mii/brgphy.c5
-rw-r--r--sys/dev/mii/eephy.c5
-rw-r--r--sys/dev/mii/nsgphy.c10
-rw-r--r--sys/dev/mii/nsphy.c5
-rw-r--r--sys/dev/mii/xmphy.c5
6 files changed, 19 insertions, 16 deletions
diff --git a/sys/dev/mii/bmtphy.c b/sys/dev/mii/bmtphy.c
index 7390b17db5b..20cabb0f392 100644
--- a/sys/dev/mii/bmtphy.c
+++ b/sys/dev/mii/bmtphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bmtphy.c,v 1.3 2001/06/18 06:31:59 deraadt Exp $ */
+/* $OpenBSD: bmtphy.c,v 1.4 2001/10/05 18:26:48 nate Exp $ */
/* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -106,6 +106,7 @@ bmtphyattach(parent, self, aux)
sc->mii_status = bmtphy_status;
sc->mii_pdata = mii;
sc->mii_flags = mii->mii_flags;
+ sc->mii_anegticks = 5;
bmtphy_reset(sc);
@@ -188,7 +189,7 @@ bmtphy_service(sc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
- if (++sc->mii_ticks != 5)
+ if (++sc->mii_ticks != sc->mii_anegticks)
return (0);
sc->mii_ticks = 0;
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index af7ffc56ce6..8f099d2267f 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brgphy.c,v 1.5 2001/08/19 15:07:34 miod Exp $ */
+/* $OpenBSD: brgphy.c,v 1.6 2001/10/05 18:26:48 nate Exp $ */
/*
* Copyright (c) 2000
@@ -116,6 +116,7 @@ brgphy_attach(parent, self, aux)
sc->mii_status = brgphy_status;
sc->mii_pdata = mii;
sc->mii_flags |= MIIF_NOISOLATE;
+ sc->mii_anegticks = 10;
mii_phy_reset(sc);
@@ -255,7 +256,7 @@ brgphy_service(sc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
- if (++sc->mii_ticks != 5)
+ if (++sc->mii_ticks != sc->mii_anegticks)
return (0);
sc->mii_ticks = 0;
diff --git a/sys/dev/mii/eephy.c b/sys/dev/mii/eephy.c
index a1822d371ab..a0a685cfb96 100644
--- a/sys/dev/mii/eephy.c
+++ b/sys/dev/mii/eephy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eephy.c,v 1.2 2001/04/14 09:36:20 deraadt Exp $ */
+/* $OpenBSD: eephy.c,v 1.3 2001/10/05 18:26:48 nate Exp $ */
/*
* Principal Author: Parag Patel
* Copyright (c) 2001
@@ -102,6 +102,7 @@ eephyattach(struct device *parent, struct device *self, void *aux)
sc->mii_status = eephy_status;
sc->mii_pdata = mii;
sc->mii_flags = mii->mii_flags;
+ sc->mii_anegticks = 5;
eephy_reset(sc);
@@ -304,7 +305,7 @@ eephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
- if (++(sc->mii_ticks) != 5) {
+ if (++(sc->mii_ticks) != sc->mii_anegticks) {
return (0);
}
sc->mii_ticks = 0;
diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c
index 3de1da37026..854c6acd2af 100644
--- a/sys/dev/mii/nsgphy.c
+++ b/sys/dev/mii/nsgphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsgphy.c,v 1.4 2001/08/19 15:07:34 miod Exp $ */
+/* $OpenBSD: nsgphy.c,v 1.5 2001/10/05 18:26:48 nate Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 2001
@@ -127,6 +127,7 @@ nsgphyattach(parent, self, aux)
sc->mii_status = nsgphy_status;
sc->mii_pdata = mii;
sc->mii_flags = mii->mii_flags;
+ sc->mii_anegticks = 10;
mii_phy_reset(sc);
@@ -268,12 +269,9 @@ nsgphy_service(sc, mii, cmd)
return (0);
/*
- * Only retry autonegotiation every 5 seconds.
- * Actually, for gigE PHYs, we should wait longer, since
- * 5 seconds is the mimimum time the documentation
- * says to wait for a 1000mbps link to be established.
+ * Only retry autonegotiation if we've hit the timeout.
*/
- if (++sc->mii_ticks != 10)
+ if (++sc->mii_ticks != sc->mii_anegticks)
return (0);
sc->mii_ticks = 0;
diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c
index be76f77c46f..2cab1ad731e 100644
--- a/sys/dev/mii/nsphy.c
+++ b/sys/dev/mii/nsphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nsphy.c,v 1.9 2000/08/26 20:04:18 nate Exp $ */
+/* $OpenBSD: nsphy.c,v 1.10 2001/10/05 18:26:48 nate Exp $ */
/* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */
/*-
@@ -139,6 +139,7 @@ nsphyattach(parent, self, aux)
sc->mii_status = nsphy_status;
sc->mii_pdata = mii;
sc->mii_flags = mii->mii_flags;
+ sc->mii_anegticks = 5;
nsphy_reset(sc);
@@ -251,7 +252,7 @@ nsphy_service(sc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
- if (++sc->mii_ticks != 5)
+ if (++sc->mii_ticks != sc->mii_anegticks)
return (0);
sc->mii_ticks = 0;
diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c
index 916e639c9ed..c7ed22901e9 100644
--- a/sys/dev/mii/xmphy.c
+++ b/sys/dev/mii/xmphy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmphy.c,v 1.3 2001/08/19 15:07:34 miod Exp $ */
+/* $OpenBSD: xmphy.c,v 1.4 2001/10/05 18:26:48 nate Exp $ */
/*
* Copyright (c) 2000
@@ -105,6 +105,7 @@ xmphy_attach(parent, self, aux)
sc->mii_status = xmphy_status;
sc->mii_pdata = mii;
sc->mii_flags |= MIIF_NOISOLATE | mii->mii_flags;
+ sc->mii_anegticks = 5;
#define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL)
@@ -208,7 +209,7 @@ xmphy_service(sc, mii, cmd)
/*
* Only retry autonegotiation every 5 seconds.
*/
- if (++sc->mii_ticks != 5)
+ if (++sc->mii_ticks != sc->mii_anegticks)
return (0);
sc->mii_ticks = 0;