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; } From patchwork Mon Sep 3 17:50:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Psyborg X-Patchwork-Id: 10586277 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 D1637920 for ; Mon, 3 Sep 2018 17:50:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF72329053 for ; Mon, 3 Sep 2018 17:50:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B379C29471; Mon, 3 Sep 2018 17:50:52 +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 1F42429053 for ; Mon, 3 Sep 2018 17:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727681AbeICWME (ORCPT ); Mon, 3 Sep 2018 18:12:04 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33786 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727380AbeICWMD (ORCPT ); Mon, 3 Sep 2018 18:12:03 -0400 Received: by mail-wr1-f67.google.com with SMTP id v90-v6so1466744wrc.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:in-reply-to:references :mime-version:content-transfer-encoding; bh=6aqqFfOIQvDUi49PEcb0m22ZCjUCCSIxXnuxA+MPBBU=; b=j7HWif6QAgl0bxqUEIXh7m6iJncLcTjSCUZYc8P4AspbuR2LI3FvcVYSkj8/3NuATr j5XF37aWOzkb/yx5xMWE3Tm+mHhz+ayVMk/+XZFtxyk7uXzkQu4PzfMa7ZvHRYyAipq5 9mLzFfWaIRFDxXwW8BRuRTDE+6bLRfLauzQO4+LhvMopDyGkRoXsqJdJE1d9R8HWXEpL DQASDPcFrsRscErIBUh5B1ZCGXoG9dzMACSIA+bMkDRhxDHmMa1uMwtADln5ZauAl7Mm GYAfaKV0TNvgD9uA0ya36r1UsbLagzAOhTKr6AqfAtc47JpvaylLrds6WEzECA4leyNM tTXg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=6aqqFfOIQvDUi49PEcb0m22ZCjUCCSIxXnuxA+MPBBU=; b=iv8X3Fg9wre66R7+SafpeYUE1YFUpAOMhKo5NThHUCMbx1q38j6a9jJENIXBRkla+5 6HSwORjig+w6/yxs6aw3rISU5wi7MyKGmfFbaqgyUogHKLaYlt6RQ/GkjRlfD08T/c65 OV4xnrhzErcAk9nPUwKkxLMsEHJNJUfCg62JFEh+NNR7T7GI2HRmnpXYZ+UBDCepZy0d PdPs3G17m9q10RavE8mQfIUlQpBIDHk4/HSJG2kgrrNC3FNMTPgMGVct8euGwSa5R/dN DmsGe2DHPCLlI483HCqHl+gK04C5hXs6DkMQwVWNxejCk6hIqNSpA5br4gEn0BPwLcaz QeKg== X-Gm-Message-State: APzg51BITJiSSrifQTXIR3DrZOpGzrLZmyn1bpcWpowKSsqnJn0GleJI 8PYy/e+IrwcC9/7zde0gv5t9Hma6hYE= X-Google-Smtp-Source: ANB0Vdb6WtzSdxO8CywyZWTU/lMrXX2MNQvRqRmngWMbqFQyACQUjjCeXsyGVr89lOkALK2L6MN+Vw== X-Received: by 2002:a5d:428a:: with SMTP id k10-v6mr9558313wrq.225.1535997047023; Mon, 03 Sep 2018 10:50:47 -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.46 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 03 Sep 2018 10:50:46 -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 2/3] ath9k_htc: enable ANI debug output Date: Mon, 3 Sep 2018 19:50:32 +0200 Message-Id: <1535997033-16330-2-git-send-email-pozega.tomislav@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1535997033-16330-1-git-send-email-pozega.tomislav@gmail.com> References: <1535997033-16330-1-git-send-email-pozega.tomislav@gmail.com> 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 Enable ANI output in debug file similar to how it's done on ath9k. Disabling the entire feature is also working. Tested with ALFA AWUS036NHA device. Signed-off-by: Tomislav Požega --- drivers/net/wireless/ath/ath9k/htc.h | 1 + drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 98 ++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/htc_drv_main.c | 49 ++++++++++++ 3 files changed, 148 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 9f64e32..5490c5f 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -564,6 +564,7 @@ void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv, u8 enable_coex); void ath9k_htc_ani_work(struct work_struct *work); +void ath9k_htc_check_ani(struct ath9k_htc_priv *priv); void ath9k_htc_start_ani(struct ath9k_htc_priv *priv); void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv); diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c index a345da8..cfbb309 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c @@ -398,6 +398,102 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf, .llseek = default_llseek, }; +static ssize_t read_file_ani(struct file *file, char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath9k_htc_priv *priv = file->private_data; + struct ath_common *common = ath9k_hw_common(priv->ah); + struct ath_hw *ah = priv->ah; + unsigned int len = 0; + const unsigned int size = 1024; + ssize_t retval = 0; + char *buf; + int i; + struct { + const char *name; + unsigned int val; + } ani_info[] = { + { "ANI RESET", ah->stats.ast_ani_reset }, + { "OFDM LEVEL", ah->ani.ofdmNoiseImmunityLevel }, + { "CCK LEVEL", ah->ani.cckNoiseImmunityLevel }, + { "SPUR UP", ah->stats.ast_ani_spurup }, + { "SPUR DOWN", ah->stats.ast_ani_spurup }, + { "OFDM WS-DET ON", ah->stats.ast_ani_ofdmon }, + { "OFDM WS-DET OFF", ah->stats.ast_ani_ofdmoff }, + { "MRC-CCK ON", ah->stats.ast_ani_ccklow }, + { "MRC-CCK OFF", ah->stats.ast_ani_cckhigh }, + { "FIR-STEP UP", ah->stats.ast_ani_stepup }, + { "FIR-STEP DOWN", ah->stats.ast_ani_stepdown }, + { "INV LISTENTIME", ah->stats.ast_ani_lneg_or_lzero }, + { "OFDM ERRORS", ah->stats.ast_ani_ofdmerrs }, + { "CCK ERRORS", ah->stats.ast_ani_cckerrs }, + }; + + buf = kzalloc(size, GFP_KERNEL); + if (buf == NULL) + return -ENOMEM; + + len += scnprintf(buf + len, size - len, "%15s: %s\n", "ANI", + common->disable_ani ? "DISABLED" : "ENABLED"); + + if (common->disable_ani) + goto exit; + + for (i = 0; i < ARRAY_SIZE(ani_info); i++) + len += scnprintf(buf + len, size - len, "%15s: %u\n", + ani_info[i].name, ani_info[i].val); + +exit: + if (len > size) + len = size; + + retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); + kfree(buf); + + return retval; +} + +static ssize_t write_file_ani(struct file *file, + const char __user *user_buf, + size_t count, loff_t *ppos) +{ + struct ath9k_htc_priv *priv = file->private_data; + struct ath_common *common = ath9k_hw_common(priv->ah); + unsigned long ani; + char buf[32]; + ssize_t len; + + len = min(count, sizeof(buf) - 1); + if (copy_from_user(buf, user_buf, len)) + return -EFAULT; + + buf[len] = '\0'; + if (kstrtoul(buf, 0, &ani)) + return -EINVAL; + + if (ani > 1) + return -EINVAL; + + common->disable_ani = !ani; + + if (common->disable_ani) { + clear_bit(ATH_OP_ANI_RUN, &common->op_flags); + ath9k_htc_stop_ani(priv); + } else { + ath9k_htc_check_ani(priv); + } + + return count; +} + +static const struct file_operations fops_ani = { + .read = read_file_ani, + .write = write_file_ani, + .open = simple_open, + .owner = THIS_MODULE, + .llseek = default_llseek, +}; + /* Ethtool support for get-stats */ #define AMKSTR(nm) #nm "_BE", #nm "_BK", #nm "_VI", #nm "_VO" static const char ath9k_htc_gstrings_stats[][ETH_GSTRING_LEN] = { @@ -524,5 +620,7 @@ int ath9k_htc_init_debug(struct ath_hw *ah) ath9k_cmn_debug_ack_to(priv->debug.debugfs_phy, priv->ah); #endif + debugfs_create_file("ani", 0600, priv->debug.debugfs_phy, priv, &fops_ani); + return 0; } diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index a82ad73..73f6fe1 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c @@ -1505,11 +1505,55 @@ static void ath9k_htc_choose_set_bssid(struct ath9k_htc_priv *priv) } } +void ath9k_htc_check_ani(struct ath9k_htc_priv *priv) +{ + struct ath_hw *ah = priv->ah; + struct ath_common *common = ath9k_hw_common(ah); + struct ath_beacon_config *cur_conf = &priv->cur_beacon_conf; + + /* + * Check for the various conditions in which ANI has to + * be stopped. + */ + if (ah->opmode == NL80211_IFTYPE_ADHOC) { + if (!cur_conf->enable_beacon) + goto stop_ani; + } else if (ah->opmode == NL80211_IFTYPE_AP) { + if (!cur_conf->enable_beacon) { + /* + * Disable ANI only when there are no + * associated stations. + */ + if (!test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags)) + goto stop_ani; + } + } else if (ah->opmode == NL80211_IFTYPE_STATION) { + if (!test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags)) + goto stop_ani; + } + + if (!test_bit(ATH_OP_ANI_RUN, &common->op_flags)) { + set_bit(ATH_OP_ANI_RUN, &common->op_flags); + ath9k_htc_start_ani(priv); + } + + return; + +stop_ani: + clear_bit(ATH_OP_ANI_RUN, &common->op_flags); + ath9k_htc_stop_ani(priv); +} + static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *bss_conf, u32 changed) { +#define CHECK_ANI \ + (BSS_CHANGED_ASSOC | \ + BSS_CHANGED_IBSS | \ + BSS_CHANGED_BEACON_ENABLED) + struct ath9k_htc_priv *priv = hw->priv; struct ath_hw *ah = priv->ah; struct ath_common *common = ath9k_hw_common(ah); @@ -1609,8 +1653,13 @@ static void ath9k_htc_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_HT) ath9k_htc_update_rate(priv, vif, bss_conf); + if (changed & CHECK_ANI) + ath9k_htc_check_ani(priv); + ath9k_htc_ps_restore(priv); mutex_unlock(&priv->mutex); + +#undef CHECK_ANI } static u64 ath9k_htc_get_tsf(struct ieee80211_hw *hw, From patchwork Mon Sep 3 17:50:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom Psyborg X-Patchwork-Id: 10586275 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 B561B180E for ; Mon, 3 Sep 2018 17:50:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A411E29053 for ; Mon, 3 Sep 2018 17:50:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98A072946B; Mon, 3 Sep 2018 17:50:51 +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 383CA29467 for ; Mon, 3 Sep 2018 17:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727716AbeICWME (ORCPT ); Mon, 3 Sep 2018 18:12:04 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38613 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727465AbeICWMD (ORCPT ); Mon, 3 Sep 2018 18:12:03 -0400 Received: by mail-wr1-f65.google.com with SMTP id w11-v6so1434261wrc.5 for ; Mon, 03 Sep 2018 10:50:48 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=D/myz0sRpa8TxyGjKXvUIrJNamYEC14XDxGQMIpaWjM=; b=ujFYkfkKnyB4+Ic5pojkl53ojLRnu2uNd+j4Rk1scX7jC0cZh3cISSdgF/xVPqr8MJ SHtGdQGvdwWSHtWEb1Jwo448UBhapt7mtBbakR9Kq6sbA7jSZvwmnqz5onP3ofECfLZz vaxFoBime2N4cjgM890BCu0iiLjFK8SKi5AOhdBfXwhjJdo0AcJtyzDELbeF0xGRMB8f iSGaz5ZjvaRCxtMZ2NBgPfDyAkfcPH8o7sGz6eDrzFoOYdqXGKKV/H3O3nkvg+MWqUFp 0hANV0vrssRqdiR5r/QrbNahNW1jvOABnQ4/tkvC6mb2qwjO/bcmeddXjAs5zgjv+aQS mnOA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=D/myz0sRpa8TxyGjKXvUIrJNamYEC14XDxGQMIpaWjM=; b=QNLA7m2praEGa0RUh7cJjg8+vlbYzTwjm6xWpw9l6vw582bwTKAR4R08IEwbDqxMzv UjBjdSKjy8oB2IQ0hsgzYshdM2nEhXH9I1AyOd7oPFDjlrAnJIc/1GphG5Fq7jmnVEpo xCV6yq1gjldkJx1tcIHbnsPoMAV7gsbJA8nb8JG2qpB5IE6D427hmcFE2521WHv95veQ monPrnQnJNIrI7MfCa3QVfWt6tiHMOtGt+XDWm6tJOgo3cFNOA/BZmKjkTL0VRYXvgBk mNXqoKT9S9eddzun/YxZXrEJ5DuhONreL/X9sHQsIbcDxXxfqRcpmy+xu75JByW6/hOk tiRw== X-Gm-Message-State: APzg51D6eAnDXEoN094MxbGsRkfTai5Qtp4A6zEHCBWG3yKlZ9MffVvh yRfYndRcj5yyIi6AsrsMCsvZiL4EfyQ= X-Google-Smtp-Source: ANB0VdZyCU7w6TLwWfJ7T1lXKPjldWbXC6TBejzOxNHl1U6yDqE6DA/3bJGd8nug+44uU+Rj+howjA== X-Received: by 2002:adf:f84b:: with SMTP id d11-v6mr19407159wrq.172.1535997048044; Mon, 03 Sep 2018 10:50:48 -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.47 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 03 Sep 2018 10:50:47 -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 3/3] ath9k_htc: increase number of configurable virtual interfaces Date: Mon, 3 Sep 2018 19:50:33 +0200 Message-Id: <1535997033-16330-3-git-send-email-pozega.tomislav@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1535997033-16330-1-git-send-email-pozega.tomislav@gmail.com> References: <1535997033-16330-1-git-send-email-pozega.tomislav@gmail.com> 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 Increase driver limit for various interface combinations. I was able to start 8 virtual APs and connect 5 clients to these. Frimware support is required too, see: https://github.com/qca/open-ath9k-htc-firmware/pull/149 Signed-off-by: Tomislav Požega --- drivers/net/wireless/ath/ath9k/htc.h | 8 ++++---- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 5490c5f..b6c577b 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -197,8 +197,8 @@ struct ath9k_htc_target_rx_stats { __be32 host_done; } __packed; -#define ATH9K_HTC_MAX_VIF 2 -#define ATH9K_HTC_MAX_BCN_VIF 2 +#define ATH9K_HTC_MAX_VIF 8 +#define ATH9K_HTC_MAX_BCN_VIF 8 #define INC_VIF(_priv, _type) do { \ switch (_type) { \ @@ -251,8 +251,8 @@ struct ath9k_vif_iter_data { u8 mask[ETH_ALEN]; }; -#define ATH9K_HTC_MAX_STA 8 -#define ATH9K_HTC_MAX_TID 8 +#define ATH9K_HTC_MAX_STA 128 +#define ATH9K_HTC_MAX_TID 16 enum tid_aggr_state { AGGR_STOP = 0, diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 214c682..fa13ba9 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -697,9 +697,9 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, } static const struct ieee80211_iface_limit if_limits[] = { - { .max = 2, .types = BIT(NL80211_IFTYPE_STATION) | + { .max = 8, .types = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_P2P_CLIENT) }, - { .max = 2, .types = BIT(NL80211_IFTYPE_AP) | + { .max = 8, .types = BIT(NL80211_IFTYPE_AP) | #ifdef CONFIG_MAC80211_MESH BIT(NL80211_IFTYPE_MESH_POINT) | #endif @@ -709,7 +709,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, static const struct ieee80211_iface_combination if_comb = { .limits = if_limits, .n_limits = ARRAY_SIZE(if_limits), - .max_interfaces = 2, + .max_interfaces = 8, .num_different_channels = 1, };