summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2008-06-05 05:51:19 +0000
committerimp <imp@FreeBSD.org>2008-06-05 05:51:19 +0000
commit570605957cddbe81ec5fa4432db2f18cc42f934a (patch)
tree6b5ef7e8f3b21af4c44ccef2d0724a90c3636957 /sys
parentec798ac2b240c5a334fb7ca455cac967a78f8781 (diff)
downloadFreeBSD-src-570605957cddbe81ec5fa4432db2f18cc42f934a.zip
FreeBSD-src-570605957cddbe81ec5fa4432db2f18cc42f934a.tar.gz
Fix the media auto code by breaking it :-). Auto now just means 'use
10BaseT' since it required 10BaseT to have carrier to switch to it. This chip makes it hard to do proper auto, so we don't do it. We can't test carrier on things easily. Don't insist on carrier when we set the media. Don't report failures. Remove a 1s! delay that appears to not be needed. With these patches, and John Baldwin's patches, I'm able to pass packets on my IBM EtherJet card again.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/cs/if_cs.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c
index b054d2b..09e397f 100644
--- a/sys/dev/cs/if_cs.c
+++ b/sys/dev/cs/if_cs.c
@@ -194,7 +194,6 @@ control_dc_dc(struct cs_softc *sc, int on_not_off)
else
self_control &= ~HCB1;
cs_writereg(sc, PP_SelfCTL, self_control);
-
DELAY(500000);
}
@@ -215,7 +214,6 @@ cs_duplex_auto(struct cs_softc *sc)
}
DELAY(1000);
}
- DELAY(1000000);
return (error);
}
@@ -225,13 +223,6 @@ enable_tp(struct cs_softc *sc)
cs_writereg(sc, PP_LineCTL, sc->line_ctl & ~AUI_ONLY);
control_dc_dc(sc, 0);
- DELAY( 150000 );
-
- if ((cs_readreg(sc, PP_LineST) & LINK_OK)==0) {
- device_printf(sc->dev, "failed to enable TP\n");
- return (EINVAL);
- }
-
return (0);
}
@@ -288,10 +279,8 @@ enable_aui(struct cs_softc *sc)
cs_writereg(sc, PP_LineCTL,
(sc->line_ctl & ~AUTO_AUI_10BASET) | AUI_ONLY);
- if (!send_test_pkt(sc)) {
- device_printf(sc->dev, "failed to enable AUI\n");
+ if (!send_test_pkt(sc))
return (EINVAL);
- }
return (0);
}
@@ -306,10 +295,8 @@ enable_bnc(struct cs_softc *sc)
cs_writereg(sc, PP_LineCTL,
(sc->line_ctl & ~AUTO_AUI_10BASET) | AUI_ONLY);
- if (!send_test_pkt(sc)) {
- device_printf(sc->dev, "failed to enable BNC\n");
+ if (!send_test_pkt(sc))
return (EINVAL);
- }
return (0);
}
@@ -1246,10 +1233,12 @@ cs_mediaset(struct cs_softc *sc, int media)
switch (IFM_SUBTYPE(media)) {
default:
case IFM_AUTO:
- if ((error=enable_tp(sc))==0)
- error = cs_duplex_auto(sc);
- else if ((error=enable_bnc(sc)) != 0)
- error = enable_aui(sc);
+ /*
+ * This chip makes it a little hard to support this, so treat
+ * it as IFM_10_T, auto duplex.
+ */
+ enable_tp(sc);
+ cs_duplex_auto(sc);
break;
case IFM_10_T:
enable_tp(sc);
OpenPOWER on IntegriCloud