linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 01/18] iwlwifi: mvm: ftm: make common calib signed
Date: Wed, 21 Aug 2019 16:37:43 +0300	[thread overview]
Message-ID: <20190821133800.23636-2-luca@coelho.fi> (raw)
In-Reply-To: <20190821133800.23636-1-luca@coelho.fi>

From: Alex Malamud <alex.malamud@intel.com>

The common calib value should be signed, so use int instead of u16.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/file.h  |  3 +-
 .../net/wireless/intel/iwlwifi/mvm/debugfs.c  | 37 +++++++++++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c   |  3 +-
 3 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index ea2b3d77f848..418064ced337 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -441,9 +441,10 @@ enum iwl_ucode_tlv_capa {
 	IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA                = (__force iwl_ucode_tlv_capa_t)44,
 	IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2		= (__force iwl_ucode_tlv_capa_t)45,
 	IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD		= (__force iwl_ucode_tlv_capa_t)46,
-	IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS		= (__force iwl_ucode_tlv_capa_t)48,
 	IWL_UCODE_TLV_CAPA_FTM_CALIBRATED		= (__force iwl_ucode_tlv_capa_t)47,
+	IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS		= (__force iwl_ucode_tlv_capa_t)48,
 	IWL_UCODE_TLV_CAPA_CS_MODIFY			= (__force iwl_ucode_tlv_capa_t)49,
+	IWL_UCODE_TLV_CAPA_SET_LTR_GEN2			= (__force iwl_ucode_tlv_capa_t)50,
 
 	/* set 2 */
 	IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE		= (__force iwl_ucode_tlv_capa_t)64,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 6d67d3da31e0..994a4ba07204 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1758,6 +1758,38 @@ iwl_dbgfs_uapsd_noagg_bssids_read(struct file *file, char __user *user_buf,
 	return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
 }
 
+static ssize_t
+iwl_dbgfs_ltr_config_write(struct iwl_mvm *mvm,
+			   char *buf, size_t count, loff_t *ppos)
+{
+	int ret;
+	struct iwl_ltr_config_cmd ltr_config = {0};
+
+	if (!iwl_mvm_firmware_running(mvm))
+		return -EIO;
+
+	if (sscanf(buf, "%x,%x,%x,%x,%x,%x,%x",
+		   &ltr_config.flags,
+		   &ltr_config.static_long,
+		   &ltr_config.static_short,
+		   &ltr_config.ltr_cfg_values[0],
+		   &ltr_config.ltr_cfg_values[1],
+		   &ltr_config.ltr_cfg_values[2],
+		   &ltr_config.ltr_cfg_values[3]) != 7) {
+		return -EINVAL;
+	}
+
+	mutex_lock(&mvm->mutex);
+	ret = iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0, sizeof(ltr_config),
+				   &ltr_config);
+	mutex_unlock(&mvm->mutex);
+
+	if (ret)
+		IWL_ERR(mvm, "failed to send ltr configuration cmd\n");
+
+	return ret ?: count;
+}
+
 MVM_DEBUGFS_READ_WRITE_FILE_OPS(prph_reg, 64);
 
 /* Device wide debugfs entries */
@@ -1806,6 +1838,8 @@ MVM_DEBUGFS_READ_WRITE_STA_FILE_OPS(amsdu_len, 16);
 
 MVM_DEBUGFS_READ_WRITE_FILE_OPS(he_sniffer_params, 32);
 
+MVM_DEBUGFS_WRITE_FILE_OPS(ltr_config, 512);
+
 static ssize_t iwl_dbgfs_mem_read(struct file *file, char __user *user_buf,
 				  size_t count, loff_t *ppos)
 {
@@ -1993,6 +2027,9 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
 #endif
 	MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600);
 
+	if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2))
+		MVM_DEBUGFS_ADD_FILE(ltr_config, mvm->debugfs_dir, 0200);
+
 	debugfs_create_bool("enable_scan_iteration_notif", 0600,
 			    mvm->debugfs_dir, &mvm->scan_iter_notif_enabled);
 	debugfs_create_bool("drop_bcn_ap_mode", 0600, mvm->debugfs_dir,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 251e7c235aaa..bb2aec9c6738 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -1302,7 +1302,8 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
 	iwl_mvm_tt_tx_backoff(mvm, 0);
 #endif
 
-	WARN_ON(iwl_mvm_config_ltr(mvm));
+	if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_LTR_GEN2))
+		WARN_ON(iwl_mvm_config_ltr(mvm));
 
 	ret = iwl_mvm_power_update_device(mvm);
 	if (ret)
-- 
2.23.0.rc1


  reply	other threads:[~2019-08-21 13:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21 13:37 [PATCH 00/18] iwlwifi: updates intended for v5.4 2019-08-21 Luca Coelho
2019-08-21 13:37 ` Luca Coelho [this message]
2019-09-03 11:23   ` [PATCH 01/18] iwlwifi: mvm: ftm: make common calib signed Kalle Valo
2019-08-21 13:37 ` [PATCH 02/18] iwlwifi: scan: add support for new scan request command version Luca Coelho
2019-08-21 13:37 ` [PATCH 03/18] iwlwifi: mvm: name magic numbers with enum Luca Coelho
2019-08-21 13:37 ` [PATCH 04/18] iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL Luca Coelho
2019-08-21 13:37 ` [PATCH 05/18] iwlwifi: Set w-pointer upon resume according to SN Luca Coelho
2019-09-03 11:26   ` Kalle Valo
2019-09-05 12:56     ` Luca Coelho
2019-09-05 12:58       ` Kalle Valo
2019-08-21 13:37 ` [PATCH 06/18] iwlwifi: remove runtime_pm_mode Luca Coelho
2019-08-21 13:37 ` [PATCH 07/18] iwlwifi: remove the opmode's d0i3 handlers Luca Coelho
2019-08-21 13:37 ` [PATCH 08/18] iwlwifi: pcie: remove the refs / unrefs from the transport Luca Coelho
2019-08-21 13:37 ` [PATCH 09/18] iwlwifi: pcie: remove some more d0i3 code " Luca Coelho
2019-08-21 13:37 ` [PATCH 10/18] iwlwifi: remove the d0i3 related module parameters Luca Coelho
2019-08-21 13:37 ` [PATCH 11/18] iwlwifi: remove pm_runtime completely Luca Coelho
2019-08-21 13:37 ` [PATCH 12/18] iwlwifi: scan: don't pass large argument by value Luca Coelho
2019-08-21 13:37 ` [PATCH 13/18] iwlwifi: dbg_ini: align dbg tlv functions names to a single format Luca Coelho
2019-08-21 13:37 ` [PATCH 14/18] iwlwifi: remove unused regdb_ptrs allocation Luca Coelho
2019-08-21 13:37 ` [PATCH 15/18] iwlwifi: dbg: add debug periphery registers to 9000 device family Luca Coelho
2019-08-21 13:37 ` [PATCH 16/18] iwlwifi: dbg_ini: maintain buffer allocations from trans instead of TLVs buffer Luca Coelho
2019-08-21 13:37 ` [PATCH 17/18] iwlwifi: dbg_ini: use linked list to store debug TLVs Luca Coelho
2019-08-21 13:38 ` [PATCH 18/18] iwlwifi: dbg_ini: remove periphery phy and aux regions handling 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=20190821133800.23636-2-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;
as well as URLs for NNTP newsgroup(s).