From patchwork Thu Nov 14 08:33:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Puzyniak X-Patchwork-Id: 3181151 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 90B9BC045B for ; Thu, 14 Nov 2013 08:35:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 726D92096E for ; Thu, 14 Nov 2013 08:35:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57C5E2096D for ; Thu, 14 Nov 2013 08:35:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751623Ab3KNIf0 (ORCPT ); Thu, 14 Nov 2013 03:35:26 -0500 Received: from mail-wg0-f46.google.com ([74.125.82.46]:35000 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751181Ab3KNIfZ (ORCPT ); Thu, 14 Nov 2013 03:35:25 -0500 Received: by mail-wg0-f46.google.com with SMTP id x12so1532155wgg.25 for ; Thu, 14 Nov 2013 00:35:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ks0JNqLSezxtwghKvLafEN9PmljsVycm6AmulrNoB0M=; b=ZSHtgZi3C6hpCMz/Qbcm4hEBWZ5LERmfwUtlJ3/bkFVa40A8KHS7Yjw45DftP6NpxT cWzqf+4UxVd4DazjC+X4Ur3fb0sgMLF3x7yIel8SkR7+CFRGu2/2B3R+jKl+iC6KsBlW DWiQmQxIGKt5+iBpSr/xbI2xierqcATCFfdu0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ks0JNqLSezxtwghKvLafEN9PmljsVycm6AmulrNoB0M=; b=ZzqqXBxEoMl6bNmIq1Rjhzob8+E91jSeXLjQYJ2U4fjFkm9qap+H2QpqshNgU7QV4O laTq6ZGOVumH/qOAffOuX0qH+M8wrsb3rcQKUF4heUR1Ab1qcerVg2Ij0hRY0yRP5MmQ vGniZdn1R/2Qnl4GFA2vsZUnF7teHWA81Hh24xCZQF/IdqyI147jNg5xb1vu9TenYg1i Dby4SLw6OqeH35ZMlU/wyb8dvP+tVf2EqYLVe8jpQjw4/zfpm3EzaxVKSbGpkxtFwuxW oaBwb4hbR8RzDisZRseqJXa5ohfYokShBSaaZn9n+V7IFBfSefSSFdhC0g1pro0jCZjl P0mA== X-Gm-Message-State: ALoCoQnKFgyUuza67CSM2NKYsl8JFcroLXh4gOfpk+ulQ+4Dt2Nd8eV03h9urjpuj1R6wtjRzJW0cyDn8v/I0Kuny8mSi3Xs0T7eR/rqofUrhYcLQ4A9BnE= X-Received: by 10.180.19.201 with SMTP id h9mr1186338wie.36.1384418124473; Thu, 14 Nov 2013 00:35:24 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id i1sm97083996eeg.0.2013.11.14.00.35.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Nov 2013 00:35:24 -0800 (PST) From: Marek Puzyniak To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Marek Puzyniak , Michal Kazior Subject: [PATCH v2 3/3] ath10k: add debugfs file to control radar events blocking Date: Thu, 14 Nov 2013 09:33:38 +0100 Message-Id: <1384418018-4973-3-git-send-email-marek.puzyniak@tieto.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1384418018-4973-1-git-send-email-marek.puzyniak@tieto.com> References: <1384418018-4973-1-git-send-email-marek.puzyniak@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Sometimes for DFS testing is required to stay on current channel even after radar detected. This patch allows to enable/disable radar detected event to be passed to mac80211. By default radar detected event in not blocked. To block it: echo 1 > /sys/kernel/debug/ieee80211/phyX/ath10k/dfs_block_radar_events To unblock again: echo 0 > /sys/kernel/debug/ieee80211/phyX/ath10k/dfs_block_radar_events Inform about blocking radar detected event even when logs are disabled for throughput/performance reasons. Signed-off-by: Marek Puzyniak Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/debug.c | 4 ++++ drivers/net/wireless/ath/ath10k/wmi.c | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index d5fd74b..cdedcbf 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -409,6 +409,7 @@ struct ath10k { bool monitor_present; unsigned int filter_flags; unsigned long dev_flags; + u32 dfs_block_radar_events; struct wmi_pdev_set_wmm_params_arg wmm_params; struct completion install_key_done; diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 13705d4..6bdfad3 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -752,6 +752,10 @@ int ath10k_debug_create(struct ath10k *ar) ar->debug.debugfs_phy, ar, &fops_simulate_radar); + debugfs_create_bool("dfs_block_radar_events", S_IWUSR, + ar->debug.debugfs_phy, + &ar->dfs_block_radar_events); + debugfs_create_file("dfs_stats", S_IRUSR, ar->debug.debugfs_phy, ar, &fops_dfs_stats); diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index aea81d9..c654137 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1453,6 +1453,14 @@ static void ath10k_dfs_radar_report(struct ath10k *ar, ath10k_dbg(ATH10K_DBG_REGULATORY, "dfs radar detected\n"); ATH10K_DFS_STAT_INC(ar, radar_detected); + + /* Control radar events reporting in debugfs file + dfs_block_radar_events */ + if (ar->dfs_block_radar_events) { + ath10k_info("DFS Radar detected, but ignored as requested\n"); + return; + } + ieee80211_radar_detected(ar->hw); }