Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH v3 06/22] iwlwifi: dbg: move monitor recording functionality from header file
Date: Mon, 19 Aug 2019 19:49:51 +0300	[thread overview]
Message-ID: <20190819165007.10181-7-luca@coelho.fi> (raw)
In-Reply-To: <20190819165007.10181-1-luca@coelho.fi>

From: Shahar S Matityahu <shahar.s.matityahu@intel.com>

The recording functions are quite big to be inline and the driver should
expose only the stop and restart functions that are allowed to be used
rather then the internal helper functions. Move the functions from the
header file.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 85 ++++++++++++++++++++
 drivers/net/wireless/intel/iwlwifi/fw/dbg.h | 89 +--------------------
 2 files changed, 89 insertions(+), 85 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index 4d81776f576d..dfb0c50df94c 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -2937,3 +2937,88 @@ void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt)
 	iwl_trans_release_nic_access(trans, &flags);
 }
 IWL_EXPORT_SYMBOL(iwl_fw_error_print_fseq_regs);
+
+static void _iwl_fw_dbg_stop_recording(struct iwl_trans *trans,
+				       struct iwl_fw_dbg_params *params)
+{
+	if (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
+		iwl_set_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x100);
+		return;
+	}
+
+	if (params) {
+		params->in_sample = iwl_read_umac_prph(trans, DBGC_IN_SAMPLE);
+		params->out_ctrl = iwl_read_umac_prph(trans, DBGC_OUT_CTRL);
+	}
+
+	iwl_write_umac_prph(trans, DBGC_IN_SAMPLE, 0);
+	/* wait for the DBGC to finish writing the internal buffer to DRAM to
+	 * avoid halting the HW while writing
+	 */
+	usleep_range(700, 1000);
+	iwl_write_umac_prph(trans, DBGC_OUT_CTRL, 0);
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+	trans->dbg.rec_on = false;
+#endif
+}
+
+void iwl_fw_dbg_stop_recording(struct iwl_trans *trans,
+			       struct iwl_fw_dbg_params *params)
+{
+	/* if the FW crashed or not debug monitor cfg was given, there is
+	 * no point in stopping
+	 */
+	if (test_bit(STATUS_FW_ERROR, &trans->status) ||
+	    (!trans->dbg.dest_tlv &&
+	     trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID))
+		return;
+
+	if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
+		IWL_ERR(trans,
+			"WRT: unsupported device family %d for debug stop recording\n",
+			trans->cfg->device_family);
+		return;
+	}
+	_iwl_fw_dbg_stop_recording(trans, params);
+}
+IWL_EXPORT_SYMBOL(iwl_fw_dbg_stop_recording);
+
+static void _iwl_fw_dbg_restart_recording(struct iwl_trans *trans,
+					  struct iwl_fw_dbg_params *params)
+{
+	if (WARN_ON(!params))
+		return;
+
+	if (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
+		iwl_clear_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x100);
+		iwl_clear_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x1);
+		iwl_set_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x1);
+	} else {
+		iwl_write_umac_prph(trans, DBGC_IN_SAMPLE, params->in_sample);
+		iwl_write_umac_prph(trans, DBGC_OUT_CTRL, params->out_ctrl);
+	}
+}
+
+void iwl_fw_dbg_restart_recording(struct iwl_fw_runtime *fwrt,
+				  struct iwl_fw_dbg_params *params)
+{
+	/* if the FW crashed or not debug monitor cfg was given, there is
+	 * no point in restarting
+	 */
+	if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status) ||
+	    (!fwrt->trans->dbg.dest_tlv &&
+	     fwrt->trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID))
+		return;
+
+	if (fwrt->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
+		IWL_ERR(fwrt,
+			"WRT: unsupported device family %d for debug restart recording\n",
+			fwrt->trans->cfg->device_family);
+		return;
+	}
+	_iwl_fw_dbg_restart_recording(fwrt->trans, params);
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+	iwl_fw_set_dbg_rec_on(fwrt);
+#endif
+}
+IWL_EXPORT_SYMBOL(iwl_fw_dbg_restart_recording);
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h
index a8459ac71b2c..d6b012459b04 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.h
@@ -263,68 +263,11 @@ _iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt,
 					iwl_fw_dbg_get_trigger((fwrt)->fw,\
 							       (trig)))
 
-static inline void
-_iwl_fw_dbg_stop_recording(struct iwl_trans *trans,
-			   struct iwl_fw_dbg_params *params)
-{
-	if (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
-		iwl_set_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x100);
-		return;
-	}
+void iwl_fw_dbg_stop_recording(struct iwl_trans *trans,
+			       struct iwl_fw_dbg_params *params);
 
-	if (params) {
-		params->in_sample = iwl_read_umac_prph(trans, DBGC_IN_SAMPLE);
-		params->out_ctrl = iwl_read_umac_prph(trans, DBGC_OUT_CTRL);
-	}
-
-	iwl_write_umac_prph(trans, DBGC_IN_SAMPLE, 0);
-	/* wait for the DBGC to finish writing the internal buffer to DRAM to
-	 * avoid halting the HW while writing
-	 */
-	usleep_range(700, 1000);
-	iwl_write_umac_prph(trans, DBGC_OUT_CTRL, 0);
-#ifdef CONFIG_IWLWIFI_DEBUGFS
-	trans->dbg.rec_on = false;
-#endif
-}
-
-static inline void
-iwl_fw_dbg_stop_recording(struct iwl_trans *trans,
-			  struct iwl_fw_dbg_params *params)
-{
-	/* if the FW crashed or not debug monitor cfg was given, there is
-	 * no point in stopping
-	 */
-	if (test_bit(STATUS_FW_ERROR, &trans->status) ||
-	    (!trans->dbg.dest_tlv &&
-	     trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID))
-		return;
-
-	if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
-		IWL_ERR(trans,
-			"WRT: unsupported device family %d for debug stop recording\n",
-			trans->cfg->device_family);
-		return;
-	}
-	_iwl_fw_dbg_stop_recording(trans, params);
-}
-
-static inline void
-_iwl_fw_dbg_restart_recording(struct iwl_trans *trans,
-			      struct iwl_fw_dbg_params *params)
-{
-	if (WARN_ON(!params))
-		return;
-
-	if (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
-		iwl_clear_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x100);
-		iwl_clear_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x1);
-		iwl_set_bits_prph(trans, MON_BUFF_SAMPLE_CTL, 0x1);
-	} else {
-		iwl_write_umac_prph(trans, DBGC_IN_SAMPLE, params->in_sample);
-		iwl_write_umac_prph(trans, DBGC_OUT_CTRL, params->out_ctrl);
-	}
-}
+void iwl_fw_dbg_restart_recording(struct iwl_fw_runtime *fwrt,
+				  struct iwl_fw_dbg_params *params);
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 static inline void iwl_fw_set_dbg_rec_on(struct iwl_fw_runtime *fwrt)
@@ -336,30 +279,6 @@ static inline void iwl_fw_set_dbg_rec_on(struct iwl_fw_runtime *fwrt)
 }
 #endif
 
-static inline void
-iwl_fw_dbg_restart_recording(struct iwl_fw_runtime *fwrt,
-			     struct iwl_fw_dbg_params *params)
-{
-	/* if the FW crashed or not debug monitor cfg was given, there is
-	 * no point in restarting
-	 */
-	if (test_bit(STATUS_FW_ERROR, &fwrt->trans->status) ||
-	    (!fwrt->trans->dbg.dest_tlv &&
-	     fwrt->trans->dbg.ini_dest == IWL_FW_INI_LOCATION_INVALID))
-		return;
-
-	if (fwrt->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
-		IWL_ERR(fwrt,
-			"WRT: unsupported device family %d for debug restart recording\n",
-			fwrt->trans->cfg->device_family);
-		return;
-	}
-	_iwl_fw_dbg_restart_recording(fwrt->trans, params);
-#ifdef CONFIG_IWLWIFI_DEBUGFS
-	iwl_fw_set_dbg_rec_on(fwrt);
-#endif
-}
-
 static inline void iwl_fw_dump_conf_clear(struct iwl_fw_runtime *fwrt)
 {
 	fwrt->dump.conf = FW_DBG_INVALID;
-- 
2.23.0.rc1


  parent reply	other threads:[~2019-08-19 16:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 16:49 [PATCH v3 00/22] iwlwifi: updates intended for v5.4 2019-08-17-3 Luca Coelho
2019-08-19 16:49 ` [PATCH v3 01/22] iwlwifi: bump FW API to 49 for 22000 series Luca Coelho
2019-08-19 16:49 ` [PATCH v3 02/22] iwlwifi: Send DQA enable command only if TVL is on Luca Coelho
2019-08-19 16:49 ` [PATCH v3 03/22] iwlwifi: mvm: remove redundant condition in iwl_mvm_set_hw_rfkill_state Luca Coelho
2019-08-19 16:49 ` [PATCH v3 04/22] iwlwifi: mvm: Block 26-tone RU OFDMA transmissions Luca Coelho
2019-08-19 16:49 ` [PATCH v3 05/22] iwlwifi: mvm: remove unnecessary forward declarations Luca Coelho
2019-08-19 16:49 ` Luca Coelho [this message]
2019-08-19 16:49 ` [PATCH v3 07/22] iwlwifi: dbg: move debug recording stop from trans to op mode Luca Coelho
2019-08-19 16:49 ` [PATCH v3 08/22] iwlwifi: dbg: support debug recording suspend resume command Luca Coelho
2019-08-19 16:49 ` [PATCH v3 09/22] iwlwifi: add ldbg config cmd debug print Luca Coelho
2019-08-19 16:49 ` [PATCH v3 10/22] iwlwifi: mvm: fix scan config command size Luca Coelho
2019-08-19 16:49 ` [PATCH v3 11/22] iwlwifi: mvm: add the skb length to a print Luca Coelho
2019-08-19 16:49 ` [PATCH v3 12/22] iwlwifi: mvm: start to remove the code for d0i3 Luca Coelho
2019-08-19 16:49 ` [PATCH v3 13/22] iwlwifi: remove all the d0i3 references Luca Coelho
2019-08-19 16:49 ` [PATCH v3 14/22] iwlwifi: mvm: remove the tx defer for d0i3 Luca Coelho
2019-08-19 16:50 ` [PATCH v3 15/22] iwlwifi: mvm: remove the d0i3 entry/exit flow Luca Coelho
2019-08-19 16:50 ` [PATCH v3 16/22] iwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only Luca Coelho
2019-08-19 16:50 ` [PATCH v3 17/22] iwlwifi: mvm: remove d0i3_ap_sta_id Luca Coelho
2019-08-19 16:50 ` [PATCH v3 18/22] iwlwifi: mvm: remove iwl_mvm_update_d0i3_power_mode Luca Coelho
2019-08-19 16:50 ` [PATCH v3 19/22] iwlwifi: mvm: remove last leftovers of d0i3 Luca Coelho
2019-08-19 16:50 ` [PATCH v3 20/22] iwlwifi: remove CMD_HIGH_PRIO Luca Coelho
2019-08-19 16:50 ` [PATCH v3 21/22] iwlwifi: trans: remove suspending flag Luca Coelho
2019-08-19 16:50 ` [PATCH v3 22/22] iwlwifi: remove the code under IWLWIFI_PCIE_RTPM Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190819165007.10181-7-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox