Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: Tulip driver fix?!?! - patch here
@ 1998-06-25  3:59 Gregory G. Woodbury
  1998-06-29  3:19 ` jrp
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory G. Woodbury @ 1998-06-25  3:59 UTC (permalink / raw)
  To: axp-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Tulip driver fix?!?! - patch here
  1998-06-25  3:59 Tulip driver fix?!?! - patch here Gregory G. Woodbury
@ 1998-06-29  3:19 ` jrp
  0 siblings, 0 replies; 2+ messages in thread
From: jrp @ 1998-06-29  3:19 UTC (permalink / raw)
  To: axp-list

On 24 Jun, Gregory G. Woodbury wrote:
> 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.

[patches deleted]

I've been poking around the tulip driver myself for the past week, and
can confirm Gregory's observations.  What I also found was that the
0.89H version of the driver (which includes the patches for
old vs. new PCI interface) works reasonably well.

You can find it at http://cesdis.gsfc.nasa.gov/linux/drivers/tulip.c


-- 
Jim Paradis   jrp@jrp.tiac.net            "The early bird gets the worm.
http://www.tiac.net/users/jrp/index.html   If you want something else for
                                           breakfast, get up later."


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-06-29  3:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-06-25  3:59 Tulip driver fix?!?! - patch here Gregory G. Woodbury
1998-06-29  3:19 ` jrp

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