]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
wil6210: add oob_mode for AP certification
authorLior David <qca_liord@qca.qualcomm.com>
Wed, 8 Mar 2017 11:52:19 +0000 (13:52 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 9 Mar 2017 08:04:40 +0000 (10:04 +0200)
Add a new value to the oob_mode module parameter for
supporting AP certification.
All enabled values of oob_mode (>0) are intended only
for debugging and diagnostics.

Signed-off-by: Lior David <qca_liord@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/main.c
drivers/net/wireless/ath/wil6210/wil6210.h

index 3206aea00ccdc38944b8816046b687f840128506..c33cc4ad44c4487ecee81d294bbf206e5bdf6d36 100644 (file)
@@ -30,8 +30,8 @@ bool debug_fw; /* = false; */
 module_param(debug_fw, bool, 0444);
 MODULE_PARM_DESC(debug_fw, " do not perform card reset. For FW debug");
 
-static bool oob_mode;
-module_param(oob_mode, bool, 0444);
+static u8 oob_mode;
+module_param(oob_mode, byte, 0444);
 MODULE_PARM_DESC(oob_mode,
                 " enable out of the box (OOB) mode in FW, for diagnostics and certification");
 
@@ -642,13 +642,25 @@ static inline void wil_release_cpu(struct wil6210_priv *wil)
        wil_w(wil, RGF_USER_USER_CPU_0, 1);
 }
 
-static void wil_set_oob_mode(struct wil6210_priv *wil, bool enable)
+static void wil_set_oob_mode(struct wil6210_priv *wil, u8 mode)
 {
-       wil_info(wil, "enable=%d\n", enable);
-       if (enable)
+       wil_info(wil, "oob_mode to %d\n", mode);
+       switch (mode) {
+       case 0:
+               wil_c(wil, RGF_USER_USAGE_6, BIT_USER_OOB_MODE |
+                     BIT_USER_OOB_R2_MODE);
+               break;
+       case 1:
+               wil_c(wil, RGF_USER_USAGE_6, BIT_USER_OOB_R2_MODE);
                wil_s(wil, RGF_USER_USAGE_6, BIT_USER_OOB_MODE);
-       else
+               break;
+       case 2:
                wil_c(wil, RGF_USER_USAGE_6, BIT_USER_OOB_MODE);
+               wil_s(wil, RGF_USER_USAGE_6, BIT_USER_OOB_R2_MODE);
+               break;
+       default:
+               wil_err(wil, "invalid oob_mode: %d\n", mode);
+       }
 }
 
 static int wil_target_reset(struct wil6210_priv *wil)
index cb825ccedbe09637279401c894e5ae30243d3f2d..fee18916b713bdefe01db023d1756d6ead8c8da0 100644 (file)
@@ -140,6 +140,7 @@ struct RGF_ICR {
 #define RGF_USER_USAGE_1               (0x880004)
 #define RGF_USER_USAGE_6               (0x880018)
        #define BIT_USER_OOB_MODE               BIT(31)
+       #define BIT_USER_OOB_R2_MODE            BIT(30)
 #define RGF_USER_HW_MACHINE_STATE      (0x8801dc)
        #define HW_MACHINE_BOOT_DONE    (0x3fffffd)
 #define RGF_USER_USER_CPU_0            (0x8801e0)