Subject: Re: [PATCH] [ETHTOOL]: Add support for large eeproms

From: Mandeep Singh Baines <[email-masked]>
Date: Thu, 24 Apr 2008 12:01:48 -0700

Hi Breno,

Comments are inline.

Breno Leitao ([email-masked]) wrote:
> I've just applied this patch, and I got something really strange now.  I 
> got the following message "Magic number 0x00000000 does not match 0x669955aa
> " when I try to dump the eeprom from my tg3 card (BCM5780S rev. 03). I 
> suppose that somehow it isn't getting the correct NIC magic number.
> 

You should not be getting this error when trying to dump an EEPROM.

The magic number is only checked when writing to an eeprom. The magic number
prevents accidental writes. The check is implemented inside the driver's
set_eeprom function. In this case, the function would be tg3_set_eeprom().

> Well, without the patch, I just got a "Cannnot allocate enough memory" 
> message when I rung the ethtool command, but if I pass the length 
> argument < 128k, then everything went ok.
> Now, with the patch applied, I can't even dump  even using the length 
> parameter, since I hit the same Magic number error.
> 
> Note that I didn't run the kernel from your tree, I just backport this 
> patch to my current kernel 2.6.16, and tried it over a ppc machine. I'll 
> run the kernel from your tree later and then post the result.
> 

I suspect you may have mis-applied the patch. The patch changes both
set_eeprom and get_eeprom. I think you may have modified get_eeprom to call
ops->set_eeprom instead of ops->get_eeprom. If not, please send me ethtool.c
and tg3.c and I can take a look.

Regards,
Mandeep