aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/power.c
diff options
context:
space:
mode:
authorAlexander Bondar <alexander.bondar@intel.com>2013-09-02 10:10:14 -0400
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2013-12-17 12:39:42 -0500
commit51498cf6d8b42e89be77d48a2158825ca9bbd3bf (patch)
tree0b624003c1d42a442eb4b5715c189d393252f530 /drivers/net/wireless/iwlwifi/mvm/power.c
parent92d8556250c81bd6d4df522926a2cb3711dd01e2 (diff)
iwlwifi: mvm: Enable power save on a single P2P client interface
Enable power save on P2P client interface only if it is the only bound interface. Avoid using uAPSD if P2P client is associated to GO that uses opportunistic power save. This is due to current FW limitation. Signed-off-by: Alexander Bondar <alexander.bondar@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.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index cfed105b28b2..0ef467428064 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -284,6 +284,7 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
284 bool radar_detect = false; 284 bool radar_detect = false;
285 struct iwl_mvm_vif *mvmvif __maybe_unused = 285 struct iwl_mvm_vif *mvmvif __maybe_unused =
286 iwl_mvm_vif_from_mac80211(vif); 286 iwl_mvm_vif_from_mac80211(vif);
287 bool allow_uapsd = true;
287 288
288 cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, 289 cmd->id_and_color = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id,
289 mvmvif->color)); 290 mvmvif->color));
@@ -354,8 +355,19 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
354 cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT); 355 cpu_to_le32(IWL_MVM_WOWLAN_PS_TX_DATA_TIMEOUT);
355 } 356 }
356 357
357 if (memcmp(mvmvif->uapsd_misbehaving_bssid, vif->bss_conf.bssid, 358 if (!memcmp(mvmvif->uapsd_misbehaving_bssid, vif->bss_conf.bssid,
358 ETH_ALEN)) 359 ETH_ALEN))
360 allow_uapsd = false;
361 /*
362 * Avoid using uAPSD if P2P client is associated to GO that uses
363 * opportunistic power save. This is due to current FW limitation.
364 */
365 if (vif->p2p &&
366 vif->bss_conf.p2p_noa_attr.oppps_ctwindow &
367 IEEE80211_P2P_OPPPS_ENABLE_BIT)
368 allow_uapsd = false;
369
370 if (allow_uapsd)
359 iwl_mvm_power_configure_uapsd(mvm, vif, cmd); 371 iwl_mvm_power_configure_uapsd(mvm, vif, cmd);
360 372
361#ifdef CONFIG_IWLWIFI_DEBUGFS 373#ifdef CONFIG_IWLWIFI_DEBUGFS
@@ -404,7 +416,11 @@ static int iwl_mvm_power_mac_update_mode(struct iwl_mvm *mvm,
404 bool ba_enable; 416 bool ba_enable;
405 struct iwl_mac_power_cmd cmd = {}; 417 struct iwl_mac_power_cmd cmd = {};
406 418
407 if (vif->type != NL80211_IFTYPE_STATION || vif->p2p) 419 if (vif->type != NL80211_IFTYPE_STATION)
420 return 0;
421
422 if (vif->p2p &&
423 !(mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_P2P_PS))
408 return 0; 424 return 0;
409 425
410 iwl_mvm_power_build_cmd(mvm, vif, &cmd); 426 iwl_mvm_power_build_cmd(mvm, vif, &cmd);