From patchwork Mon Sep 3 17:50:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Psyborg X-Patchwork-Id: 10586273 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-2.web.codeaurora.org (Postfix) with ESMTP id 7038C920 for ; Mon, 3 Sep 2018 17:50:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D28929053 for ; Mon, 3 Sep 2018 17:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DBDA2946B; Mon, 3 Sep 2018 17:50:50 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D2D6029053 for ; Mon, 3 Sep 2018 17:50:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727640AbeICWMC (ORCPT ); Mon, 3 Sep 2018 18:12:02 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33783 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727141AbeICWMC (ORCPT ); Mon, 3 Sep 2018 18:12:02 -0400 Received: by mail-wm0-f67.google.com with SMTP id r1-v6so7257297wmh.0 for ; Mon, 03 Sep 2018 10:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FK6wH6msy2AM6hztK/EEl5T8B7t8Q0DOg0gNuD13zqw=; b=O2flnVqvyZtMAyIT65G5/snshhjW7GSeNANmKn2+sid1FGBrMc+mI/fn9LLmofYPMq pyE12XJ0m/iJ4I9rMtgwXBJJJvz2upFpLnj3477ayzk3yexVVpJ3Vb6NzOA0G+maYDLO rMKcpS+sLSGnFezCJnfrkYaj3TcaqVMixWYVEb0ZJ32D3vSuyW3Q0JC7mZ+Gf0UQ3IEf iqs+JT0yxydKHwF86IMxsGC9mesdWEQG7ch1BnOthadVuOUHKxVPeJl81olnszqd301m Rl0JynYMEE47c5E969Ygy1T7gc/4LHUQLc3KtXuivwg5qyFjXt7yBBDuP8qzBOHeD6o3 pkZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FK6wH6msy2AM6hztK/EEl5T8B7t8Q0DOg0gNuD13zqw=; b=s952mZv39TZRPrnOb5U0aeYiTJw5RlTJhAfgqtULGmO6igY8M/dh3iB9KstmSU4Q2I akVQPVYmXP2v+uYJH5XqSq7fisJpmNrH58PHeqmWCpLdQuyon0mrfv1+ZhNxJCumYBGf 5NiY6mT4JZU7eOB78QGXSy6c/AuxNeizPXvLG8aokM8K2dpDPtQzn4hEqPLJUEHRQjUW DkItkiC//rf1eOoPdm8R2P6gOxFtWoHp/UjCqyvKgAcRg/7h846vkA2ckxo4oynAV09K dNGR4UmaaZuYrrKuYu0t6da8JtfPV/lhSGNLrKoTcxQAb4yN0xfpuEGUdwtenLsnhsKB tzxQ== X-Gm-Message-State: APzg51CFQtXGb28G2WgPQTZ3VS6JoZVEOlsU6UeUJR8JjEqw0S8v8m9s fp5w775990q3pC3h+YPWPQ5KgnXnScA= X-Google-Smtp-Source: ANB0Vdaz5Ik1MZDocPvALWdiB3wLO5OpsuIKEnaSyghXaL2yEa9RWdswBfnoKSCjOquPqd472iSQfA== X-Received: by 2002:a1c:7f93:: with SMTP id a141-v6mr287724wmd.45.1535997046098; Mon, 03 Sep 2018 10:50:46 -0700 (PDT) Received: from localhost.localdomain ([31.147.208.18]) by smtp.googlemail.com with ESMTPSA id y17-v6sm25063216wrm.61.2018.09.03.10.50.44 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 03 Sep 2018 10:50:45 -0700 (PDT) From: =?utf-8?q?Tomislav_Po=C5=BEega?= To: linux-wireless@vger.kernel.org Cc: kvalo@codeaurora.org, ath9k-devel@qca.qualcomm.com, ath9k_htc_fw@lists.infradead.org Subject: [PATCH 1/3] debug: use common debug for ack timeout output Date: Mon, 3 Sep 2018 19:50:31 +0200 Message-Id: <1535997033-16330-1-git-send-email-pozega.tomislav@gmail.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 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 Move ack debug code to common-debug and adjust ath9k/ath9k_htc debug for common ack output. Signed-off-by: Tomislav Požega --- drivers/net/wireless/ath/ath9k/common-debug.c | 29 ++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/common-debug.h | 7 +++++ drivers/net/wireless/ath/ath9k/debug.c | 26 +-------------------- drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 4 +++ 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c b/drivers/net/wireless/ath/ath9k/common-debug.c index 239429f..230fe55 100644 --- a/drivers/net/wireless/ath/ath9k/common-debug.c +++ b/drivers/net/wireless/ath/ath9k/common-debug.c @@ -258,3 +258,32 @@ void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, &fops_phy_err); } EXPORT_SYMBOL(ath9k_cmn_debug_phy_err); + +#ifdef CONFIG_ATH9K_DYNACK +static ssize_t read_file_ackto(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath_hw *ah = file->private_data; + char buf[32]; + unsigned int len; + + len = sprintf(buf, "%u %c\n", ah->dynack.ackto, + (ah->dynack.enabled) ? 'A' : 'S'); + + return simple_read_from_buffer(user_buf, count, ppos, buf, len); +} + +static const struct file_operations fops_ackto = { + .read = read_file_ackto, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + +void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy, + struct ath_hw *ah) +{ + debugfs_create_file("ack_to", 0400, debugfs_phy, ah, &fops_ackto); +} +EXPORT_SYMBOL(ath9k_cmn_debug_ack_to); +#endif diff --git a/drivers/net/wireless/ath/ath9k/common-debug.h b/drivers/net/wireless/ath/ath9k/common-debug.h index 3376990..a4bc75f 100644 --- a/drivers/net/wireless/ath/ath9k/common-debug.h +++ b/drivers/net/wireless/ath/ath9k/common-debug.h @@ -71,6 +71,8 @@ void ath9k_cmn_debug_recv(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats); void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats); +void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy, + struct ath_hw *ah); #else static inline void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy, struct ath_hw *ah) @@ -96,4 +98,9 @@ static inline void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats) { } + +static inline void ath9k_cmn_debug_ack_to(struct dentry *debugfs_phy, + struct ath_hw *ah) +{ +} #endif /* CONFIG_ATH9K_COMMON_DEBUG */ diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 0a6eb8a..d2ea0b1 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -1038,29 +1038,6 @@ static ssize_t read_file_btcoex(struct file *file, char __user *user_buf, }; #endif -#ifdef CONFIG_ATH9K_DYNACK -static ssize_t read_file_ackto(struct file *file, char __user *user_buf, - size_t count, loff_t *ppos) -{ - struct ath_softc *sc = file->private_data; - struct ath_hw *ah = sc->sc_ah; - char buf[32]; - unsigned int len; - - len = sprintf(buf, "%u %c\n", ah->dynack.ackto, - (ah->dynack.enabled) ? 'A' : 'S'); - - return simple_read_from_buffer(user_buf, count, ppos, buf, len); -} - -static const struct file_operations fops_ackto = { - .read = read_file_ackto, - .open = simple_open, - .owner = THIS_MODULE, - .llseek = default_llseek, -}; -#endif - #ifdef CONFIG_ATH9K_WOW static ssize_t read_file_wow(struct file *file, char __user *user_buf, @@ -1451,8 +1428,7 @@ int ath9k_init_debug(struct ath_hw *ah) #endif #ifdef CONFIG_ATH9K_DYNACK - debugfs_create_file("ack_to", 0400, sc->debug.debugfs_phy, - sc, &fops_ackto); + ath9k_cmn_dbg_ack_to(sc->debug.debugfs_phy, sc->sc_ah); #endif debugfs_create_file("tpc", 0600, sc->debug.debugfs_phy, sc, &fops_tpc); diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c index b3ed65e..a345da8 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c @@ -520,5 +520,9 @@ int ath9k_htc_init_debug(struct ath_hw *ah) ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah); ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah); +#ifdef CONFIG_ATH9K_DYNACK + ath9k_cmn_debug_ack_to(priv->debug.debugfs_phy, priv->ah); +#endif + return 0; }