ixgbe: change the eeprom version reported by ethtool
authorEmil Tantilov <emil.s.tantilov@intel.com>
Thu, 29 Sep 2011 05:01:29 +0000 (05:01 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 18 Oct 2011 00:04:30 +0000 (17:04 -0700)
Use 32bit value starting at offset 0x2d for displaying the firmware
version in ethtool. This should work for all current ixgbe HW

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe.h
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 6c4d693be08d42078ab31790324aff679c9c99d9..a8368d5cf6866aa061bc21a180f86d45894e86f3 100644 (file)
@@ -497,7 +497,8 @@ struct ixgbe_adapter {
        u64 rsc_total_count;
        u64 rsc_total_flush;
        u32 wol;
-       u16 eeprom_version;
+       u16 eeprom_verh;
+       u16 eeprom_verl;
        u16 eeprom_cap;
 
        int node;
index 7acfce317f4e670398eee180215dba3c29c36c09..70d58c3849b0592fa767319a0f14c5551330f15a 100644 (file)
@@ -889,21 +889,22 @@ static void ixgbe_get_drvinfo(struct net_device *netdev,
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
        char firmware_version[32];
+       u32 nvm_track_id;
 
        strncpy(drvinfo->driver, ixgbe_driver_name,
                sizeof(drvinfo->driver) - 1);
        strncpy(drvinfo->version, ixgbe_driver_version,
                sizeof(drvinfo->version) - 1);
 
-       snprintf(firmware_version, sizeof(firmware_version), "%d.%d-%d",
-                (adapter->eeprom_version & 0xF000) >> 12,
-                (adapter->eeprom_version & 0x0FF0) >> 4,
-                adapter->eeprom_version & 0x000F);
+       nvm_track_id = (adapter->eeprom_verh << 16) |
+                       adapter->eeprom_verl;
+       snprintf(firmware_version, sizeof(firmware_version), "0x%08x",
+                nvm_track_id);
 
        strncpy(drvinfo->fw_version, firmware_version,
-               sizeof(drvinfo->fw_version));
+               sizeof(drvinfo->fw_version) - 1);
        strncpy(drvinfo->bus_info, pci_name(adapter->pdev),
-               sizeof(drvinfo->bus_info));
+               sizeof(drvinfo->bus_info) - 1);
        drvinfo->n_stats = IXGBE_STATS_LEN;
        drvinfo->testinfo_len = IXGBE_TEST_LEN;
        drvinfo->regdump_len = ixgbe_get_regs_len(netdev);
index fb7d8842a36267f4c7f3dd377eee7c1f11f83351..8075d11b4cdeeb81d68148981133a0c3bb50d5ce 100644 (file)
@@ -7640,6 +7640,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
        }
        device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
 
+       /* save off EEPROM version number */
+       hw->eeprom.ops.read(hw, 0x2e, &adapter->eeprom_verh);
+       hw->eeprom.ops.read(hw, 0x2d, &adapter->eeprom_verl);
+
        /* pick up the PCI bus settings for reporting later */
        hw->mac.ops.get_bus_info(hw);
 
@@ -7672,9 +7676,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
                           "is required.\n");
        }
 
-       /* save off EEPROM version number */
-       hw->eeprom.ops.read(hw, 0x29, &adapter->eeprom_version);
-
        /* reset the hardware with the new settings */
        err = hw->mac.ops.start_hw(hw);