Commit 9474d444 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Emmanuel Grumbach

iwlwifi: mvm: fix PSM disable during TDLS

Simplify the code and check for TDLS stations just before sending the
MAC_POWER_TABLE command. The previous version of the code still allowed
PM in some multi-interface scenarios even with TDLS connected.
Signed-off-by: default avatarArik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 49c6d802
...@@ -336,7 +336,7 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, ...@@ -336,7 +336,7 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK);
if (!vif->bss_conf.ps || iwl_mvm_vif_low_latency(mvmvif) || if (!vif->bss_conf.ps || iwl_mvm_vif_low_latency(mvmvif) ||
!mvmvif->pm_enabled) !mvmvif->pm_enabled || iwl_mvm_tdls_sta_count(mvm, vif))
return; return;
cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK);
...@@ -510,8 +510,6 @@ struct iwl_power_vifs { ...@@ -510,8 +510,6 @@ struct iwl_power_vifs {
bool bss_active; bool bss_active;
bool ap_active; bool ap_active;
bool monitor_active; bool monitor_active;
bool bss_tdls;
bool p2p_tdls;
}; };
static void iwl_mvm_power_disable_pm_iterator(void *_data, u8* mac, static void iwl_mvm_power_disable_pm_iterator(void *_data, u8* mac,
...@@ -566,8 +564,6 @@ static void iwl_mvm_power_get_vifs_iterator(void *_data, u8 *mac, ...@@ -566,8 +564,6 @@ static void iwl_mvm_power_get_vifs_iterator(void *_data, u8 *mac,
/* only a single MAC of the same type */ /* only a single MAC of the same type */
WARN_ON(power_iterator->p2p_vif); WARN_ON(power_iterator->p2p_vif);
power_iterator->p2p_vif = vif; power_iterator->p2p_vif = vif;
power_iterator->p2p_tdls =
!!iwl_mvm_tdls_sta_count(power_iterator->mvm, vif);
if (mvmvif->phy_ctxt) if (mvmvif->phy_ctxt)
if (mvmvif->phy_ctxt->id < MAX_PHYS) if (mvmvif->phy_ctxt->id < MAX_PHYS)
power_iterator->p2p_active = true; power_iterator->p2p_active = true;
...@@ -577,8 +573,6 @@ static void iwl_mvm_power_get_vifs_iterator(void *_data, u8 *mac, ...@@ -577,8 +573,6 @@ static void iwl_mvm_power_get_vifs_iterator(void *_data, u8 *mac,
/* only a single MAC of the same type */ /* only a single MAC of the same type */
WARN_ON(power_iterator->bss_vif); WARN_ON(power_iterator->bss_vif);
power_iterator->bss_vif = vif; power_iterator->bss_vif = vif;
power_iterator->bss_tdls =
!!iwl_mvm_tdls_sta_count(power_iterator->mvm, vif);
if (mvmvif->phy_ctxt) if (mvmvif->phy_ctxt)
if (mvmvif->phy_ctxt->id < MAX_PHYS) if (mvmvif->phy_ctxt->id < MAX_PHYS)
power_iterator->bss_active = true; power_iterator->bss_active = true;
...@@ -621,15 +615,13 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm, ...@@ -621,15 +615,13 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm,
ap_mvmvif = iwl_mvm_vif_from_mac80211(vifs->ap_vif); ap_mvmvif = iwl_mvm_vif_from_mac80211(vifs->ap_vif);
/* enable PM on bss if bss stand alone */ /* enable PM on bss if bss stand alone */
if (vifs->bss_active && !vifs->p2p_active && !vifs->ap_active && if (vifs->bss_active && !vifs->p2p_active && !vifs->ap_active) {
!vifs->bss_tdls) {
bss_mvmvif->pm_enabled = true; bss_mvmvif->pm_enabled = true;
return; return;
} }
/* enable PM on p2p if p2p stand alone */ /* enable PM on p2p if p2p stand alone */
if (vifs->p2p_active && !vifs->bss_active && !vifs->ap_active && if (vifs->p2p_active && !vifs->bss_active && !vifs->ap_active) {
!vifs->p2p_tdls) {
if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_P2P_PM) if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_P2P_PM)
p2p_mvmvif->pm_enabled = true; p2p_mvmvif->pm_enabled = true;
return; return;
......
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