All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, Sara Sharon <sara.sharon@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 17/25] iwlwifi: mvm: support init extended command
Date: Wed, 19 Apr 2017 01:17:21 +0300	[thread overview]
Message-ID: <20170418221729.28372-18-luca@coelho.fi> (raw)
In-Reply-To: <20170418221729.28372-1-luca@coelho.fi>

From: Sara Sharon <sara.sharon@intel.com>

When we load firmware in extended mode (as we do by default for
now) driver should send a command what kind of commands ucode
should stop and wait for before proceeding with phy calibrations.
Support this command. Currently we only do NVM access - so mark
this bit only.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h | 23 +++++++++++++++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c     | 15 +++++++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c    |  1 +
 3 files changed, 39 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
index 5086dc00346c..8302cf03ac28 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw-api.h
@@ -327,6 +327,7 @@ enum iwl_phy_ops_subcmd_ids {
 
 enum iwl_system_subcmd_ids {
 	SHARED_MEM_CFG_CMD = 0x0,
+	INIT_EXTENDED_CFG_CMD = 0x03,
 };
 
 enum iwl_data_path_subcmd_ids {
@@ -2236,4 +2237,26 @@ struct iwl_nvm_access_complete_cmd {
 	__le32 reserved;
 } __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
 
+/**
+ * enum iwl_extended_cfg_flag - commands driver may send before
+ *	finishing init flow
+ * @IWL_INIT_DEBUG_CFG: driver is going to send debug config command
+ * @IWL_INIT_NVM: driver is going to send NVM_ACCESS commands
+ * @IWL_INIT_PHY: driver is going to send PHY_DB commands
+ */
+enum iwl_extended_cfg_flags {
+	IWL_INIT_DEBUG_CFG,
+	IWL_INIT_NVM,
+	IWL_INIT_PHY,
+};
+
+/**
+ * struct iwl_extended_cfg_cmd - mark what commands ucode should wait for
+ * before finishing init flows
+ * @init_flags: values from iwl_extended_cfg_flags
+ */
+struct iwl_init_extended_cfg_cmd {
+	__le32 init_flags;
+} __packed; /* INIT_EXTENDED_CFG_CMD_API_S_VER_1 */
+
 #endif /* __fw_api_h__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index bce3cf5fab67..900f1e25b9da 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -836,6 +836,9 @@ int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
 {
 	struct iwl_notification_wait init_wait;
 	struct iwl_nvm_access_complete_cmd nvm_complete = {};
+	struct iwl_init_extended_cfg_cmd init_cfg = {
+		.init_flags = cpu_to_le32(BIT(IWL_INIT_NVM)),
+	};
 	static const u16 init_complete[] = {
 		INIT_COMPLETE_NOTIF,
 	};
@@ -857,6 +860,18 @@ int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
 		goto error;
 	}
 
+	/* Send init config command to mark that we are sending NVM access
+	 * commands
+	 */
+	ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(SYSTEM_GROUP,
+						INIT_EXTENDED_CFG_CMD), 0,
+				   sizeof(init_cfg), &init_cfg);
+	if (ret) {
+		IWL_ERR(mvm, "Failed to run init config command: %d\n",
+			ret);
+		goto error;
+	}
+
 	/* Read the NVM only at driver load time, no need to do this twice */
 	if (read_nvm) {
 		/* Read nvm */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 488d3c948fe8..888053323c92 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -428,6 +428,7 @@ static const struct iwl_hcmd_names iwl_mvm_legacy_names[] = {
  */
 static const struct iwl_hcmd_names iwl_mvm_system_names[] = {
 	HCMD_NAME(SHARED_MEM_CFG_CMD),
+	HCMD_NAME(INIT_EXTENDED_CFG_CMD),
 };
 
 /* Please keep this array *SORTED* by hex value.
-- 
2.11.0

  parent reply	other threads:[~2017-04-18 22:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 22:17 [PATCH 00/25] iwlwifi: updates intended for v4.12 2017-04-19 Luca Coelho
2017-04-18 22:17 ` [PATCH 01/25] iwlwifi: mvm: remove unnecessary label in iwl_mvm_handle_rx_statistics() Luca Coelho
2017-04-18 22:17 ` [PATCH 02/25] iwlwifi: mvm: fix accessing fw_id_to_mac_id Luca Coelho
2017-04-18 22:17 ` [PATCH 03/25] iwlwifi: pcie: get rid of txq id assignment Luca Coelho
2017-04-18 22:17 ` [PATCH 04/25] iwlwifi: mvm: support new TX response for TVQM Luca Coelho
2017-04-18 22:17 ` [PATCH 05/25] iwlwifi: move to TVQM mode Luca Coelho
2017-04-18 22:17 ` [PATCH 06/25] iwlwifi: mvm: remove unneeded reg write in iwl_mvm_up() Luca Coelho
2017-04-18 22:17 ` [PATCH 07/25] iwlwifi: mvm: do not turn on RX_FLAG_AMSDU_MORE Luca Coelho
2017-04-18 22:17 ` [PATCH 08/25] iwlwifi: mvm: work around HW issue with AMSDU de-aggregation Luca Coelho
2017-04-18 22:17 ` [PATCH 09/25] iwlwifi: mvm: change TX_CMD_SEC_KEY_FROM_TABLE value Luca Coelho
2017-04-18 22:17 ` [PATCH 10/25] iwlwifi: mvm: ignore BAID for SN smaller than SSN Luca Coelho
2017-04-18 22:17 ` [PATCH 11/25] iwlwifi: mvm: provide the actual number of frames for the SP len Luca Coelho
2017-04-18 22:17 ` [PATCH 12/25] iwlwifi: add four new 8265 and 8275 series PCI IDs Luca Coelho
2017-04-18 22:17 ` [PATCH 13/25] iwlwifi: mvm: support change to a000 smem API Luca Coelho
2017-04-18 22:17 ` [PATCH 14/25] iwlwifi: support a000 CDB product Luca Coelho
2017-04-18 22:17 ` [PATCH 15/25] iwlwifi: pcie: remove RSA race workaround Luca Coelho
2017-04-18 22:17 ` [PATCH 16/25] iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table Luca Coelho
2017-04-18 22:17 ` Luca Coelho [this message]
2017-04-18 22:17 ` [PATCH 18/25] iwlwifi: mvm: disable RX queue notification for a000 devices Luca Coelho
2017-04-18 22:17 ` [PATCH 19/25] iwlwifi: mvm: dump frames early on invalid rate Luca Coelho
2017-04-18 22:17 ` [PATCH 20/25] iwlwifi: split the handler and the wake parts of the notification infra Luca Coelho
2017-04-18 22:17 ` [PATCH 21/25] iwlwifi: mvm: flip address 4 of AMSDU frames Luca Coelho
2017-04-18 22:17 ` [PATCH 22/25] iwlwifi: mvm: support changing band for phy context Luca Coelho
2017-04-18 22:17 ` [PATCH 23/25] iwlwifi: a000: fix memory offsets and lengths Luca Coelho
2017-04-18 22:17 ` [PATCH 24/25] iwlwifi: bump API to 31 Luca Coelho
2017-04-18 22:17 ` [PATCH 25/25] iwlwifi: mvm: allow block ack response without data 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=20170418221729.28372-18-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=sara.sharon@intel.com \
    /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.