OSDN Git Service

wil6210: add option to load FTM FW
authorHamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Fri, 19 May 2017 08:54:07 +0000 (11:54 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 23 May 2017 15:29:35 +0000 (18:29 +0300)
Module parameter allows to load specific FW used
for FTM testing.

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/pcie_bus.c
drivers/net/wireless/ath/wil6210/wil6210.h

index b38515f..33bd85c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
+ * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -26,6 +26,10 @@ static bool use_msi = true;
 module_param(use_msi, bool, 0444);
 MODULE_PARM_DESC(use_msi, " Use MSI interrupt, default - true");
 
+static bool ftm_mode;
+module_param(ftm_mode, bool, 0444);
+MODULE_PARM_DESC(ftm_mode, " Set factory test mode, default - false");
+
 #ifdef CONFIG_PM
 #ifdef CONFIG_PM_SLEEP
 static int wil6210_pm_notify(struct notifier_block *notify_block,
@@ -36,13 +40,15 @@ static int wil6210_pm_notify(struct notifier_block *notify_block,
 static
 void wil_set_capabilities(struct wil6210_priv *wil)
 {
+       const char *wil_fw_name;
        u32 jtag_id = wil_r(wil, RGF_USER_JTAG_DEV_ID);
        u8 chip_revision = (wil_r(wil, RGF_USER_REVISION_ID) &
                            RGF_USER_REVISION_ID_MASK);
 
        bitmap_zero(wil->hw_capabilities, hw_capability_last);
        bitmap_zero(wil->fw_capabilities, WMI_FW_CAPABILITY_MAX);
-       wil->wil_fw_name = WIL_FW_NAME_DEFAULT;
+       wil->wil_fw_name = ftm_mode ? WIL_FW_NAME_FTM_DEFAULT :
+                          WIL_FW_NAME_DEFAULT;
        wil->chip_revision = chip_revision;
 
        switch (jtag_id) {
@@ -51,9 +57,11 @@ void wil_set_capabilities(struct wil6210_priv *wil)
                case REVISION_ID_SPARROW_D0:
                        wil->hw_name = "Sparrow D0";
                        wil->hw_version = HW_VER_SPARROW_D0;
-                       if (wil_fw_verify_file_exists(wil,
-                                                     WIL_FW_NAME_SPARROW_PLUS))
-                               wil->wil_fw_name = WIL_FW_NAME_SPARROW_PLUS;
+                       wil_fw_name = ftm_mode ? WIL_FW_NAME_FTM_SPARROW_PLUS :
+                                     WIL_FW_NAME_SPARROW_PLUS;
+
+                       if (wil_fw_verify_file_exists(wil, wil_fw_name))
+                               wil->wil_fw_name = wil_fw_name;
                        break;
                case REVISION_ID_SPARROW_B0:
                        wil->hw_name = "Sparrow B0";
index b00c803..fe942ba 100644 (file)
@@ -37,8 +37,13 @@ extern bool debug_fw;
 extern bool disable_ap_sme;
 
 #define WIL_NAME "wil6210"
-#define WIL_FW_NAME_DEFAULT "wil6210.fw" /* code Sparrow B0 */
-#define WIL_FW_NAME_SPARROW_PLUS "wil6210_sparrow_plus.fw" /* code Sparrow D0 */
+
+#define WIL_FW_NAME_DEFAULT "wil6210.fw"
+#define WIL_FW_NAME_FTM_DEFAULT "wil6210_ftm.fw"
+
+#define WIL_FW_NAME_SPARROW_PLUS "wil6210_sparrow_plus.fw"
+#define WIL_FW_NAME_FTM_SPARROW_PLUS "wil6210_sparrow_plus_ftm.fw"
+
 #define WIL_BOARD_FILE_NAME "wil6210.brd" /* board & radio parameters */
 
 #define WIL_DEFAULT_BUS_REQUEST_KBPS 128000 /* ~1Gbps */