[tulip-bug] Capture Effect - a value-added feature and options=14

Junjiro Okajima j-okajim@nskli014.nsk.nis.nec.co.jp
Sun, 01 Oct 2000 01:56:15 +0900


Hello, all.
I am not a member of this ML. Please CC: to me when you reply.

I hava tulip 21143-TD and it works fine with driver 0.91g when it is
auto-negotiated as 100M, full-duplex. But when it is linked to another
hub, the autonegotiation will be half-duplex. It seems that is a
matter of negotiaton to that hub. So I decided to add a module option,
options=14 which means 100M and full-duplex.

After loading tulip module and starting network, of course tulip is
running, but the speed is very slow. I checked with ftp'ing 16M bytes
file and the result is here.

>From tulip	200 - 300 Kbytes/s
To tulip	5 - 10    Mbytes/s

Next, I checked with tcpdump and found the time between the packets
are long. It was 0.4 - 1.0 second.

I got the manual of tulip from web.intel and there was the description
about "Capture Effect - a value-added feature" on the section 6-20.
I checked the register csr6 with tulip-diag tool and it shows me this
feature is off.
I think the tulip driver 0.91g should use this feature if the
"options=" is set. So here is my patch.

And I want you to tell me,
- Is that a problem that the driver not to use "Capture Effect - a
  value-added feature"?
- Is my patch effective and used as generic? Or only my environment?


Thanks in advance.
Junjiro Okajima


Index: tulip.c
===================================================================
RCS file: linux-2.2/drivers/net/tulip.c,v
retrieving revision 10.2
diff -u -r10.2 tulip.c
--- tulip.c	2000/01/07 06:11:45	10.2
+++ tulip.c	2000/09/30 16:31:29
@@ -1548,12 +1548,22 @@
 		tp->csr6 = 0x01880200;
 		outl(0x0f370000 | inw(ioaddr + 0x80), ioaddr + 0x80);
 		outl(0x11000 | inw(ioaddr + 0xa0), ioaddr + 0xa0);
-	} else if (tp->chip_id == DC21143  &&
-			   media_cap[dev->if_port] & MediaIsMII) {
-		/* We must reset the media CSRs when we force-select MII mode. */
-		outl(0x0000, ioaddr + CSR13);
-		outl(0x0000, ioaddr + CSR14);
-		outl(0x0008, ioaddr + CSR15);
+	} else if (tp->chip_id == DC21143) {
+		/*
+		 * why DC21143 is equiv. to DC21142?
+		 * only options is specified, reaching here.
+		 */
+		/* capture effect - a value-added feature is on */
+		outl(0x82020000, ioaddr + CSR6);
+		tp->csr6 = 0x820E0000;
+		if (media_cap[dev->if_port] & (MediaIsFD|MediaAlwaysFD))
+			tp->csr6 |= 0x0200;
+		if (media_cap[dev->if_port] & MediaIsMII) {
+			/* We must reset the media CSRs when we force-select MII mode. */
+			outl(0x0000, ioaddr + CSR13);
+			outl(0x0000, ioaddr + CSR14);
+			outl(0x0008, ioaddr + CSR15);
+		}
 	} else if (tp->chip_id == COMET) {
 		dev->if_port = 0;
 		tp->csr6 = 0x00040000;