iwlwifi: 8000: fix fw name to account for revision
authorLiad Kaufman <liad.kaufman@intel.com>
Thu, 18 Sep 2014 14:22:58 +0000 (17:22 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 21 Sep 2014 10:25:48 +0000 (13:25 +0300)
The 8000 HW series also includes the revision in the FW
name.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/iwl-8000.c
drivers/net/wireless/iwlwifi/iwl-drv.c

index 4ae8ba6ccfffd3142ea6aeb7c8e3586919b686b4..e4351487ca7269aefe06d4bf2da3c2fedc1f34da 100644 (file)
@@ -81,7 +81,7 @@
 #define IWL8000_NVM_VERSION            0x0a1d
 #define IWL8000_TX_POWER_VERSION       0xffff /* meaningless */
 
-#define IWL8000_FW_PRE "iwlwifi-8000-"
+#define IWL8000_FW_PRE "iwlwifi-8000"
 #define IWL8000_MODULE_FIRMWARE(api) IWL8000_FW_PRE __stringify(api) ".ucode"
 
 #define NVM_HW_SECTION_NUM_FAMILY_8000         10
index ed673baedfd7924729c5256dbab37f2ef3af0ea1..0f1084f09caabfdf1265c4e34ba54bbd682cffaa 100644 (file)
@@ -69,6 +69,7 @@
 #include <linux/vmalloc.h>
 
 #include "iwl-drv.h"
+#include "iwl-csr.h"
 #include "iwl-debug.h"
 #include "iwl-trans.h"
 #include "iwl-op-mode.h"
@@ -244,6 +245,23 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first)
        snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s.ucode",
                 name_pre, tag);
 
+       /*
+        * Starting 8000B - FW name format has changed. This overwrites the
+        * previous name and uses the new format.
+        */
+       if (drv->trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) {
+               char rev_step[2] = {
+                       'A' + CSR_HW_REV_STEP(drv->trans->hw_rev), 0
+               };
+
+               /* A-step doesn't have an indication */
+               if (CSR_HW_REV_STEP(drv->trans->hw_rev) == SILICON_A_STEP)
+                       rev_step[0] = 0;
+
+               snprintf(drv->firmware_name, sizeof(drv->firmware_name),
+                        "%s%s-%s.ucode", name_pre, rev_step, tag);
+       }
+
        IWL_DEBUG_INFO(drv, "attempting to load firmware %s'%s'\n",
                       (drv->fw_index == UCODE_EXPERIMENTAL_INDEX)
                                ? "EXPERIMENTAL " : "",