From patchwork Sun Apr 15 12:22:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10341551 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 2764E601C2 for ; Sun, 15 Apr 2018 12:23:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B4FA2835B for ; Sun, 15 Apr 2018 12:23:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F251328329; Sun, 15 Apr 2018 12:23:17 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 6ACED28346 for ; Sun, 15 Apr 2018 12:23: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=ZedX/BbbcejB85JNKERI1o9feCp73TBhfklqfv74yz0=; b=K98ZhhdYlh5X6quQzamnDIvGdO l+xf9umTAboEvNdzI62o8yNU3KFVjjDBb5k5UNqbEL5RM3T0Dx23EqLpmyPD8l1vTDTcFfeJy1AW4 vs85jvqceGMW6H6sWJCZ/gmcMP7QoDskag2cpOy+tB73t7k9o/TBSt1L4PzFETpWcwM3Qnyj+Jx9J j+usfySXonIu1Fn8VZMFXgFthWTAxShYSkOn7ob1eL93OA2BqJvJ+nyUPEABpRW8WIVEisObFkUBD PTrKLejvlkV7NUvv7bXhunr7BTMETYyTO1dLUNkF1JQj3Dx4BB2NpU9BM7dw9KnnZB7898RhDwCn5 +L+6e7xg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7ggY-0001F5-8T; Sun, 15 Apr 2018 12:23:10 +0000 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f7ggP-00017w-G0 for ath10k@lists.infradead.org; Sun, 15 Apr 2018 12:23:02 +0000 Received: by mail-lf0-x244.google.com with SMTP id i18-v6so3215681lfc.7 for ; Sun, 15 Apr 2018 05:22:51 -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=Y5O9agLKcks3pS6ZrM+B1UWNkcgYJ+QnaX10vzY0DUQ=; b=RAxu+MDTYsjl9i+Ytonk0VPg7Xv5d+wwQZYNuqSirIFMy18/WPubrL9V37Yj1944L1 9bRgYObXARlduxWarg7CpjrHIbrzXNXkDR+YP3OCfHIzRnOTlMMF7+E+ta9VT01jWzNA 3ESmJqdtsBr+imvllwyOXD1GDcsVTedrREzwUItOqTYx60HGheDlFKeTKy0NCzIbIcJI zCZTJo7DUoHnv+QndNDs0F90eBI0BC/dZ8hZzPFkvTLOOgitgCM96EMUnoHlAFCmkmWY lT+y4i30cCFqj+x/PR00en8M5lyUUbctLzzM32/qMGtM20KW7kw401aB9v6eWT0Bkhjn voyg== 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=Y5O9agLKcks3pS6ZrM+B1UWNkcgYJ+QnaX10vzY0DUQ=; b=nIg+s0rpIirrny1yx50tO+tsZVMMP9fPvFsErkEWMu7eG/RS59tMBAzHsyktjFDEpJ 7QXLA5PZVCYkhsvj2MiaM0TyCWBM/R5TViezA0CTzAMb/N/AFcCx7F8o3LaivqJ5gZHt LzRgNDm6GNMt0CggdJr9iDyy6ShVg8WETplTNry+RXNgi8XhrEiukWAdKyeyJHbLSbQD m1fBHTnqAvX7VQAofho/2JP4IPOSkb19BU/lq/Tn4VaFOGzmS80uOTvC3fVeUbOEvOZf +WqtOaACKTwNmywXENMDqS4GsOlAkn2HJR235WbcZUiIF18X6EQEwRnC5wLD8yYsj94w F12w== X-Gm-Message-State: ALQs6tDFVhbT4CGEBLJtXtlQjxN+jHjNu14WkyOvL2oNYwtsGkgPe9Ae pGsAbaEC7BiCdA2PMJOnqAA= X-Google-Smtp-Source: AIpwx48ONKhZXptd9HUhWgI130/6iTDancf7vMdMmG/gQOZRz2+oJHQ/I90m2WnosZTPeq/t2JAhVg== X-Received: by 2002:a19:e48a:: with SMTP id x10-v6mr1899065lfi.115.1523794969802; Sun, 15 Apr 2018 05:22:49 -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 h9-v6sm2269891lfj.78.2018.04.15.05.22.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Apr 2018 05:22:49 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: add inlined wrappers for htt rx ops Date: Sun, 15 Apr 2018 14:22:28 +0200 Message-Id: <20180415122228.12565-3-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180415122228.12565-1-erik.stromdahl@gmail.com> References: <20180415122228.12565-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180415_052301_531799_8FE67938 X-CRM114-Status: GOOD ( 12.67 ) 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 Added for the same reason as the TX wrappers. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htt.h | 37 ++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/htt_rx.c | 14 ++++----- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index c76f6daafe70..3fa1be7749b2 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -1908,6 +1908,43 @@ struct ath10k_htt_rx_ops { void (*htt_reset_paddrs_ring)(struct ath10k_htt *htt, int idx); }; +static inline size_t ath10k_htt_get_rx_ring_size(struct ath10k_htt *htt) +{ + if (!htt->rx_ops->htt_get_rx_ring_size) + return 0; + + return htt->rx_ops->htt_get_rx_ring_size(htt); +} + +static inline void ath10k_htt_config_paddrs_ring(struct ath10k_htt *htt, + void *vaddr) +{ + if (htt->rx_ops->htt_config_paddrs_ring) + htt->rx_ops->htt_config_paddrs_ring(htt, vaddr); +} + +static inline void ath10k_htt_set_paddrs_ring(struct ath10k_htt *htt, + dma_addr_t paddr, + int idx) +{ + if (htt->rx_ops->htt_set_paddrs_ring) + htt->rx_ops->htt_set_paddrs_ring(htt, paddr, idx); +} + +static inline void *ath10k_htt_get_vaddr_ring(struct ath10k_htt *htt) +{ + if (!htt->rx_ops->htt_get_vaddr_ring) + return NULL; + + return htt->rx_ops->htt_get_vaddr_ring(htt); +} + +static inline void ath10k_htt_reset_paddrs_ring(struct ath10k_htt *htt, int idx) +{ + if (htt->rx_ops->htt_reset_paddrs_ring) + htt->rx_ops->htt_reset_paddrs_ring(htt, idx); +} + #define RX_HTT_HDR_STATUS_LEN 64 /* This structure layout is programmed via rx ring setup diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 5e02e26158f6..5e8a84fa5422 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -181,7 +181,7 @@ static int __ath10k_htt_rx_ring_fill_n(struct ath10k_htt *htt, int num) rxcb = ATH10K_SKB_RXCB(skb); rxcb->paddr = paddr; htt->rx_ring.netbufs_ring[idx] = skb; - htt->rx_ops->htt_set_paddrs_ring(htt, paddr, idx); + ath10k_htt_set_paddrs_ring(htt, paddr, idx); htt->rx_ring.fill_cnt++; if (htt->rx_ring.in_ord_rx) { @@ -286,8 +286,8 @@ void ath10k_htt_rx_free(struct ath10k_htt *htt) ath10k_htt_rx_ring_free(htt); dma_free_coherent(htt->ar->dev, - htt->rx_ops->htt_get_rx_ring_size(htt), - htt->rx_ops->htt_get_vaddr_ring(htt), + ath10k_htt_get_rx_ring_size(htt), + ath10k_htt_get_vaddr_ring(htt), htt->rx_ring.base_paddr); dma_free_coherent(htt->ar->dev, @@ -314,7 +314,7 @@ static inline struct sk_buff *ath10k_htt_rx_netbuf_pop(struct ath10k_htt *htt) idx = htt->rx_ring.sw_rd_idx.msdu_payld; msdu = htt->rx_ring.netbufs_ring[idx]; htt->rx_ring.netbufs_ring[idx] = NULL; - htt->rx_ops->htt_reset_paddrs_ring(htt, idx); + ath10k_htt_reset_paddrs_ring(htt, idx); idx++; idx &= htt->rx_ring.size_mask; @@ -586,13 +586,13 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt) if (!htt->rx_ring.netbufs_ring) goto err_netbuf; - size = htt->rx_ops->htt_get_rx_ring_size(htt); + size = ath10k_htt_get_rx_ring_size(htt); vaddr_ring = dma_alloc_coherent(htt->ar->dev, size, &paddr, GFP_KERNEL); if (!vaddr_ring) goto err_dma_ring; - htt->rx_ops->htt_config_paddrs_ring(htt, vaddr_ring); + ath10k_htt_config_paddrs_ring(htt, vaddr_ring); htt->rx_ring.base_paddr = paddr; vaddr = dma_alloc_coherent(htt->ar->dev, @@ -626,7 +626,7 @@ int ath10k_htt_rx_alloc(struct ath10k_htt *htt) err_dma_idx: dma_free_coherent(htt->ar->dev, - htt->rx_ops->htt_get_rx_ring_size(htt), + ath10k_htt_get_rx_ring_size(htt), vaddr_ring, htt->rx_ring.base_paddr); err_dma_ring: