From patchwork Sun Jun 3 18:20:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10445539 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 53D19601BC for ; Sun, 3 Jun 2018 18:23:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4338C23B24 for ; Sun, 3 Jun 2018 18:23:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 379F227E63; Sun, 3 Jun 2018 18:23:30 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, T_DKIM_INVALID 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 E531023B24 for ; Sun, 3 Jun 2018 18:23:29 +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=Rh0Jxt6xbvGk1G+4ZKN9+A8pCoxt99Epy/R3EZAPPJU=; b=c46UU8gdQVuBxDSwIn6w3o40Uq 9alq1exfNeb23KEWlrXf0+3nPHN4ZvgQm1RzFrAx7Q60xz87mHPtZ4X8H4heBEEWsq6KzZfIAZqgI hx3jxGI94xdtogIzXqQ95BH8IV/09CYzcLFKj261QlVoBDsx04gWz7429cEjRhjmC2hkjrNvVA+jR weN6BbmWdxvbKD+517u4akUSCEzzKTlQEnC9mfLHU/yjxXyZGPkglTNQGesHZHrbIo3tyLhDIdHFB qYRNtgdmhl9KSR7QmWJbRU/wFjJv664+o39vKMJsoBB0yi5RM8NdtO1iBD0Pygqi5Dpj0VGNBMGED RvgcgfGw==; 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 1fPXez-00073S-9a; Sun, 03 Jun 2018 18:23:21 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPXe2-0006VU-9Y for ath10k@lists.infradead.org; Sun, 03 Jun 2018 18:22:30 +0000 Received: by mail-lf0-x243.google.com with SMTP id y20-v6so21789689lfy.0 for ; Sun, 03 Jun 2018 11:22:13 -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; bh=VwQgRw8uzEa6v6Rcpcz+empmwaUJXo0GauFaxqY565Y=; b=VzEBglk1PbHlXlAW0skBgc9fw1mx5wlWGKOBBPT260oO6qz80fIuJjy7de6q3R6iFI uslOw6dMTAHzFCYuS0AmC9AF2sZmWY2Mc+RwqIOko49Op9S0B+98OkMyphv4rajP7qFi u8jyXBo3gfYa4aCmVmr+5soBuT9LLNKpzm+0rpAozEOYPAxLWiLIE9ILaazlXWu/MpN8 TcTCr+DRe0aXYBDCiA22bMrzRxSAp4Oqk/Prn3v3dknMRdYCrxkb9PzzeoGhwWm+86Hs RR8NDf/oxtDnRENkNUPFNaotJ1ORPDYaTgTDKu8KaKs0GTLTj1PfJH2B8WuAUswY1vIt 9fxQ== 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=VwQgRw8uzEa6v6Rcpcz+empmwaUJXo0GauFaxqY565Y=; b=BPJ2vahO2Rb3/CxfWhm6I76/FPJ9bwGUtG/ZUaH30uP3yJQP8zQoIJJ70sqdol5UAY 51DO71O64DThsj/Ctj5mEGIkfyVqHKVQubx3v0NMYRGHVKrYIbcEWK4QUweE4iwPT8Ti ggvifa3Hsh4lf44jrEBnHqSRCkKsnONhFwfSvPn/385S6Q9DUrcTHgKl8r4e3W7bz1HE 3pwuaMgeX2uIiYJ4/vLN9Fn3owtVvyv6DzEjAvyOourNPLCBte7JkKX9LP9W509b/z1u nQF4RWQ0m4Ym9zXzMFYEbPotpmVrJ5SkAN0OEPybw4ifFK8By4ItGizkLbo0H55CfUhv CaLw== X-Gm-Message-State: ALKqPwfkvJITLIsvcNOuAFmVmR/Ui/H3Hy/9qt+LRZqCRyYUbonjzAxF cTgUTv2AlLskjAJqO2YwKgI= X-Google-Smtp-Source: ADUXVKIp8tMZb6hTdCdnOlQ4w8yGXDVLlNrMnHOc5mgQGyZfMEYlVc+BrtSVpAoYqZkn8qeWwYcSmw== X-Received: by 2002:a2e:9e57:: with SMTP id g23-v6mr9850723ljk.37.1528050132162; Sun, 03 Jun 2018 11:22:12 -0700 (PDT) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id l200-v6sm4980562lfe.77.2018.06.03.11.22.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jun 2018 11:22:11 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v5 04/12] ath10k: use hw_params.num_peers for num_tids in TLV init Date: Sun, 3 Jun 2018 20:20:21 +0200 Message-Id: <20180603182029.8914-5-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180603182029.8914-1-erik.stromdahl@gmail.com> References: <20180603182029.8914-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180603_112222_376999_12A8C310 X-CRM114-Status: GOOD ( 12.41 ) 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 As TARGET_TLV_NUM_TIDS is calculated like this: #define TARGET_TLV_NUM_TIDS ((TARGET_TLV_NUM_PEERS) * 2) ... it is better to use the per device hw_params.num_peers value in the TLV init message (if set), rather than using a hard coded value. This makes the value used in the TLV init message match the hw_param value. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 2e34a1fc5ba6..acd2186526b7 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -1552,7 +1552,10 @@ 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); + if (ar->hw_params.num_peers) + cfg->num_tids = __cpu_to_le32(ar->hw_params.num_peers * 2); + else + cfg->num_tids = __cpu_to_le32(TARGET_TLV_NUM_TIDS); 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);