[vortex] [CFT] 3c59x.c for 2.2.18-pre

Andrew Morton andrewm@uow.edu.au
Sat, 21 Oct 2000 19:19:07 +1100


Koos van den Hout wrote:
> 
> Quoting Andrew Morton who wrote on Fri, Oct 20, 2000 at 12:48:00AM +1100:
> 
> > could you please test a proposed update of the 2.2.18 kernel's
> > 3c59x.c driver?
> >
> > It is at http://www.uow.edu.au/~andrewm/linux/3c59x-2.2.18-pre16-1.gz .
> > You don't need to upgrade your 2.2 kernel to test this - it should
> > just drop into 2.2.anything.
> 
> Ok, since I had some troubles before, I torture tested it, and it failed.
> So now you are going to be very intested in 'how' :)
> 
> - The situation: Transfer a *laaaarge* file from a Sparc20 with a hme0
>   (100 mbit) card to a Linux machine with a 3c595, storing it in
>   /dev/null.
> 
> - First of all, my switch at home (a 'lantech mini-switch') does not
>   recognize full duplex on the 3com cards. So I let them at half-duplex in
>   order to avoid frame errors. When I force the card into full-duplex the
>   switch still sees this as half-duplex. The switch does recognize the
>   full duplex on the Sun hme card without any forcing, they just
>   autonegotiate it.

Does the interface function reliably when the duplex is not forced?

> - The ftp transfer above hangs the 3c595 completely. I get the following
>   messages:
> 
> 3c59x.c 19Oct00 Donald Becker and others
> http://www.scyld.com/network/vortex.html
> eth0: 3Com 3c595 Vortex 100baseTx at 0xd000,  00:a0:24:0b:2e:41, IRQ 5
                          ^^^^^^^^^

hmm.. There seems to be a disagreement between the drivers and
`vortex-diag' about the human-readable name of this device.  Could you
please confirm that this is in fact a 10/100 NIC?

>   64K word-wide RAM 3:1 Rx:Tx split, autoselect/10baseT interface.
    ^^^

This report is bogus but harmless.  I've been meaning to fix that :)

> eth0: Transmit error, Tx status register 90.

I have a feeling that this is the second recent report of this.  It
indicates that the bus mastering couldn't get data from your host
quickly enough.  Is there anything else going on on the machine at the
time?  Like high-bandwidth video display output?

I'll dig out my 3c590, see if I can reproduce this, but I probably
can't.

> eth0: Transmit error, Tx status register 90.
> eth0: Transmit error, Tx status register 90.
> eth0: Transmit error, Tx status register 90.
> eth0: Transmit error, Tx status register c0.
> eth0: Transmit error, Tx status register c0.
> eth0: Transmit error, Tx status register 90.
> 
> (with nfs messages in between, but that's another list)
> 
> Info on the card:
> 
> vortex-diag.c:v1.09 7/28/99 Donald Becker (becker@cesdis.gsfc.nasa.gov)
> Index #1: Found a 3Com 3c595 Vortex 10/100baseTx adapter at 0xd000.
> The Vortex chip may be active, so FIFO registers will not be read.
> To see all register values use the '-f' flag.
> Initial window 7, registers values by window:
>   Window 0: 0000 0000 0000 0000 0000 00bf 0000 0000.
>   Window 1: FIFO FIFO 0000 2000 8000 00ff 3ffc 2000.
>   Window 2: a000 0b24 412e 0000 0000 0000 00de 4000.
>   Window 3: 001b 0141 0000 0000 e10a bfff 3fff 6000.
>   Window 4: 0000 02d6 0000 0c80 0000 8882 0000 8000.
>   Window 5: 1ffc 1ffc 00de 1ffc 0005 02de 00de a000.
              ^^^^

This value says that the NIC should not start transitting a frame until
it is _all_ contained within the onboard FIFO, which makes the reported
underruns very wierd.

You could try this patch, but it's a stab in the dark...

Index: drivers/net/3c59x.c
===================================================================
RCS file: /opt/cvs/lk2.2/drivers/net/3c59x.c,v
retrieving revision 1.11
diff -u -r1.11 3c59x.c
--- drivers/net/3c59x.c	2000/10/19 12:24:22	1.11
+++ drivers/net/3c59x.c	2000/10/21 08:18:05
@@ -1205,6 +1205,7 @@
 			vp->tx_skbuff[i] = 0;
 		outl(0, ioaddr + DownListPtr);
 	}
+	outw(SetTxStart|(1600<<2), ioaddr + EL3_CMD);
 	/* Set reciever mode: presumably accept b-case and phys addr only. */
 	set_rx_mode(dev);
 	outw(StatsEnable, ioaddr + EL3_CMD); /* Turn on statistics. */