From patchwork Mon Jul 31 16:32:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 9872449 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 74C6460365 for ; Mon, 31 Jul 2017 16:32:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EB1E28508 for ; Mon, 31 Jul 2017 16:32:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 538FD28516; Mon, 31 Jul 2017 16:32:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC91128506 for ; Mon, 31 Jul 2017 16:32:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbdGaQcn (ORCPT ); Mon, 31 Jul 2017 12:32:43 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:37196 "EHLO alexa-out-lv-01.qualcomm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752555AbdGaQcl (ORCPT ); Mon, 31 Jul 2017 12:32:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1501518761; x=1533054761; h=cc:from:to:subject:date:message-id:in-reply-to: references; bh=QkgrgyDJjOspzdDehrBLULAJEHuUGJc9p2JWYg//xw0=; b=uKE0vRsjrFzUuTPxfjw8O8YF5r+bendFxV0WLTBJwDCIihhiePUUUMt/ tbVaS4WwaIZRESbm8m5L8t/+0FLA8EviB6zxDQ2zq3S7A40SZcyZgVVqY yOQ6YBLtIeajpH6Zni/BA5CbmRRORRn1bzFp/fY4g6O/ZHmxL4Z/lEZB4 8=; X-IronPort-AV: E=Sophos;i="5.41,304,1498546800"; d="scan'208";a="2385927" Received: from ironmsg02-l-new.qualcomm.com (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by alexa-out-lv-01.qualcomm.com with ESMTP; 31 Jul 2017 09:32:41 -0700 Cc: Hamad Kadmany , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, Maya Erez X-IronPort-AV: E=McAfee;i="5900,7806,8608"; a="974365073" X-MGA-submission: =?us-ascii?q?MDHAD6i0sZ3qO0aFEDc499Kmlb1nZeuGiGspqn?= =?us-ascii?q?XUseoF6Snh1G4foMrr3tRWdbnTcUjTKefE0Jksofp/V9JKlP4rB3kShF?= =?us-ascii?q?wjRliVehQXKk8byxE7l84LQdQuJzt3doL45JnhFKL179t7B3w5aE1Rd9?= =?us-ascii?q?Gc?= Received: from lx-merez1.mea.qualcomm.com ([10.18.173.103]) by ironmsg02-L.qualcomm.com with ESMTP; 31 Jul 2017 09:32:39 -0700 From: Maya Erez To: Kalle Valo Subject: [PATCH 02/10] wil6210: allow configuring scan timers Date: Mon, 31 Jul 2017 19:32:25 +0300 Message-Id: <1501518753-6339-3-git-send-email-qca_merez@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501518753-6339-1-git-send-email-qca_merez@qca.qualcomm.com> References: <1501518753-6339-1-git-send-email-qca_merez@qca.qualcomm.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hamad Kadmany Allow setting scan timeout and scan dwell time through module parameters. Signed-off-by: Hamad Kadmany Signed-off-by: Maya Erez --- 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 \