From patchwork Sun Jun 3 18:20:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10445547 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 5CDC860234 for ; Sun, 3 Jun 2018 18:24:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C435286B3 for ; Sun, 3 Jun 2018 18:24:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4043A2886D; Sun, 3 Jun 2018 18:24:01 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, 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 D1362286B3 for ; Sun, 3 Jun 2018 18:24:00 +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=nVrGtJuZ2HoCGffGSEHQBXqyx81+9vIhcYnQje/u7jk=; b=NDLtzO5iCEdSaELmbpwK+IAcrc zkcxlt92H0iHwfLBJPwQwtOsSU+nhPAgrW7HjA77sx1XyxBrFFWmUMnfzGaZFPV2KiJj2TXLc73zH NCOqCrdNUyu2LhL87I2BRSJOK6QqiLDCdnlitjQuwQvYhcpkNaX8bhKi/1+O5m9oK6eV6/rTV67J3 kxnohNVWxO6CIVTBDtjPmTQkeNGgKUqjcIMls7mY/c95ZFNZEi5gQOjQDubsr7O/6X7LAQ3rT5YnR r5Y8GlZqjcBCUqmkZ53PhBs2+SixbsZ7scMuNbAa+HbATiPO5b24KBvwUC+adXax7oUYq0gQZwyys tG4ia6qg==; 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 1fPXfW-0007Nx-3l; Sun, 03 Jun 2018 18:23:54 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPXe5-0006WH-0j for ath10k@lists.infradead.org; Sun, 03 Jun 2018 18:22:41 +0000 Received: by mail-lf0-x244.google.com with SMTP id o9-v6so21774388lfk.1 for ; Sun, 03 Jun 2018 11:22:18 -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=gcsl606uvjXQaE0DrAgSHi711WddkveIhUCYa5o34Hk=; b=IJr9/WhondmGvplM6UtBESHT0+AtlxhM7h3FoCKWW3uBY/36zfLzj1OrP+T/ICaVm7 SPh8om1+f4Ys0JPxVu0ymoML4KRY5OcCAGHqAfkCojitEmBuaHgCKrMjRyUzLZWmkhGr HkY7LkFsAY0RfD5CxsNWF0FHWyakDzwJbSHuXqhFlXOWl/Dbf9+a4VpCc+T8A5ytNVZr SURSgczXVMS9vZK2tjeGVjHyHWuAMJgPN/m9tSjf0eLfIMYzU6h7BPCe2fhVq9CXOHcf /IQ3ObGWZHijA4GnZ0n2EKQeBT7dmsSgUqukaPG9wRGXWh8SDVU9vr3EsaK+81uGwt9f Vs+Q== 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=gcsl606uvjXQaE0DrAgSHi711WddkveIhUCYa5o34Hk=; b=EKuCwZn7XlPSh1OpuvtoVjkco3A+0FHTEC/UlUdH6U8zYurgluUSgSIQ6BJhyGdJAX Ef+3SGxAOBz6do0KgR+V8m8wPQrl6idWTfSF7s4kTpWsINsUWMYt3fK3q1ue/ombUisr zVqv/SX9Nbu7876kYO9Yk6FrO+SlO+AE1gokuGFaJ0gbSdkCspa3Y0Ou16Cy35O380sC 9/eXNY9PNmuEe5R+I0mMPfvdtpQ0m7LADHmwr43ISl4aUWqf7zPXuUjsh2FG/PsQ4iOg xLkI8bAzC1tq4y0uLvpg/Bqg+EC9wAJbaHvL7Vuk5rVN+U2y9CaqN83n6WQuIhqZzkUd AF8A== X-Gm-Message-State: ALKqPwfWXWS776DnklkfpUSlLirvsekDXh4O5HqHrvipUj+Rd5ogpGmI OxpZ3XrCcelNRbS8qn8dtHxqLA== X-Google-Smtp-Source: ADUXVKIFzNmApGKCExJuu9HovNlaksMqbJXPU6CYX7M1UItoB5BBgyP9jnCWfu+19XtP82+/zq8xvQ== X-Received: by 2002:a19:e910:: with SMTP id g16-v6mr10611913lfh.44.1528050136869; Sun, 03 Jun 2018 11:22:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jun 2018 11:22:16 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v5 09/12] ath10k: htt: RX ring config HL support Date: Sun, 3 Jun 2018 20:20:26 +0200 Message-Id: <20180603182029.8914-10-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_112225_095641_A7B27969 X-CRM114-Status: GOOD ( 13.10 ) 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 Special HTT RX ring config message used by high latency devices. The main difference between HL and LL is that HL devices do not use shared memory between device and host and thus, no host paddr's are added to the RX config message. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htt_tx.c | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 7c7e434fcde5..740e8740844e 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -934,6 +934,57 @@ static int ath10k_htt_send_rx_ring_cfg_64(struct ath10k_htt *htt) return 0; } +static int ath10k_htt_send_rx_ring_cfg_hl(struct ath10k_htt *htt) +{ + struct ath10k *ar = htt->ar; + struct sk_buff *skb; + struct htt_cmd *cmd; + struct htt_rx_ring_setup_ring32 *ring; + const int num_rx_ring = 1; + u16 flags; + int len; + int ret; + + /* + * the HW expects the buffer to be an integral number of 4-byte + * "words" + */ + BUILD_BUG_ON(!IS_ALIGNED(HTT_RX_BUF_SIZE, 4)); + BUILD_BUG_ON((HTT_RX_BUF_SIZE & HTT_MAX_CACHE_LINE_SIZE_MASK) != 0); + + len = sizeof(cmd->hdr) + sizeof(cmd->rx_setup_32.hdr) + + (sizeof(*ring) * num_rx_ring); + skb = ath10k_htc_alloc_skb(ar, len); + if (!skb) + return -ENOMEM; + + skb_put(skb, len); + + cmd = (struct htt_cmd *)skb->data; + ring = &cmd->rx_setup_32.rings[0]; + + cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_RX_RING_CFG; + cmd->rx_setup_32.hdr.num_rings = 1; + + flags = 0; + flags |= HTT_RX_RING_FLAGS_MSDU_PAYLOAD; + flags |= HTT_RX_RING_FLAGS_UNICAST_RX; + flags |= HTT_RX_RING_FLAGS_MULTICAST_RX; + + memset(ring, 0, sizeof(*ring)); + ring->rx_ring_len = __cpu_to_le16(HTT_RX_RING_SIZE_MIN); + ring->rx_ring_bufsize = __cpu_to_le16(HTT_RX_BUF_SIZE); + ring->flags = __cpu_to_le16(flags); + + ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb); + if (ret) { + dev_kfree_skb_any(skb); + return ret; + } + + return 0; +} + int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, u8 max_subfrms_ampdu, u8 max_subfrms_amsdu) @@ -1569,6 +1620,7 @@ static const struct ath10k_htt_tx_ops htt_tx_ops_64 = { }; static const struct ath10k_htt_tx_ops htt_tx_ops_hl = { + .htt_send_rx_ring_cfg = ath10k_htt_send_rx_ring_cfg_hl, .htt_send_frag_desc_bank_cfg = ath10k_htt_send_frag_desc_bank_cfg_32, };