2001-10-07 18:02:11

by Martin Frey

[permalink] [raw]
Subject: Fix for drivers/net/natsemi.c on 64 bit platforms

Hi,

the natsemi.c Ethernet driver cuts the upper bits of
the address when accessing the EEPROM. Changing "int ee_addr"
to "long ee_addr" in eeprom_read() fixes the problem for me on Alpha.
The Bug is in the 2.2.x driver from Donald as
well as in the 2.4.x driver. I tested the patch
only on 2.4.x however, since it is actually trivial, I guess
it will also work for Donalds version.

Here is the patch for 2.4.10:
--- linux-2.4.10/drivers/net/natsemi.c Tue Aug 14 13:14:12 2001
+++ linux-2.4.10.digitalpw/drivers/net/natsemi.c Fri Oct 5 13:25:59 2001
@@ -633,7 +633,7 @@
{
int i;
int retval = 0;
- int ee_addr = addr + EECtrl;
+ long ee_addr = addr + EECtrl;
int read_cmd = location | EE_ReadCmd;
writel(EE_Write0, ee_addr);

and here for the driver on the Scyld page:
--- natsemi.c.orig Sun Oct 7 13:49:03 2001
+++ natsemi.c Sun Oct 7 13:49:16 2001
@@ -499,7 +499,7 @@
{
int i;
int retval = 0;
- int ee_addr = addr + EECtrl;
+ long ee_addr = addr + EECtrl;
int read_cmd = location | EE_ReadCmd;
writel(EE_Write0, ee_addr);

Regards, Martin

--
Supercomputing Systems AG email: [email protected]
Martin Frey web: http://www.scs.ch/~frey/
at Compaq Computer Corporation phone: +1 603 884 4266
ZKO2-3R75, 110 Spit Brook Road, Nashua, NH 03062


2001-10-07 18:09:11

by Jeff Garzik

[permalink] [raw]
Subject: Re: Fix for drivers/net/natsemi.c on 64 bit platforms

Thanks, modified slightly and applied to at1700.c, natsemi.c, and
winbond-840.c. Patches to Alan and Linus will be sent shortly...

Jeff