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 29/42] iwlwifi: mvm: add number of scan iterations and multiplier to params
Date: Sun,  3 May 2015 22:31:40 +0300	[thread overview]
Message-ID: <1430681513-7838-29-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1430681438.3240.3.camel@intel.com>

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

As another step towards combining the scan and sched scan functions,
add parameters that tell the scan function how many iterations we want
(i.e. 1 for normal scan, more for scheduled scan) and that set the
full scan multiplier (only meaningful for LMAC).

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 | 42 ++++++++++++++++++++++-----------
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index acff2e7..5576152 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -98,6 +98,10 @@ struct iwl_mvm_scan_params {
 		u16 active;
 		u16 fragmented;
 	} dwell[IEEE80211_NUM_BANDS];
+	struct {
+		u8 iterations;
+		u8 full_scan_mul; /* not used for UMAC */
+	} schedule[2];
 };
 
 enum iwl_umac_scan_uid_type {
@@ -861,11 +865,11 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	ssid_bitmap <<= 1;
 
 	cmd->schedule[0].delay = cpu_to_le16(params->interval);
-	cmd->schedule[0].iterations = 1;
-	cmd->schedule[0].full_scan_mul = 0;
+	cmd->schedule[0].iterations = params->schedule[0].iterations;
+	cmd->schedule[0].full_scan_mul = params->schedule[0].full_scan_mul;
 	cmd->schedule[1].delay = cpu_to_le16(params->interval);
-	cmd->schedule[1].iterations = 0;
-	cmd->schedule[1].full_scan_mul = 0;
+	cmd->schedule[1].iterations = params->schedule[1].iterations;
+	cmd->schedule[1].full_scan_mul = params->schedule[1].iterations;
 
 	if (mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_SINGLE_SCAN_EBS &&
 	    mvm->last_ebs_successful) {
@@ -941,12 +945,11 @@ iwl_mvm_sched_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	ssid_bitmap <<= 1;
 
 	cmd->schedule[0].delay = cpu_to_le16(params->interval);
-	cmd->schedule[0].iterations = IWL_FAST_SCHED_SCAN_ITERATIONS;
-	cmd->schedule[0].full_scan_mul = 1;
-
+	cmd->schedule[0].iterations = params->schedule[0].iterations;
+	cmd->schedule[0].full_scan_mul = params->schedule[0].full_scan_mul;
 	cmd->schedule[1].delay = cpu_to_le16(params->interval);
-	cmd->schedule[1].iterations = 0xff;
-	cmd->schedule[1].full_scan_mul = IWL_FULL_SCAN_MULTIPLIER;
+	cmd->schedule[1].iterations = params->schedule[1].iterations;
+	cmd->schedule[1].full_scan_mul = params->schedule[1].iterations;
 
 	if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_EBS_SUPPORT &&
 	    mvm->last_ebs_successful) {
@@ -1276,8 +1279,8 @@ static int iwl_mvm_scan_umac(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	iwl_mvm_umac_scan_cfg_channels(mvm, params->channels,
 				       params->n_channels, ssid_bitmap, cmd);
 
-	sec_part->schedule[0].iter_count = 1;
-	sec_part->delay = 0;
+	sec_part->schedule[0].iter_count = params->schedule[0].iterations;
+	sec_part->delay = cpu_to_le16(params->delay);
 	sec_part->preq = params->preq;
 
 	return 0;
@@ -1337,9 +1340,10 @@ static int iwl_mvm_sched_scan_umac(struct iwl_mvm *mvm,
 	iwl_mvm_umac_scan_cfg_channels(mvm, params->channels,
 				       params->n_channels, ssid_bitmap, cmd);
 
-	sec_part->schedule[0].interval =
-				cpu_to_le16(params->interval / MSEC_PER_SEC);
-	sec_part->schedule[0].iter_count = 0xff;
+	sec_part->schedule[0].interval = cpu_to_le16(params->interval);
+
+	/* With UMAC we use only one schedule, so take the final one only */
+	sec_part->schedule[0].iter_count = params->schedule[1].iterations;
 
 	if (params->delay > U16_MAX) {
 		IWL_DEBUG_SCAN(mvm,
@@ -1447,6 +1451,11 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	params.n_match_sets = 0;
 	params.match_sets = NULL;
 
+	params.schedule[0].iterations = 1;
+	params.schedule[0].full_scan_mul = 0;
+	params.schedule[1].iterations = 0;
+	params.schedule[1].full_scan_mul = 0;
+
 	iwl_mvm_scan_calc_dwell(mvm, vif, &params);
 
 	iwl_mvm_build_scan_probe(mvm, vif, ies, &params);
@@ -1525,6 +1534,11 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm,
 	params.n_match_sets = req->n_match_sets;
 	params.match_sets = req->match_sets;
 
+	params.schedule[0].iterations = IWL_FAST_SCHED_SCAN_ITERATIONS;
+	params.schedule[0].full_scan_mul = 1;
+	params.schedule[1].iterations = 0xff;
+	params.schedule[1].full_scan_mul = IWL_FULL_SCAN_MULTIPLIER;
+
 	if (req->interval > U16_MAX) {
 		IWL_DEBUG_SCAN(mvm,
 			       "interval value is > 16-bits, set to max possible\n");
-- 
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 ` Emmanuel Grumbach [this message]
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 ` [PATCH 38/42] iwlwifi: mvm: rename generic_scan_cmd functions to dwell Emmanuel Grumbach
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-29-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).