Patch to 2.3.99-pre5 kernel to get Linksys card working...

Christopher Smith x@xman.org
Wed Apr 12 16:36:47 2000


Ok. I've read over the LC82C115 docs enough that I actually have a
clue what's going on inside that chips (I don't pretend to understand
the 139 odd other tulip cards out there ;-). Consequently, I've been
able to trim down my patch a fair bit. Rather than post a patch to
2.2.14 which would be of limited interest, I've managed to get the
patch to work with the 2.3.99-pre5 kernel. The change is basically to
the bitfield sent to the CSR6 register. I haven't read any of the
other tulip docs yet, but looking at the LC82C115 docs what the
original driver was doing seems insane.

Anyway, the patch I've applied is not really applied in the right
place, but it does make it clear where the problem is. I can think of
about 10 different ways to do it better (there might be something said
for making a #define or a data field called CSR6_MASK), but I'll leave
that to the experts. ;-)

Please find the patch attached below.

--Chris

P.S.: This was my first foray into playing around with the kernel
drivers and with modules in general. The experience was
enlightening. :-) I actually added module options to my local version
of the kernel driver which let me toggle the settings for the card's
LED's (actually necessary to get them to do what they're LABELLED as
doing... sigh. ;-).

P.P.S.: Here's the patch:

--- linux/drivers/net/tulip/21142.c	Tue Mar 21 12:39:17 2000
+++ linux-works/drivers/net/tulip/21142.c	Wed Apr 12 13:19:20 2000
@@ -108,7 +108,10 @@
 			   dev->name, csr14);
 	outl(0x0001, ioaddr + CSR13);
 	outl(csr14, ioaddr + CSR14);
-	tp->csr6 = 0x82420000 | (tp->to_advertise & 0x0040 ? 0x0200 : 0);
+	if (tp->chip_id == PNIC2)
+	  tp->csr6 = 0x01a80000 | (tp->to_advertise & 0x0040 ? 0x0200 : 0);
+	else 
+	  tp->csr6 = 0x82420000 | (tp->to_advertise & 0x0040 ? 0x0200 : 0);
 	tulip_outl_CSR6(tp, tp->csr6);
 	if (tp->mtable  &&  tp->mtable->csr15dir) {
 		outl(tp->mtable->csr15dir, ioaddr + CSR15);

-------------------------------------------------------------------
To unsubscribe send a message body containing "unsubscribe"
to linux-tulip-request@beowulf.org