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 16/22] iwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only
Date: Sat, 17 Aug 2019 09:51:54 +0300	[thread overview]
Message-ID: <20190817065200.9701-17-luca@coelho.fi> (raw)
In-Reply-To: <20190817065200.9701-1-luca@coelho.fi>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Now that d0i3 is dead, this function can't be called from d0i3
flows. Change its signature and make it static.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c  | 64 +++++---------------
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 12 ----
 2 files changed, 15 insertions(+), 61 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 2ddc6cc56d1d..89839a83d8c2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -735,40 +735,16 @@ iwl_mvm_get_wowlan_config(struct iwl_mvm *mvm,
 	return 0;
 }
 
-static void
-iwl_mvm_iter_d0i3_ap_keys(struct iwl_mvm *mvm,
-			  struct ieee80211_vif *vif,
-			  void (*iter)(struct ieee80211_hw *hw,
-				       struct ieee80211_vif *vif,
-				       struct ieee80211_sta *sta,
-				       struct ieee80211_key_conf *key,
-				       void *data),
-			  void *data)
-{
-	struct ieee80211_sta *ap_sta;
-
-	rcu_read_lock();
-
-	ap_sta = rcu_dereference(mvm->fw_id_to_mac_id[mvm->d0i3_ap_sta_id]);
-	if (IS_ERR_OR_NULL(ap_sta))
-		goto out;
-
-	ieee80211_iter_keys_rcu(mvm->hw, vif, iter, data);
-out:
-	rcu_read_unlock();
-}
-
-int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
-				     struct ieee80211_vif *vif,
-				     bool d0i3,
-				     u32 cmd_flags)
+static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
+					    struct ieee80211_vif *vif,
+					    u32 cmd_flags)
 {
 	struct iwl_wowlan_kek_kck_material_cmd kek_kck_cmd = {};
 	struct iwl_wowlan_tkip_params_cmd tkip_cmd = {};
 	bool unified = fw_has_capa(&mvm->fw->ucode_capa,
 				   IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG);
 	struct wowlan_key_data key_data = {
-		.configure_keys = !d0i3 && !unified,
+		.configure_keys = !unified,
 		.use_rsc_tsc = false,
 		.tkip = &tkip_cmd,
 		.use_tkip = false,
@@ -784,25 +760,16 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 	 * if we have to configure keys, call ieee80211_iter_keys(),
 	 * as we need non-atomic context in order to take the
 	 * required locks.
-	 * for the d0i3 we can't use ieee80211_iter_keys(), as
-	 * taking (almost) any mutex might result in deadlock.
 	 */
-	if (!d0i3) {
-		/*
-		 * Note that currently we don't propagate cmd_flags
-		 * to the iterator. In case of key_data.configure_keys,
-		 * all the configured commands are SYNC, and
-		 * iwl_mvm_wowlan_program_keys() will take care of
-		 * locking/unlocking mvm->mutex.
-		 */
-		ieee80211_iter_keys(mvm->hw, vif,
-				    iwl_mvm_wowlan_program_keys,
-				    &key_data);
-	} else {
-		iwl_mvm_iter_d0i3_ap_keys(mvm, vif,
-					  iwl_mvm_wowlan_program_keys,
-					  &key_data);
-	}
+	/*
+	 * Note that currently we don't propagate cmd_flags
+	 * to the iterator. In case of key_data.configure_keys,
+	 * all the configured commands are SYNC, and
+	 * iwl_mvm_wowlan_program_keys() will take care of
+	 * locking/unlocking mvm->mutex.
+	 */
+	ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_wowlan_program_keys,
+			    &key_data);
 
 	if (key_data.error) {
 		ret = -EIO;
@@ -830,7 +797,7 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 	}
 
 	/* configure rekey data only if offloaded rekey is supported (d3) */
-	if (mvmvif->rekey_data.valid && !d0i3) {
+	if (mvmvif->rekey_data.valid) {
 		memset(&kek_kck_cmd, 0, sizeof(kek_kck_cmd));
 		memcpy(kek_kck_cmd.kck, mvmvif->rekey_data.kck,
 		       NL80211_KCK_LEN);
@@ -881,8 +848,7 @@ iwl_mvm_wowlan_config(struct iwl_mvm *mvm,
 		 * that isn't really a problem though.
 		 */
 		mutex_unlock(&mvm->mutex);
-		ret = iwl_mvm_wowlan_config_key_params(mvm, vif, false,
-						       CMD_ASYNC);
+		ret = iwl_mvm_wowlan_config_key_params(mvm, vif, CMD_ASYNC);
 		mutex_lock(&mvm->mutex);
 		if (ret)
 			return ret;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 2cf5d31ad3ed..03f3faa02781 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1802,21 +1802,9 @@ void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw,
 extern const struct file_operations iwl_dbgfs_d3_test_ops;
 struct iwl_wowlan_status *iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm);
 #ifdef CONFIG_PM
-int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
-				     struct ieee80211_vif *vif,
-				     bool host_awake,
-				     u32 cmd_flags);
 void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm,
 				 struct ieee80211_vif *vif);
 #else
-static inline int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
-						   struct ieee80211_vif *vif,
-						   bool host_awake,
-						   u32 cmd_flags)
-{
-	return 0;
-}
-
 static inline void
 iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 {
-- 
2.23.0.rc1


  parent reply	other threads:[~2019-08-17  6:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-17  6:51 [PATCH 00/22] iwlwifi: updates intended for v5.4 2019-08-17 Luca Coelho
2019-08-17  6:51 ` [PATCH 01/22] iwlwifi: bump FW API to 49 for 22000 series Luca Coelho
2019-08-17  6:51 ` [PATCH 02/22] iwlwifi: Send DQA enable command only if TVL is on Luca Coelho
2019-08-17  6:51 ` [PATCH 03/22] iwlwifi: mvm: remove redundant condition in iwl_mvm_set_hw_rfkill_state Luca Coelho
2019-08-17  6:51 ` [PATCH 04/22] iwlwifi: mvm: Block 26-tone RU OFDMA transmissions Luca Coelho
2019-08-17  6:51 ` [PATCH 05/22] iwlwifi: mvm: remove unnecessary forward declarations Luca Coelho
2019-08-17  6:51 ` [PATCH 06/22] iwlwifi: dbg: move monitor recording functionality from header file Luca Coelho
2019-08-17  6:51 ` [PATCH 07/22] iwlwifi: dbg: move debug recording stop from trans to op mode Luca Coelho
2019-08-17  6:51 ` [PATCH 08/22] iwlwifi: dbg: support debug recording suspend resume command Luca Coelho
2019-08-17  6:51 ` [PATCH 09/22] iwlwifi: remove iwl-constants.h Luca Coelho
2019-08-18 13:55   ` Kalle Valo
2019-08-19 13:07     ` Luca Coelho
2019-08-17  6:51 ` [PATCH 10/22] iwlwifi: mvm: fix scan config command size Luca Coelho
2019-08-17  6:51 ` [PATCH 11/22] iwlwifi: mvm: add the skb length to a print Luca Coelho
2019-08-17  6:51 ` [PATCH 12/22] iwlwifi: mvm: start to remove the code for d0i3 Luca Coelho
2019-08-18 14:01   ` Kalle Valo
2019-08-19 13:08     ` Luca Coelho
2019-08-17  6:51 ` [PATCH 13/22] iwlwifi: remove all the d0i3 references Luca Coelho
2019-08-17  6:51 ` [PATCH 14/22] iwlwifi: mvm: remove the tx defer for d0i3 Luca Coelho
2019-08-17  6:51 ` [PATCH 15/22] iwlwifi: mvm: remove the d0i3 entry/exit flow Luca Coelho
2019-08-17  6:51 ` Luca Coelho [this message]
2019-08-17  6:51 ` [PATCH 17/22] iwlwifi: mvm: remove d0i3_ap_sta_id Luca Coelho
2019-08-17  6:51 ` [PATCH 18/22] iwlwifi: mvm: remove iwl_mvm_update_d0i3_power_mode Luca Coelho
2019-08-17  6:51 ` [PATCH 19/22] iwlwifi: mvm: remove last leftovers of d0i3 Luca Coelho
2019-08-17  6:51 ` [PATCH 20/22] iwlwifi: remove CMD_HIGH_PRIO Luca Coelho
2019-08-17  6:51 ` [PATCH 21/22] iwlwifi: trans: remove suspending flag Luca Coelho
2019-08-17  6:52 ` [PATCH 22/22] iwlwifi: remove the code under IWLWIFI_PCIE_RTPM Luca Coelho
2019-08-18 13:59   ` Kalle Valo
2019-08-19 13:08     ` 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=20190817065200.9701-17-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).