[257] in linux-net channel archive

home help back first fref pref prev next nref lref last post

NE2000 fixes --- 1.2.7 (#3B)

daemon@ATHENA.MIT.EDU (Paul Gortmaker)
Sun Apr 30 02:38:14 1995

From: Paul Gortmaker <paul@rasty.anu.edu.au>
To: linux-net@vger.rutgers.edu
Date: Sun, 30 Apr 1995 15:58:31 +1000 (EST)

	This is just a minor nit, and it probably won't make a difference
to anybody except people running 8 bit ne1000 cards in a 386sx-12  :-)

In #3A (now 1.2.7) we are timing the PIO + (wait for ack from card)
with the dma_start/NE_RDC_TIMEOUT combo. This means using a long
(3 jiffies) timeout value to keep the slow boxes happy. However
a 1 jiffy timeout is more than enough for a 16 bit card in a 486.

Here is a one-liner that is a better fix than just increasing the
value of NE_RDC_TIMEOUT to 0x03. Just move the assignment of dma_start
to *after* the PIO, and then it won't make a difference if we are
doing slower outsb on a ne1k vs. faster outsw on a ne2k. We are
then only timing how long before the card "ack"s instead of timing
(PIO + wait for ack) which makes much more sense.

This should allow you to run NE_RDC_TIMEOUT at 0x01 on an old ne1000.
Apply to stock 1.2.7

Paul.

--- ne.c.old	Sun Apr 30 14:20:19 1995
+++ ne.c	Sun Apr 30 14:21:01 1995
@@ -86,7 +86,7 @@
 #define NESM_START_PG	0x40	/* First page of TX buffer */
 #define NESM_STOP_PG	0x80	/* Last page +1 of RX ring */
 
-#define NE_RDC_TIMEOUT	0x03	/* Max wait in jiffies for Tx RDC */
+#define NE_RDC_TIMEOUT	0x01	/* Max wait in jiffies for Tx RDC */
 
 int ne_probe(struct device *dev);
 static int ne_probe1(struct device *dev, int ioaddr);
@@ -462,7 +462,6 @@
     SLOW_DOWN_IO;
 #endif  /* rw_bugfix */
 
-    dma_start = jiffies;
     outb_p(ENISR_RDC, nic_base + EN0_ISR);
 
    /* Now the normal output. */
@@ -478,6 +477,8 @@
 	outsb(NE_BASE + NE_DATAPORT, buf, count);
     }
 
+    dma_start = jiffies;
+
 #ifdef CONFIG_NE_SANITY
     /* This was for the ALPHA version only, but enough people have
        been encountering problems so it is still here. */

home help back first fref pref prev next nref lref last post