From owner-freebsd-current Fri Jun 14 00:52:06 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA15442 for current-outgoing; Fri, 14 Jun 1996 00:52:06 -0700 (PDT) Received: from research.gate.nec.co.jp (research.gate.nec.co.jp [202.32.8.49]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id AAA15407 for ; Fri, 14 Jun 1996 00:52:01 -0700 (PDT) Received: from sbl-gw.sbl.cl.nec.co.jp by research.gate.nec.co.jp (8.7.5+2.6Wbeta6/950912) with ESMTP id QAA08097; Fri, 14 Jun 1996 16:51:49 +0900 (JST) Received: from sirius.sbl.cl.nec.co.jp by sbl-gw.sbl.cl.nec.co.jp (8.7.5+2.6Wbeta6/3.3W6) with ESMTP id QAA17540; Fri, 14 Jun 1996 16:51:47 +0900 (JST) X-Authentication-Warning: sbl-gw.sbl.cl.nec.co.jp: Host nao@sirius [133.207.68.90] claimed to be sirius.sbl.cl.nec.co.jp Received: by sirius.sbl.cl.nec.co.jp (8.7.5+2.6Wbeta6/3.3W6) with UUCP id QAA09655; Fri, 14 Jun 1996 16:51:41 +0900 (JST) Date: Fri, 14 Jun 1996 16:51:41 +0900 (JST) From: Naoki Hamada Message-Id: <199606140751.QAA09655@sirius.sbl.cl.nec.co.jp> References: <199606101905.NAA09662@rocky.sri.MT.net> To: nate@sri.MT.net CC: current@FreeBSD.ORG In-reply-to: Nate Williams's message of "Mon, 10 Jun 1996 13:05:22 -0600" <199606101905.NAA09662@rocky.sri.MT.net> Subject: Re: Attention 3C5X9 owners Sender: owner-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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);