]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/ethernet/intel/ice/ice_ethtool.c
ice: fix and consolidate logging of NVM/firmware version information
[linux.git] / drivers / net / ethernet / intel / ice / ice_ethtool.c
index 26eca4ce9e2c7a043185abddfcf7bababe6a4121..7539fd8147deb4d2bfce66fc0dac3ac80914e3e8 100644 (file)
@@ -166,13 +166,24 @@ static void
 ice_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
 {
        struct ice_netdev_priv *np = netdev_priv(netdev);
+       u8 oem_ver, oem_patch, nvm_ver_hi, nvm_ver_lo;
        struct ice_vsi *vsi = np->vsi;
        struct ice_pf *pf = vsi->back;
+       struct ice_hw *hw = &pf->hw;
+       u16 oem_build;
 
        strlcpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver));
        strlcpy(drvinfo->version, ice_drv_ver, sizeof(drvinfo->version));
-       strlcpy(drvinfo->fw_version, ice_nvm_version_str(&pf->hw),
-               sizeof(drvinfo->fw_version));
+
+       /* Display NVM version (from which the firmware version can be
+        * determined) which contains more pertinent information.
+        */
+       ice_get_nvm_version(hw, &oem_ver, &oem_build, &oem_patch,
+                           &nvm_ver_hi, &nvm_ver_lo);
+       snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
+                "%x.%02x 0x%x %d.%d.%d", nvm_ver_hi, nvm_ver_lo,
+                hw->nvm.eetrack, oem_ver, oem_build, oem_patch);
+
        strlcpy(drvinfo->bus_info, pci_name(pf->pdev),
                sizeof(drvinfo->bus_info));
        drvinfo->n_priv_flags = ICE_PRIV_FLAG_ARRAY_SIZE;