Subject: Re: 3c900/3c590 PCI ethernet card
To: Theo de Raadt <deraadt@theos.com>
From: Andrew Y Ng <ayn@ngbert.res.cmu.edu>
List: port-i386
Date: 10/01/1996 22:10:21
Just patched the stuff u gave me the other day, it works!  At least 
it got improved...

I installed the patch, recompiled my kernel, and now I'm able to send out 
big packets.  Tho it freezed when I telneted onto gold.tc.umn.edu and tried to
get a 16MB file from Ngbert.  Normal transfers r ok, like http and stuff.

I have to c if my network can keep running for tomorrow or something...
I had to reboot my machine six times today due to the former problem.

I hope I don't need to reboot it anymore tomorrow.  If it goes well, I will
write u a mail telling u how to patch the stuff.  or u could consult
the patch manpage.

thx!

/ayn

On Sun, 29 Sep 1996, Theo de Raadt wrote:

> can you try this?
> i've read the FreeBSD sources, and I have no idea how they fixed the
> problem -- it makes *no sense*...
> 
> 
> Index: elink3.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/elink3.c,v
> retrieving revision 1.11
> diff -u -r1.11 elink3..c
> --- elink3.c	1996/09/28 10:16:20	1.11
> +++ elink3.c	1996/09/29 11:29:39
> @@ -299,6 +299,7 @@
>  	bus_io_handle_t ioh = sc->sc_ioh;
>  	struct mbuf *m, *m0;
>  	int sh, len, pad;
> +	u_int16_t finishirq = 0;
>  
>  	/* Don't transmit if interface is busy or not running */
>  	if ((ifp->if_flags & (IFF_RUNNING|IFF_OACTIVE)) != IFF_RUNNING)
> @@ -334,6 +335,7 @@
>  		bus_io_write_2(bc, ioh, EP_COMMAND,
>  		    SET_TX_AVAIL_THRESH | (len + pad + 4));
>  		/* not enough room in FIFO */
> +		finishirq = WRTX_FINISHIRQ;
>  		ifp->if_flags |= IFF_OACTIVE;
>  		return;
>  	} else {
> @@ -359,7 +361,7 @@
>  	 */
>  	sh = splhigh();
>  
> -	bus_io_write_2(bc, ioh, EP_W1_TX_PIO_WR_1, len);
> +	bus_io_write_2(bc, ioh, EP_W1_TX_PIO_WR_1, len | finishirq);
>  	bus_io_write_2(bc, ioh, EP_W1_TX_PIO_WR_1,
>  	    0xffff);	/* Second dword meaningless */
>  	if (EP_IS_BUS_32(sc->bustype)) {
> Index: elink3reg.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/elink3reg.h,v
> retrieving revision 1.3
> diff -u -r1.3 elink3reg.h
> --- elink3reg.h	1996/05/26 00:26:59	1.3
> +++ elink3reg.h	1996/08/29 10:11:49
> @@ -248,6 +248,16 @@
>  #define ERR_DRIBBLE	(u_short) (0x1000)
>  
>  /*
> + * Data Write Port
> + *   Window 1/Port 0x00
> + *
> + *   Various things go in here. First write of a sequence is a length,
> + *   and the high bit can be set to indicate a end-of-transfer
> + *   interrupt
> + */
> +#define WRTX_FINISHIRQ	0x8000
> +
> +/*
>   * TX Status
>   *
>   *   Reports the transmit status of a completed transmission. Writing this
> 

--
Andrew Y Ng <ayn@CMU.EDU> http://Ngbert.res.cmu.edu/~ayn/
Carnegie Mellon University; ECE major, Music minor
campus ph: 412/862-2836;  voice mail: 412/268-6700 x30027
talk: finger ayn@Ngbert.res.cmu.edu for online status.
finger ayn@CMU.EDU for more info,
        such as my public key, geekcode, snail address, etc.