Commit 0ea93388 authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Luca Coelho

iwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only

Now that d0i3 is dead, this function can't be called from d0i3
flows. Change its signature and make it static.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 45745363
...@@ -735,32 +735,8 @@ iwl_mvm_get_wowlan_config(struct iwl_mvm *mvm, ...@@ -735,32 +735,8 @@ iwl_mvm_get_wowlan_config(struct iwl_mvm *mvm,
return 0; return 0;
} }
static void static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
iwl_mvm_iter_d0i3_ap_keys(struct iwl_mvm *mvm,
struct ieee80211_vif *vif, 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) u32 cmd_flags)
{ {
struct iwl_wowlan_kek_kck_material_cmd kek_kck_cmd = {}; struct iwl_wowlan_kek_kck_material_cmd kek_kck_cmd = {};
...@@ -768,7 +744,7 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, ...@@ -768,7 +744,7 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
bool unified = fw_has_capa(&mvm->fw->ucode_capa, bool unified = fw_has_capa(&mvm->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG); IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG);
struct wowlan_key_data key_data = { struct wowlan_key_data key_data = {
.configure_keys = !d0i3 && !unified, .configure_keys = !unified,
.use_rsc_tsc = false, .use_rsc_tsc = false,
.tkip = &tkip_cmd, .tkip = &tkip_cmd,
.use_tkip = false, .use_tkip = false,
...@@ -784,10 +760,7 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, ...@@ -784,10 +760,7 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
* if we have to configure keys, call ieee80211_iter_keys(), * if we have to configure keys, call ieee80211_iter_keys(),
* as we need non-atomic context in order to take the * as we need non-atomic context in order to take the
* required locks. * 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 * Note that currently we don't propagate cmd_flags
* to the iterator. In case of key_data.configure_keys, * to the iterator. In case of key_data.configure_keys,
...@@ -795,14 +768,8 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, ...@@ -795,14 +768,8 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
* iwl_mvm_wowlan_program_keys() will take care of * iwl_mvm_wowlan_program_keys() will take care of
* locking/unlocking mvm->mutex. * locking/unlocking mvm->mutex.
*/ */
ieee80211_iter_keys(mvm->hw, vif, ieee80211_iter_keys(mvm->hw, vif, iwl_mvm_wowlan_program_keys,
iwl_mvm_wowlan_program_keys,
&key_data);
} else {
iwl_mvm_iter_d0i3_ap_keys(mvm, vif,
iwl_mvm_wowlan_program_keys,
&key_data); &key_data);
}
if (key_data.error) { if (key_data.error) {
ret = -EIO; ret = -EIO;
...@@ -830,7 +797,7 @@ int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm, ...@@ -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) */ /* 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)); memset(&kek_kck_cmd, 0, sizeof(kek_kck_cmd));
memcpy(kek_kck_cmd.kck, mvmvif->rekey_data.kck, memcpy(kek_kck_cmd.kck, mvmvif->rekey_data.kck,
NL80211_KCK_LEN); NL80211_KCK_LEN);
...@@ -881,8 +848,7 @@ iwl_mvm_wowlan_config(struct iwl_mvm *mvm, ...@@ -881,8 +848,7 @@ iwl_mvm_wowlan_config(struct iwl_mvm *mvm,
* that isn't really a problem though. * that isn't really a problem though.
*/ */
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
ret = iwl_mvm_wowlan_config_key_params(mvm, vif, false, ret = iwl_mvm_wowlan_config_key_params(mvm, vif, CMD_ASYNC);
CMD_ASYNC);
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
if (ret) if (ret)
return ret; return ret;
......
...@@ -1802,21 +1802,9 @@ void iwl_mvm_set_default_unicast_key(struct ieee80211_hw *hw, ...@@ -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; extern const struct file_operations iwl_dbgfs_d3_test_ops;
struct iwl_wowlan_status *iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm); struct iwl_wowlan_status *iwl_mvm_send_wowlan_get_status(struct iwl_mvm *mvm);
#ifdef CONFIG_PM #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, void iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm,
struct ieee80211_vif *vif); struct ieee80211_vif *vif);
#else #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 static inline void
iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif) iwl_mvm_set_last_nonqos_seq(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment