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: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 56/62] iwlwifi: mvm: clean up in power code
Date: Mon,  3 Feb 2014 22:58:02 +0200	[thread overview]
Message-ID: <1391461088-8082-56-git-send-email-egrumbach@gmail.com> (raw)
In-Reply-To: <CANUX_P2BFLVRL-DFsTWA56zLJsRcn_dZhVdCChaQs2ZLWiBv3g@mail.gmail.com>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Reduce indentation where it is possible.
Make a function static - it wasn't used outside its file
anyway.
Remove the unneeded pm_prevent state.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/mvm.h   |    5 ---
 drivers/net/wireless/iwlwifi/mvm/power.c |   61 +++++++++++++-----------------
 2 files changed, 27 insertions(+), 39 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h
index 1f53ade..93e6c18 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h
@@ -353,8 +353,6 @@ struct iwl_mvm_vif {
 
 	/* FW identified misbehaving AP */
 	u8 uapsd_misbehaving_bssid[ETH_ALEN];
-
-	bool pm_prevented;
 };
 
 static inline struct iwl_mvm_vif *
@@ -943,9 +941,6 @@ int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
 				  struct ieee80211_vif *vif,
 				  u32 flags);
-int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
-				   struct iwl_beacon_filter_cmd *cmd,
-				   u32 flags);
 int iwl_mvm_update_beacon_abort(struct iwl_mvm *mvm,
 				struct ieee80211_vif *vif, bool enable);
 int iwl_mvm_update_beacon_filter(struct iwl_mvm *mvm,
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c
index b20771c..f9ddd79 100644
--- a/drivers/net/wireless/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/iwlwifi/mvm/power.c
@@ -74,40 +74,36 @@
 
 #define POWER_KEEP_ALIVE_PERIOD_SEC    25
 
+static
 int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
 				   struct iwl_beacon_filter_cmd *cmd,
 				   u32 flags)
 {
-	int ret;
-
-	ret = iwl_mvm_send_cmd_pdu(mvm, REPLY_BEACON_FILTERING_CMD, flags,
-				   sizeof(struct iwl_beacon_filter_cmd), cmd);
-
-	if (!ret) {
-		IWL_DEBUG_POWER(mvm, "ba_enable_beacon_abort is: %d\n",
-				le32_to_cpu(cmd->ba_enable_beacon_abort));
-		IWL_DEBUG_POWER(mvm, "ba_escape_timer is: %d\n",
-				le32_to_cpu(cmd->ba_escape_timer));
-		IWL_DEBUG_POWER(mvm, "bf_debug_flag is: %d\n",
-				le32_to_cpu(cmd->bf_debug_flag));
-		IWL_DEBUG_POWER(mvm, "bf_enable_beacon_filter is: %d\n",
-				le32_to_cpu(cmd->bf_enable_beacon_filter));
-		IWL_DEBUG_POWER(mvm, "bf_energy_delta is: %d\n",
-				le32_to_cpu(cmd->bf_energy_delta));
-		IWL_DEBUG_POWER(mvm, "bf_escape_timer is: %d\n",
-				le32_to_cpu(cmd->bf_escape_timer));
-		IWL_DEBUG_POWER(mvm, "bf_roaming_energy_delta is: %d\n",
-				le32_to_cpu(cmd->bf_roaming_energy_delta));
-		IWL_DEBUG_POWER(mvm, "bf_roaming_state is: %d\n",
-				le32_to_cpu(cmd->bf_roaming_state));
-		IWL_DEBUG_POWER(mvm, "bf_temp_threshold is: %d\n",
-				le32_to_cpu(cmd->bf_temp_threshold));
-		IWL_DEBUG_POWER(mvm, "bf_temp_fast_filter is: %d\n",
-				le32_to_cpu(cmd->bf_temp_fast_filter));
-		IWL_DEBUG_POWER(mvm, "bf_temp_slow_filter is: %d\n",
-				le32_to_cpu(cmd->bf_temp_slow_filter));
-	}
-	return ret;
+	IWL_DEBUG_POWER(mvm, "ba_enable_beacon_abort is: %d\n",
+			le32_to_cpu(cmd->ba_enable_beacon_abort));
+	IWL_DEBUG_POWER(mvm, "ba_escape_timer is: %d\n",
+			le32_to_cpu(cmd->ba_escape_timer));
+	IWL_DEBUG_POWER(mvm, "bf_debug_flag is: %d\n",
+			le32_to_cpu(cmd->bf_debug_flag));
+	IWL_DEBUG_POWER(mvm, "bf_enable_beacon_filter is: %d\n",
+			le32_to_cpu(cmd->bf_enable_beacon_filter));
+	IWL_DEBUG_POWER(mvm, "bf_energy_delta is: %d\n",
+			le32_to_cpu(cmd->bf_energy_delta));
+	IWL_DEBUG_POWER(mvm, "bf_escape_timer is: %d\n",
+			le32_to_cpu(cmd->bf_escape_timer));
+	IWL_DEBUG_POWER(mvm, "bf_roaming_energy_delta is: %d\n",
+			le32_to_cpu(cmd->bf_roaming_energy_delta));
+	IWL_DEBUG_POWER(mvm, "bf_roaming_state is: %d\n",
+			le32_to_cpu(cmd->bf_roaming_state));
+	IWL_DEBUG_POWER(mvm, "bf_temp_threshold is: %d\n",
+			le32_to_cpu(cmd->bf_temp_threshold));
+	IWL_DEBUG_POWER(mvm, "bf_temp_fast_filter is: %d\n",
+			le32_to_cpu(cmd->bf_temp_fast_filter));
+	IWL_DEBUG_POWER(mvm, "bf_temp_slow_filter is: %d\n",
+			le32_to_cpu(cmd->bf_temp_slow_filter));
+
+	return iwl_mvm_send_cmd_pdu(mvm, REPLY_BEACON_FILTERING_CMD, flags,
+				    sizeof(struct iwl_beacon_filter_cmd), cmd);
 }
 
 static
@@ -313,7 +309,7 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm,
 	    mvmvif->dbgfs_pm.disable_power_off)
 		cmd->flags &= cpu_to_le16(~POWER_FLAGS_POWER_SAVE_ENA_MSK);
 #endif
-	if (!vif->bss_conf.ps || mvmvif->pm_prevented ||
+	if (!vif->bss_conf.ps || mvm->bound_vif_cnt > 1 ||
 	    iwl_mvm_vif_low_latency(mvmvif))
 		return;
 
@@ -549,12 +545,9 @@ int iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm,
 static void iwl_mvm_power_binding_iterator(void *_data, u8 *mac,
 					   struct ieee80211_vif *vif)
 {
-	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 	struct iwl_mvm *mvm = _data;
 	int ret;
 
-	mvmvif->pm_prevented = (mvm->bound_vif_cnt <= 1) ? false : true;
-
 	ret = iwl_mvm_power_mac_update_mode(mvm, vif);
 	WARN_ONCE(ret, "Failed to update power parameters on a specific vif\n");
 }
-- 
1.7.9.5


  parent reply	other threads:[~2014-02-03 20:59 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-03 20:56 pull request: iwlwifi-next 2014-02-03 Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 01/62] iwlwifi: mvm: implement AP/GO uAPSD support Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 02/62] iwlwifi: Add 8000 HW family support Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 03/62] iwlwifi: mvm: support NVM sections for family 8000 Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 04/62] iwlwifi: pcie: disable APMG configurations " Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 05/62] iwlwifi: pcie: change CSR reset in " Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 06/62] iwlwifi: pcie: Disable L0S exit timer for 8000 HW family Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 07/62] iwlwifi: pcie: fix secure section / dual cpu firmware loading Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 08/62] iwlwifi: pcie: make FH debugfs file code easier to understand Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 09/62] iwlwifi: 7000: warn about old firmware Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 10/62] iwlwifi: remove obsolete TODO Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 11/62] iwlwifi: mvm: provide helper to fetch the iwl_mvm_sta from sta_id Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 12/62] iwlwifi: mvm: check ARRAY_SIZE(mvm->fw_id_to_mac_id) = IWL_MVM_STATION_COUNT Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 13/62] iwlwifi: pcie: fix unused variable gcc warning Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 14/62] iwlwifi: mvm: don't stop sched scan in restart Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 15/62] iwlwifi: mvm: notify scan completed even if no fw_restart Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 16/62] iwlwifi: mvm: add low-latency framework Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 17/62] iwlwifi: mvm: disable powersave in low-latency Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 18/62] iwlwifi: mvm: reserve bandwidth for low-latency interface Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 19/62] iwlwifi: mvm: limit non-low-latency binding scheduling duration Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 20/62] iwlwifi: mvm: BT Coex - set low latency vif as primary Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 21/62] iwlwifi: mvm: BT Coex - change SMPS settings in AP mode Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 22/62] iwlwifi: mvm: change the format of the SRAM dump Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 23/62] iwlwifi: mvm: add basic bcast filtering implementation Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 24/62] iwlwifi: mvm: add predefined broadcast filter configuration Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 25/62] iwlwifi: mvm: add dest ip to bcast " Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 26/62] iwlwifi: mvm: add bcast_filtering debugfs entries Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 27/62] iwlwifi: mvm: allow to force reduced tx power from debugfs Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 28/62] iwlwifi: rs: use const u16 for throughput tables Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 29/62] iwlwifi: mvm: add vif type in debugfs output Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 30/62] iwlwifi: mvm: add the quota remainder to a data binding Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 31/62] iwlwifi: mvm: fix quota allocation Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 32/62] iwlwifi: pcie: retrieve and parse ACPI power limitations Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 33/62] iwlwifi: mvm: handle platform PCIe power limitation Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 34/62] iwlwifi: 7265: add power limit/tx backoff translation table Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 35/62] iwlwifi: add D0i3 references boiler plate Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 36/62] iwlwifi: add enter/exit D0i3 ops Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 37/62] iwlwifi: add very first D0i3 support Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 38/62] iwlwifi: mvm: add D0i3 power configurations Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 39/62] iwlwifi: mvm: configure vifs upon D0i3 entry/exit Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 40/62] iwlwifi: mvm: allow transport sleep when FW is operational Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 41/62] iwlwifi: mvm: add D0i3 ref/unref for scan Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 42/62] iwlwifi: mvm: add D0i3 ref/unref for ROC commands Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 43/62] iwlwifi: mvm: add D0i3 ref/unref when ap, ibss or p2p_cli vifs are running Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 44/62] iwlwifi: mvm: add d0i3_refs debugfs file Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 45/62] iwlwifi: mvm: configure WOWLAN_CONFIGURATION on D0i3 entry Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 46/62] iwlwifi: mvm: get status on D0i3 exit Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 47/62] iwlwifi: mvm: add debugfs hook to take an mvm ref Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 48/62] iwlwifi: mvm: remove unneeded calculations Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 49/62] iwlwifi: mvm: support multiple firmware sections Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 50/62] iwlwifi: fix potential buffer overrun in fw name Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 51/62] iwlwifi: mvm: abort scheduled scan on scan request Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 52/62] iwlwifi: fix kerneldoc format Emmanuel Grumbach
2014-02-03 20:57 ` [PATCH 53/62] iwlwifi: mvm: BT Coex - fix SYNC2SCO flags Emmanuel Grumbach
2014-02-03 20:58 ` [PATCH 54/62] iwlwifi: mvm: clean up iwl_mvm_bss_info_changed_ap_ibss Emmanuel Grumbach
2014-02-03 20:58 ` [PATCH 55/62] iwlwifi: mvm: remove duplicate assignment to ap_ibss_active Emmanuel Grumbach
2014-02-03 20:58 ` Emmanuel Grumbach [this message]
2014-02-03 20:58 ` [PATCH 57/62] iwlwifi: mvm: don't look at power commmand to decide if power is enabled Emmanuel Grumbach
2014-02-03 20:58 ` [PATCH 58/62] iwlwifi: mvm: don't send the beacon filtering command from iterator Emmanuel Grumbach
2014-02-03 20:58 ` [PATCH 59/62] iwlwifi: mvm: store latest power command for debugfs read Emmanuel Grumbach
2014-02-03 20:58 ` [PATCH 60/62] iwlwifi: mvm: remove support for legacy power API Emmanuel Grumbach
2014-02-03 20:58 ` [PATCH 61/62] iwlwifi: mvm: remove iwl_mvm_power_mac_disable Emmanuel Grumbach
2014-02-03 20:58 ` [PATCH 62/62] iwlwifi: mvm: refactor power code Emmanuel Grumbach
2014-02-12 20:27 ` pull request: iwlwifi-next 2014-02-03 John W. Linville
2014-02-13  7:10   ` [Ilw] " Grumbach, Emmanuel
2014-02-13 14:44     ` John W. Linville
2014-02-13 14:48       ` Grumbach, Emmanuel

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=1391461088-8082-56-git-send-email-egrumbach@gmail.com \
    --to=egrumbach@gmail.com \
    --cc=emmanuel.grumbach@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /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).