From patchwork Sun Dec 31 17:29:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10138273 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 BC4E660362 for ; Sun, 31 Dec 2017 17:32:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2E812886B for ; Sun, 31 Dec 2017 17:32:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97DA92887A; Sun, 31 Dec 2017 17:32:25 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 3E61A2886B for ; Sun, 31 Dec 2017 17:32:25 +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=/HW6SG91oU7CZyRs/USZrJUUMVsbFCMG50oX8OsuadQ=; b=q6eLRsq9XgJu9ldX/Jf7gI2ruc zppIjuwWOJJyQ1VY8r5Wn24WzKF3MK6lW/kehcVzg6IyTHpqswzF8BJIMn1ZMsm6LmN6DkFi5oJE4 ZR16QRNO4oGw20E6D5Y1ZTMLppYBFxgey28k0FPx4yL65p3s0wjKMr3oXNAyPH3s9DFZ7L6U+1O8/ eBKqeYC4lQJIHxKQEJGFdspbjtKG5BYYFSQdam4ypoYw09Bw+0/BGEatt3RrIhrbNzTSSny6BiXRr w9BJY1gU3jOiImEk21TmDnBroDB/GLMaZKDsrbdem2KNA720GDdhlbQYQa0HfdN/BjdBDmx4pSxRk CYBOl+Ag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eVhT8-0006Ix-HF; Sun, 31 Dec 2017 17:32:18 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eVhSc-0005z1-EN for ath10k@lists.infradead.org; Sun, 31 Dec 2017 17:31:52 +0000 Received: by mail-lf0-x244.google.com with SMTP id m20so39145326lfi.6 for ; Sun, 31 Dec 2017 09:31:40 -0800 (PST) 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; bh=xw9U7jEzwRjDQopYp5BeQ1oOb+ZUgPkIF3VeUBKHqQg=; b=iL77jSrTBqpomixI6WUAQzzbLyYu7sQipDBftjBUxoop++O3KMSesh3WkPehdqXwJg o9+TLJ3n2H7VXxFeDfpx1m2ob492Peg894lTsYgiQxiBb0ebg5SZAy9Tq7faV/P2mkEd cL7fdUEbqzPEsUNxLxfyraPITNudXDYLjre/9CyTIqb/cTrdhAPCMQXY95nB7GF/Ob9M X3xKGwyf76niJBK9LDv8BeSWHqDN/4dMGH5ylyM77MqFM0cGqhEEVuuDkXFH+QeznxDW EFNU5oKfv8gqregHN4qmtKisTnPt8CCC9S737+QSXgHpNRgquoIk6eyYCLQHKC/h126b c99Q== 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; bh=xw9U7jEzwRjDQopYp5BeQ1oOb+ZUgPkIF3VeUBKHqQg=; b=kNXmiZkt3qgaLVJ62lVl+6ILq0mbuVwL+y+b6WOukKNiWgtj1/Tbg83KvPL+0i3uQz yXYWhFIKsHSFRppiRZRcQxIZl7pUKuo9OkNZmr/0biBkRPV+3zhjZcp63U63Cls83PnZ EQiLwS+sWWmrh6aN+RV9wucS8l0S4EVSAFHKUwPAsf7sMfqw1KcPohvZYDrtcSISJpWJ N4ZK9RIgIA8KlG42QGQsgApyVRdY7X6MryOP4OpjEPnJaj7v5a/RUuldsNxIU17yL7n+ 2fbwkpEglTl5j6WwwBmYdX/y96Z/orkd8oy3viA9pDKQfHpP1PvW+nnrvSiYM3jq42sC BAUA== X-Gm-Message-State: AKGB3mIvoZQYHzPPBOgIsIJNOkyQg4HQoEey5oBo3U5ZoS/ZdvQg6qsN fsvSSnpthVRqAKENJ8ef/hg= X-Google-Smtp-Source: ACJfBotuBfonKtvbDJDx8ZKshYKcunfZC8+ZVYGZJsMjEYmBgue6tnpcP6vAYSEVWFUSEZ7MktPOTw== X-Received: by 10.25.37.205 with SMTP id l196mr22828427lfl.81.1514741499164; Sun, 31 Dec 2017 09:31:39 -0800 (PST) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id o64sm5048449lfo.53.2017.12.31.09.31.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Dec 2017 09:31:38 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 06/18] ath10k: per target config of max_num_peers Date: Sun, 31 Dec 2017 18:29:13 +0100 Message-Id: <20171231172925.24014-7-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171231172925.24014-1-erik.stromdahl@gmail.com> References: <20171231172925.24014-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171231_093146_606328_F46AFDA8 X-CRM114-Status: GOOD ( 10.27 ) 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: Erik Stromdahl 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 patch makes sure the value of max_num_peers matches num_peers in hw_params (if set to a non zero value). Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/core.c | 17 ++++++++++++----- drivers/net/wireless/ath/ath10k/hw.h | 3 +++ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 3 +-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 41e6b5a08885..4e849ec924c6 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -1905,6 +1905,7 @@ static void ath10k_core_set_coverage_class_work(struct work_struct *work) static int ath10k_core_init_firmware_features(struct ath10k *ar) { struct ath10k_fw_file *fw_file = &ar->normal_mode_fw.fw_file; + int max_num_peers; if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, fw_file->fw_features) && !test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) { @@ -1984,7 +1985,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) switch (fw_file->wmi_op_version) { case ATH10K_FW_WMI_OP_VERSION_MAIN: - ar->max_num_peers = TARGET_NUM_PEERS; + max_num_peers = TARGET_NUM_PEERS; ar->max_num_stations = TARGET_NUM_STATIONS; ar->max_num_vdevs = TARGET_NUM_VDEVS; ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC; @@ -1996,10 +1997,10 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) case ATH10K_FW_WMI_OP_VERSION_10_2: case ATH10K_FW_WMI_OP_VERSION_10_2_4: if (ath10k_peer_stats_enabled(ar)) { - ar->max_num_peers = TARGET_10X_TX_STATS_NUM_PEERS; + max_num_peers = TARGET_10X_TX_STATS_NUM_PEERS; ar->max_num_stations = TARGET_10X_TX_STATS_NUM_STATIONS; } else { - ar->max_num_peers = TARGET_10X_NUM_PEERS; + max_num_peers = TARGET_10X_NUM_PEERS; ar->max_num_stations = TARGET_10X_NUM_STATIONS; } ar->max_num_vdevs = TARGET_10X_NUM_VDEVS; @@ -2008,7 +2009,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM; break; case ATH10K_FW_WMI_OP_VERSION_TLV: - ar->max_num_peers = TARGET_TLV_NUM_PEERS; + max_num_peers = TARGET_TLV_NUM_PEERS; ar->max_num_stations = TARGET_TLV_NUM_STATIONS; ar->max_num_vdevs = TARGET_TLV_NUM_VDEVS; ar->max_num_tdls_vdevs = TARGET_TLV_NUM_TDLS_VDEVS; @@ -2019,7 +2020,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM; break; case ATH10K_FW_WMI_OP_VERSION_10_4: - ar->max_num_peers = TARGET_10_4_NUM_PEERS; + max_num_peers = TARGET_10_4_NUM_PEERS; ar->max_num_stations = TARGET_10_4_NUM_STATIONS; ar->num_active_peers = TARGET_10_4_ACTIVE_PEERS; ar->max_num_vdevs = TARGET_10_4_NUM_VDEVS; @@ -2037,10 +2038,16 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar) break; case ATH10K_FW_WMI_OP_VERSION_UNSET: case ATH10K_FW_WMI_OP_VERSION_MAX: + default: WARN_ON(1); return -EINVAL; } + if (ar->hw_params.num_peers) + ar->max_num_peers = ar->hw_params.num_peers; + else + ar->max_num_peers = max_num_peers; + /* Backwards compatibility for firmwares without * ATH10K_FW_IE_HTT_OP_VERSION. */ diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 3043fd17942e..53276950c95c 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -692,6 +692,9 @@ ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw, #define TARGET_HL_10_TLV_AST_SKID_LIMIT 6 #define TARGET_HL_10_TLV_NUM_WDS_ENTRIES 2 +/* Target specific defines for QCA9377 high latency firmware */ +#define TARGET_QCA9377_HL_NUM_PEERS 15 + /* Diagnostic Window */ #define CE_DIAG_PIPE 7 diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index ae77a007ae07..6b58bcbb36c1 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -1439,7 +1439,6 @@ static struct sk_buff *ath10k_wmi_tlv_op_gen_init(struct ath10k *ar) cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks); cfg->num_vdevs = __cpu_to_le32(TARGET_TLV_NUM_VDEVS); - cfg->num_peers = __cpu_to_le32(ar->hw_params.num_peers); cfg->ast_skid_limit = __cpu_to_le32(ar->hw_params.ast_skid_limit); cfg->num_wds_entries = __cpu_to_le32(ar->hw_params.num_wds_entries); @@ -1453,7 +1452,7 @@ static struct sk_buff *ath10k_wmi_tlv_op_gen_init(struct ath10k *ar) } cfg->num_peer_keys = __cpu_to_le32(2); - cfg->num_tids = __cpu_to_le32(TARGET_TLV_NUM_TIDS); + cfg->num_tids = __cpu_to_le32(ar->hw_params.num_peers * 2); cfg->tx_chain_mask = __cpu_to_le32(0x7); cfg->rx_chain_mask = __cpu_to_le32(0x7); cfg->rx_timeout_pri[0] = __cpu_to_le32(0x64);