summaryrefslogtreecommitdiff
path: root/sys/dev/ic/re.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-09-17 18:18:58 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-09-17 18:18:58 +0000
commit591eba2ef97f449b76516339bea0e7f78b489f31 (patch)
tree57bb04d08de2c61283e56b6f6ef8d2e7d5d2d98d /sys/dev/ic/re.c
parent686e82a0d24eddd08131981a5da2a6909b4f748c (diff)
Re-add the link state check to re_start(), which was added in rev 1.31 and
removed in rev 1.43 just before release, as a workaround for a link state issue found with the 8139C+ chips. Due to the different bit layout used by the 8139C+ chips rlphy(4) was not reporting the correct link status. Fix from yongary@FreeBSD Tested by maja@
Diffstat (limited to 'sys/dev/ic/re.c')
-rw-r--r--sys/dev/ic/re.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index 6d5a7a477d0..97c90172caa 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.44 2006/09/15 23:39:24 drahn Exp $ */
+/* $OpenBSD: re.c,v 1.45 2006/09/17 18:18:57 brad Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -400,6 +400,10 @@ re_miibus_readreg(struct device *dev, int phy, int reg)
return (0);
}
rval = CSR_READ_2(sc, re8139_reg);
+ if (sc->rl_type == RL_8139CPLUS && re8139_reg == RL_BMCR) {
+ /* 8139C+ has different bit layout. */
+ rval &= ~(BMCR_LOOP | BMCR_ISO);
+ }
splx(s);
return (rval);
}
@@ -427,6 +431,10 @@ re_miibus_writereg(struct device *dev, int phy, int reg, int data)
switch(reg) {
case MII_BMCR:
re8139_reg = RL_BMCR;
+ if (sc->rl_type == RL_8139CPLUS) {
+ /* 8139C+ has different bit layout. */
+ data &= ~(BMCR_LOOP | BMCR_ISO);
+ }
break;
case MII_BMSR:
re8139_reg = RL_BMSR;
@@ -1667,7 +1675,7 @@ re_start(struct ifnet *ifp)
sc = ifp->if_softc;
- if (ifp->if_flags & IFF_OACTIVE)
+ if (!sc->rl_link || ifp->if_flags & IFF_OACTIVE)
return;
idx = sc->rl_ldata.rl_txq_prodidx;