iwlwifi: provide firmware version
authorReinette Chatre <reinette.chatre@intel.com>
Fri, 30 Oct 2009 21:36:04 +0000 (14:36 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 2 Nov 2009 20:39:43 +0000 (15:39 -0500)
By setting the firmware version in wiphy it is possible to obtain this
information via ethtool. Some examples,

    # ethtool -i wlan1
    driver: iwlagn
    version: 2.6.32-rc5-wl-56840-g26d8540
    firmware-version: 228.57.2.23
    bus-info: 0000:03:00.0
    # ethtool -i wlan0
    driver: iwl3945
    version: 2.6.32-rc5-wl-56840-g26d8540
    firmware-version: 15.28.2.8
    bus-info: 0000:02:00.0

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

index fa1672e99e4b68b938d19d0e42e8c6ab01d7cd58..05d1070e22d042aacc1a0cfcb0973b263b94d54e 100644 (file)
@@ -1377,6 +1377,14 @@ static int iwl_read_ucode(struct iwl_priv *priv)
               IWL_UCODE_API(priv->ucode_ver),
               IWL_UCODE_SERIAL(priv->ucode_ver));
 
+       snprintf(priv->hw->wiphy->fw_version,
+                sizeof(priv->hw->wiphy->fw_version),
+                "%u.%u.%u.%u",
+                IWL_UCODE_MAJOR(priv->ucode_ver),
+                IWL_UCODE_MINOR(priv->ucode_ver),
+                IWL_UCODE_API(priv->ucode_ver),
+                IWL_UCODE_SERIAL(priv->ucode_ver));
+
        if (build)
                IWL_DEBUG_INFO(priv, "Build %u\n", build);
 
index bfd7f497157fcd87516501dd01154d9d5aa86ab0..5c80a83eb2e1b42e2dafe9d6f0f3666534055a34 100644 (file)
@@ -2160,6 +2160,14 @@ static int iwl3945_read_ucode(struct iwl_priv *priv)
                IWL_UCODE_API(priv->ucode_ver),
                IWL_UCODE_SERIAL(priv->ucode_ver));
 
+       snprintf(priv->hw->wiphy->fw_version,
+                sizeof(priv->hw->wiphy->fw_version),
+                "%u.%u.%u.%u",
+                IWL_UCODE_MAJOR(priv->ucode_ver),
+                IWL_UCODE_MINOR(priv->ucode_ver),
+                IWL_UCODE_API(priv->ucode_ver),
+                IWL_UCODE_SERIAL(priv->ucode_ver));
+
        IWL_DEBUG_INFO(priv, "f/w package hdr ucode version raw = 0x%x\n",
                       priv->ucode_ver);
        IWL_DEBUG_INFO(priv, "f/w package hdr runtime inst size = %u\n",