ixgbe: Display EEPROM version in ethtool -i queries
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Fri, 6 Feb 2009 07:54:42 +0000 (23:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Feb 2009 07:54:42 +0000 (23:54 -0800)
Currently ixgbe does not display the EEPROM version in ethtool -i, where
other drivers do.  The EEPROM version is located at offset 0x29.  This
patch adds support to display it.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ixgbe/ixgbe.h
drivers/net/ixgbe/ixgbe_ethtool.c
drivers/net/ixgbe/ixgbe_main.c

index 0ea791ae0d14422791e094f59db7c10759c85d69..e98ace8c578dfa37c67ddc56c7585bf8cf80770b 100644 (file)
@@ -310,6 +310,8 @@ struct ixgbe_adapter {
        struct work_struct watchdog_task;
        struct work_struct sfp_task;
        struct timer_list sfp_timer;
+
+       u16 eeprom_version;
 };
 
 enum ixbge_state_t {
index 14e661e0a2504a1899a82bc164ea83afdba3edaf..54d96cb05b4860ff71ef32e1b4973eb6598ce50a 100644 (file)
@@ -679,10 +679,17 @@ static void ixgbe_get_drvinfo(struct net_device *netdev,
                               struct ethtool_drvinfo *drvinfo)
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
+       char firmware_version[32];
 
        strncpy(drvinfo->driver, ixgbe_driver_name, 32);
        strncpy(drvinfo->version, ixgbe_driver_version, 32);
-       strncpy(drvinfo->fw_version, "N/A", 32);
+
+       sprintf(firmware_version, "%d.%d-%d",
+               (adapter->eeprom_version & 0xF000) >> 12,
+               (adapter->eeprom_version & 0x0FF0) >> 4,
+               adapter->eeprom_version & 0x000F);
+
+       strncpy(drvinfo->fw_version, firmware_version, 32);
        strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
        drvinfo->n_stats = IXGBE_STATS_LEN;
        drvinfo->regdump_len = ixgbe_get_regs_len(netdev);
index 5db82b5fa9b3a2063bdfda8789eb72f683ab57da..dceae37fd57f7852f13aa3697cec94f95a9bab1e 100644 (file)
@@ -4191,6 +4191,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
                         "PCI-Express slot is required.\n");
        }
 
+       /* save off EEPROM version number */
+       hw->eeprom.ops.read(hw, 0x29, &adapter->eeprom_version);
+
        /* reset the hardware with the new settings */
        hw->mac.ops.start_hw(hw);