summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/mvm/power.c
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-08-08 19:50:46 +0300
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-09-03 22:48:59 +0300
commit2533edcee8aa311a24e5c0a7da955893ad65dc24 (patch)
tree8c205a88b744cf0ef3658b01a0f55027d51db686 /drivers/net/wireless/iwlwifi/mvm/power.c
parentef9203d23fecf11e02958de0988170a67adf7447 (diff)
downloadlwn-2533edcee8aa311a24e5c0a7da955893ad65dc24.tar.gz
lwn-2533edcee8aa311a24e5c0a7da955893ad65dc24.zip
iwlwifi: mvm: add option that allows a vif to disable PS
We need to disable PS when a monitor vif is active or, in the future, when a channel switch is happening. Add a boolean to mvmvif that allows PS to be disabled generically. Additionally, make the monitor interface use this new flag when it gets activated. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/power.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/power.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index 18f887aa32ae..b552183d0a31 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -512,6 +512,17 @@ static void iwl_mvm_power_disable_pm_iterator(void *_data, u8* mac,
mvmvif->pm_enabled = false;
}
+static void iwl_mvm_power_ps_disabled_iterator(void *_data, u8* mac,
+ struct ieee80211_vif *vif)
+{
+ struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+ bool *disable_ps = _data;
+
+ if (mvmvif->phy_ctxt)
+ if (mvmvif->phy_ctxt->id < MAX_PHYS)
+ *disable_ps |= mvmvif->ps_disabled;
+}
+
static void iwl_mvm_power_get_vifs_iterator(void *_data, u8 *mac,
struct ieee80211_vif *vif)
{
@@ -831,16 +842,18 @@ int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
return ret;
}
-static int iwl_mvm_power_set_ps(struct iwl_mvm *mvm,
- struct iwl_power_vifs *vifs)
+static int iwl_mvm_power_set_ps(struct iwl_mvm *mvm)
{
bool disable_ps;
int ret;
/* disable PS if CAM */
disable_ps = (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_CAM);
- /* ...or if there is an active monitor vif */
- disable_ps |= (vifs->monitor_vif && vifs->monitor_active);
+ /* ...or if any of the vifs require PS to be off */
+ ieee80211_iterate_active_interfaces_atomic(mvm->hw,
+ IEEE80211_IFACE_ITER_NORMAL,
+ iwl_mvm_power_ps_disabled_iterator,
+ &disable_ps);
/* update device power state if it has changed */
if (mvm->ps_disabled != disable_ps) {
@@ -889,7 +902,7 @@ int iwl_mvm_power_update_ps(struct iwl_mvm *mvm)
IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_power_get_vifs_iterator, &vifs);
- ret = iwl_mvm_power_set_ps(mvm, &vifs);
+ ret = iwl_mvm_power_set_ps(mvm);
if (ret)
return ret;
@@ -912,7 +925,7 @@ int iwl_mvm_power_update_mac(struct iwl_mvm *mvm)
iwl_mvm_power_set_pm(mvm, &vifs);
- ret = iwl_mvm_power_set_ps(mvm, &vifs);
+ ret = iwl_mvm_power_set_ps(mvm);
if (ret)
return ret;