iwmc3200wifi: Set wiphy firmware version
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 16 Oct 2009 05:18:59 +0000 (13:18 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 27 Oct 2009 20:48:27 +0000 (16:48 -0400)
Our wiphy firmware version is a combination of the UMAC and LMAC ones.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwmc3200wifi/fw.c
drivers/net/wireless/iwmc3200wifi/iwm.h
drivers/net/wireless/iwmc3200wifi/main.c

index f02d571b0a1367f4d487471a2f14d4d0cb70eb03..49067092d33671816776cbfb6a82bfe8cdbef7c5 100644 (file)
@@ -217,6 +217,13 @@ static int iwm_load_img(struct iwm_priv *iwm, const char *img_name)
                 IWM_BUILD_YEAR(build_date), IWM_BUILD_MONTH(build_date),
                 IWM_BUILD_DAY(build_date));
 
+       if (!strcmp(img_name, iwm->bus_ops->umac_name))
+               sprintf(iwm->umac_version, "%02X.%02X",
+                       ver->major, ver->minor);
+
+       if (!strcmp(img_name, iwm->bus_ops->lmac_name))
+               sprintf(iwm->lmac_version, "%02X.%02X",
+                       ver->major, ver->minor);
 
  err_release_fw:
        release_firmware(fw);
index c4a01f2a6028a8070637a58285570c7bd8ce524e..a9bf6bc97bea2930b9f18f4ecd3e09ed7f50d5f7 100644 (file)
@@ -294,6 +294,8 @@ struct iwm_priv {
        int resp_ie_len;
 
        struct iwm_fw_error_hdr *last_fw_err;
+       char umac_version[8];
+       char lmac_version[8];
 
        char private[0] __attribute__((__aligned__(NETDEV_ALIGN)));
 };
index 952701e6127e72ceaa8ec94ecde77003a0fb331a..f93e9139b0f20d50fd9f04b5ff3ec99c48209d84 100644 (file)
@@ -628,6 +628,7 @@ static int __iwm_up(struct iwm_priv *iwm)
 {
        int ret;
        struct iwm_notif *notif_reboot, *notif_ack = NULL;
+       struct wiphy *wiphy = iwm_to_wiphy(iwm);
 
        ret = iwm_bus_enable(iwm);
        if (ret) {
@@ -689,6 +690,9 @@ static int __iwm_up(struct iwm_priv *iwm)
                goto err_disable;
        }
 
+       snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "L%s_U%s",
+                iwm->lmac_version, iwm->umac_version);
+
        /* We configure the UMAC and enable the wifi module */
        ret = iwm_send_umac_config(iwm,
                        cpu_to_le32(UMAC_RST_CTRL_FLG_WIFI_CORE_EN) |