Subject: re: 3Com 3c59x woes...
To: None <port-i386@NetBSD.ORG>
From: Rafal Boni <rafal@scofflaw.coordinate.com>
List: port-i386
Date: 10/10/1996 06:40:05
Here's some stuff I found on people's problems with 3com 3c59x cards
in Plan 9.  This seems pretty close to what BSDi's patch did too...

--rafal

-----An unknown source (because my newsreader sucks) said... ---

You're right and I'd forgotten about that fix in the current driver
we have, the 590 and 595 (and the eisa variants whose numbers I've
forgotten) require the thresholds to be in longwords.

You can decide whether the shift is necessary at the end of the reset
routine by either just requiring it if a pci card is detected or by the
following, courtesy of Tom Killian (tom@research.att.com)

	COMMAND(port, SetTxAvailable, 1800);
	COMMAND(port, SelectWindow, 5);
	i = ins(port+0x02);
	COMMAND(port, SelectWindow, 1);
	switch(i){
	case 1800:
		ctlr->card.txashift = 0;
		break;
	case 7200:
		ctlr->card.txashift = 1;
		print("ether509: SetTxAvailable shifted\n");
		break;
	default:
		panic("ether509: SetTxAvailable %d", i);
		break;
	}

along with adding an element to the Card structure in ether.h

	uchar	txashift;

and using the variable when setting the threshold in the transmit routine

				if(ctlr->card.txashift)
					COMMAND(port, SetTxAvailable, len/4);
				else
					COMMAND(port, SetTxAvailable, len);

------ forwarded message follows ------

>From cse.psu.edu!owner-9fans Mon Oct  7 09:22:31 EDT 1996
From: hamnavoe.demon.co.uk!miller
Message-Id: <199610071258.IAA15081@cse.psu.edu>
To: cse.psu.edu!9fans
Date: Mon, 7 Oct 1996 13:52:26 GMT
Subject: Re: Installing & IP
Reply-To: cse.psu.edu!9fans

Jim McKie says:

> ... the 3C590 is a 10Mbps card only and should work

I found problems with the 3C590: particularly under the IL protocol,
transmission was very slow and often hung up completely.  Some
investigation showed that the TxAvailable interrupt (which signals
that the adapter's transmit FIFO has space for the next packet) wasn't
being received.  (Presumably only the IL protocol is efficient enough
to overrun the adapter's transmission speed and allow the FIFO to
fill up ...)

I believe the problem is that the TxAvailable threshold needs to be
set in units of longwords rather than bytes (could someone with
access to hardware documentation for the 3C590 please confirm this?).
If this is right, in ether509.c the line

	COMMAND(port, SetTxAvailable, len);

ought to be

	COMMAND(port, SetTxAvailable, len>>2);

After this change on my system, TxAvailable interrupts occur as 
expected and IL transmission runs without a problem.

-- Richard Miller

-- 
Rafal Boni                                        rafal@scofflaw.coordinate.com
Software Engineer                                                Coordinate.com
(All opinions are my own)                     51 Sawyer Road, Waltham, MA 02154