iwlwifi: set default timstamp marker cmd
authorMordechay Goodstein <mordechay.goodstein@intel.com>
Tue, 19 Dec 2017 10:24:44 +0000 (10:24 +0000)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 28 Mar 2018 09:16:04 +0000 (12:16 +0300)
In case debug configuration is started with LDBG cmd also start timestamp
marker for syncing logs witn the FW.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/intel/iwlwifi/fw/debugfs.c
drivers/net/wireless/intel/iwlwifi/fw/debugfs.h

index 7bd704a..d27a43e 100644 (file)
@@ -68,6 +68,7 @@
 #include "iwl-drv.h"
 #include "runtime.h"
 #include "dbg.h"
+#include "debugfs.h"
 #include "iwl-io.h"
 #include "iwl-prph.h"
 #include "iwl-csr.h"
@@ -1080,6 +1081,9 @@ int iwl_fw_start_dbg_conf(struct iwl_fw_runtime *fwrt, u8 conf_id)
                IWL_WARN(fwrt, "FW already configured (%d) - re-configuring\n",
                         fwrt->dump.conf);
 
+       /* start default config marker cmd for syncing logs */
+       iwl_fw_trigger_timestamp(fwrt, 1);
+
        /* Send all HCMDs for configuring the FW debug */
        ptr = (void *)&fwrt->fw->dbg_conf_tlv[conf_id]->hcmd;
        for (i = 0; i < fwrt->fw->dbg_conf_tlv[conf_id]->num_of_hcmds; i++) {
index baec2fb..8f005cd 100644 (file)
@@ -157,6 +157,20 @@ static void iwl_fw_timestamp_marker_wk(struct work_struct *work)
                         ret, jiffies_to_msecs(delay) / 1000);
 }
 
+void iwl_fw_trigger_timestamp(struct iwl_fw_runtime *fwrt, u32 delay)
+{
+       IWL_INFO(fwrt,
+                "starting timestamp_marker trigger with delay: %us\n",
+                delay);
+
+       iwl_fw_cancel_timestamp(fwrt);
+
+       fwrt->timestamp.delay = msecs_to_jiffies(delay * 1000);
+
+       schedule_delayed_work(&fwrt->timestamp.wk,
+                             round_jiffies_relative(fwrt->timestamp.delay));
+}
+
 static ssize_t iwl_dbgfs_timestamp_marker_write(struct iwl_fw_runtime *fwrt,
                                                char *buf, size_t count,
                                                loff_t *ppos)
@@ -168,16 +182,8 @@ static ssize_t iwl_dbgfs_timestamp_marker_write(struct iwl_fw_runtime *fwrt,
        if (ret < 0)
                return ret;
 
-       IWL_INFO(fwrt,
-                "starting timestamp_marker trigger with delay: %us\n",
-                delay);
+       iwl_fw_trigger_timestamp(fwrt, delay);
 
-       iwl_fw_cancel_timestamp(fwrt);
-
-       fwrt->timestamp.delay = msecs_to_jiffies(delay * 1000);
-
-       schedule_delayed_work(&fwrt->timestamp.wk,
-                             round_jiffies_relative(fwrt->timestamp.delay));
        return count;
 }
 
index 3da468d..d93f6a4 100644 (file)
@@ -89,6 +89,8 @@ static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt)
                              round_jiffies_relative(fwrt->timestamp.delay));
 }
 
+void iwl_fw_trigger_timestamp(struct iwl_fw_runtime *fwrt, u32 delay);
+
 #else
 static inline int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,
                                          struct dentry *dbgfs_dir)
@@ -102,4 +104,7 @@ static inline void iwl_fw_suspend_timestamp(struct iwl_fw_runtime *fwrt) {}
 
 static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt) {}
 
+static inline void iwl_fw_trigger_timestamp(struct iwl_fw_runtime *fwrt,
+                                           u32 delay) {}
+
 #endif /* CONFIG_IWLWIFI_DEBUGFS */