summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNathan Binkert <nate@cvs.openbsd.org>2001-06-25 20:24:14 +0000
committerNathan Binkert <nate@cvs.openbsd.org>2001-06-25 20:24:14 +0000
commita7a6103ab9bb4b69da543361bb4767658660feb8 (patch)
tree85d31d7009c0b4b9bbe7dd4f8790a347183e1277 /sys/dev
parent83de6993af1bb4493c0cc797fc9a69fb9e55a842 (diff)
Change autonegotiation timeout for devices with a gigabit phy to 10s. All
other devices default to 5 seconds. ok deraadt. from NetBSD.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mii/mii_physubr.c13
-rw-r--r--sys/dev/mii/miivar.h3
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c
index ee9cbcdf316..1d0481b321a 100644
--- a/sys/dev/mii/mii_physubr.c
+++ b/sys/dev/mii/mii_physubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mii_physubr.c,v 1.9 2001/06/08 02:16:41 nate Exp $ */
+/* $OpenBSD: mii_physubr.c,v 1.10 2001/06/25 20:24:13 nate Exp $ */
/* $NetBSD: mii_physubr.c,v 1.20 2001/04/13 23:30:09 thorpej Exp $ */
/*-
@@ -202,9 +202,12 @@ mii_phy_tick(sc)
}
/*
- * Only retry autonegotiation every 5 seconds.
+ * Only retry autonegotiation every N seconds.
*/
- if (++sc->mii_ticks != 5)
+ if (!sc->mii_anegticks)
+ sc->mii_anegticks = 5;
+
+ if (++sc->mii_ticks != sc->mii_anegticks)
return (EJUSTRETURN);
sc->mii_ticks = 0;
@@ -363,18 +366,22 @@ mii_phy_add_media(sc)
* XXX to hnalde 1000LX and 1000CX some how.
*/
if (sc->mii_extcapabilities & EXTSR_1000XHDX) {
+ sc->mii_anegticks = 10;
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, 0,
sc->mii_inst), MII_MEDIA_1000);
}
if (sc->mii_extcapabilities & EXTSR_1000XFDX) {
+ sc->mii_anegticks = 10;
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX,
sc->mii_inst), MII_MEDIA_1000_FDX);
}
if (sc->mii_extcapabilities & EXTSR_1000THDX) {
+ sc->mii_anegticks = 10;
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_TX, 0,
sc->mii_inst), MII_MEDIA_1000);
}
if (sc->mii_extcapabilities & EXTSR_1000TFDX) {
+ sc->mii_anegticks = 10;
ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_TX, IFM_FDX,
sc->mii_inst), MII_MEDIA_1000_FDX);
}
diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h
index bb7562c6fd3..95ce35035db 100644
--- a/sys/dev/mii/miivar.h
+++ b/sys/dev/mii/miivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: miivar.h,v 1.10 2001/06/08 02:16:41 nate Exp $ */
+/* $OpenBSD: miivar.h,v 1.11 2001/06/25 20:24:13 nate Exp $ */
/* $NetBSD: miivar.h,v 1.17 2000/03/06 20:56:57 thorpej Exp $ */
/*-
@@ -140,6 +140,7 @@ struct mii_softc {
int mii_capabilities; /* capabilities from BMSR */
int mii_extcapabilities; /* extended capabilities */
int mii_ticks; /* MII_TICK counter */
+ int mii_anegticks; /* ticks before retrying aneg */
#if defined(__NetBSD__)
struct callout mii_nway_ch; /* NWAY callout */