All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-wireless@vger.kernel.org
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 25/38] iwlwifi: mvm: add support for new LTR command
Date: Thu, 22 Jan 2015 22:33:16 +0200	[thread overview]
Message-ID: <1421958809-3371-25-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1421958313.6424.2.camel@egrumbacBox>

This new command will give finer granularity to configure
the platform.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-fw-file.h      |  2 ++
 drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | 20 ++++++++++++-
 drivers/net/wireless/iwlwifi/mvm/fw.c           | 38 +++++++++++++++++++------
 3 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
index 4aa26b2..b998aaf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h
@@ -241,6 +241,7 @@ enum iwl_ucode_tlv_flag {
  * @IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF: ucode supports disabling dummy notif.
  * @IWL_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time
  *	longer than the passive one, which is essential for fragmented scan.
+ * IWL_UCODE_TLV_API_HDC_PHASE_0: ucode supports finer configuration of LTR
  * @IWL_UCODE_TLV_API_BASIC_DWELL: use only basic dwell time in scan command,
  *	regardless of the band or the number of the probes. FW will calculate
  *	the actual dwell time.
@@ -255,6 +256,7 @@ enum iwl_ucode_tlv_api {
 	IWL_UCODE_TLV_API_LMAC_SCAN		= BIT(6),
 	IWL_UCODE_TLV_API_SF_NO_DUMMY_NOTIF	= BIT(7),
 	IWL_UCODE_TLV_API_FRAGMENTED_SCAN	= BIT(8),
+	IWL_UCODE_TLV_API_HDC_PHASE_0		= BIT(10),
 	IWL_UCODE_TLV_API_BASIC_DWELL		= BIT(13),
 	IWL_UCODE_TLV_API_SCD_CFG		= BIT(15),
 	IWL_UCODE_TLV_API_SINGLE_SCAN_EBS	= BIT(16),
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
index 4300200..4fc0938b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h
@@ -92,14 +92,32 @@ enum iwl_ltr_config_flags {
 };
 
 /**
+ * struct iwl_ltr_config_cmd_v1 - configures the LTR
+ * @flags: See %enum iwl_ltr_config_flags
+ */
+struct iwl_ltr_config_cmd_v1 {
+	__le32 flags;
+	__le32 static_long;
+	__le32 static_short;
+} __packed; /* LTR_CAPABLE_API_S_VER_1 */
+
+#define LTR_VALID_STATES_NUM 4
+
+/**
  * struct iwl_ltr_config_cmd - configures the LTR
  * @flags: See %enum iwl_ltr_config_flags
+ * @static_long:
+ * @static_short:
+ * @ltr_cfg_values:
+ * @ltr_short_idle_timeout:
  */
 struct iwl_ltr_config_cmd {
 	__le32 flags;
 	__le32 static_long;
 	__le32 static_short;
-} __packed;
+	__le32 ltr_cfg_values[LTR_VALID_STATES_NUM];
+	__le32 ltr_short_idle_timeout;
+} __packed; /* LTR_CAPABLE_API_S_VER_2 */
 
 /* Radio LP RX Energy Threshold measured in dBm */
 #define POWER_LPRX_RSSI_THRESHOLD	75
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c
index 2e12f41..a322a5e 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/iwlwifi/mvm/fw.c
@@ -499,6 +499,35 @@ int iwl_mvm_start_fw_dbg_conf(struct iwl_mvm *mvm, enum iwl_fw_dbg_conf conf_id)
 	return ret;
 }
 
+static int iwl_mvm_config_ltr_v1(struct iwl_mvm *mvm)
+{
+	struct iwl_ltr_config_cmd_v1 cmd_v1 = {
+		.flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE),
+	};
+
+	if (!mvm->trans->ltr_enabled)
+		return 0;
+
+	return iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,
+				    sizeof(cmd_v1), &cmd_v1);
+}
+
+static int iwl_mvm_config_ltr(struct iwl_mvm *mvm)
+{
+	struct iwl_ltr_config_cmd cmd = {
+		.flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE),
+	};
+
+	if (!mvm->trans->ltr_enabled)
+		return 0;
+
+	if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_HDC_PHASE_0))
+		return iwl_mvm_config_ltr_v1(mvm);
+
+	return iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,
+				    sizeof(cmd), &cmd);
+}
+
 int iwl_mvm_up(struct iwl_mvm *mvm)
 {
 	int ret, i;
@@ -604,14 +633,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
 	/* Initialize tx backoffs to the minimal possible */
 	iwl_mvm_tt_tx_backoff(mvm, 0);
 
-	if (mvm->trans->ltr_enabled) {
-		struct iwl_ltr_config_cmd cmd = {
-			.flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE),
-		};
-
-		WARN_ON(iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0,
-					     sizeof(cmd), &cmd));
-	}
+	WARN_ON(iwl_mvm_config_ltr(mvm));
 
 	ret = iwl_mvm_power_update_device(mvm);
 	if (ret)
-- 
1.9.1


  parent reply	other threads:[~2015-01-22 20:34 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 20:25 pull request: iwlwifi-next 2015-01-22 Grumbach, Emmanuel
2015-01-22 20:32 ` [PATCH 01/38] iwlwifi: mvm: don't indicate no BA if STA was in powersave Emmanuel Grumbach
2015-01-22 20:32 ` [PATCH 02/38] iwlwifi: mvm: rs: repeat initial legacy rates in LQ table Emmanuel Grumbach
2015-01-22 20:32 ` [PATCH 03/38] iwlwifi: mvm: make sure state isn't in d0i3 when collecting fw dbg Emmanuel Grumbach
2015-01-22 20:32 ` [PATCH 04/38] iwlwifi: add new config and PCI IDs for 4165 series Emmanuel Grumbach
2015-01-22 20:32 ` [PATCH 05/38] iwlwifi: mvm: Add debugfs entry to enable scan offload notification Emmanuel Grumbach
2015-01-22 20:32 ` [PATCH 06/38] iwlwifi: mvm: make sure state isn't in d0i3 when stopping fw monitor Emmanuel Grumbach
2015-01-22 20:32 ` [PATCH 07/38] iwlwifi: mvm: allow to collect debug data from non-sleepable context Emmanuel Grumbach
2015-01-22 20:32 ` [PATCH 08/38] iwlwifi: mvm: rs: allow to disable MIMO for P2P only Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 09/38] iwlwifi: mvm: set max_out_time equal to frag_passive_dwell in fragmented scan Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 10/38] iwlwifi: mvm: add print of he nvm version Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 11/38] iwlwifi: remove unused TLV capability flags Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 12/38] iwlwifi: mvm: scan dwell time corrections Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 13/38] iwlwifi: mvm: let the firmware configure the scheduler Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 14/38] iwlwifi: mvm: add debugfs file for misbehaving U-APSD AP Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 15/38] iwlwifi: mvm: add support for dumping a secondary SRAM Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 16/38] iwlwifi: mvm: add rxf and txf to dump data Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 17/38] iwlwifi: correctly set the NMI register Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 18/38] iwlwifi: mvm: sync statistics firmware API Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 19/38] iwlwifi: mvm: move statistics API to new header file Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 20/38] iwlwifi: mvm: generate statistics debugfs code Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 21/38] iwlwifi: mvm: rs: cleanup unuseful and overflowing traces Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 22/38] iwlwifi: mvm: ignore temperature updates in the RX statistics notification Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 23/38] iwlwifi: mvm: move U-APSD decision to authentication Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 24/38] iwlwifi: mvm: BT Coex - fine tune the MPLUT register Emmanuel Grumbach
2015-01-22 20:33 ` Emmanuel Grumbach [this message]
2015-01-22 20:33 ` [PATCH 26/38] Revert "iwlwifi: mvm: drop non VO frames when flushing" Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 27/38] iwlwifi: mvm: rs: use STBC regardless of power save mode Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 28/38] iwlwifi: mvm: document switch case fall-through in iwl_mvm_send_sta_key Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 29/38] iwlwifi: pcie: init ref_lock Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 30/38] iwlwifi: mvm: support family 8000 C step Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 31/38] iwlwifi: mvm: BT Coex - set all the co-running values to 0 Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 32/38] iwlwifi: mvm: Do not consider invalid HW queues in queue mask Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 33/38] iwlwifi: mvm: really disable TDLS queues Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 34/38] iwlwifi: mvm: rs: refactor ht/vht init Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 35/38] iwlwifi: mvm: use a new API for enabling STBC Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 36/38] iwlwifi: mvm: rs: remove stats argument from functions Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 37/38] iwlwifi: pcie: support secured boot flow for family 8000 B step Emmanuel Grumbach
2015-01-22 20:33 ` [PATCH 38/38] iwlwifi: mvm: fix rx chains configuration in phy ctxt cmd Emmanuel Grumbach
2015-01-23 15:56 ` pull request: iwlwifi-next 2015-01-22 Kalle Valo

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=1421958809-3371-25-git-send-email-emmanuel.grumbach@intel.com \
    --to=emmanuel.grumbach@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.