Date: Wed, 24 Jul 1996 14:54:02 +0900 (JST) From: HAMADA Naoki <nao@sbl.cl.nec.co.jp> To: FreeBSD-hackers@freebsd.org Subject: ep bug fix Message-ID: <199607240554.OAA24904@sirius.sbl.cl.nec.co.jp>
next in thread | raw e-mail | index | archive | help
Hi. I fixed two bugs of the ep driver. First, the transmit complete interrupt enabling patch which appeared in revision 1.50 makes the ep driver out of order, so I got rid of it. Second, when the adapter uses IRQ 9, the ep driver set the IRQ register of the adapter to IRQ 2. This disables the interrupt generation. From "Ethelink III Parallel Tasking ISA, EISA, Micro Channel, and PCMCIA Adapter Drivers Technical Reference": IRQ: Interrupt Request select (values given in decimal) {3,5,7,9,10,11,12,15} = Enable corresponding IRQ line driver. {0,1,2,4,6,8,13,14} = Disable all IRQ line drivers. I made the ep driver sets the correct IRQ number. Third, not a bug fix. The problem with 'AUTO SELECT' feature is quite frequently asked me, so I made the driver to warn when it finds the 'AUTO SELECT' bit of 3C509B and 3C589[BC] is set. With the following patch, my 3C509B ISA adapter and my 3C589C PCMCIA adapter works greatly. -nao --- if_ep.c- Wed Jul 24 11:26:52 1996 +++ if_ep.c Wed Jul 24 13:23:54 1996 @@ -274,6 +274,7 @@ struct isa_device *is = &dp->isahd; struct ep_softc *sc = ep_softc[is->id_unit]; u_short config; + int acf; sc->ep_connectors = 0; config = inw(IS_BASE + EP_W0_CONFIG_CTRL); @@ -285,7 +286,12 @@ } if (!(sc->ep_connectors & 7)) printf("no connectors!"); - sc->ep_connector = inw(BASE + EP_W0_ADDRESS_CFG) >> ACF_CONNECTOR_BITS; + acf = inw(BASE + EP_W0_ADDRESS_CFG); + if (acf & ACF_AUTO_SELECT) { + printf("ep%d: WARNING: This driver is not capable of AUTO SELECT.\n", + is->id_unit); + } + sc->ep_connector = acf >> ACF_CONNECTOR_BITS; /* ROM size = 0, ROM base = 0 */ /* For now, ignore AUTO SELECT feature of 3C589B and later. */ @@ -598,6 +604,7 @@ struct ep_softc *sc = ep_softc[is->id_unit]; u_short config; int irq; + int acf; sc->ep_connectors = 0; config = inw(IS_BASE + EP_W0_CONFIG_CTRL); @@ -612,7 +619,12 @@ } if (!(sc->ep_connectors & 7)) printf("no connectors!"); - sc->ep_connector = inw(BASE + EP_W0_ADDRESS_CFG) >> ACF_CONNECTOR_BITS; + acf = inw(BASE + EP_W0_ADDRESS_CFG); + if (acf & ACF_AUTO_SELECT) { + printf("ep%d: WARNING: This driver is not capable of auto select.\n", + is->id_unit); + } + sc->ep_connector = acf >> ACF_CONNECTOR_BITS; /* * Write IRQ value to board */ @@ -624,8 +636,8 @@ } GO_WINDOW(0); - if(irq == 9) - irq = 2; + if(irq == 2) + irq = 9; SET_IRQ(BASE, irq); ep_attach(sc); @@ -964,7 +976,7 @@ } IF_DEQUEUE(&ifp->if_snd, m); - outw(BASE + EP_W1_TX_PIO_WR_1, len | 0x8000); /* XXX */ + outw(BASE + EP_W1_TX_PIO_WR_1, len); outw(BASE + EP_W1_TX_PIO_WR_1, 0x0); /* Second dword meaningless */ /* compute the Tx start threshold for this packet */ --- if_epreg.h- Wed Jul 24 11:27:23 1996 +++ if_epreg.h Wed Jul 24 11:32:24 1996 @@ -364,6 +364,7 @@ #define ACF_CONNECTOR_UTP 0 #define ACF_CONNECTOR_AUI 1 #define ACF_CONNECTOR_BNC 3 +#define ACF_AUTO_SELECT 0x0080 /* Resource configuration register. * Window 0/Port 08
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607240554.OAA24904>