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: 10445511 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.web.codeaurora.org (Postfix) with ESMTP id A050660234 for ; Sun, 3 Jun 2018 18:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 915DB28A4D for ; Sun, 3 Jun 2018 18:22:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 866DE28B1C; Sun, 3 Jun 2018 18:22:22 +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 2F7FA28A4D for ; Sun, 3 Jun 2018 18:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751406AbeFCSWV (ORCPT ); Sun, 3 Jun 2018 14:22:21 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36852 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbeFCSWS (ORCPT ); Sun, 3 Jun 2018 14:22:18 -0400 Received: by mail-lf0-f67.google.com with SMTP id u4-v6so21785117lff.3 for ; Sun, 03 Jun 2018 11:22:17 -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=cCTHdhE9H8fuxux8cq26vfbX/eVLWkoN4PROK3L5wW6gLK/EdYxaQ0i/fBs+jtc5nN 0mGknjYQdt2C7BfavqQ3a0hz28Hzrs+DqNT+YECm4GusfgZ+d2aGAOoUquxacWUH4D6M qwDAIvXGRkoWyjYxErynE/NgfybQcN++46bZrqTcu6tzusApY0x6nIAFwGdDmwWJMFDV JyHYsVB9TzIVZHgweJTlsJr0KmWeIBFEV2aZRbfvKJqFwyKFVrPVKdSXVVhDD9zyIMQZ 7q8QYHYo7Q1UGjTQnZVliol2u7JChJkMsPIzRd5HqkiorXJaFFfrfSX6GuYRZOdy9A6A DhXQ== X-Gm-Message-State: ALKqPweqbr7S0k1vxT/MpqTyqYM8/7D8cK20QSy3Vk9DvliF+8exglm4 TCQbq+8ZEX2F4V4DxynOA6E= 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 Cc: Erik Stromdahl 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> 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 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, };