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

From: Breno Leitao <[email-masked]>
Date: Thu, 24 Apr 2008 17:21:25 -0300

Mandeep,

Mandeep Singh Baines wrote:
> 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.

Well, IMHO the patch is correctly applied as I could see. I just got the 
David's tree and run a diff between the ethtool.c files (from David's 
tree and mine), and I get the following differences. Note that I just 
add a printk() there to "debug" what was going on.

static int ethtool_get_eeprom(struct net_device *dev, void __user *useraddr)
 {
        struct ethtool_eeprom eeprom;
-       const struct ethtool_ops *ops = dev->ethtool_ops;
+       struct ethtool_ops *ops = dev->ethtool_ops;
        void __user *userbuf = useraddr + sizeof(eeprom);
        u32 bytes_remaining;
        u8 *data;
        int ret = 0;

+       printk("<1> ethtool_get_eeprom()\n");
        if (!ops->get_eeprom || !ops->get_eeprom_len)
                return -EOPNOTSUPP;

@@ -330,12 +330,13 @@ static int ethtool_get_eeprom(struct net
 static int ethtool_set_eeprom(struct net_device *dev, void __user 
*useraddr)
 {
        struct ethtool_eeprom eeprom;
-       const struct ethtool_ops *ops = dev->ethtool_ops;
+       struct ethtool_ops *ops = dev->ethtool_ops;
        void __user *userbuf = useraddr + sizeof(eeprom);
        u32 bytes_remaining;
        u8 *data;
        int ret = 0;

+       printk("<1> ethtool_set_eeprom()\n");
        if (!ops->set_eeprom || !ops->get_eeprom_len)
                return -EOPNOTSUPP;

The patched ethtool.c is at  http://rafb.net/p/fWXNwk28.html and tg3.c 
is at http://rapidshare.com/files/110139941/tg3.c.html

--
Breno Leitão
[email-masked]