提交 1e4d19ca 编写于 作者: L Luciano Coelho 提交者: Emmanuel Grumbach

iwlwifi: mvm: move the check if associated outside of the iterator for wowlan

Instead of checking if we are associated when suspending with wowlan
enabled in the interface iterator, allow it to return an unassociated
vif and move the check to the main suspend function.  This will be
needed by netdetect, since it should also work when we are not
associated but the vif is active.
Signed-off-by: NLuciano Coelho <luciano.coelho@intel.com>
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
上级 671b5820
...@@ -611,14 +611,10 @@ static void iwl_mvm_d3_iface_iterator(void *_data, u8 *mac, ...@@ -611,14 +611,10 @@ static void iwl_mvm_d3_iface_iterator(void *_data, u8 *mac,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct iwl_d3_iter_data *data = _data; struct iwl_d3_iter_data *data = _data;
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
if (vif->type != NL80211_IFTYPE_STATION || vif->p2p) if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
return; return;
if (mvmvif->ap_sta_id == IWL_MVM_STATION_COUNT)
return;
if (data->vif) { if (data->vif) {
IWL_ERR(data->mvm, "More than one managed interface active!\n"); IWL_ERR(data->mvm, "More than one managed interface active!\n");
data->error = true; data->error = true;
...@@ -1029,7 +1025,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, ...@@ -1029,7 +1025,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
/* see if there's only a single BSS vif and it's associated */ /* see if there's only a single BSS vif */
ieee80211_iterate_active_interfaces_atomic( ieee80211_iterate_active_interfaces_atomic(
mvm->hw, IEEE80211_IFACE_ITER_NORMAL, mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_d3_iface_iterator, &suspend_iter_data); iwl_mvm_d3_iface_iterator, &suspend_iter_data);
...@@ -1042,27 +1038,33 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, ...@@ -1042,27 +1038,33 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
vif = suspend_iter_data.vif; vif = suspend_iter_data.vif;
mvmvif = iwl_mvm_vif_from_mac80211(vif); mvmvif = iwl_mvm_vif_from_mac80211(vif);
ap_sta = rcu_dereference_protected( /* if we're associated, this is wowlan */
mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], if (mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) {
lockdep_is_held(&mvm->mutex)); ap_sta = rcu_dereference_protected(
if (IS_ERR_OR_NULL(ap_sta)) { mvm->fw_id_to_mac_id[mvmvif->ap_sta_id],
ret = -EINVAL; lockdep_is_held(&mvm->mutex));
goto out_noreset; if (IS_ERR_OR_NULL(ap_sta)) {
} ret = -EINVAL;
goto out_noreset;
}
ret = iwl_mvm_get_wowlan_config(mvm, wowlan, &wowlan_config_cmd, vif, ret = iwl_mvm_get_wowlan_config(mvm, wowlan, &wowlan_config_cmd,
mvmvif, ap_sta); vif, mvmvif, ap_sta);
if (ret) if (ret)
goto out_noreset; goto out_noreset;
ret = iwl_mvm_switch_to_d3(mvm); ret = iwl_mvm_switch_to_d3(mvm);
if (ret) if (ret)
goto out; goto out;
ret = iwl_mvm_wowlan_config(mvm, wowlan, &wowlan_config_cmd, ret = iwl_mvm_wowlan_config(mvm, wowlan, &wowlan_config_cmd,
vif, mvmvif, ap_sta); vif, mvmvif, ap_sta);
if (ret) if (ret)
goto out; goto out;
} else {
ret = 1;
goto out_noreset;
}
ret = iwl_mvm_power_update_device(mvm); ret = iwl_mvm_power_update_device(mvm);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册