From patchwork Fri Jul 27 00:42:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10546545 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 89E701805 for ; Fri, 27 Jul 2018 00:43:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 759B12BB1A for ; Fri, 27 Jul 2018 00:43:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 683BA2BB3E; Fri, 27 Jul 2018 00:43:21 +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 095662BB36 for ; Fri, 27 Jul 2018 00:43:21 +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: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:In-Reply-To: References:List-Owner; bh=aGrhPOQLlD5asRm5AlGhknZ6uiFuivIeDrTxlEjRm1g=; b=Z5+ 1mjH6JQg94Qa02NksNLmNsxut8qlI6SIONoDbdgiYKL3yuubgDsYPm2qXgrtNJYcVoQKDIrlZwmhb W7gA4EeDupnCnhUtqP18AT4Afy7sR+vMIDlpMv9vIpcbYjSw+8x143WGg+w4AAUztQeGnrilwBcdd 5J/gyj72kTYf8O7FzSxRk9qxKL+MnSmT3JZmbivaC5NPALBWWVDnQjHGXslRMHVL+ldkw3BXy6kPm 2oB4QuhxBW3qW6MHKK/arMM61e2EBxEYSXdHaVYBxVwDnFNQqTbmxH8g0rED4yrVREoU40ISLJY05 /PofKDYWuQYS5f1+YiQIN7wo/R8n0Vw==; 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 1fiqqi-0000wx-3u; Fri, 27 Jul 2018 00:43:16 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiqqb-0000t0-Ia for ath10k@lists.infradead.org; Fri, 27 Jul 2018 00:43:12 +0000 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id CA24D40A626; Thu, 26 Jul 2018 17:42:51 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, kvalo@codeaurora.org Subject: [PATCH v3 1/3] ath10k: Add ath10k-ct firmware feature flags and descriptions. Date: Thu, 26 Jul 2018 17:42:43 -0700 Message-Id: <1532652165-27272-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.11 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180726_174309_711735_DACDCD1D X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. 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: Ben Greear MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear These feature flags are used by ath10k-ct firmware. Add these so we can use them in future patches and so there are no warnings about feature flags on loading ath10k-ct firmware. Signed-off-by: Ben Greear --- No significant changes since v2 (though I rebased against latest wireless-testing and made sure it compiles. Old patches were not found in patchwork, so maybe they silently went away? drivers/net/wireless/ath/ath10k/core.c | 17 +++++++++ drivers/net/wireless/ath/ath10k/core.h | 67 ++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 85c58eb..5e48e06 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -563,6 +563,23 @@ static const char *const ath10k_core_fw_feature_str[] = { [ATH10K_FW_FEATURE_NO_PS] = "no-ps", [ATH10K_FW_FEATURE_MGMT_TX_BY_REF] = "mgmt-tx-by-reference", [ATH10K_FW_FEATURE_NON_BMI] = "non-bmi", + [ATH10K_FW_FEATURE_WMI_10X_CT] = "wmi-10.x-CT", + [ATH10K_FW_FEATURE_CT_RXSWCRYPT] = "rxswcrypt-CT", + [ATH10K_FW_FEATURE_HAS_TXSTATUS_NOACK] = "txstatus-noack", + [ATH10K_FW_FEATURE_CT_RATEMASK] = "ratemask-CT", + [ATH10K_FW_FEATURE_HAS_SAFE_BURST] = "safe-burst", + [ATH10K_FW_FEATURE_REGDUMP_CT] = "regdump-CT", + [ATH10K_FW_FEATURE_TXRATE_CT] = "txrate-CT", + [ATH10K_FW_FEATURE_FLUSH_ALL_CT] = "flush-all-CT", + [ATH10K_FW_FEATURE_PINGPONG_READ_CT] = "pingpong-CT", + [ATH10K_FW_FEATURE_SKIP_CH_RES_CT] = "ch-regs-CT", + [ATH10K_FW_FEATURE_NOP_CT] = "nop-CT", + [ATH10K_FW_FEATURE_HTT_MGT_CT] = "htt-mgt-CT", + [ATH10K_FW_FEATURE_SET_SPECIAL_CT] = "set-special-CT", + [ATH10K_FW_FEATURE_NO_BMISS_CT] = "no-bmiss-CT", + [ATH10K_FW_FEATURE_HAS_GET_TEMP_CT] = "get-temp-CT", + [ATH10K_FW_FEATURE_HAS_TX_RC_CT] = "tx-rc-CT", + [ATH10K_FW_FEATURE_CUST_STATS_CT] = "cust-stats-CT", }; static unsigned int ath10k_core_get_fw_feature_str(char *buf, diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 427ee57..e49b915 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -729,6 +729,73 @@ enum ath10k_fw_features { /* Firmware load is done externally, not by bmi */ ATH10K_FW_FEATURE_NON_BMI = 19, + /* tx-status has the noack bits (CT firmware version 14 and higher ) */ + ATH10K_FW_FEATURE_HAS_TXSTATUS_NOACK = 30, + + /* Firmware from Candela Technologies, enables more VIFs, etc */ + ATH10K_FW_FEATURE_WMI_10X_CT = 31, + + /* Firmware from Candela Technologies with rx-software-crypt. + * Required for multiple stations connected to same AP when using + * encryption (ie, commercial version of CT firmware) + */ + ATH10K_FW_FEATURE_CT_RXSWCRYPT = 32, + + /* Firmware supports extended wmi_common_peer_assoc_complete_cmd that + * contains an array of rate-disable masks. This allows the host to + * have better control over what rates the firmware will use. CT + * Firmware only (v15 and higher) + */ + ATH10K_FW_FEATURE_CT_RATEMASK = 33, + + /* Versions of firmware before approximately 10.2.4.72 would corrupt + * txop fields during burst. Since this is fixed now, add a flag to + * denote this. + */ + ATH10K_FW_FEATURE_HAS_SAFE_BURST = 34, + + /* Register-dump is supported. */ + ATH10K_FW_FEATURE_REGDUMP_CT = 35, + + /* TX-Rate is reported. */ + ATH10K_FW_FEATURE_TXRATE_CT = 36, + + /* Firmware can flush all peers. */ + ATH10K_FW_FEATURE_FLUSH_ALL_CT = 37, + + /* Firmware can read memory with ping-pong protocol. */ + ATH10K_FW_FEATURE_PINGPONG_READ_CT = 38, + + /* Firmware can skip channel reservation. */ + ATH10K_FW_FEATURE_SKIP_CH_RES_CT = 39, + + /* Firmware supports NOP keep-alive message. */ + ATH10K_FW_FEATURE_NOP_CT = 40, + + /* Firmware supports CT HTT MGT feature. */ + ATH10K_FW_FEATURE_HTT_MGT_CT = 41, + + /* Set-special cmd-id is supported. */ + ATH10K_FW_FEATURE_SET_SPECIAL_CT = 42, + + /* SW Beacon Miss is disabled in this kernel, so you have to + * let mac80211 manage the connection. + */ + ATH10K_FW_FEATURE_NO_BMISS_CT = 43, + + /* 10.1 firmware that supports getting temperature. Stock + * 10.1 cannot. + */ + ATH10K_FW_FEATURE_HAS_GET_TEMP_CT = 44, + + /* Can peer-id be over-ridden to provide rix + retries for raw pkts? + * CT only option. + */ + ATH10K_FW_FEATURE_HAS_TX_RC_CT = 45, + + /* Do we support requesting custom stats */ + ATH10K_FW_FEATURE_CUST_STATS_CT = 46, + /* keep last */ ATH10K_FW_FEATURE_COUNT, }; From patchwork Fri Jul 27 00:42:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10546549 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 C8F86139A for ; Fri, 27 Jul 2018 00:43:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B52BC2BB1A for ; Fri, 27 Jul 2018 00:43:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A903F2BB36; Fri, 27 Jul 2018 00:43:21 +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=ham 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 0944E2BB30 for ; Fri, 27 Jul 2018 00:43:20 +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=gdweZhB+wmSgGB34WmwnxRMtVgc/7VZTh4bqMLEdB74=; b=VCtq4DqYFLWUNM3BDfPzXG6hXN TKG+bYZiNz5wKXOw93Atr18Z5ffcl7+zZN2admrnz7qzF0mtwgwN3tZBit9chW1cVZuvn1BUevTKb sfcI26zbNg2kN5THHzD4PCvnLJIWWxZKnS2Hh2ejfedMjeSbUkoNkTnFn18jb6hYx3q/ur5Wkl78J C3beG0AM7H55CvgLD3IftAcY99zgWXp2/mnEoOKY3ncNhmD5BktEg8qEIRQWjpAU32uTywpDWSsqe qgI63utV0uUCxDw/ERxkKLtBSC05VvPMTwfTfhMCzibeNpaVM6fvWtdkYvE0JIXIPU6QOXe9OKAFK IhjQigzA==; 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 1fiqqf-0000uE-21; Fri, 27 Jul 2018 00:43:13 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiqqb-0000st-Ia for ath10k@lists.infradead.org; Fri, 27 Jul 2018 00:43:10 +0000 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id EA6DD40AC0B; Thu, 26 Jul 2018 17:42:52 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, kvalo@codeaurora.org Subject: [PATCH v3 2/3] ath10k: Don't try un-supported idle_ps_config command. Date: Thu, 26 Jul 2018 17:42:44 -0700 Message-Id: <1532652165-27272-2-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1532652165-27272-1-git-send-email-greearb@candelatech.com> References: <1532652165-27272-1-git-send-email-greearb@candelatech.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180726_174309_639763_E6310D01 X-CRM114-Status: GOOD ( 10.89 ) 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: Ben Greear MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear The warning the the logs does not give user a clue as to what command is failing, so it is worth it to check for un-supported command before trying the call. And add return-code to survey error message. Signed-off-by: Ben Greear --- drivers/net/wireless/ath/ath10k/mac.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 541bc1c..345d333 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4690,10 +4690,13 @@ static int ath10k_start(struct ieee80211_hw *hw) } param = ar->wmi.pdev_param->idle_ps_config; - ret = ath10k_wmi_pdev_set_param(ar, param, 1); - if (ret && ret != -EOPNOTSUPP) { - ath10k_warn(ar, "failed to enable idle_ps_config: %d\n", ret); - goto err_core_stop; + if (param != WMI_PDEV_PARAM_UNSUPPORTED) { + ret = ath10k_wmi_pdev_set_param(ar, param, 1); + if (ret) { + ath10k_warn(ar, "failed to enable idle_ps_config: %d\n", + ret); + goto err_core_stop; + } } __ath10k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask); @@ -6809,7 +6812,8 @@ ath10k_mac_update_bss_chan_survey(struct ath10k *ar, ret = ath10k_wmi_pdev_bss_chan_info_request(ar, type); if (ret) { - ath10k_warn(ar, "failed to send pdev bss chan info request\n"); + ath10k_warn(ar, "failed to send pdev bss chan info request: %d\n", + ret); return; } From patchwork Fri Jul 27 00:42:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 10546547 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 95C0B1822 for ; Fri, 27 Jul 2018 00:43:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 814382BB36 for ; Fri, 27 Jul 2018 00:43:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 753AA2BB3C; Fri, 27 Jul 2018 00:43:21 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID 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 092992BB1A for ; Fri, 27 Jul 2018 00:43:20 +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=rQ+S4gjvqiwoe/vV5pFrltVixCGZ04Wfur0nFh3fNWg=; b=SH2dfZJFJmyYIte11JtWgVgTxg Oo+7uIEp6yBSqc+CeF+mVpXnKZrSYBwXDOTLnKGG4Uez3kvxSMpRAEMX/xkZEUGx5kkxjojirrXEt qrhNX8Aq1szKf4tI65WEhYbPSxnfrCtkvGxW+0M+cCuTh+OnxsTlbQgdoz/iqeK71WmhzM9Yacv1N nE6/s8wozjoBeuwD9lE6GF8uMKqN1+WO+bXjtpGnAokEZ5w73IBBqWKolsmnPWLGf6skgJgP/WIQ2 v7/xL9eiHQ9P3AD51j0xIQJIFWJFa0x7ZBTFwUC3zIsWSKEU2g/YfJpd3TAu7LyCaXxJNB3xowrUw PJnbi/BQ==; 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 1fiqqg-0000v6-DX; Fri, 27 Jul 2018 00:43:14 +0000 Received: from mail2.candelatech.com ([208.74.158.173]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiqqb-0000t1-Ib for ath10k@lists.infradead.org; Fri, 27 Jul 2018 00:43:11 +0000 Received: from ben-dt3.candelatech.com (firewall.candelatech.com [50.251.239.81]) by mail2.candelatech.com (Postfix) with ESMTP id 158D640AF76; Thu, 26 Jul 2018 17:42:54 -0700 (PDT) From: greearb@candelatech.com To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, kvalo@codeaurora.org Subject: [PATCH v3 3/3] ath10k: Support survey dump for ath10k-ct 10.1 firmware. Date: Thu, 26 Jul 2018 17:42:45 -0700 Message-Id: <1532652165-27272-3-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 2.4.11 In-Reply-To: <1532652165-27272-1-git-send-email-greearb@candelatech.com> References: <1532652165-27272-1-git-send-email-greearb@candelatech.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180726_174309_659916_7A308510 X-CRM114-Status: GOOD ( 14.97 ) 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: Ben Greear MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ben Greear Recent ath10k-ct 10.1 firmware supports survey results, and advertises the appropriate service flags. This confuses the ath10k driver because the 10.1 wmi commands are not set up for survey information. So, this patch adds support for handling survey information. Example output: Survey data from wlan0 frequency: 5180 MHz [in use] noise: -97 dBm channel active time: 44 ms channel busy time: 15 ms channel receive time: 7 ms channel transmit time: 7 ms Survey data from wlan0 frequency: 5200 MHz noise: -98 dBm channel active time: 46 ms channel busy time: 2 ms ... Signed-off-by: Ben Greear --- drivers/net/wireless/ath/ath10k/wmi.c | 54 +++++++++++++++++++++++++++++++---- drivers/net/wireless/ath/ath10k/wmi.h | 8 ++++++ 2 files changed, 56 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 877249a..6dbd57c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -367,7 +367,8 @@ static struct wmi_cmd_map wmi_10x_cmd_map = { .vdev_filter_neighbor_rx_packets_cmdid = WMI_CMD_UNSUPPORTED, .mu_cal_start_cmdid = WMI_CMD_UNSUPPORTED, .set_cca_params_cmdid = WMI_CMD_UNSUPPORTED, - .pdev_bss_chan_info_request_cmdid = WMI_CMD_UNSUPPORTED, + .pdev_bss_chan_info_request_cmdid = + WMI_10_2_PDEV_BSS_CHAN_INFO_REQUEST_CMDID, .pdev_get_tpc_table_cmdid = WMI_CMD_UNSUPPORTED, .radar_found_cmdid = WMI_CMD_UNSUPPORTED, }; @@ -2832,9 +2833,15 @@ static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k *ar, for (i = 0; i < num_peer_stats; i++) { const struct wmi_10x_peer_stats *src; struct ath10k_fw_stats_peer *dst; + int stats_len; + + if (test_bit(WMI_SERVICE_PEER_STATS, ar->wmi.svc_map)) + stats_len = sizeof(struct wmi_10x_peer_stats_ct_ext); + else + stats_len = sizeof(*src); src = (void *)skb->data; - if (!skb_pull(skb, sizeof(*src))) + if (!skb_pull(skb, stats_len)) return -EPROTO; dst = kzalloc(sizeof(*dst), GFP_ATOMIC); @@ -2845,6 +2852,12 @@ static int ath10k_wmi_10x_op_pull_fw_stats(struct ath10k *ar, dst->peer_rx_rate = __le32_to_cpu(src->peer_rx_rate); + if (ath10k_peer_stats_enabled(ar)) { + struct wmi_10x_peer_stats_ct_ext *src2 = (void *)(src); + + dst->rx_duration = __le32_to_cpu(src2->rx_duration); + } + list_add_tail(&dst->list, &stats->peers); } @@ -5616,7 +5629,7 @@ static void ath10k_wmi_op_rx(struct ath10k *ar, struct sk_buff *skb) ath10k_wmi_event_service_available(ar, skb); break; default: - ath10k_warn(ar, "Unknown eventid: %d\n", id); + ath10k_warn(ar, "Unknown (main) eventid: %d\n", id); break; } @@ -5746,8 +5759,11 @@ static void ath10k_wmi_10_1_op_rx(struct ath10k *ar, struct sk_buff *skb) case WMI_10X_PDEV_UTF_EVENTID: /* ignore utf events */ break; + case WMI_10_1_PDEV_BSS_CHAN_INFO_EVENTID: /* Newer CT 10.1 firmware */ + ath10k_wmi_event_pdev_bss_chan_info(ar, skb); + break; default: - ath10k_warn(ar, "Unknown eventid: %d\n", id); + ath10k_warn(ar, "Unknown (10.1) eventid: %d\n", id); break; } @@ -5893,7 +5909,7 @@ static void ath10k_wmi_10_2_op_rx(struct ath10k *ar, struct sk_buff *skb) "received event id %d not implemented\n", id); break; default: - ath10k_warn(ar, "Unknown eventid: %d\n", id); + ath10k_warn(ar, "Unknown (10.2) eventid: %d\n", id); break; } @@ -6010,7 +6026,7 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb) ath10k_wmi_event_dfs_status_check(ar, skb); break; default: - ath10k_warn(ar, "Unknown eventid: %d\n", id); + ath10k_warn(ar, "Unknown (10.4) eventid: %d\n", id); break; } @@ -6305,6 +6321,26 @@ static struct sk_buff *ath10k_wmi_10_1_op_gen_init(struct ath10k *ar) config.num_msdu_desc = __cpu_to_le32(TARGET_10X_NUM_MSDU_DESC); config.max_frag_entries = __cpu_to_le32(TARGET_10X_MAX_FRAG_ENTRIES); + if (test_bit(ATH10K_FW_FEATURE_WMI_10X_CT, + ar->running_fw->fw_file.fw_features)) { + u32 features = 0; + + if (test_bit(ATH10K_FLAG_BTCOEX, &ar->dev_flags) && + test_bit(WMI_SERVICE_COEX_GPIO, ar->wmi.svc_map)) + features |= WMI_10_2_COEX_GPIO; + + if (ath10k_peer_stats_enabled(ar)) + features |= WMI_10_2_PEER_STATS; + + if (test_bit(WMI_SERVICE_BSS_CHANNEL_INFO_64, ar->wmi.svc_map)) + features |= WMI_10_2_BSS_CHAN_INFO; + + /* CT firmware uses high 8 bits of rx_decap_mode to pass the + * features flags + */ + config.rx_decap_mode |= __cpu_to_le32(features << 24); + } + len = sizeof(*cmd) + (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks); @@ -8799,6 +8835,12 @@ static const struct wmi_ops wmi_10_1_ops = { /* .gen_p2p_go_bcn_ie not implemented */ /* .gen_adaptive_qcs not implemented */ /* .gen_pdev_enable_adaptive_cca not implemented */ + + /* Some CT 10.1 firmware supports this. Non-CT 10.1 firmware will not + * advertise WMI_SERVICE_BSS_CHANNEL_INFO_64, so it will never be called + * in the first place. + */ + .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info, }; static const struct wmi_ops wmi_10_2_ops = { diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index d68afb6..7981377 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -1464,6 +1464,8 @@ enum wmi_10x_event_id { WMI_10X_PDEV_TPC_CONFIG_EVENTID, WMI_10X_GPIO_INPUT_EVENTID, + + WMI_10_1_PDEV_BSS_CHAN_INFO_EVENTID = 36900, /* Newer CT firmware */ WMI_10X_PDEV_UTF_EVENTID = WMI_10X_END_EVENTID - 1, }; @@ -4644,6 +4646,12 @@ struct wmi_10x_peer_stats { __le32 peer_rx_rate; } __packed; +struct wmi_10x_peer_stats_ct_ext { + struct wmi_peer_stats old; + __le32 peer_rx_rate; + __le32 rx_duration; +} __packed; + struct wmi_10_2_peer_stats { struct wmi_peer_stats old; __le32 peer_rx_rate;