[realtek] rtl8139 - rtl8139_1.17 driver patch update

jhorton@equiinet.com jhorton@equiinet.com
Fri Mar 1 03:42:00 2002


This is a multi-part message in MIME format.
--------------689A9E7EB46D60A083673051
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,
I have found that oversized frames can also cause a lockup (as mentioned
in the code)
I have attached a patch with appears to solve this - any confirmations
as to whether this patch works would be very appreciated!
John

--------------689A9E7EB46D60A083673051
Content-Type: text/plain; charset=us-ascii;
 name="rtl8139.diff3"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="rtl8139.diff3"

--- rtl8139_v17.c	Wed Feb 27 09:59:33 2002
+++ rtl8139.c	Thu Feb 28 11:51:19 2002
@@ -734,7 +734,7 @@
 	outl(tp->rx_config, ioaddr + RxConfig);
 	/* Check this value: the documentation contradicts ifself.  Is the
 	   IFG correct with bit 28:27 zero, or with |0x03000000 ? */
-	outl((TX_DMA_BURST<<8), ioaddr + TxConfig);
+	outl((TX_DMA_BURST<<8)|0x03000000, ioaddr + TxConfig);
 
 	/* This is check_duplex() */
 	if (tp->phys[0] >= 0  ||  (tp->drv_flags & HAS_MII_XCVR)) {
@@ -1111,6 +1111,12 @@
 				printk(KERN_NOTICE"%s: Abnormal interrupt, status %8.8x.\n",
 					   dev->name, status);
 
+			if(status&RxUnderrun){ 
+				printk("resetting hardware %d\n",status);
+				rtl_hw_start(dev);
+				goto leave;
+			}
+
 			if (status == 0xffff)
 				break;
 			/* Update the error count. */
@@ -1167,6 +1173,7 @@
 		printk(KERN_DEBUG"%s: exiting interrupt, intr_status=%#4.4x.\n",
 			   dev->name, inw(ioaddr + IntrStatus));
 
+leave:
 #if defined(__i386__)  &&  LINUX_VERSION_CODE < 0x20123
 	clear_bit(0, (void*)&dev->interrupt);
 #endif
@@ -1221,6 +1228,8 @@
 				   This should never occur, which means that we are screwed
 				   when it does.
 				 */
+				printk("resetting hardware\n");
+                                rtl_hw_start(dev);		
 			}
 			tp->stats.rx_errors++;
 			if (rx_status & (RxBadSymbol|RxBadAlign))

--------------689A9E7EB46D60A083673051--