aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r--drivers/net/e1000/e1000_ethtool.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 0f9c86057a58..d252297e4db0 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -582,10 +582,29 @@ e1000_get_drvinfo(struct net_device *netdev,
582 struct ethtool_drvinfo *drvinfo) 582 struct ethtool_drvinfo *drvinfo)
583{ 583{
584 struct e1000_adapter *adapter = netdev_priv(netdev); 584 struct e1000_adapter *adapter = netdev_priv(netdev);
585 char firmware_version[32];
586 uint16_t eeprom_data;
585 587
586 strncpy(drvinfo->driver, e1000_driver_name, 32); 588 strncpy(drvinfo->driver, e1000_driver_name, 32);
587 strncpy(drvinfo->version, e1000_driver_version, 32); 589 strncpy(drvinfo->version, e1000_driver_version, 32);
588 strncpy(drvinfo->fw_version, "N/A", 32); 590
591 /* EEPROM image version # is reported as firmware version # for
592 * 8257{1|2|3} controllers */
593 e1000_read_eeprom(&adapter->hw, 5, 1, &eeprom_data);
594 switch (adapter->hw.mac_type) {
595 case e1000_82571:
596 case e1000_82572:
597 case e1000_82573:
598 sprintf(firmware_version, "%d.%d-%d",
599 (eeprom_data & 0xF000) >> 12,
600 (eeprom_data & 0x0FF0) >> 4,
601 eeprom_data & 0x000F);
602 break;
603 default:
604 sprintf(firmware_version, "N/A");
605 }
606
607 strncpy(drvinfo->fw_version, firmware_version, 32);
589 strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); 608 strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
590 drvinfo->n_stats = E1000_STATS_LEN; 609 drvinfo->n_stats = E1000_STATS_LEN;
591 drvinfo->testinfo_len = E1000_TEST_LEN; 610 drvinfo->testinfo_len = E1000_TEST_LEN;