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

Jeff Garzik jgarzik@mandrakesoft.com
Wed Apr 12 19:00:13 2000


Christopher Smith wrote:
> 
> 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. ;-)

Take a look at 2.3.99-pre6-pre1 (found in /pub/linux/kernel/testing/). 
If you look at "pre6-1.bz2", the patch against 2.3.99-pre5 release, it
should contain the various bits of CSR6 spelled out, for the 21143 chip.

I am all for getting rid of magic numbers in the code.  Doing so has
helped me spot bugs in existing drivers on more than one occasion. 
(including a specific 21041 case where I was told "getting rid of magic
numbers doesn't help" ;-);-))


> Please find the patch attached below.

Cool, thanks.


> 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. ;-).

Patches to fix this are welcome too.  Generally this involves reading
value(s) from EEPROM and then communicating them to the chip.  Since the
method to do this often varies across chips, chip revisions, and boards,
it is not uncommon for the LEDs to be setup incorrectly.

Regards,

	Jeff




-- 
Jeff Garzik              | Nothing cures insomnia like the
Building 1024            | realization that it's time to get up.
MandrakeSoft, Inc.       |        -- random fortune
-------------------------------------------------------------------
To unsubscribe send a message body containing "unsubscribe"
to linux-tulip-request@beowulf.org