From patchwork Tue May 15 09:09:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sriram R X-Patchwork-Id: 10400633 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 39904600F4 for ; Tue, 15 May 2018 09:18:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DB192869D for ; Tue, 15 May 2018 09:18:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1291C286F8; Tue, 15 May 2018 09:18:59 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3BEFE286F5 for ; Tue, 15 May 2018 09:18:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XbnVYqMFTHwpwjOntwmLojGv3OUeeLNt1Yp6G6zFoUc=; b=WiTqlDATfBfSkZe9IBaTNCQnOX kgizKtCwX8tNHp8slrhEacA+6xzb9/iFyFc1mF304tahMTUxtUDK/CTSsUBM0WKh8WtkqLnLR9DiC G+6oYb5yNyhipDZh1XXHDzaM8LO2IiZTT3/bSu+0bzl8OzpZf96+w2zWFfFNiw/NHWtHLEA0ttR0h 7tB7JrvVPdOHHOxpGzo+ZPuRmOuNtjmLSwBRTmSPuHPujFgVop5dK9rqHNcq7y4fHHIuYmNX2xfBY ErHMkCw9boBeGtj1CQ6AwHOXRaEqGpC6iJERT6eeGomFavYbasSJZ4xn1lCC4inM/vtgyNOJM34wx wxI0fkVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIW6Z-0004J1-S8; Tue, 15 May 2018 09:18:47 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fIVyJ-00064H-Vk for ath10k@lists.infradead.org; Tue, 15 May 2018 09:10:34 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 072E560F5F; Tue, 15 May 2018 09:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526375411; bh=yn2+OWlZLgigYCG09aK6QvTCqTgOOF46M5N9Yegl334=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNqapQv2vqN7tCFKL05wDojjZbdGR/HfH4hiAxRfrynAWaODd4k+EhYyTDp+QHbv3 KDgcDzM3c1+YUfqG9jhoex9Tah/VtBaJjNXPasPYSp8eKc69/xk9bVqQXEOk++1Tem /cSTFJdgNH4NgwInAwZ2Hld0YPzQvtWUB3pDMMA0= Received: from checstp253621-lin.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: srirrama@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4ACCB60C65; Tue, 15 May 2018 09:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526375409; bh=yn2+OWlZLgigYCG09aK6QvTCqTgOOF46M5N9Yegl334=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eTEGZZxqK6YdCYRoWXdV8HqVcq6lDwqTJ8HMJeOx6J4p9DikJWr3rqHOXlYsUV5nK dfKw+uuKPrVr1WAzUn1jcYNl4fzjNP6I/aFa6ixx87Zm7ElNFj/DAbT0aRylTkx3sM BQ3Rd8PFIerWkbkl4BlcGeNQJc0yGJjzTUo32hmY= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4ACCB60C65 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=srirrama@codeaurora.org From: Sriram R To: kvalo@codeaurora.org, ath10k@lists.infradead.org Subject: [PATCHv2 1/2] ath: Add support to get the detected radar specifications Date: Tue, 15 May 2018 14:39:48 +0530 Message-Id: <1526375389-7106-2-git-send-email-srirrama@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526375389-7106-1-git-send-email-srirrama@codeaurora.org> References: <1526375389-7106-1-git-send-email-srirrama@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180515_021016_099811_2B8E9859 X-CRM114-Status: GOOD ( 13.82 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Sriram R MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This enables ath10k/ath9k drivers to collect the specifications of the radar type once it is detected by the dfs pattern detector unit. Usage of the collected info is specific to driver implementation. For example, collected radar info could be used by the host driver to send to co-processors for additional processing/validation. Note: 'radar_detector_specs' data containing the specifications of different radar types which was private within dfs_pattern_detector/ dfs_pri_detector is now shared with drivers as well for making use of this information. Signed-off-by: Sriram R --- drivers/net/wireless/ath/ath10k/wmi.c | 2 +- drivers/net/wireless/ath/ath9k/dfs.c | 2 +- drivers/net/wireless/ath/dfs_pattern_detector.c | 5 ++++- drivers/net/wireless/ath/dfs_pattern_detector.h | 3 ++- drivers/net/wireless/ath/dfs_pri_detector.h | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 46fb96e..1bccac0 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -3757,7 +3757,7 @@ static void ath10k_dfs_radar_report(struct ath10k *ar, ATH10K_DFS_STAT_INC(ar, pulses_detected); - if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) { + if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) { ath10k_dbg(ar, ATH10K_DBG_REGULATORY, "dfs no pulse pattern detected, yet\n"); return; diff --git a/drivers/net/wireless/ath/ath9k/dfs.c b/drivers/net/wireless/ath/ath9k/dfs.c index c8844f5..acb9602 100644 --- a/drivers/net/wireless/ath/ath9k/dfs.c +++ b/drivers/net/wireless/ath/ath9k/dfs.c @@ -277,7 +277,7 @@ ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe) DFS_STAT_INC(sc, pulses_processed); if (pd == NULL) return; - if (!pd->add_pulse(pd, pe)) + if (!pd->add_pulse(pd, pe, NULL)) return; DFS_STAT_INC(sc, radar_detected); ieee80211_radar_detected(sc->hw); diff --git a/drivers/net/wireless/ath/dfs_pattern_detector.c b/drivers/net/wireless/ath/dfs_pattern_detector.c index 448b83e..d52b31b 100644 --- a/drivers/net/wireless/ath/dfs_pattern_detector.c +++ b/drivers/net/wireless/ath/dfs_pattern_detector.c @@ -268,7 +268,8 @@ static void dpd_exit(struct dfs_pattern_detector *dpd) } static bool -dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event) +dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event, + struct radar_detector_specs *rs) { u32 i; struct channel_detector *cd; @@ -294,6 +295,8 @@ dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event) struct pri_detector *pd = cd->detectors[i]; struct pri_sequence *ps = pd->add_pulse(pd, event); if (ps != NULL) { + if (rs != NULL) + memcpy(rs, pd->rs, sizeof(*rs)); ath_dbg(dpd->common, DFS, "DFS: radar found on freq=%d: id=%d, pri=%d, " "count=%d, count_false=%d\n", diff --git a/drivers/net/wireless/ath/dfs_pattern_detector.h b/drivers/net/wireless/ath/dfs_pattern_detector.h index 92be353..18db6f4 100644 --- a/drivers/net/wireless/ath/dfs_pattern_detector.h +++ b/drivers/net/wireless/ath/dfs_pattern_detector.h @@ -97,7 +97,8 @@ struct dfs_pattern_detector { bool (*set_dfs_domain)(struct dfs_pattern_detector *dpd, enum nl80211_dfs_regions region); bool (*add_pulse)(struct dfs_pattern_detector *dpd, - struct pulse_event *pe); + struct pulse_event *pe, + struct radar_detector_specs *rs); struct ath_dfs_pool_stats (*get_stats)(struct dfs_pattern_detector *dpd); enum nl80211_dfs_regions region; diff --git a/drivers/net/wireless/ath/dfs_pri_detector.h b/drivers/net/wireless/ath/dfs_pri_detector.h index 79f0fff..86339f2 100644 --- a/drivers/net/wireless/ath/dfs_pri_detector.h +++ b/drivers/net/wireless/ath/dfs_pri_detector.h @@ -62,8 +62,9 @@ struct pri_detector { (*add_pulse)(struct pri_detector *de, struct pulse_event *e); void (*reset) (struct pri_detector *de, u64 ts); -/* private: internal use only */ const struct radar_detector_specs *rs; + +/* private: internal use only */ u64 last_ts; struct list_head sequences; struct list_head pulses;