]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
e1000e: store EEPROM version number to prevent unnecessary NVM reads
authorBruce Allan <bruce.w.allan@intel.com>
Sat, 22 Nov 2008 01:00:22 +0000 (17:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 22 Nov 2008 01:00:22 +0000 (17:00 -0800)
Rather than reading the NVM to get the EEPROM version number everytime the
ethool get_drvinfo function is called, read it once during probe and save
it for future reference.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/e1000e/e1000.h
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/netdev.c

index c55fd6fdb91c16bcf0fba6049b1ef0d6ea3064ff..473c41479ece464c9bcffa540bc13552520548ee 100644 (file)
@@ -193,6 +193,7 @@ struct e1000_adapter {
        u16 mng_vlan_id;
        u16 link_speed;
        u16 link_duplex;
+       u16 eeprom_vers;
 
        spinlock_t tx_queue_lock; /* prevent concurrent tail updates */
 
index 875d769531fd510172ddbd25853ca7ca04813fce..840e8c4fb75386c6838a3571ec5dce1e46f81e73 100644 (file)
@@ -588,7 +588,6 @@ static void e1000_get_drvinfo(struct net_device *netdev,
 {
        struct e1000_adapter *adapter = netdev_priv(netdev);
        char firmware_version[32];
-       u16 eeprom_data;
 
        strncpy(drvinfo->driver,  e1000e_driver_name, 32);
        strncpy(drvinfo->version, e1000e_driver_version, 32);
@@ -597,11 +596,10 @@ static void e1000_get_drvinfo(struct net_device *netdev,
         * EEPROM image version # is reported as firmware version # for
         * PCI-E controllers
         */
-       e1000_read_nvm(&adapter->hw, 5, 1, &eeprom_data);
        sprintf(firmware_version, "%d.%d-%d",
-               (eeprom_data & 0xF000) >> 12,
-               (eeprom_data & 0x0FF0) >> 4,
-               eeprom_data & 0x000F);
+               (adapter->eeprom_vers & 0xF000) >> 12,
+               (adapter->eeprom_vers & 0x0FF0) >> 4,
+               (adapter->eeprom_vers & 0x000F));
 
        strncpy(drvinfo->fw_version, firmware_version, 32);
        strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
index f10252b055d42ed278d50489c3dddd0838ec9744..b3f0b4797016647e8b5983e2b58c324d5e46ffce 100644 (file)
@@ -5025,6 +5025,9 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        adapter->wol = adapter->eeprom_wol;
        device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
 
+       /* save off EEPROM version number */
+       e1000_read_nvm(&adapter->hw, 5, 1, &adapter->eeprom_vers);
+
        /* reset the hardware with the new settings */
        e1000e_reset(adapter);