From patchwork Sun Sep 17 19:40: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: 9955035 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 3B1F06028A for ; Sun, 17 Sep 2017 19:41:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC0228A6E for ; Sun, 17 Sep 2017 19:41:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23B1828A8D; Sun, 17 Sep 2017 19:41:21 +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 3D8D028A6E for ; Sun, 17 Sep 2017 19:41:17 +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=AWrros9A3t7ZKOTLHgBCjCXUNvmSQd9yCjwTfH9IL+M=; b=UlJcuLkIXfssRRoKi0YY8Vxtpn IIFknF4ea6qT/5R6QrPDlwVp1fhPgtzMGYNqzjIYlgCxudd7VKmoS6w/J0sfRl22R8ooiUAqgtFm+ 6TI/wZQe6B8kibNW5QMCZq46QC4RcauQXyarx1Vh9+Lr2HcQAorD0YYaseG72RYdLh3RTYVUII/Hm oYaJ2JvWibSkh/Mwe3pRcsAaJ0jRddn/VOz/EKjDOI+038dU7MGO85ow8RzlvEhpFYi3Y54ZDOkcW CkVoidXi6eclpFpMHpJ5kye7atnVm7A5bwWDJGpixHit2xs5CsSBRErqQITwfyud74ALNDcCdsrGa bmmp2q1A==; 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 1dtfRI-0000Dv-7G; Sun, 17 Sep 2017 19:41:12 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dtfQt-0008I1-Dg for ath10k@lists.infradead.org; Sun, 17 Sep 2017 19:40:52 +0000 Received: by mail-lf0-x241.google.com with SMTP id l196so3535664lfl.3 for ; Sun, 17 Sep 2017 12:40:26 -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=4vKwtZm3vhMyRVOCHKrgiawpKkUqFG+6v13HekfiD9M=; b=VkemDy7HQP2J7lbzRFA4TrxcG7rRgdQdB56FleVVCUE1rs5WPjk3GNYWbvW6l87NLC zDax7n0i1EDcNFUEaHFc+Zulsmu4lJYJXHSu57wesZK6MQAmFXj2gqgwUTPAC2ofoYXI adc2WULgPhp0PF/9dDNa6pD7eXiZRVHWGcvPRa7CvzmdNdjVUJwzO1BpMTvp4X72pPHq 6Ap0GRrHioc+O52KlylGMQP0BSbl4dpBHsZcWx6A+/VdU7qyM82wr1z1xjLB9KdPTZtR r4YJqhw0ctdYUwpEUxmoPDXIajMCFbCGFztRwlr+nj66hhcYOlcDkqnbXXrLJSMHceJ1 K3ug== 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=4vKwtZm3vhMyRVOCHKrgiawpKkUqFG+6v13HekfiD9M=; b=UU3FBbt2/j733oieB6bJH8WLPwLJzijcBbT8zSe+stpuaagfyvvBjUSXOgYFtbwsnt qbSEctZv/ALB3zLIYbDJx/4lelVaU1bFcBT+BadNHn8cP2TExYKwpJ/EmQeDBl9sU2bz jxlVYyxQPdEKqB6DDM030z9iPYb/gRTmPf/u85Rg/OmTr+qFFSbYBSdIMbEdp95jhUm1 eiRVEAxCQnNtRngiHMyH35jYaerW0DfMFQdEW4W4aqMmGWq0B66KcvoSlkq5ldYHapVx 1mUD2otGZlAK4JHy7SBoQDJ+/gS187GSgTJ/E4oHLn1vrjtYTeFL4HojucVk7+i0GPAj l8Gg== X-Gm-Message-State: AHPjjUg3Y/lnu5d66/GAnSm1oFNt7JZJOdnN+8IMbIpvplmhUItCQ+Ms QBCW/iXe1h0SJA== X-Google-Smtp-Source: AOwi7QDsPe9lT/pU7hDb2jrSaWOi27DIH8azGL5LAcebgEcu+A3PNi9YZVIEVeG00mzMhFMi7QIVqw== X-Received: by 10.46.25.23 with SMTP id p23mr6774900lje.37.1505677225241; Sun, 17 Sep 2017 12:40:25 -0700 (PDT) Received: from erik-arch-i5-6600.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id 1sm1452879ljo.13.2017.09.17.12.40.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Sep 2017 12:40:24 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v3 02/11] ath10k: htt: RX ring config HL support Date: Sun, 17 Sep 2017 21:40:04 +0200 Message-Id: <20170917194013.8658-3-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170917194013.8658-1-erik.stromdahl@gmail.com> References: <20170917194013.8658-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170917_124047_712491_C5ED9141 X-CRM114-Status: GOOD ( 12.73 ) 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 cd160b16db1e..29ed4afe52a4 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 6305308422c4..7ffa1d41f478 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -1805,6 +1805,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 685faac1368f..8d85f82ad8f8 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -693,6 +693,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)