From patchwork Tue Feb 21 16:15:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9585093 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 BED3360578 for ; Tue, 21 Feb 2017 16:23:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADC38285A3 for ; Tue, 21 Feb 2017 16:23:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2C5E285B8; Tue, 21 Feb 2017 16:23:33 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM 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 5A5EA285B7 for ; Tue, 21 Feb 2017 16:23:33 +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=cZsDe2twTSVW8YuotrhDYgb+BX/IeQpiMvKFQDYyeSw=; b=MN3/rsHZtRGQSFGIg3WB6c5EQa x224e6R5DLrd4B2jNr6dcd4eI4ZrqGwVTeYiPLVF7kgRNWy1JJV2itQM5vJMzGduYbWbAycGRnN30 H7V+9kf2mPeBRYq29gJbPhmP097VRtJQIHDivnCcG8HfaoibuzzuD4FDCCM+gN7eXHqA7eQ1bVnYb pL/zka82xyF3qUS8VUQJpmyFQbi008bGJ7UVHoMn8evuUA3rZMHPT4x/sSLDF0yNlG/YBOPtwykkV ovrJwIg8Nq6f/Cs4BpNcsIJcjlE2qRj32FH7vD5SmKsgHovIRlgqa7uozWXFxMfo2StccVXjOxOEb kdF/Y03A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cgDDr-0004kI-Jv; Tue, 21 Feb 2017 16:23:27 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgDCz-0003yz-Rn for ath10k@bombadil.infradead.org; Tue, 21 Feb 2017 16:22:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=c9Af8eDnetO1+wjtEdeGqFjR9GWN6HNP6QUbEZpTyzA=; b=XPHWhJvqZ30ob/08NL88riDdq 6vi8nM/e00RFAq5sZ83Jt4ocqVCpORVfFKzbjmEUumtXxVIoRbn7iHUoJxi76LOYcMZhidFbsOLtm jvXQNe4zPXW/Q8e9+r+mMFugaUw+WG9E+OxwjJUCdJMDLrMCAi2zXlUKi/INi2HyXIFUrv7TECzrY fbiVZH8Fe1Lw9iVpiF6i9cCUrpHhmM4k4kLxqRsMpuShD+7V58m4xbd4WZze9Q4ghaP/wExcOfx6t MKlnGQEBof2kgd59lyhCcqjyYtqv+rKdtbpBa1pFUG+jZlIetEBVTUNDnKnL4EzTWHCsoeXV9iJgV ihnRY2jxA==; Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgD7P-0006hU-7k for ath10k@lists.infradead.org; Tue, 21 Feb 2017 16:16:49 +0000 Received: by mail-lf0-x242.google.com with SMTP id 90so4027042lfr.3 for ; Tue, 21 Feb 2017 08:16:27 -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=c9Af8eDnetO1+wjtEdeGqFjR9GWN6HNP6QUbEZpTyzA=; b=kwgQyu5a4JuOO6Idzt9/aIgFXHcQSg7D9sg8VT4+1OM15p9ApcQ8WqB+dSZSXuY/dl aCQuwOAyV8EP8AtsFXrnaowCiq74M49SqHsRkmZ3WbVxLKlh7LWFFwhdr9hYa70wWIXp IgSi4v88xfMqgwTkGz5HO3y/D9FJhtygmFmzfcMd85EI/U6iPbFfwEuVhiiOaxXvBWNd BWhAedvFgoytfPTUVzuzNwEelScXWniW1+BkXtWh3XsegmteGWps6FAkc8z6rfcP/h0d zIGOmDOn5RDxh9V5BkDj9yOlK/wtXnJPmA4qme86QmdOwDy2M3woF6c3w9NlVHrz/cnk jhjg== 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=c9Af8eDnetO1+wjtEdeGqFjR9GWN6HNP6QUbEZpTyzA=; b=WzopIgEiEBRl0NXRuv2z3+24gd2PosQBFdg9MGSt7DAkFaWRRaKEWKT19gGbg0ffs3 PFoMIm/8ekIT2P9CFG15VY5oaxtfmVTZxvea+vLC6gGXtYyYQ6QfpKgfRy+B9MmMF1Fq TKX/lo6gT5Atp+cHHrHEiKZXnVe25c59st063LPDhF0ruRkUKRtoA0mY+f1QQpWH3agz 71cu4/iF37I+Wwc0hGcWafxyOkPe/QhIE7M/cf0YOTcOGjsjxEr+EfPQo2+/q6XDM0Tm mtLdMMp4a2Mxlq7rt3eNPz08R1jV/T527EQu6stKS2FZ5qYL2CzY1lPBRGd2iFOE2+/V m1vw== X-Gm-Message-State: AMke39klqPOu5+shVsUWu1OJcg8BiaVk/gUXNcMODxKZC8msZe/jTiU4+nhDUhIHO2x6Xg== X-Received: by 10.46.72.10 with SMTP id v10mr6536240lja.22.1487693785686; Tue, 21 Feb 2017 08:16:25 -0800 (PST) Received: from erik-mate-1604.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id t29sm6336069ljd.39.2017.02.21.08.16.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 08:16:25 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 14/21] ath10k: htt: RX ring config HL support Date: Tue, 21 Feb 2017 17:15:34 +0100 Message-Id: <1487693741-10042-15-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> References: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170221_161647_510009_E1FF04CE X-CRM114-Status: GOOD ( 14.49 ) 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.c | 5 +++- drivers/net/wireless/ath/ath10k/htt.h | 1 + drivers/net/wireless/ath/ath10k/htt_tx.c | 51 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c index cd160b1..29ed4af 100644 --- a/drivers/net/wireless/ath/ath10k/htt.c +++ b/drivers/net/wireless/ath/ath10k/htt.c @@ -258,7 +258,10 @@ int ath10k_htt_setup(struct ath10k_htt *htt) if (status) return status; - status = ath10k_htt_send_rx_ring_cfg_ll(htt); + if (ar->is_high_latency) + status = ath10k_htt_send_rx_ring_cfg_hl(htt); + else + status = ath10k_htt_send_rx_ring_cfg_ll(htt); if (status) { ath10k_warn(ar, "failed to setup rx ring: %d\n", status); diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index 90c2f72..bdee2e7 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -1797,6 +1797,7 @@ int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt); int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie); int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt); int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt); +int ath10k_htt_send_rx_ring_cfg_hl(struct ath10k_htt *htt); int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, u8 max_subfrms_ampdu, u8 max_subfrms_amsdu); diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 86b427f..ca899e1 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -692,6 +692,57 @@ int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt) return 0; } +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_ring *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.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.rings[0]; + + cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_RX_RING_CFG; + cmd->rx_setup.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)