Date: Fri, 14 Jun 1996 16:51:41 +0900 (JST) From: Naoki Hamada <nao@sbl.cl.nec.co.jp> To: nate@sri.MT.net Cc: current@FreeBSD.ORG Subject: Re: Attention 3C5X9 owners Message-ID: <199606140751.QAA09655@sirius.sbl.cl.nec.co.jp> In-Reply-To: Nate Williams's message of "Mon, 10 Jun 1996 13:05:22 -0600" <199606101905.NAA09662@rocky.sri.MT.net> References: <199606101905.NAA09662@rocky.sri.MT.net>
next in thread | previous in thread | raw e-mail | index | archive | help
>Can you please test out this patch to /sys/i386/isa/if_ep.c to make sure
>this works? This changes the way the driver selects the different card
>ports (AUI/BNC), and is needed for the PCCARD support (not included).
>In order to get the BNC connector working on my 3C589 card, but since
>it's based on code that was originally for the 3C509 I suspect it should
>work.
Nate, your patch still lacks some cases and breaks some important
information. I carefully studied the logic and made the connector
selection scheme a bit clearer and robuster, I hope.
>I need folks who have AUI connections, and folks who have BNC
>connections to test this to make sure it works, or even better folks who
>have both can test it to make sure it works fine with both.
My 3C509B-COMBO works fine with the following patch. Switching between
UTP and BNC is quite easy. (Just type 'ifconfig ep0 link1 -link2' or 'ifconifg
ep0 link2 -link1'.)
I have no AUI equipment, and what is worse, my 3C589B is now under
repair, so we need some other tests!
-nao
--- if_ep.c.orig Sat May 25 00:22:36 1996
+++ if_ep.c Fri Jun 14 16:23:40 1996
@@ -641,39 +641,40 @@
*
*/
+ /* Set the xcvr. */
if(ifp->if_flags & IFF_LINK0 && sc->ep_connectors & AUI) {
- /* nothing */
+ i = ACF_CONNECTOR_AUI;
} else if(ifp->if_flags & IFF_LINK1 && sc->ep_connectors & BNC) {
- outw(BASE + EP_COMMAND, START_TRANSCEIVER);
- DELAY(1000);
+ i = ACF_CONNECTOR_BNC;
} else if(ifp->if_flags & IFF_LINK2 && sc->ep_connectors & UTP) {
- GO_WINDOW(4);
- outw(BASE + EP_W4_MEDIA_TYPE, ENABLE_UTP);
- GO_WINDOW(1);
+ i = ACF_CONNECTOR_UTP;
} else {
- GO_WINDOW(1);
- switch(sc->ep_connector) {
- case ACF_CONNECTOR_UTP:
- if(sc->ep_connectors & UTP) {
- GO_WINDOW(4);
- outw(BASE + EP_W4_MEDIA_TYPE, ENABLE_UTP);
- GO_WINDOW(1);
- }
- break;
- case ACF_CONNECTOR_BNC:
- if(sc->ep_connectors & BNC) {
- outw(BASE + EP_COMMAND, START_TRANSCEIVER);
- DELAY(1000);
- }
- break;
- case ACF_CONNECTOR_AUI:
- /* nothing to do */
- break;
- default:
- printf("ep%d: strange connector type in EEPROM: assuming AUI\n",
- sc->unit);
- break;
+ i = sc->ep_connector;
+ }
+ GO_WINDOW(0);
+ j = inw(BASE + EP_W0_ADDRESS_CFG) & 0x3fff;
+ outw(BASE + EP_W0_ADDRESS_CFG, j | (i << ACF_CONNECTOR_BITS));
+
+ switch(i) {
+ case ACF_CONNECTOR_UTP:
+ if(sc->ep_connectors & UTP) {
+ GO_WINDOW(4);
+ outw(BASE + EP_W4_MEDIA_TYPE, ENABLE_UTP);
+ }
+ break;
+ case ACF_CONNECTOR_BNC:
+ if(sc->ep_connectors & BNC) {
+ outw(BASE + EP_COMMAND, START_TRANSCEIVER);
+ DELAY(1000);
}
+ break;
+ case ACF_CONNECTOR_AUI:
+ /* nothing to do */
+ break;
+ default:
+ printf("ep%d: strange connector type in EEPROM: assuming AUI\n",
+ sc->unit);
+ break;
}
outw(BASE + EP_COMMAND, RX_ENABLE);
@@ -718,6 +719,7 @@
sc->next_mb = 0;
epmbuffill((caddr_t) sc, 0);
+ GO_WINDOW(1);
epstart(ifp);
splx(s);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606140751.QAA09655>
