linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <egrumbach@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Luciano Coelho <luciano.coelho@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 16/36] iwlwifi: mvm: add function to update only ps
Date: Wed,  3 Sep 2014 22:56:04 +0300	[thread overview]
Message-ID: <1409774184-24665-16-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <540771E5.6080908@gmail.com>

From: Luciano Coelho <luciano.coelho@intel.com>

Add a new iwl_mvm_power_update_ps() function that allows only ps to be
updated according to changes in the vifs.  This allows us to disable
ps only without affecting the pm values of the vifs (and to avoid
sending unnecessary MAC_PM_POWER_TABLE commands to the firmware).

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>
---
 drivers/net/wireless/iwlwifi/mvm/mvm.h   |  1 +
 drivers/net/wireless/iwlwifi/mvm/power.c | 52 ++++++++++++++++++++++++--------
 2 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 08cb26d..108ef16 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -983,6 +983,7 @@ int rs_pretty_print_rate(char *buf, const u32 rate);
 /* power management */
 int iwl_mvm_power_update_device(struct iwl_mvm *mvm);
 int iwl_mvm_power_update_mac(struct iwl_mvm *mvm);
+int iwl_mvm_power_update_ps(struct iwl_mvm *mvm);
 int iwl_mvm_power_mac_dbgfs_read(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 				 char *buf, int bufsz);
 
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index 42aaf57..18f887aa 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -857,13 +857,50 @@ static int iwl_mvm_power_set_ps(struct iwl_mvm *mvm,
 	return 0;
 }
 
-int iwl_mvm_power_update_mac(struct iwl_mvm *mvm)
+static int iwl_mvm_power_set_ba(struct iwl_mvm *mvm,
+				struct iwl_power_vifs *vifs)
 {
 	struct iwl_mvm_vif *mvmvif;
+	bool ba_enable;
+
+	if (!vifs->bf_vif)
+		return 0;
+
+	mvmvif = iwl_mvm_vif_from_mac80211(vifs->bf_vif);
+
+	ba_enable = !(!mvmvif->pm_enabled || mvm->ps_disabled ||
+		      !vifs->bf_vif->bss_conf.ps ||
+		      iwl_mvm_vif_low_latency(mvmvif));
+
+	return iwl_mvm_update_beacon_abort(mvm, vifs->bf_vif, ba_enable);
+}
+
+int iwl_mvm_power_update_ps(struct iwl_mvm *mvm)
+{
+	struct iwl_power_vifs vifs = {
+		.mvm = mvm,
+	};
+	int ret;
+
+	lockdep_assert_held(&mvm->mutex);
+
+	/* get vifs info */
+	ieee80211_iterate_active_interfaces_atomic(mvm->hw,
+					IEEE80211_IFACE_ITER_NORMAL,
+					iwl_mvm_power_get_vifs_iterator, &vifs);
+
+	ret = iwl_mvm_power_set_ps(mvm, &vifs);
+	if (ret)
+		return ret;
+
+	return iwl_mvm_power_set_ba(mvm, &vifs);
+}
+
+int iwl_mvm_power_update_mac(struct iwl_mvm *mvm)
+{
 	struct iwl_power_vifs vifs = {
 		.mvm = mvm,
 	};
-	bool ba_enable;
 	int ret;
 
 	lockdep_assert_held(&mvm->mutex);
@@ -891,16 +928,7 @@ int iwl_mvm_power_update_mac(struct iwl_mvm *mvm)
 			return ret;
 	}
 
-	if (!vifs.bf_vif)
-		return 0;
-
-	mvmvif = iwl_mvm_vif_from_mac80211(vifs.bf_vif);
-
-	ba_enable = !(!mvmvif->pm_enabled || mvm->ps_disabled ||
-		      !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_power_set_ba(mvm, &vifs);
 }
 
 int iwl_mvm_update_d0i3_power_mode(struct iwl_mvm *mvm,
-- 
1.9.1


  parent reply	other threads:[~2014-09-03 19:56 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 19:54 pull request: iwlwifi-next 2014-09-03 Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 01/36] iwlwifi: mvm: Add set NIC temperature debug option Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 02/36] iwlwifi: mvm: reduce the AMPDU size in low latency mode Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 03/36] iwlwifi: mvm: use dynamic SMPS for P2P Client Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 04/36] iwlwifi: mvm: add use_ps-poll debugfs power option Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 05/36] iwlwifi: mvm: force protection for P2P Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 06/36] iwlwifi: mvm: reset the temperature when temperature test is disabled Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 07/36] iwlwifi: mvm: don't run automatic checks if CT was caused by debugfs Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 08/36] iwlwifi: mvm: Add marker command 0xcb Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 09/36] iwlwifi: mvm: fix the dump_umac_error_log Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 10/36] iwlwifi: make U-APSD default configurable at compile time Emmanuel Grumbach
2014-09-03 19:55 ` [PATCH 11/36] iwlwifi: mvm: add debugfs entry for ps_disabled Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 12/36] iwlwifi: mvm: disable tx aggregation on low latency vifs Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 13/36] iwlwifi: mvm: clear d0i3 state on recovery Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 14/36] iwlwifi: mvm: re-enable ps when monitor interfaces are removed Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 15/36] iwlwifi: mvm: refactor iwl_mvm_power_set_pm() to spin the ps part off Emmanuel Grumbach
2014-09-03 19:56 ` Emmanuel Grumbach [this message]
2014-09-03 19:56 ` [PATCH 17/36] iwlwifi: mvm: add option that allows a vif to disable PS Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 18/36] iwlwifi: mvm: wait for TE notif when protecting TDLS session Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 19/36] iwlwifi: consolidate hw scheduler configuration code Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 20/36] iwlwifi: trans: refactor txq_enable arguments Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 21/36] iwlwifi: mvm: enable passive fragmented scan changes Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 22/36] iwlwifi: mvm: add some debugging to quota allocation Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 23/36] iwlwifi: don't export tracepoints unnecessarily Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 24/36] iwlwifi: mvm: fix comment typo Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 25/36] iwlwifi: trans: allow skipping scheduler hardware config Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 26/36] iwlwifi: trans: make aggregation explicit for TX queue handling Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 27/36] iwlwifi: trans: configure the scheduler enable register Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 28/36] iwlwifi: add Intel Mobile Communications copyright Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 29/36] iwlwifi: mvm: set the TX disable bit when doing a chanctx switch Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 30/36] iwlwifi: mvm: correct firmware disassoc command sequence Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 31/36] iwlwifi: mvm: clean up FIFO definitions Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 32/36] iwlwifi: mvm: clarify stop_count, remove transport_stopped Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 33/36] iwlwifi: mvm: use tdls indication from mac80211 Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 34/36] iwlwifi: mvm: use iwl_mvm_mac_get_queues_mask() more Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 35/36] iwlwifi: mvm: clean up broadcast station handling Emmanuel Grumbach
2014-09-03 19:56 ` [PATCH 36/36] iwlwifi: mvm: clean up AUX " Emmanuel Grumbach
2014-09-04 18:05 ` pull request: iwlwifi-next 2014-09-03 John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409774184-24665-16-git-send-email-egrumbach@gmail.com \
    --to=egrumbach@gmail.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).