From patchwork Thu May 28 19:23:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yanbo Li X-Patchwork-Id: 6501391 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 148DDC0020 for ; Thu, 28 May 2015 19:26:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 468C32076B for ; Thu, 28 May 2015 19:26:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 401F72072B for ; Thu, 28 May 2015 19:26:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yy3RL-0004Ce-NZ; Thu, 28 May 2015 19:26:03 +0000 Received: from sabertooth01.qualcomm.com ([65.197.215.72]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yy3RJ-000466-It for ath10k@lists.infradead.org; Thu, 28 May 2015 19:26:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1432841161; x=1464377161; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ij5ehFUBv4OKELIbtMblaK4MyCaXe0oegWJXZEv4X5M=; b=F/JsIV1didLYaE03iTOdf5ckVxKtK0YfOtEeXUGZuGWxh/E68QXXwAlM X5bie9hG80N29GbzcRGdXqpMGQaZAUZUidTTikToshIXmLuetQkWHNXXZ YHuj0pOIqJMc8OeqvQuwYi+8OlGFz/mjjKkUyL/VNWrkkHIYyr+0SHRji Q=; X-IronPort-AV: E=McAfee;i="5700,7163,7815"; a="89944959" Received: from ironmsg04-r.qualcomm.com ([172.30.46.18]) by sabertooth01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 28 May 2015 12:25:40 -0700 X-IronPort-AV: E=Sophos;i="5.13,513,1427785200"; d="scan'208";a="981712053" Received: from nasanexm02e.na.qualcomm.com ([10.85.0.86]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 28 May 2015 12:25:40 -0700 Received: from buildX11.qca.qualcomm.com (10.80.80.8) by nasanexm02e.na.qualcomm.com (10.85.0.86) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 28 May 2015 12:25:40 -0700 From: Yanbo Li To: Subject: [PATCH 2/2] ath10k: Ignore the adjacent radio's activity when surveying a channel Date: Thu, 28 May 2015 12:23:06 -0700 Message-ID: <1432840986-21918-2-git-send-email-yanbol@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432840986-21918-1-git-send-email-yanbol@qca.qualcomm.com> References: <1432840986-21918-1-git-send-email-yanbol@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To nasanexm02e.na.qualcomm.com (10.85.0.86) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150528_122601_697034_925D1B04 X-CRM114-Status: UNSURE ( 9.69 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.1 (-----) Cc: dreamfly281@gmail.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The overall goal for a scanning radio is to evaluate the outside radio environment. Some platforms integrate several radios together. When one radio wants to survey the current channel, the adjacent radio's activity will make this survey result inaccurate. the switcher can be used to enable the FW to ignore the survey time slot when the adjacent radio is active, especially for TX. This skipped scan approach will make the survey result more accurate. This technique requires a precondition that the scanning and adjacent radio have some physical connection to make them aware of each other's activity from within the FW layer, and the FW claimed supporting this capability. To enable this feature, execute: echo 2 > /sys/kernel/debug/ieee80211/phyX/ath10k/adjacent_wlan_interfrc Then run the survey scan and dump the stastics: iw dev wifiX survey dump The TX&RX counter showed already deducted the time slot be interfered To check whether the feature is enabled, execute: cat /sys/kernel/debug/ieee80211/phyX/ath10k/adjacent_wlan_interfrc INTERFRC DETECT FOR SURVEY SCAN: Enable/Disable Signed-off-by: Yanbo Li --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/debug.c | 4 ++++ drivers/net/wireless/ath/ath10k/wmi.c | 5 +++++ drivers/net/wireless/ath/ath10k/wmi.h | 7 +++++++ 4 files changed, 17 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index fb0e8521fc45..164160aaf8a7 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -491,6 +491,7 @@ enum ath10k_cal_mode { enum ath10k_wlan_interfrc_mask { ATH10K_SPECTRAL_INTERFRC = 0x00000001, + ATH10K_SURVEY_INTERFRC = 0x00000002, }; static inline const char *ath10k_cal_mode_str(enum ath10k_cal_mode mode) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 534dfb8ada95..3051cbaebc74 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -2190,6 +2190,10 @@ static ssize_t ath10k_read_adjacent_wlan_interfrc(struct file *file, interfrc_5g); len += scnprintf(buf + len, buf_len - len, "2G INTERFRC: %d\n", interfrc_2g); + len += scnprintf(buf + len, buf_len - len, + "INTERFRC DETECT FOR SURVEY SCAN: %s\n", + ar->wlan_interfrc_mask & ATH10K_SURVEY_INTERFRC ? + "Enable" : "Disable"); mutex_unlock(&ar->conf_mutex); diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 1fb850817589..dbd394422905 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -3942,6 +3942,11 @@ static struct sk_buff *ath10k_wmi_10_2_op_gen_init(struct ath10k *ar) ar->wmi.svc_map))) features |= WMI_10_2_ADJ_RADIO_SPECTRAL_INTERFRC; + if ((ar->wlan_interfrc_mask & ATH10K_SURVEY_INTERFRC) && + (test_bit(WMI_SERVICE_ADJ_RADIO_SURVEY_INTERFRC, ar->wmi.svc_map))) + features |= WMI_10_2_ADJ_RADIO_SURVEY_INTERFRC; + + cmd->resource_config.feature_mask = __cpu_to_le32(features); memcpy(&cmd->resource_config.common, &config, sizeof(config)); diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 36bb0768d87f..7cbad1932bf5 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -151,6 +151,7 @@ enum wmi_service { WMI_SERVICE_ATF, WMI_SERVICE_COEX_GPIO, WMI_SERVICE_ADJ_RADIO_SPECTRAL_INTERFRC, + WMI_SERVICE_ADJ_RADIO_SURVEY_INTERFRC, /* keep last */ WMI_SERVICE_MAX, @@ -183,6 +184,7 @@ enum wmi_10x_service { WMI_10X_SERVICE_ATF, WMI_10X_SERVICE_COEX_GPIO, WMI_10X_SERVICE_ADJ_RADIO_SPECTRAL_INTERFRC, + WMI_10X_SERVICE_ADJ_RADIO_SURVEY_INTERFRC, }; enum wmi_main_service { @@ -302,6 +304,7 @@ static inline char *wmi_service_name(int service_id) SVCSTR(WMI_SERVICE_ATF); SVCSTR(WMI_SERVICE_COEX_GPIO); SVCSTR(WMI_SERVICE_ADJ_RADIO_SPECTRAL_INTERFRC); + SVCSTR(WMI_SERVICE_ADJ_RADIO_SURVEY_INTERFRC); default: return NULL; @@ -372,6 +375,9 @@ static inline void wmi_10x_svc_map(const __le32 *in, unsigned long *out, WMI_SERVICE_COEX_GPIO, len); SVCMAP(WMI_10X_SERVICE_ADJ_RADIO_SPECTRAL_INTERFRC, WMI_SERVICE_ADJ_RADIO_SPECTRAL_INTERFRC, len); + SVCMAP(WMI_10X_SERVICE_ADJ_RADIO_SURVEY_INTERFRC, + WMI_SERVICE_ADJ_RADIO_SURVEY_INTERFRC, len); + } static inline void wmi_main_svc_map(const __le32 *in, unsigned long *out, @@ -1973,6 +1979,7 @@ enum wmi_10_2_feature_mask { WMI_10_2_ATF_CONFIG = BIT(1), WMI_10_2_COEX_GPIO = BIT(3), WMI_10_2_ADJ_RADIO_SPECTRAL_INTERFRC = BIT(4), + WMI_10_2_ADJ_RADIO_SURVEY_INTERFRC = BIT(5), }; struct wmi_resource_config_10_2 {