From patchwork Wed Apr 3 16:31:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zefir Kurtisi X-Patchwork-Id: 2388721 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 05034DFB79 for ; Wed, 3 Apr 2013 16:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762171Ab3DCQcF (ORCPT ); Wed, 3 Apr 2013 12:32:05 -0400 Received: from mail.neratec.com ([80.75.119.105]:38721 "EHLO mail.neratec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759911Ab3DCQbu (ORCPT ); Wed, 3 Apr 2013 12:31:50 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.neratec.com (Postfix) with ESMTP id 5645E8BDFD9; Wed, 3 Apr 2013 18:31:42 +0200 (CEST) X-Virus-Scanned: amavisd-new at neratec.com Received: from mail.neratec.com ([127.0.0.1]) by localhost (mail.neratec.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2OXznYKO58NU; Wed, 3 Apr 2013 18:31:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.neratec.com (Postfix) with ESMTP id C14718A71BA; Wed, 3 Apr 2013 18:31:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at neratec.com Received: from mail.neratec.com ([127.0.0.1]) by localhost (mail.neratec.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uwK5TDRU_uih; Wed, 3 Apr 2013 18:31:40 +0200 (CEST) Received: from CHL500308.neratec.local (CHL500308.neratec.local [192.168.11.104]) by mail.neratec.com (Postfix) with ESMTPSA id DFA7D8BC1B6; Wed, 3 Apr 2013 18:31:40 +0200 (CEST) From: Zefir Kurtisi To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, siwu@hrz.tu-chemnitz.de, Zefir Kurtisi Subject: [PATCH 2/3] ath9k: add debugfs based DFS radar simulation Date: Wed, 3 Apr 2013 18:31:30 +0200 Message-Id: <1365006691-16705-3-git-send-email-zefir.kurtisi@neratec.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1365006691-16705-1-git-send-email-zefir.kurtisi@neratec.com> References: <1365006691-16705-1-git-send-email-zefir.kurtisi@neratec.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This helps testing DFS without radar generating equipment and is required for certification. Signed-off-by: Simon Wunderlich Signed-off-by: Zefir Kurtisi --- drivers/net/wireless/ath/ath9k/dfs_debug.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c index 55d2807..b7611b7 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_debug.c +++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c @@ -105,6 +105,24 @@ static ssize_t write_file_dfs(struct file *file, const char __user *user_buf, return count; } +static ssize_t write_file_simulate_radar(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath_softc *sc = file->private_data; + + ieee80211_radar_detected(sc->hw); + + return count; +} + +static const struct file_operations fops_simulate_radar = { + .write = write_file_simulate_radar, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + static const struct file_operations fops_dfs_stats = { .read = read_file_dfs, .write = write_file_dfs, @@ -117,4 +135,6 @@ void ath9k_dfs_init_debug(struct ath_softc *sc) { debugfs_create_file("dfs_stats", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_dfs_stats); + debugfs_create_file("dfs_simulate_radar", S_IWUSR, + sc->debug.debugfs_phy, sc, &fops_simulate_radar); }