From patchwork Thu Aug 8 13:02:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maharaja Kennadyrajan X-Patchwork-Id: 11084105 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-2.web.codeaurora.org (Postfix) with ESMTP id 2203D14DB for ; Thu, 8 Aug 2019 13:03:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10B2F2873C for ; Thu, 8 Aug 2019 13:03:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0F85289BD; Thu, 8 Aug 2019 13:03:26 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham 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 03F3628876 for ; Thu, 8 Aug 2019 13:03:26 +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=IkAFvlVAOWXqTxyGuxHTn2R9LGk3TDsI6YLBOUTxPD8=; b=VZ7uuofNinX26VlMtF50uFTYhf hp8wQpcldLvt9hvEIco3bYq7rvreV9o3I0M+/8kBc8M6e6pf2eSNnIMfJ97E7MYPcP1zTfRZ3lALM mL3o3RcrS2oW+XaAMDZko9ynfI+ODLHqQN9o86YEnHJqOWCrbFQLXLb7IShlkQHgMOdlmSDqweYCr essphjtEGFP86zKYptsiOJDIbFFPdYEP79IBptvniRSKU4/ClqN6UVfG73kd5xPiUUmhT+cp3KzDy COLuGFfWGEe8DTzQD6vDKOjwtttpV9PzFS33V4TC1GtXI1rX247a1Kv8v1JJls2LDFnJbEhPpvtIz 8zgMqekw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvi4i-000886-Ba; Thu, 08 Aug 2019 13:03:24 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvi4Z-00082a-35 for ath11k@lists.infradead.org; Thu, 08 Aug 2019 13:03:17 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7BAF160770; Thu, 8 Aug 2019 13:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565269394; bh=q/wO72gFkSEjskRF72+1+BbjlIwuxzEmsafQj5wKYRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MgCv9PIJxyyL8FkJ93r22s0Jq8Mb4jKw02WTD+cJ+RMcHgFihBLomahtUDX/iBecy 4QLkaSs9s0r6Zpowzy8oczI2EcJwrPJEWPz2HmBeoon4Q2rkGkj7m7IKdD4N+3h7NR TJwsnCsL6eRvUnVIXDHvs1vtzggo+fCBQszmfKAA= Received: from che-swdbs-01.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mkenna@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id CAEDC60256; Thu, 8 Aug 2019 13:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565269393; bh=q/wO72gFkSEjskRF72+1+BbjlIwuxzEmsafQj5wKYRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mh73t6+ggvcECXzlLWkc79ZHVjLU6T7uFxH9JlUPPJuZBD86BYpORlM/PP0/48dkZ WCOCEyMPh4Gsm/QZnDuB9F+VwQIaPwHsruOQchmpGHfISHpEDJlabSnVHHqO6r2lof wrdqnVQczA/O+BnwvNz6quQOnVkHVnHoZBrHNIX4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CAEDC60256 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=mkenna@codeaurora.org From: Maharaja Kennadyrajan To: ath11k@lists.infradead.org Subject: [PATCH 02/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.c Date: Thu, 8 Aug 2019 18:32:59 +0530 Message-Id: <1565269392-2838-3-git-send-email-mkenna@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1565269392-2838-1-git-send-email-mkenna@codeaurora.org> References: <1565269392-2838-1-git-send-email-mkenna@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190808_060315_168301_E0F47473 X-CRM114-Status: GOOD ( 15.07 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maharaja Kennadyrajan MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP To avoid confusion and better readability, renamed the ath11k_base struct from 'sc' to 'ab' in ce.c file. Signed-off-by: Maharaja Kennadyrajan --- drivers/net/wireless/ath/ath11k/ce.c | 96 ++++++++++++++-------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ce.c b/drivers/net/wireless/ath/ath11k/ce.c index 626e7d264a63..4ac65a16d72f 100644 --- a/drivers/net/wireless/ath/ath11k/ce.c +++ b/drivers/net/wireless/ath/ath11k/ce.c @@ -111,7 +111,7 @@ static const struct ce_attr host_ce_config_wlan[] = { static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe, struct sk_buff *skb, dma_addr_t paddr) { - struct ath11k_base *ab = pipe->sc; + struct ath11k_base *ab = pipe->ab; struct ath11k_ce_ring *ring = pipe->dest_ring; struct hal_srng *srng; unsigned int write_index; @@ -164,7 +164,7 @@ static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe, static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) { - struct ath11k_base *sc = pipe->sc; + struct ath11k_base *ab = pipe->ab; struct sk_buff *skb; dma_addr_t paddr; int ret = 0; @@ -172,7 +172,7 @@ static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) if (!(pipe->dest_ring || pipe->status_ring)) return 0; - spin_lock_bh(&sc->ce.ce_lock); + spin_lock_bh(&ab->ce.ce_lock); while (pipe->rx_buf_needed) { skb = dev_alloc_skb(pipe->buf_sz); if (!skb) { @@ -182,11 +182,11 @@ static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) WARN_ON_ONCE(!IS_ALIGNED((unsigned long)skb->data, 4)); - paddr = dma_map_single(sc->dev, skb->data, + paddr = dma_map_single(ab->dev, skb->data, skb->len + skb_tailroom(skb), DMA_FROM_DEVICE); - if (unlikely(dma_mapping_error(sc->dev, paddr))) { - ath11k_warn(sc, "failed to dma map ce rx buf\n"); + if (unlikely(dma_mapping_error(ab->dev, paddr))) { + ath11k_warn(ab, "failed to dma map ce rx buf\n"); dev_kfree_skb_any(skb); ret = -EIO; goto exit; @@ -197,8 +197,8 @@ static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) ret = ath11k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr); if (ret) { - ath11k_warn(sc, "failed to enqueue rx buf: %d\n", ret); - dma_unmap_single(sc->dev, paddr, + ath11k_warn(ab, "failed to enqueue rx buf: %d\n", ret); + dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), DMA_FROM_DEVICE); dev_kfree_skb_any(skb); @@ -207,14 +207,14 @@ static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) } exit: - spin_unlock_bh(&sc->ce.ce_lock); + spin_unlock_bh(&ab->ce.ce_lock); return ret; } static int ath11k_ce_completed_recv_next(struct ath11k_ce_pipe *pipe, struct sk_buff **context, int *nbytes) { - struct ath11k_base *ab = pipe->sc; + struct ath11k_base *ab = pipe->ab; struct hal_srng *srng; unsigned int sw_index; unsigned int nentries_mask; @@ -263,7 +263,7 @@ static int ath11k_ce_completed_recv_next(struct ath11k_ce_pipe *pipe, static void ath11k_ce_recv_process_cb(struct ath11k_ce_pipe *pipe) { - struct ath11k_base *ab = pipe->sc; + struct ath11k_base *ab = pipe->ab; struct sk_buff *skb; struct sk_buff_head list; unsigned int nbytes, max_nbytes; @@ -304,7 +304,7 @@ static void ath11k_ce_recv_process_cb(struct ath11k_ce_pipe *pipe) static int ath11k_ce_completed_send_next(struct ath11k_ce_pipe *pipe, struct sk_buff **transfer_contextp) { - struct ath11k_base *ab = pipe->sc; + struct ath11k_base *ab = pipe->ab; struct hal_srng *srng; unsigned int sw_index; unsigned int nentries_mask; @@ -345,7 +345,7 @@ static int ath11k_ce_completed_send_next(struct ath11k_ce_pipe *pipe, static void ath11k_ce_send_done_cb(struct ath11k_ce_pipe *pipe) { - struct ath11k_base *ab = pipe->sc; + struct ath11k_base *ab = pipe->ab; struct sk_buff *skb; while (ath11k_ce_completed_send_next(pipe, &skb) == 0) { @@ -358,7 +358,7 @@ static void ath11k_ce_send_done_cb(struct ath11k_ce_pipe *pipe) } } -static int ath11k_ce_init_ring(struct ath11k_base *sc, +static int ath11k_ce_init_ring(struct ath11k_base *ab, struct ath11k_ce_ring *ce_ring, int ce_id, enum hal_ring_type type) { @@ -389,15 +389,15 @@ static int ath11k_ce_init_ring(struct ath11k_base *sc, } break; default: - ath11k_warn(sc, "Invalid CE ring type %d\n", type); + ath11k_warn(ab, "Invalid CE ring type %d\n", type); return -EINVAL; } /* TODO: Init other params needed by HAL to init the ring */ - ret = ath11k_hal_srng_setup(sc, type, ce_id, 0, ¶ms); + ret = ath11k_hal_srng_setup(ab, type, ce_id, 0, ¶ms); if (ret < 0) { - ath11k_warn(sc, "failed to setup srng: %d ring_id %d\n", + ath11k_warn(ab, "failed to setup srng: %d ring_id %d\n", ret, ce_id); return ret; } @@ -407,7 +407,7 @@ static int ath11k_ce_init_ring(struct ath11k_base *sc, } static struct ath11k_ce_ring * -ath11k_ce_alloc_ring(struct ath11k_base *sc, int nentries, int desc_sz) +ath11k_ce_alloc_ring(struct ath11k_base *ab, int nentries, int desc_sz) { struct ath11k_ce_ring *ce_ring; dma_addr_t base_addr; @@ -426,7 +426,7 @@ ath11k_ce_alloc_ring(struct ath11k_base *sc, int nentries, int desc_sz) * coherent DMA are unsupported */ ce_ring->base_addr_owner_space_unaligned = - dma_alloc_coherent(sc->dev, + dma_alloc_coherent(ab->dev, nentries * desc_sz + CE_DESC_RING_ALIGN, &base_addr, GFP_KERNEL); if (!ce_ring->base_addr_owner_space_unaligned) { @@ -446,9 +446,9 @@ ath11k_ce_alloc_ring(struct ath11k_base *sc, int nentries, int desc_sz) return ce_ring; } -static int ath11k_ce_alloc_pipe(struct ath11k_base *sc, int ce_id) +static int ath11k_ce_alloc_pipe(struct ath11k_base *ab, int ce_id) { - struct ath11k_ce_pipe *pipe = &sc->ce.ce_pipe[ce_id]; + struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; const struct ce_attr *attr = &host_ce_config_wlan[ce_id]; int nentries; int desc_sz; @@ -459,7 +459,7 @@ static int ath11k_ce_alloc_pipe(struct ath11k_base *sc, int ce_id) pipe->send_cb = ath11k_ce_send_done_cb; nentries = roundup_pow_of_two(attr->src_nentries); desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_SRC); - pipe->src_ring = ath11k_ce_alloc_ring(sc, nentries, desc_sz); + pipe->src_ring = ath11k_ce_alloc_ring(ab, nentries, desc_sz); if (!pipe->src_ring) return -ENOMEM; } @@ -468,13 +468,13 @@ static int ath11k_ce_alloc_pipe(struct ath11k_base *sc, int ce_id) pipe->recv_cb = attr->recv_cb; nentries = roundup_pow_of_two(attr->dest_nentries); desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_DST); - pipe->dest_ring = ath11k_ce_alloc_ring(sc, nentries, desc_sz); + pipe->dest_ring = ath11k_ce_alloc_ring(ab, nentries, desc_sz); if (!pipe->dest_ring) return -ENOMEM; desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_DST_STATUS); - pipe->status_ring = ath11k_ce_alloc_ring(sc, nentries, desc_sz); + pipe->status_ring = ath11k_ce_alloc_ring(ab, nentries, desc_sz); if (!pipe->status_ring) return -ENOMEM; } @@ -590,7 +590,7 @@ int ath11k_ce_send(struct ath11k_base *ab, struct sk_buff *skb, u8 pipe_id, static void ath11k_ce_rx_pipe_cleanup(struct ath11k_ce_pipe *pipe) { - struct ath11k_base *ab = pipe->sc; + struct ath11k_base *ab = pipe->ab; struct ath11k_ce_ring *ring = pipe->dest_ring; struct sk_buff *skb; int i; @@ -626,22 +626,22 @@ void ath11k_ce_cleanup_pipes(struct ath11k_base *ab) } } -void ath11k_ce_rx_post_buf(struct ath11k_base *sc) +void ath11k_ce_rx_post_buf(struct ath11k_base *ab) { struct ath11k_ce_pipe *pipe; int i; int ret; for (i = 0; i < CE_COUNT; i++) { - pipe = &sc->ce.ce_pipe[i]; + pipe = &ab->ce.ce_pipe[i]; ret = ath11k_ce_rx_post_pipe(pipe); if (ret) { if (ret == -ENOSPC) continue; - ath11k_warn(sc, "failed to post rx buf to pipe: %d err: %d\n", + ath11k_warn(ab, "failed to post rx buf to pipe: %d err: %d\n", i, ret); - mod_timer(&sc->rx_replenish_retry, + mod_timer(&ab->rx_replenish_retry, jiffies + ATH11K_CE_RX_POST_RETRY_JIFFIES); return; @@ -656,20 +656,20 @@ void ath11k_ce_rx_replenish_retry(struct timer_list *t) ath11k_ce_rx_post_buf(ab); } -int ath11k_ce_init_pipes(struct ath11k_base *sc) +int ath11k_ce_init_pipes(struct ath11k_base *ab) { struct ath11k_ce_pipe *pipe; int i; int ret; for (i = 0; i < CE_COUNT; i++) { - pipe = &sc->ce.ce_pipe[i]; + pipe = &ab->ce.ce_pipe[i]; if (pipe->src_ring) { - ret = ath11k_ce_init_ring(sc, pipe->src_ring, i, + ret = ath11k_ce_init_ring(ab, pipe->src_ring, i, HAL_CE_SRC); if (ret) { - ath11k_warn(sc, "failed to init src ring: %d\n", + ath11k_warn(ab, "failed to init src ring: %d\n", ret); /* Should we clear any partial init */ return ret; @@ -680,10 +680,10 @@ int ath11k_ce_init_pipes(struct ath11k_base *sc) } if (pipe->dest_ring) { - ret = ath11k_ce_init_ring(sc, pipe->dest_ring, i, + ret = ath11k_ce_init_ring(ab, pipe->dest_ring, i, HAL_CE_DST); if (ret) { - ath11k_warn(sc, "failed to init dest ring: %d\n", + ath11k_warn(ab, "failed to init dest ring: %d\n", ret); /* Should we clear any partial init */ return ret; @@ -697,10 +697,10 @@ int ath11k_ce_init_pipes(struct ath11k_base *sc) } if (pipe->status_ring) { - ret = ath11k_ce_init_ring(sc, pipe->status_ring, i, + ret = ath11k_ce_init_ring(ab, pipe->status_ring, i, HAL_CE_DST_STATUS); if (ret) { - ath11k_warn(sc, "failed to init dest status ing: %d\n", + ath11k_warn(ab, "failed to init dest status ing: %d\n", ret); /* Should we clear any partial init */ return ret; @@ -714,18 +714,18 @@ int ath11k_ce_init_pipes(struct ath11k_base *sc) return 0; } -void ath11k_ce_free_pipes(struct ath11k_base *sc) +void ath11k_ce_free_pipes(struct ath11k_base *ab) { struct ath11k_ce_pipe *pipe; int desc_sz; int i; for (i = 0; i < CE_COUNT; i++) { - pipe = &sc->ce.ce_pipe[i]; + pipe = &ab->ce.ce_pipe[i]; if (pipe->src_ring) { desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_SRC); - dma_free_coherent(sc->dev, + dma_free_coherent(ab->dev, pipe->src_ring->nentries * desc_sz + CE_DESC_RING_ALIGN, pipe->src_ring->base_addr_owner_space, @@ -736,7 +736,7 @@ void ath11k_ce_free_pipes(struct ath11k_base *sc) if (pipe->dest_ring) { desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_DST); - dma_free_coherent(sc->dev, + dma_free_coherent(ab->dev, pipe->dest_ring->nentries * desc_sz + CE_DESC_RING_ALIGN, pipe->dest_ring->base_addr_owner_space, @@ -748,7 +748,7 @@ void ath11k_ce_free_pipes(struct ath11k_base *sc) if (pipe->status_ring) { desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_DST_STATUS); - dma_free_coherent(sc->dev, + dma_free_coherent(ab->dev, pipe->status_ring->nentries * desc_sz + CE_DESC_RING_ALIGN, pipe->status_ring->base_addr_owner_space, @@ -759,26 +759,26 @@ void ath11k_ce_free_pipes(struct ath11k_base *sc) } } -int ath11k_ce_alloc_pipes(struct ath11k_base *sc) +int ath11k_ce_alloc_pipes(struct ath11k_base *ab) { struct ath11k_ce_pipe *pipe; int i; int ret; const struct ce_attr *attr; - spin_lock_init(&sc->ce.ce_lock); + spin_lock_init(&ab->ce.ce_lock); for (i = 0; i < CE_COUNT; i++) { attr = &host_ce_config_wlan[i]; - pipe = &sc->ce.ce_pipe[i]; + pipe = &ab->ce.ce_pipe[i]; pipe->pipe_num = i; - pipe->sc = sc; + pipe->ab = ab; pipe->buf_sz = attr->src_sz_max; - ret = ath11k_ce_alloc_pipe(sc, i); + ret = ath11k_ce_alloc_pipe(ab, i); if (ret) { /* Free any parial successful allocation */ - ath11k_ce_free_pipes(sc); + ath11k_ce_free_pipes(ab); return ret; } }