Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: ggw@cds.duke.edu (Gregory G. Woodbury)
To: axp-list@redhat.com
Subject: Re: Tulip driver fix?!?! - patch here
Date: Wed, 24 Jun 1998 23:59:53 -0400 (EDT)	[thread overview]
Message-ID: <m0yp3CT-000A0YC@dukcds.cds.duke.edu> (raw)

I got the 2.0.34 patches from gatekeeper.dec.com and applied them to my
pristine 2.0.34 tree.  This solved quite a few problems on my LX164 with
an NCR53c8xx and a "tulip" ethercard.

I didn't try the "other" dec driver, but found that there were a few
problems with the patches that the gatekeeper patch makes in the tulip.c
driver.

Specifically, the patched driver presumes the "new" PCI interface and
tries to deal with versions of the kernel < 2.1.85 (and .57) in an intelligent
manner.  The only problem is that there are a few additional places
that needed to be handled specially when using the "old" interface
for "older" kernels.

I poked around a bit, and made the following patches (unified diff)
to make the tulip driver work for me. 

Additionally, I'm using the ncr53c8xx.c driver, but can't use any of the
"new" options (yet.)

-------------------------
--- tulip.c.bak	Wed Jun 24 17:19:22 1998
+++ tulip.c	Wed Jun 24 22:13:52 1998
@@ -455,7 +455,11 @@
 	   well with the current structure.  So instead we detect just the
 	   Tulip cards in slot order. */
 
-	if (pci_present()) {
+#if LINUX_VERSION_CODE < 0x20155
+	if (pcibios_present()) {
+#else
+	if ( pci_present()) {
+#endif
 		unsigned char pci_bus, pci_device_fn;
 
 		for (;pci_index < 0xff; pci_index++) {
@@ -1816,7 +1820,11 @@
 	if (entry == TX_RING_SIZE-1)
 		flag |= 0xe2000000;
 
+#if LINUX_VERSION_CODE > 0x20139
 	tp->stats.tx_bytes += skb->len;
+#else
+	tp->stats.tx_packets++;
+#endif
 	tp->tx_ring[entry].length = skb->len | flag;
 	tp->tx_ring[entry].status = 0x80000000;	/* Pass ownership to the chip. */
 	tp->cur_tx++;
@@ -1912,7 +1920,11 @@
 				}
 
 				/* Free the original skb. */
+#if LINUX_VERSION_CODE > 0x20139
 				dev_kfree_skb(lp->tx_skbuff[entry]);
+#else
+				dev_kfree_skb(lp->tx_skbuff[entry],FREE_WRITE);
+#endif
 				lp->tx_skbuff[entry] = 0;
 			}
 
@@ -2260,7 +2272,11 @@
 #endif
 			lp->stats.rx_packets++;
 #ifndef ORIGINAL_TEXT
+#if LINUX_VERSION_CODE > 0x20139
 			lp->stats.rx_bytes += pkt_len;
+#else
+			lp->stats.rx_packets++;
+#endif
 #endif
 		}
 
@@ -2325,13 +2341,19 @@
 		if (skb) {
 #if LINUX_VERSION_CODE < 0x20139
 			skb->free = 1;
-#endif
+			dev_kfree_skb(skb,FREE_WRITE);
+#else
 			dev_kfree_skb(skb);
+#endif
 		}
 	}
 	for (i = 0; i < TX_RING_SIZE; i++) {
 		if (tp->tx_skbuff[i])
+#if LINUX_VERSION_CODE > 0x20139
 			dev_kfree_skb(tp->tx_skbuff[i]);
+#else
+			dev_kfree_skb(tp->tx_skbuff[i],FREE_WRITE);
+#endif
 		tp->tx_skbuff[i] = 0;
 	}
 
-----
Gregory G. "Wolfe" Woodbury       At, but NOT speaking for . . Duke University
System Programmer, Center for Demographic Studies, Box 90408   +1 919 684 6126
Durham NC 27708-0408                     [Home email: ggw@wolves.durham.nc.us]
ObQuote: "The LineEater is a boojum snar..."  -Greg Woodbury


             reply	other threads:[~1998-06-25  3:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-25  3:59 Gregory G. Woodbury [this message]
1998-06-29  3:19 ` Tulip driver fix?!?! - patch here jrp
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox