summaryrefslogtreecommitdiffstats
path: root/sys/dev/re
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2006-09-08 00:58:02 +0000
committeryongari <yongari@FreeBSD.org>2006-09-08 00:58:02 +0000
commitcbddd65974e9d22234ac4dcfa88bb55bb337a925 (patch)
tree96876437e97d5d958227c468ca1116f6dd77d27e /sys/dev/re
parentb99a8efe6d62bf55ac94f95e43d20b86a8b60069 (diff)
downloadFreeBSD-src-cbddd65974e9d22234ac4dcfa88bb55bb337a925.zip
FreeBSD-src-cbddd65974e9d22234ac4dcfa88bb55bb337a925.tar.gz
Make 8139C+ work again which was broken since rev 1.68.
Ever since rev 1.68 re(4) checks the validity of link in re_start. But rlphy(4) got a garbled data due to a different bit layout used on 8139C+ and it couldn't report correct link state. To fix it, ignore BMCR_LOOP and BMCR_ISO bits which have different meanings on 8139C+. I think this also make dhclient(8) work on 8139C+. Reported by: Gerrit Kuehn <gerrit AT pmp DOT uni-hannover DOT de> Tested by: Gerrit Kuehn <gerrit AT pmp DOT uni-hannover DOT de>
Diffstat (limited to 'sys/dev/re')
-rw-r--r--sys/dev/re/if_re.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c
index 8500d8f..12a6a1f 100644
--- a/sys/dev/re/if_re.c
+++ b/sys/dev/re/if_re.c
@@ -541,6 +541,10 @@ re_miibus_readreg(dev, phy, 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);
+ }
return (rval);
}
@@ -567,6 +571,10 @@ re_miibus_writereg(dev, phy, reg, 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;
OpenPOWER on IntegriCloud