Ok, I fixed my own problem. Please test it.
Christopher Smith
x@xman.org
Wed Apr 12 00:27:13 2000
Well, my ongoing saga with my Linksys card is now over, at least for
the 2.2.x kernel. Please find attached my patch to the v0.91g-ppc
which has allowed my card to function properly while hooked up to a
10/100 switch.
I am posting this in the hopes that people who actually understand the
tulip chipsets can perhaps apply a correct patch. Lord knows this
patch probably messes up other Lite-On PNIC2 based cards. :-(
FYI, I am not a kernel or network driver hacker, nor do I play one on
TV. I arrived at this patch after a certain degree of frustration
caused me to actually go through the tulip.c provided by Linksys
vs. the current kernel driver. Since I had no knowledge of the current
driver, and since the Linksys driver is based on a different version,
I was limited in my development methods. I essentially looked for
areas where it looked like the Linksys driver was really doing
something different, as opposed to mere structural changes in the
driver. After making a variety of mods, I compiled the new driver,
until I got something which worked. I then removed mods until I had
something which, during my limited testing, seemed to work.
Some notes:
- The patch to the "Reset the xcvr interface and turn on
heartbeat" appears to be unnecessary. However, without this
modification, I tulip-diag shows the transmit unit to 128 instead of
"store-and-forward". Tulip-diag will also showed something different
from 10mbps-serial. I assumed that since the original Linksys driver
did not have this behavior, this was not a good thing, but it's quite
possible I'm wrong.
- It's quite possible additional mods are necessary. I noticed
the Linksys supplied driver uses the Macronix timer routine instead of
the 21142 timer routine. Given that the Lite-On is supposed to be a
lot like the Macronix, and that a lot of my other changes have been to
make the Lite-On chip use Macronix routines instead of standard 21142
routines, I would expect that this makes sense. My goal was as minimal
a set of changes as possible, so I'll let someone with more expertise
make that determination.
Just to repeat the warning: I have essentially tested this code for 5
minutes. So, there's no reason to believe it's a good patch. It's just
the first time I've been able to get the current 2.2.14 (actually
2.2.15pre17) version of the driver to work at all. So, I'm pretty
happy.
Please send any feedback. I hope this helps resolve whatever problem
exists with the Linksys card.
--Chris
P.S.: Here's the patch:
--- donald/tulip.c Tue Apr 11 21:03:51 2000
+++ tulip/tulip.c Tue Apr 11 21:07:17 2000
@@ -18,7 +18,7 @@
*/
#define SMP_CHECK
-static const char version[] = "tulip.c:v0.91g-ppc 7/16/99 becker@cesdis.gsfc.nasa.gov\n";
+static const char version[] = "tulip.c:v0.91g-ppc 7/16/99 becker@cesdis.gsfc.nasa.gov\nModified (ver.5) by Christopher Smith (x@xman.org) to work with Linksys LNE100TX\nPlease do not bug Donald about problems with this driver until you've tested with regular v0.91g-ppc\n";
/* A few user-configurable values. */
@@ -389,6 +389,7 @@
HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | MC_HASH_ONLY, tulip_timer },
{ "Lite-On PNIC-II", 256, 0x0801fbff,
HAS_MII | HAS_NWAY143 | HAS_8023X, t21142_timer },
+ // HAS_MII | HAS_NWAY143 | HAS_8023X, mxic_timer },
{ "ADMtek Comet", 256, 0x0001abef,
MC_HASH_ONLY, comet_timer },
{ "Compex 9881 PMAC", 128, 0x0001ebef,
@@ -949,7 +950,6 @@
outl(tp->mtable->csr12dir | 0x100, ioaddr + CSR12);
break;
case DC21142:
- case PNIC2:
if (tp->mii_cnt || media_cap[dev->if_port] & MediaIsMII) {
outl(0x82020000, ioaddr + CSR6);
outl(0x0000, ioaddr + CSR13);
@@ -973,7 +973,7 @@
outl(0x000711C0, ioaddr + CSR14); /* Turn on NWay. */
outl(0x00000001, ioaddr + CSR13);
break;
- case MX98715: case MX98725:
+ case MX98715: case MX98725: case PNIC2:
outl(0x01a80000, ioaddr + CSR6);
outl(0xFFFFFFFF, ioaddr + CSR14);
outl(0x00001000, ioaddr + CSR12);
@@ -1524,8 +1524,9 @@
outl(0x0000, ioaddr + CSR14);
} else
t21142_start_nway(dev);
- } else if (tp->chip_id == PNIC2) {
- t21142_start_nway(dev);
+ // Chris hack
+ // } else if (tp->chip_id == PNIC2) {
+ // t21142_start_nway(dev);
} else if (tp->chip_id == LC82C168 && ! tp->medialock) {
if (tp->mii_cnt) {
dev->if_port = 11;
@@ -1546,7 +1547,7 @@
dev->if_port = 0;
tp->csr6 = 0x01880000 | (tp->full_duplex ? 0x0200 : 0);
outl(0x0f370000 | inw(ioaddr + 0x80), ioaddr + 0x80);
- } else if (tp->chip_id == MX98715 || tp->chip_id == MX98725) {
+ } else if (tp->chip_id == MX98715 || tp->chip_id == MX98725 || tp->chip_id == PNIC2) {
/* Provided by BOLO, Macronix - 12/10/1998. */
dev->if_port = 0;
tp->csr6 = 0x01a80200;
-------------------------------------------------------------------
To unsubscribe send a message body containing "unsubscribe"
to linux-tulip-request@beowulf.org