All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregory.greenman@intel.com
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Avraham Stern <avraham.stern@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 09/11] wifi: iwlwifi: mei: make mei filtered scan more aggressive
Date: Tue, 18 Apr 2023 12:28:12 +0300	[thread overview]
Message-ID: <20230418122405.47e383b10b18.I14340a118acdb19ecb7214e7ff413054c77bd99c@changeid> (raw)
In-Reply-To: <20230418092814.1438734-1-gregory.greenman@intel.com>

From: Avraham Stern <avraham.stern@intel.com>

When mei filtered scan is performed, it must find the AP on the first
scan, otherwise CSME will take the ownership of the NIC.
Make this scan more aggressive by scanning the channel the AP is
supposed to be on (as reported by CSME) several times.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index fe7cb33d5593..175615755d9d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -45,6 +45,9 @@
 /* minimal number of 2GHz and 5GHz channels in the regular scan request */
 #define IWL_MVM_6GHZ_PASSIVE_SCAN_MIN_CHANS 4
 
+/* Number of iterations on the channel for mei filtered scan */
+#define IWL_MEI_SCAN_NUM_ITER	5U
+
 struct iwl_mvm_scan_timing_params {
 	u32 suspend_time;
 	u32 max_out_time;
@@ -2665,6 +2668,7 @@ static void iwl_mvm_mei_limited_scan(struct iwl_mvm *mvm,
 	struct iwl_mvm_csme_conn_info *info = iwl_mvm_get_csme_conn_info(mvm);
 	struct iwl_mei_conn_info *conn_info;
 	struct ieee80211_channel *chan;
+	int scan_iters, i;
 
 	if (!info) {
 		IWL_DEBUG_SCAN(mvm, "mei_limited_scan: no connection info\n");
@@ -2690,8 +2694,16 @@ static void iwl_mvm_mei_limited_scan(struct iwl_mvm *mvm,
 		return;
 	}
 
-	params->n_channels = 1;
-	params->channels[0] = chan;
+	/* The mei filtered scan must find the AP, otherwise CSME will
+	 * take the NIC ownership. Add several iterations on the channel to
+	 * make the scan more robust.
+	 */
+	scan_iters = min(IWL_MEI_SCAN_NUM_ITER, params->n_channels);
+	params->n_channels = scan_iters;
+	for (i = 0; i < scan_iters; i++)
+		params->channels[i] = chan;
+
+	IWL_DEBUG_SCAN(mvm, "Mei scan: num iterations=%u\n", scan_iters);
 
 	params->n_ssids = 1;
 	params->ssids[0].ssid_len = conn_info->ssid_len;
-- 
2.38.1


  parent reply	other threads:[~2023-04-18  9:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  9:28 [PATCH 00/11] wifi: iwlwifi: updates intended for v6.4 2023-04-18 gregory.greenman
2023-04-18  9:28 ` [PATCH 01/11] wifi: iwlwifi: Update support for b0 version gregory.greenman
2023-04-18  9:28 ` [PATCH 02/11] wifi: iwlwifi: fw: fix memory leak in debugfs gregory.greenman
2023-04-18  9:28 ` [PATCH 03/11] wifi: iwlwifi: mvm: fix MIC removal confusion gregory.greenman
2023-04-18  9:28 ` [PATCH 04/11] wifi: iwlwifi: fw: fix argument to efi.get_variable gregory.greenman
2023-04-18  9:28 ` [PATCH 05/11] wifi: iwlwifi: mvm: fix potential memory leak gregory.greenman
2023-04-18  9:28 ` [PATCH 06/11] wifi: iwlwifi: mvm: prefer RCU_INIT_POINTER() gregory.greenman
2023-04-18  9:28 ` [PATCH 07/11] wifi: iwlwifi: mvm: enable support for MLO APIs gregory.greenman
2023-04-18  9:28 ` [PATCH 08/11] wifi: iwlwifi: modify scan request and results when in link protection gregory.greenman
2023-04-18  9:28 ` gregory.greenman [this message]
2023-04-18  9:28 ` [PATCH 10/11] wifi: iwlwifi: mei: re-ask for ownership after it was taken by CSME gregory.greenman
2023-04-18  9:28 ` [PATCH 11/11] wifi: iwlwifi: mvm: fix RFKILL report when driver is going down gregory.greenman

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=20230418122405.47e383b10b18.I14340a118acdb19ecb7214e7ff413054c77bd99c@changeid \
    --to=gregory.greenman@intel.com \
    --cc=avraham.stern@intel.com \
    --cc=johannes@sipsolutions.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.