Commit 999609f1 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Emmanuel Grumbach

iwlwifi: mvm: remove vif argument from power_update_mac

The power update function looks at all current vifs to determine the power
policy. It doesn't use the current vif. Instead the value was overwritten
and used internally.
Signed-off-by: default avatarArik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 13b72322
...@@ -1028,7 +1028,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw, ...@@ -1028,7 +1028,7 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
if (ret) if (ret)
goto out; goto out;
ret = iwl_mvm_power_update_mac(mvm, vif); ret = iwl_mvm_power_update_mac(mvm);
if (ret) if (ret)
goto out; goto out;
......
...@@ -175,7 +175,7 @@ static ssize_t iwl_dbgfs_pm_params_write(struct ieee80211_vif *vif, char *buf, ...@@ -175,7 +175,7 @@ static ssize_t iwl_dbgfs_pm_params_write(struct ieee80211_vif *vif, char *buf,
mutex_lock(&mvm->mutex); mutex_lock(&mvm->mutex);
iwl_dbgfs_update_pm(mvm, vif, param, val); iwl_dbgfs_update_pm(mvm, vif, param, val);
ret = iwl_mvm_power_update_mac(mvm, vif); ret = iwl_mvm_power_update_mac(mvm);
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
return ret ?: count; return ret ?: count;
......
...@@ -832,7 +832,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, ...@@ -832,7 +832,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
if (ret) if (ret)
goto out_release; goto out_release;
ret = iwl_mvm_power_update_mac(mvm, vif); ret = iwl_mvm_power_update_mac(mvm);
if (ret) if (ret)
goto out_release; goto out_release;
...@@ -983,7 +983,7 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw, ...@@ -983,7 +983,7 @@ static void iwl_mvm_mac_remove_interface(struct ieee80211_hw *hw,
if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE) if (mvm->vif_count && vif->type != NL80211_IFTYPE_P2P_DEVICE)
mvm->vif_count--; mvm->vif_count--;
iwl_mvm_power_update_mac(mvm, vif); iwl_mvm_power_update_mac(mvm);
iwl_mvm_mac_ctxt_remove(mvm, vif); iwl_mvm_mac_ctxt_remove(mvm, vif);
out_release: out_release:
...@@ -1354,7 +1354,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, ...@@ -1354,7 +1354,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm,
WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0)); WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0));
} else if (changes & (BSS_CHANGED_PS | BSS_CHANGED_P2P_PS | } else if (changes & (BSS_CHANGED_PS | BSS_CHANGED_P2P_PS |
BSS_CHANGED_QOS)) { BSS_CHANGED_QOS)) {
ret = iwl_mvm_power_update_mac(mvm, vif); ret = iwl_mvm_power_update_mac(mvm);
if (ret) if (ret)
IWL_ERR(mvm, "failed to update power mode\n"); IWL_ERR(mvm, "failed to update power mode\n");
} }
...@@ -1423,7 +1423,7 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw, ...@@ -1423,7 +1423,7 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
mvmvif->ap_ibss_active = true; mvmvif->ap_ibss_active = true;
/* power updated needs to be done before quotas */ /* power updated needs to be done before quotas */
iwl_mvm_power_update_mac(mvm, vif); iwl_mvm_power_update_mac(mvm);
ret = iwl_mvm_update_quotas(mvm, vif); ret = iwl_mvm_update_quotas(mvm, vif);
if (ret) if (ret)
...@@ -1441,7 +1441,7 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw, ...@@ -1441,7 +1441,7 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw,
return 0; return 0;
out_quota_failed: out_quota_failed:
iwl_mvm_power_update_mac(mvm, vif); iwl_mvm_power_update_mac(mvm);
mvmvif->ap_ibss_active = false; mvmvif->ap_ibss_active = false;
iwl_mvm_send_rm_bcast_sta(mvm, &mvmvif->bcast_sta); iwl_mvm_send_rm_bcast_sta(mvm, &mvmvif->bcast_sta);
out_unbind: out_unbind:
...@@ -1477,7 +1477,7 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw, ...@@ -1477,7 +1477,7 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
iwl_mvm_send_rm_bcast_sta(mvm, &mvmvif->bcast_sta); iwl_mvm_send_rm_bcast_sta(mvm, &mvmvif->bcast_sta);
iwl_mvm_binding_remove_vif(mvm, vif); iwl_mvm_binding_remove_vif(mvm, vif);
iwl_mvm_power_update_mac(mvm, vif); iwl_mvm_power_update_mac(mvm);
iwl_mvm_mac_ctxt_remove(mvm, vif); iwl_mvm_mac_ctxt_remove(mvm, vif);
...@@ -2239,7 +2239,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -2239,7 +2239,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw,
* Power state must be updated before quotas, * Power state must be updated before quotas,
* otherwise fw will complain. * otherwise fw will complain.
*/ */
iwl_mvm_power_update_mac(mvm, vif); iwl_mvm_power_update_mac(mvm);
/* Setting the quota at this stage is only required for monitor /* Setting the quota at this stage is only required for monitor
* interfaces. For the other types, the bss_info changed flow * interfaces. For the other types, the bss_info changed flow
...@@ -2262,7 +2262,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -2262,7 +2262,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw,
out_remove_binding: out_remove_binding:
iwl_mvm_binding_remove_vif(mvm, vif); iwl_mvm_binding_remove_vif(mvm, vif);
iwl_mvm_power_update_mac(mvm, vif); iwl_mvm_power_update_mac(mvm);
out_unlock: out_unlock:
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
if (ret) if (ret)
...@@ -2304,7 +2304,7 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -2304,7 +2304,7 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw,
out_unlock: out_unlock:
mvmvif->phy_ctxt = NULL; mvmvif->phy_ctxt = NULL;
iwl_mvm_power_update_mac(mvm, vif); iwl_mvm_power_update_mac(mvm);
mutex_unlock(&mvm->mutex); mutex_unlock(&mvm->mutex);
} }
......
...@@ -894,7 +894,7 @@ int rs_pretty_print_rate(char *buf, const u32 rate); ...@@ -894,7 +894,7 @@ int rs_pretty_print_rate(char *buf, const u32 rate);
/* power management */ /* power management */
int iwl_mvm_power_update_device(struct iwl_mvm *mvm); int iwl_mvm_power_update_device(struct iwl_mvm *mvm);
int iwl_mvm_power_update_mac(struct iwl_mvm *mvm, struct ieee80211_vif *vif); int iwl_mvm_power_update_mac(struct iwl_mvm *mvm);
int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm, struct ieee80211_vif *vif, int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
char *buf, int bufsz); char *buf, int bufsz);
......
...@@ -828,7 +828,7 @@ int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm, ...@@ -828,7 +828,7 @@ int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
return ret; return ret;
} }
int iwl_mvm_power_update_mac(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int iwl_mvm_power_update_mac(struct iwl_mvm *mvm)
{ {
struct iwl_mvm_vif *mvmvif; struct iwl_mvm_vif *mvmvif;
struct iwl_power_vifs vifs = {}; struct iwl_power_vifs vifs = {};
...@@ -868,11 +868,11 @@ int iwl_mvm_power_update_mac(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ...@@ -868,11 +868,11 @@ int iwl_mvm_power_update_mac(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
if (!vifs.bf_vif) if (!vifs.bf_vif)
return 0; return 0;
vif = vifs.bf_vif; mvmvif = iwl_mvm_vif_from_mac80211(vifs.bf_vif);
mvmvif = iwl_mvm_vif_from_mac80211(vif);
ba_enable = !(!mvmvif->pm_enabled || mvm->ps_disabled || ba_enable = !(!mvmvif->pm_enabled || mvm->ps_disabled ||
!vif->bss_conf.ps || iwl_mvm_vif_low_latency(mvmvif)); !vifs.bf_vif->bss_conf.ps ||
iwl_mvm_vif_low_latency(mvmvif));
return iwl_mvm_update_beacon_abort(mvm, vifs.bf_vif, ba_enable); return iwl_mvm_update_beacon_abort(mvm, vifs.bf_vif, ba_enable);
} }
......
...@@ -702,7 +702,7 @@ int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -702,7 +702,7 @@ int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
iwl_mvm_bt_coex_vif_change(mvm); iwl_mvm_bt_coex_vif_change(mvm);
return iwl_mvm_power_update_mac(mvm, vif); return iwl_mvm_power_update_mac(mvm);
} }
static void iwl_mvm_ll_iter(void *_data, u8 *mac, struct ieee80211_vif *vif) static void iwl_mvm_ll_iter(void *_data, u8 *mac, 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