All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maya Erez <qca_merez@qca.qualcomm.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Hamad Kadmany <QCA_hkadmany@QCA.qualcomm.com>,
	linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com,
	Maya Erez <qca_merez@qca.qualcomm.com>
Subject: [PATCH v4 02/10] wil6210: allow configuring scan timers
Date: Thu,  3 Aug 2017 22:08:14 +0300	[thread overview]
Message-ID: <1501787302-22885-3-git-send-email-qca_merez@qca.qualcomm.com> (raw)
In-Reply-To: <1501787302-22885-1-git-send-email-qca_merez@qca.qualcomm.com>

From: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>

Allow setting scan timeout and scan dwell time
through module parameters.

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 17 ++++++++++++++---
 drivers/net/wireless/ath/wil6210/wil6210.h  |  2 +-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 77af749..d079533 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -26,6 +26,14 @@
 module_param(disable_ap_sme, bool, 0444);
 MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
 
+static uint scan_dwell_time  = WMI_SCAN_DWELL_TIME_MS;
+module_param(scan_dwell_time, uint, 0644);
+MODULE_PARM_DESC(scan_dwell_time, " Scan dwell time (msec)");
+
+static uint scan_timeout = WIL6210_SCAN_TO_SEC;
+module_param(scan_timeout, uint, 0644);
+MODULE_PARM_DESC(scan_timeout, " Scan timeout (seconds)");
+
 #define CHAN60G(_channel, _flags) {				\
 	.band			= NL80211_BAND_60GHZ,		\
 	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -528,8 +536,9 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
 
 	(void)wil_p2p_stop_discovery(wil);
 
-	wil_dbg_misc(wil, "Start scan_request 0x%p\n", request);
-	wil_dbg_misc(wil, "SSID count: %d", request->n_ssids);
+	wil_dbg_misc(wil,
+		     "Start scan_request 0x%p, dwell_time %dms, timeout %dsec, SSID count %d\n",
+		     request, scan_dwell_time, scan_timeout, request->n_ssids);
 
 	for (i = 0; i < request->n_ssids; i++) {
 		wil_dbg_misc(wil, "SSID[%d]", i);
@@ -550,10 +559,12 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
 	}
 
 	wil->scan_request = request;
-	mod_timer(&wil->scan_timer, jiffies + WIL6210_SCAN_TO);
+	mod_timer(&wil->scan_timer,
+		  jiffies + msecs_to_jiffies(1000U * scan_timeout));
 
 	memset(&cmd, 0, sizeof(cmd));
 	cmd.cmd.scan_type = WMI_ACTIVE_SCAN;
+	cmd.cmd.dwell_time = cpu_to_le32(scan_dwell_time);
 	cmd.cmd.num_channels = 0;
 	n = min(request->n_channels, 4U);
 	for (i = 0; i < n; i++) {
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index d085ccf..ac32284 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -112,7 +112,7 @@ static inline u32 wil_mtu2macbuf(u32 mtu)
 #define WIL6210_ITR_RX_MAX_BURST_DURATION_DEFAULT (500) /* usec */
 #define WIL6210_FW_RECOVERY_RETRIES	(5) /* try to recover this many times */
 #define WIL6210_FW_RECOVERY_TO	msecs_to_jiffies(5000)
-#define WIL6210_SCAN_TO		msecs_to_jiffies(10000)
+#define WIL6210_SCAN_TO_SEC		10
 #define WIL6210_DISCONNECT_TO_MS (2000)
 #define WIL6210_RX_HIGH_TRSH_INIT		(0)
 #define WIL6210_RX_HIGH_TRSH_DEFAULT \
-- 
1.9.1

  parent reply	other threads:[~2017-08-03 19:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-03 19:08 [PATCH v4 00/10] wil6210 patches Maya Erez
2017-08-03 19:08 ` [PATCH v4 01/10] wil6210: protect against invalid length of tx management frame Maya Erez
2017-08-08 18:44   ` [v4, " Kalle Valo
2017-08-09  8:02   ` [PATCH v4 " Arend van Spriel
2017-08-09 12:01     ` Lior David
2017-08-03 19:08 ` Maya Erez [this message]
2017-08-08 10:53   ` [PATCH v4 02/10] wil6210: allow configuring scan timers Kalle Valo
2017-08-03 19:08 ` [PATCH v4 03/10] wil6210: support FW RSSI reporting Maya Erez
2017-08-03 19:08 ` [PATCH v4 04/10] wil6210: check no_fw_recovery in resume failure recovery Maya Erez
2017-08-03 19:08 ` [PATCH v4 05/10] wil6210: add statistics for suspend time Maya Erez
2017-08-03 19:08 ` [PATCH v4 06/10] wil6210: notify wiphy on wowlan support Maya Erez
2017-08-03 19:08 ` [PATCH v4 07/10] wil6210: fix interface-up check Maya Erez
2017-08-03 19:08 ` [PATCH v4 08/10] wil6210: store FW RF calibration result Maya Erez
2017-08-03 19:08 ` [PATCH v4 09/10] wil6210: move vring_idle_trsh definition to wil6210_priv Maya Erez
2017-08-03 19:08 ` [PATCH v4 10/10] wil6210: make debugfs compilation optional Maya Erez
2017-08-08 11:03   ` Kalle Valo
2017-08-08 17:32     ` Lior David
2017-08-08 18:43       ` 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=1501787302-22885-3-git-send-email-qca_merez@qca.qualcomm.com \
    --to=qca_merez@qca.qualcomm.com \
    --cc=QCA_hkadmany@QCA.qualcomm.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wil6210@qca.qualcomm.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 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.