From patchwork Sun Dec 31 17:29:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10138277 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 750ED60362 for ; Sun, 31 Dec 2017 17:32:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C19928875 for ; Sun, 31 Dec 2017 17:32:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 510C42887A; Sun, 31 Dec 2017 17:32:41 +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 02C782887E for ; Sun, 31 Dec 2017 17:32:41 +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=21PsxgZz46yRSdqFHg3Z33ONqWOpaIz6RNBbYEWEGco=; b=mp2DI4Z2SYZeeQRb2YL7vWcT+e Pm+QZODUJ/FLPCMDN3dsfLm7yPc+mJH+BVOj1Hd5RXD8T5SKInBtmqHkYW9/Jkd2fbajrh6ti0QgK lkJWnuCqG0wOqlyZSDFWHWSwJqCzWZaTdcYLnTM91vLwXtjWfaURY0yrxTqUoCil/JC+CPXw4Lfuc Za7cDmAPu0giJm7fX/vdR/cHPnZtRPJkniHfQtbA92e8F+E6ORJkk3Pmj4FLfikOXfNxAGDdfEKKu yv2gXmoHBa3zy8Zf7N7K9LzqoZVpivv/2YXi2g0g3I3H5k6Lsmkjt6A2GNLVzjM57WLB12Og2uA4+ RsCTY+Dg==; 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 1eVhTN-0006TG-AG; Sun, 31 Dec 2017 17:32:33 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eVhSe-0005zj-Dz for ath10k@lists.infradead.org; Sun, 31 Dec 2017 17:31:55 +0000 Received: by mail-lf0-x242.google.com with SMTP id f3so16110763lfe.4 for ; Sun, 31 Dec 2017 09:31:45 -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=9Se1///tQjJ8JYiza6O3QG7eT4MpZjqPSc4McFCanCg=; b=MV9InlJmXTFq8zoQrbtEgfO9xzOv0hKDf3RonyhUbth02H8Ntca/DrNu2hVexnuv3Q YGAywDnLwcln5oETMaoFTOG67n6oH+q2sPuCcpfIGKfgG0f128XhURH2BxA/oRtPyihd nhLHYT0BSkCvdEPzb6Q/o83ClDKfK4KQ83MC7QLxOIbEOfNC7g59SzocmuUN4R+KxzU/ mpPMN4vliHtt4Nhwx8erwn8IVsyGulbYGLs8YOHc2pBiRhCdwqAg4VvDuGeyrR6WTNAp A7WFkw80LmhFjeYilOqYXNejaXpptzC1eBi/kif4HBAOVTWes2Wdz8PiMUZO+ugdn8ug wpEQ== 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=9Se1///tQjJ8JYiza6O3QG7eT4MpZjqPSc4McFCanCg=; b=BFKroMDdbq2h/RjcxzsVsjwRWeghVYOeEOJL1/lAwOTi/7WANwrdKmH1islnzwbgyd 2A5iNFDaLzD5K4+hDTDkFATwZLCMx3iWmCN95EsRZ+Kl7cBusRJpeo7ByMXoRmtlYAq6 tCimJ45U5iS7NEmXjqOcJ3mHjvKQTem2E78PHs1EddfeP78XU92lW9cd2mciiTz2ArfQ xpNe4lldAaFB5Lvmk7KD/vCxpe49CbtxZRq6G1tz5JRPmfeGvRFZsHlPXaxUEOMzoC6j zrgsuF4Bt7+bP3XyLSb/yKfDFBSOKB952WD6gjEiTUlchOYjI0K/4re9GpyFYU0h57Fz zlhA== X-Gm-Message-State: AKGB3mLYgaTfZ6M0X3U0VTfgMixMbXyGFIkxRj/+GizzSVBZTlFMJder 1QYsxsAYnmxmCCQic1NPy7c= X-Google-Smtp-Source: ACJfBovBwHr51EjrP+qPb7RlFbPFjZZNPSSAnspyPUrxcGp0849MTJZwfYeOghB7++Yj+EMviR+6Dg== X-Received: by 10.25.234.195 with SMTP id y64mr15395219lfi.61.1514741504476; Sun, 31 Dec 2017 09:31:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Dec 2017 09:31:44 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 12/18] ath10k: htt: RX ring config HL support Date: Sun, 31 Dec 2017 18:29:19 +0100 Message-Id: <20171231172925.24014-13-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_093148_673943_42574264 X-CRM114-Status: GOOD ( 11.72 ) 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 321f131e417d..1f6470de7b8d 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) @@ -1566,6 +1617,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, };