iwlwifi: mvm: reflect TDLS pm state in mvmvif->pm_enabled
authorArik Nemtsov <arik@wizery.com>
Sun, 22 Feb 2015 17:15:04 +0000 (19:15 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 12 Mar 2015 07:57:39 +0000 (09:57 +0200)
When entering D0i3, the MVM mutex cannot be grabbed. This interferes
with the calculation of the number of connected TDLS stations during
the setup of the power cmd.
The goal is to disable power saving for all vifs while any TDLS station
is connected. For this purpose it is enough to keep the pm_enabled
member of all mvmvifs as false. An update of the power state already
occurs when a TDLS station is added/removed, so the values are correctly
updated.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/power.c

index 2620dd0c45f9638c949fd34b7482533b13c33126..9c6fce10fe0bdb4f1e19b0db9046701957c8cf71 100644 (file)
@@ -357,7 +357,7 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
        cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK);
 
        if (!vif->bss_conf.ps || iwl_mvm_vif_low_latency(mvmvif) ||
-           !mvmvif->pm_enabled || iwl_mvm_tdls_sta_count(mvm, vif))
+           !mvmvif->pm_enabled)
                return;
 
        cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK);
@@ -638,6 +638,10 @@ static void iwl_mvm_power_set_pm(struct iwl_mvm *mvm,
        if (vifs->ap_vif)
                ap_mvmvif = iwl_mvm_vif_from_mac80211(vifs->ap_vif);
 
+       /* don't allow PM if any TDLS stations exist */
+       if (iwl_mvm_tdls_sta_count(mvm, NULL))
+               return;
+
        /* enable PM on bss if bss stand alone */
        if (vifs->bss_active && !vifs->p2p_active && !vifs->ap_active) {
                bss_mvmvif->pm_enabled = true;