From patchwork Fri Jan 13 21:35:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9516541 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 2E43260761 for ; Fri, 13 Jan 2017 21:35:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F47D28584 for ; Fri, 13 Jan 2017 21:35:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13B0B286B9; Fri, 13 Jan 2017 21:35:56 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 97C4528584 for ; Fri, 13 Jan 2017 21:35:55 +0000 (UTC) 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 1cS9Vm-0003fB-8m; Fri, 13 Jan 2017 21:35:50 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cS9Vi-0003b6-6h for ath10k@lists.infradead.org; Fri, 13 Jan 2017 21:35:48 +0000 Received: by mail-lf0-x243.google.com with SMTP id x1so1724579lff.0 for ; Fri, 13 Jan 2017 13:35:28 -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=bqpeX1nZV0juKZQnEBpZvWq9dom8nLnKHsdh+/LDeVU=; b=AXlGO42zokLcBVVbEDga4pemZn9QZ8oLisvlGK/K3KV7f2xvKQSU7stzMepeFtaN4s yjoWjg9nhp+tYeG5F8Xj83+f5WIuYnobYgNsXYLzqTbulPXpCUKK3UtpfI8Ebc8s8tUm m2wTb7M7toGXmBtUNDofamQPM+ovtuGO9iiv9DEbSePpT8xdFBGTiwYV396jAIbtaGEV EPOd8oq4oN0PeICW+dauRRvE5sGBV9JDy/uPLCaitjZc4utfvanains8pRCoFaEugHGE ijPX6k1XM49JX8FB2j5HayisKQKXYb4G7ptCTzKlhQLj03m/BBsKn3BylRfGPt8PsqjU o9Mg== 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=bqpeX1nZV0juKZQnEBpZvWq9dom8nLnKHsdh+/LDeVU=; b=erb749eh5k1uK1aNf4/4MpfphAB60yWkwGVfXjf452cooBzGLShs9mm5cpFI/BdXf7 GpjI/jHi0+oVhtCENQ7+hx0ret0qcKKAgWitiJdH3ycXutmWUaPxyVfg8oimxuljIHso OLNx5s81mdbTXnRvVtVaVM4ZBZrAS5CevNhvBreVrCKY9xUs9rl2sSV+di35ntuTXM84 DDI1U2WLo/TiU5BUlC+3kG3yZ0lNnmJyulKcFiDKfLFb/sBrdjIX01gzKcGuMNYzGnEU +ygvOCcNM5OzK936kTpkq4M0ge9EXUmWsy39DSGOCRATjsv7p4JruFmoTVDux+teswdj NHeQ== X-Gm-Message-State: AIkVDXKLZJW4TpJQ5D0x8moT0TSrDiBZyOcvCvQHKKAV1ztdYc3ersx77lYocSisW6r7IA== X-Received: by 10.25.66.70 with SMTP id p67mr3251491lfa.99.1484343326924; Fri, 13 Jan 2017 13:35:26 -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 66sm4437411lfy.42.2017.01.13.13.35.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 13:35:26 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC 05/10] ath10k: htt: RX ring config HL support Date: Fri, 13 Jan 2017 22:35:04 +0100 Message-Id: <1484343309-6327-6-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484343309-6327-1-git-send-email-erik.stromdahl@gmail.com> References: <1484343309-6327-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170113_133546_442187_CDD08316 X-CRM114-Status: GOOD ( 12.71 ) 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 44b25cf..3d1bd6f 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..505d3ed 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_le32(HTT_RX_RING_SIZE_MIN); + ring->rx_ring_bufsize = __cpu_to_le32(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)