linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: linux-wireless@vger.kernel.org
Cc: Luciano Coelho <luciano.coelho@intel.com>,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 38/42] iwlwifi: mvm: rename generic_scan_cmd functions to dwell
Date: Sun,  3 May 2015 22:31:49 +0300	[thread overview]
Message-ID: <1430681513-7838-38-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1430681438.3240.3.camel@intel.com>

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

The generic scan command functions are now irrelevant, since both
sched and regular scans are in the same code.  So rename this
functions to dwell and isolate all the dwell-related setting to them.
Keeping the dwell code separate makes it easier to compare the LMAC
and UMAC versions.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 drivers/net/wireless/iwlwifi/mvm/scan.c | 40 +++++++++++++++++----------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 277fe79..8646887 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -782,22 +782,18 @@ iwl_mvm_build_scan_probe(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	params->preq.common_data.len = cpu_to_le16(ies->common_ie_len);
 }
 
-static void
-iwl_mvm_build_generic_scan_cmd(struct iwl_mvm *mvm,
-			       struct iwl_scan_req_lmac *cmd,
-			       struct iwl_mvm_scan_params *params)
+static void iwl_mvm_scan_lmac_dwell(struct iwl_mvm *mvm,
+				    struct iwl_scan_req_lmac *cmd,
+				    struct iwl_mvm_scan_params *params)
 {
-	memset(cmd, 0, ksize(cmd));
 	cmd->active_dwell = params->dwell[IEEE80211_BAND_2GHZ].active;
 	cmd->passive_dwell = params->dwell[IEEE80211_BAND_2GHZ].passive;
 	if (params->passive_fragmented)
 		cmd->fragmented_dwell =
 				params->dwell[IEEE80211_BAND_2GHZ].fragmented;
-	cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm);
 	cmd->max_out_time = cpu_to_le32(params->max_out_time);
 	cmd->suspend_time = cpu_to_le32(params->suspend_time);
 	cmd->scan_prio = cpu_to_le32(IWL_SCAN_PRIORITY_HIGH);
-	cmd->iter_num = cpu_to_le32(1);
 }
 
 static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
@@ -874,8 +870,12 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
 	lockdep_assert_held(&mvm->mutex);
 
-	iwl_mvm_build_generic_scan_cmd(mvm, cmd, params);
+	memset(cmd, 0, ksize(cmd));
+
+	iwl_mvm_scan_lmac_dwell(mvm, cmd, params);
 
+	cmd->rx_chain_select = iwl_mvm_scan_rx_chain(mvm);
+	cmd->iter_num = cpu_to_le32(1);
 	cmd->n_channels = (u8)params->n_channels;
 
 	cmd->delay = cpu_to_le32(params->delay);
@@ -1119,14 +1119,10 @@ static u32 iwl_generate_scan_uid(struct iwl_mvm *mvm,
 	return uid;
 }
 
-static void
-iwl_mvm_build_generic_umac_scan_cmd(struct iwl_mvm *mvm,
+static void iwl_mvm_scan_umac_dwell(struct iwl_mvm *mvm,
 				    struct iwl_scan_req_umac *cmd,
 				    struct iwl_mvm_scan_params *params)
 {
-	memset(cmd, 0, ksize(cmd));
-	cmd->hdr.size = cpu_to_le16(iwl_mvm_scan_size(mvm) -
-				    sizeof(struct iwl_mvm_umac_cmd_hdr));
 	cmd->active_dwell = params->dwell[IEEE80211_BAND_2GHZ].active;
 	cmd->passive_dwell = params->dwell[IEEE80211_BAND_2GHZ].passive;
 	if (params->passive_fragmented)
@@ -1135,6 +1131,11 @@ iwl_mvm_build_generic_umac_scan_cmd(struct iwl_mvm *mvm,
 	cmd->max_out_time = cpu_to_le32(params->max_out_time);
 	cmd->suspend_time = cpu_to_le32(params->suspend_time);
 	cmd->scan_priority = cpu_to_le32(IWL_SCAN_PRIORITY_HIGH);
+
+	if (iwl_mvm_scan_total_iterations(params) == 0)
+		cmd->ooc_priority = cpu_to_le32(IWL_SCAN_PRIORITY_HIGH);
+	else
+		cmd->ooc_priority = cpu_to_le32(IWL_SCAN_PRIORITY_LOW);
 }
 
 static void
@@ -1200,15 +1201,16 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	if (uid_idx >= mvm->max_scans)
 		return -EBUSY;
 
-	iwl_mvm_build_generic_umac_scan_cmd(mvm, cmd, params);
+	memset(cmd, 0, ksize(cmd));
+	cmd->hdr.size = cpu_to_le16(iwl_mvm_scan_size(mvm) -
+				    sizeof(struct iwl_mvm_umac_cmd_hdr));
 
-	if (n_iterations == 1) {
-		cmd->ooc_priority = cpu_to_le32(IWL_SCAN_PRIORITY_HIGH);
+	iwl_mvm_scan_umac_dwell(mvm, cmd, params);
+
+	if (n_iterations == 1)
 		uid = iwl_generate_scan_uid(mvm, IWL_UMAC_SCAN_UID_REG_SCAN);
-	} else {
-		cmd->ooc_priority = cpu_to_le32(IWL_SCAN_PRIORITY_LOW);
+	else
 		uid = iwl_generate_scan_uid(mvm, IWL_UMAC_SCAN_UID_SCHED_SCAN);
-	}
 
 	mvm->scan_uid[uid_idx] = uid;
 	cmd->uid = cpu_to_le32(uid);
-- 
2.1.0


  parent reply	other threads:[~2015-05-03 19:33 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-03 19:30 pull request: iwlwifi-next 2015-05-03 Grumbach, Emmanuel
2015-05-03 19:31 ` [PATCH 01/42] iwlwifi: mvm: ROC: Reduce the aux roc max delay Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 02/42] iwlwifi: rs: remove code duplication when filling lq cmd Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 03/42] iwlwifi: rs: cleanup last_txrate_idx Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 04/42] iwlwifi: mvm: add scan parameters debugging info Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 05/42] iwlwifi: mvm: don't increase max_out_time when low priority scan is requested Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 06/42] iwlwifi: mvm: convert scan_status to a bitmap Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 07/42] iwlwifi: mvm: don't wait for scan stopped work when cancelling scans Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 08/42] iwlwifi: mvm: check if scan can be started before cancelling other scans Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 09/42] iwlwifi: mvm: generalize the other-scan stopping code Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 10/42] iwlwifi: mvm: rename unified_scan symbols to just scan Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 11/42] iwlwifi: mvm: move scan code from mac80211.c to scan.c Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 12/42] iwlwifi: mvm: differentiate net-detect from sched scan Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 13/42] iwlwifi: pcie: support marbh fw dbg mode Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 14/42] iwlwifi: rs: remove unneeded check of average tpt in window Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 15/42] iwlwifi: mvm: some clean ups in fw-api-scan.h Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 16/42] iwlwifi: mvm: allow scheduled scan for all the firmwares Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 17/42] iwlwifi: mvm: always use iwl_mvm_scan_size to calculate the scan size Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 18/42] iwlwifi: mvm: combine scan size checks into a common function Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 19/42] iwlwifi: mvm: iterate all interfaces during HW recovery cleanup Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 20/42] iwlwifi: clarify the device / firmware mapping in Kconfig Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 21/42] iwlwifi: mvm: combine parts of UMAC and LMAC scans Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 22/42] iwlwifi: mvm: combine parts of UMAC and LMAC sched scans Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 23/42] iwlwifi: mvm: add common scan params to thw iwl_mvm_scan_params struct Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 24/42] iwlwifi: mvm: combine ssid_bitmap setting for regular scans Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 25/42] iwlwifi: mvm: revert order of SSIDs for sched scans Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 26/42] iwlwifi: mvm: combine SSID functions for sched and regular scans Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 27/42] iwlwifi: mvm: rename scan_calc_params to scan_calc_dwell Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 28/42] iwlwifi: mvm: combine LMAC and UMAC preq generation Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 29/42] iwlwifi: mvm: add number of scan iterations and multiplier to params Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 30/42] iwlwifi: mvm: combine LMAC scans into one Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 31/42] iwlwifi: mvm: trim sched scan delay down to 16-bit for LMAC as well Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 32/42] iwlwifi: mvm: combine UMAC scans into one Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 33/42] iwlwifi: mvm: avoid use-after-free on iwl_mvm_d0i3_enable_tx() [BUGFIX] Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 34/42] iwlwifi: allow to limit the size of the external buffer for firmware debugging Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 35/42] iwlwifi: mvm: remove deprecated command IDs Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 36/42] iwlwifi: mvm: move all UMAC scan flags setting into the relevant function Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 37/42] iwlwifi: mvm: move all LMAC scan flags into a single funtion Emmanuel Grumbach
2015-05-03 19:31 ` Emmanuel Grumbach [this message]
2015-05-03 19:31 ` [PATCH 39/42] iwlwifi: mvm: don't reset key index on HW restart Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 40/42] iwlwifi: mvm: make thermal throttling values configurable per NIC family Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 41/42] iwlwifi: mvm: remove some unused stuff from scan.c Emmanuel Grumbach
2015-05-03 19:31 ` [PATCH 42/42] iwlwifi: mvm: include wildcard SSID in scans Emmanuel Grumbach
2015-05-09 13:24 ` pull request: iwlwifi-next 2015-05-03 Kalle Valo

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=1430681513-7838-38-git-send-email-emmanuel.grumbach@intel.com \
    --to=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).