From patchwork Thu Aug 8 13:02:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maharaja Kennadyrajan X-Patchwork-Id: 11084107 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 58EF414DB for ; Thu, 8 Aug 2019 13:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4626028409 for ; Thu, 8 Aug 2019 13:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39AFB289BD; Thu, 8 Aug 2019 13:03:28 +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 44E7C28409 for ; Thu, 8 Aug 2019 13:03:27 +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=ecBUPVG55o/Nyzo1pldq3YcNQ3ZIsc8TxqIROewFXGw=; b=MR5se/h1QfRzY7auyF8deKOPG1 KJ4KKp9mVEsFGVYjBSGVMEcKP9zQTk5Skm/ful74Z+mbmUTwGH5F7HuhXit/RfWSoVheViIiJSbD6 DFPWlEr0EQNSw/aRfQstX34c9ToKTCmUF4+nAMnl50/wNBZYXutzpm8CfMOUVZlrnVkSHEKkZGCJr Kn8XqH+AKSmqXoIkVMA0HC6bIB199iGVbDY6uJ50yPMCuNhNvPCf9FVLmGoAnCtrziibd+N4Tz1P1 ivhMPjFpnbv4iTWA7dCr4IRacx9XGEldjdYwpx4DTxTwUYwkvjnG9Qhhlxh/s/U8dm22ur8RtI8Ev FqhHPddw==; 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 1hvi4j-00089Y-DP; Thu, 08 Aug 2019 13:03:25 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hvi4Y-00082M-Qb for ath11k@lists.infradead.org; Thu, 08 Aug 2019 13:03:17 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5CDE5602F1; Thu, 8 Aug 2019 13:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565269393; bh=SXhVO5VG4dq17qEnYfxE37aHP1pMK0DhLUMwFogbU5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ONmiThKdZnjskoJNYtSUDjOAxysBDqyoqw2+synSrBqsCiOGDzldaZNRCAa4Dieng dz/rHoZj7ULfFJ35yEQ1xZSWlaqmbyJUCrnE4IFnrPWOLKT7OxYuJab85veOtGRwjj 8TQS0yJUdMiFf2VHegNgSKYAKdEOiQYDBPdgyGos= 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 37D3060208; Thu, 8 Aug 2019 13:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1565269392; bh=SXhVO5VG4dq17qEnYfxE37aHP1pMK0DhLUMwFogbU5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jYu8tXKtmKwCnwnKmbxMvrjiuFyVgq2nBSmTtteR7gkVX+DVhYugPuWFdmZdlovAm GyVXX6xXxe2gQLlFaPRphKcxwEKARznAV3mntSN88Ig2E5p/YvadHJU0sxgGtUvnsQ YutRoXA542MfwcEfPH/FUiDXFIUvAptcinOcCsmI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 37D3060208 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 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c Date: Thu, 8 Aug 2019 18:32:58 +0530 Message-Id: <1565269392-2838-2-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_060314_900668_FA90B930 X-CRM114-Status: GOOD ( 14.20 ) 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'. Signed-off-by: Maharaja Kennadyrajan --- drivers/net/wireless/ath/ath11k/ahb.c | 202 +++++++++++++------------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index a2c697b97bdf..e1fee70055a6 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -463,22 +463,22 @@ enum ext_irq_num { tcl2host_status_ring, }; -inline u32 ath11k_ahb_read32(struct ath11k_base *sc, u32 offset) +inline u32 ath11k_ahb_read32(struct ath11k_base *ab, u32 offset) { - return ioread32(sc->mem + offset); + return ioread32(ab->mem + offset); } -inline void ath11k_ahb_write32(struct ath11k_base *sc, u32 offset, u32 value) +inline void ath11k_ahb_write32(struct ath11k_base *ab, u32 offset, u32 value) { - iowrite32(value, sc->mem + offset); + iowrite32(value, ab->mem + offset); } -static void ath11k_ahb_kill_tasklets(struct ath11k_base *sc) +static void ath11k_ahb_kill_tasklets(struct ath11k_base *ab) { int i; for (i = 0; i < CE_COUNT; i++) { - struct ath11k_ce_pipe *ce_pipe = &sc->ce.ce_pipe[i]; + struct ath11k_ce_pipe *ce_pipe = &ab->ce.ce_pipe[i]; if (ath11k_ce_get_attr_flags(i) & CE_ATTR_DIS_INTR) continue; @@ -492,16 +492,16 @@ static void ath11k_ahb_ext_grp_disable(struct ath11k_ext_irq_grp *irq_grp) int i; for (i = 0; i < irq_grp->num_irq; i++) - disable_irq_nosync(irq_grp->sc->irq_num[irq_grp->irqs[i]]); + disable_irq_nosync(irq_grp->ab->irq_num[irq_grp->irqs[i]]); } -static void __ath11k_ahb_ext_irq_disable(struct ath11k_base *sc) +static void __ath11k_ahb_ext_irq_disable(struct ath11k_base *ab) { struct sk_buff *skb; int i; for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) { - struct ath11k_ext_irq_grp *irq_grp = &sc->ext_irq_grp[i]; + struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; ath11k_ahb_ext_grp_disable(irq_grp); @@ -518,52 +518,52 @@ static void ath11k_ahb_ext_grp_enable(struct ath11k_ext_irq_grp *irq_grp) int i; for (i = 0; i < irq_grp->num_irq; i++) - enable_irq(irq_grp->sc->irq_num[irq_grp->irqs[i]]); + enable_irq(irq_grp->ab->irq_num[irq_grp->irqs[i]]); } -static void ath11k_ahb_ce_irq_enable(struct ath11k_base *sc, u16 ce_id) +static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id) { const struct ce_pipe_config *ce_config; u32 val; ce_config = &target_ce_config_wlan[ce_id]; if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT) { - val = ath11k_ahb_read32(sc, CE_HOST_IE_ADDRESS); + val = ath11k_ahb_read32(ab, CE_HOST_IE_ADDRESS); val |= BIT(ce_id); - ath11k_ahb_write32(sc, CE_HOST_IE_ADDRESS, val); + ath11k_ahb_write32(ab, CE_HOST_IE_ADDRESS, val); } if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_IN) { - val = ath11k_ahb_read32(sc, CE_HOST_IE_2_ADDRESS); + val = ath11k_ahb_read32(ab, CE_HOST_IE_2_ADDRESS); val |= BIT(ce_id); - ath11k_ahb_write32(sc, CE_HOST_IE_2_ADDRESS, val); + ath11k_ahb_write32(ab, CE_HOST_IE_2_ADDRESS, val); - val = ath11k_ahb_read32(sc, CE_HOST_IE_3_ADDRESS); + val = ath11k_ahb_read32(ab, CE_HOST_IE_3_ADDRESS); val |= BIT(ce_id + CE_HOST_IE_3_SHIFT); - ath11k_ahb_write32(sc, CE_HOST_IE_3_ADDRESS, val); + ath11k_ahb_write32(ab, CE_HOST_IE_3_ADDRESS, val); } } -static void ath11k_ahb_ce_irq_disable(struct ath11k_base *sc, u16 ce_id) +static void ath11k_ahb_ce_irq_disable(struct ath11k_base *ab, u16 ce_id) { const struct ce_pipe_config *ce_config; u32 val; ce_config = &target_ce_config_wlan[ce_id]; if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_OUT) { - val = ath11k_ahb_read32(sc, CE_HOST_IE_ADDRESS); + val = ath11k_ahb_read32(ab, CE_HOST_IE_ADDRESS); val &= ~BIT(ce_id); - ath11k_ahb_write32(sc, CE_HOST_IE_ADDRESS, val); + ath11k_ahb_write32(ab, CE_HOST_IE_ADDRESS, val); } if (__le32_to_cpu(ce_config->pipedir) & PIPEDIR_IN) { - val = ath11k_ahb_read32(sc, CE_HOST_IE_2_ADDRESS); + val = ath11k_ahb_read32(ab, CE_HOST_IE_2_ADDRESS); val &= ~BIT(ce_id); - ath11k_ahb_write32(sc, CE_HOST_IE_2_ADDRESS, val); + ath11k_ahb_write32(ab, CE_HOST_IE_2_ADDRESS, val); - val = ath11k_ahb_read32(sc, CE_HOST_IE_3_ADDRESS); + val = ath11k_ahb_read32(ab, CE_HOST_IE_3_ADDRESS); val &= ~BIT(ce_id + CE_HOST_IE_3_SHIFT); - ath11k_ahb_write32(sc, CE_HOST_IE_3_ADDRESS, val); + ath11k_ahb_write32(ab, CE_HOST_IE_3_ADDRESS, val); } } @@ -596,32 +596,32 @@ static void ath11k_ahb_sync_ext_irqs(struct ath11k_base *ab) } } -static void ath11k_ahb_ce_irqs_enable(struct ath11k_base *sc) +static void ath11k_ahb_ce_irqs_enable(struct ath11k_base *ab) { int i; for (i = 0; i < CE_COUNT; i++) { if (ath11k_ce_get_attr_flags(i) & CE_ATTR_DIS_INTR) continue; - ath11k_ahb_ce_irq_enable(sc, i); + ath11k_ahb_ce_irq_enable(ab, i); } } -static void ath11k_ahb_ce_irqs_disable(struct ath11k_base *sc) +static void ath11k_ahb_ce_irqs_disable(struct ath11k_base *ab) { int i; for (i = 0; i < CE_COUNT; i++) { if (ath11k_ce_get_attr_flags(i) & CE_ATTR_DIS_INTR) continue; - ath11k_ahb_ce_irq_disable(sc, i); + ath11k_ahb_ce_irq_disable(ab, i); } } -int ath11k_ahb_start(struct ath11k_base *sc) +int ath11k_ahb_start(struct ath11k_base *ab) { - ath11k_ahb_ce_irqs_enable(sc); - ath11k_ce_rx_post_buf(sc); + ath11k_ahb_ce_irqs_enable(ab); + ath11k_ce_rx_post_buf(ab); /* Bring up other components as appropriate */ @@ -646,36 +646,36 @@ void ath11k_ahb_ext_irq_disable(struct ath11k_base *ab) ath11k_ahb_sync_ext_irqs(ab); } -void ath11k_ahb_stop(struct ath11k_base *sc) +void ath11k_ahb_stop(struct ath11k_base *ab) { - if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, &sc->dev_flags)) - ath11k_ahb_ce_irqs_disable(sc); - ath11k_ahb_sync_ce_irqs(sc); - ath11k_ahb_kill_tasklets(sc); - del_timer_sync(&sc->rx_replenish_retry); - ath11k_ce_cleanup_pipes(sc); + if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags)) + ath11k_ahb_ce_irqs_disable(ab); + ath11k_ahb_sync_ce_irqs(ab); + ath11k_ahb_kill_tasklets(ab); + del_timer_sync(&ab->rx_replenish_retry); + ath11k_ce_cleanup_pipes(ab); /* Shutdown other components as appropriate */ } -int ath11k_ahb_power_up(struct ath11k_base *sc) +int ath11k_ahb_power_up(struct ath11k_base *ab) { int ret; - ret = rproc_boot(sc->tgt_rproc); + ret = rproc_boot(ab->tgt_rproc); if (ret) - ath11k_err(sc, "failed to boot the remote processor Q6\n"); + ath11k_err(ab, "failed to boot the remote processor Q6\n"); return ret; } -void ath11k_ahb_power_down(struct ath11k_base *sc) +void ath11k_ahb_power_down(struct ath11k_base *ab) { - rproc_shutdown(sc->tgt_rproc); + rproc_shutdown(ab->tgt_rproc); } -static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *sc) +static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) { - struct ath11k_qmi_ce_cfg *cfg = &sc->qmi.ce_cfg; + struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg; cfg->tgt_ce = (u8 *)target_ce_config_wlan; cfg->tgt_ce_len = sizeof(target_ce_config_wlan); @@ -684,19 +684,19 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *sc) cfg->svc_to_ce_map_len = sizeof(target_service_to_ce_map_wlan); } -static void ath11k_ahb_free_ext_irq(struct ath11k_base *sc) +static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab) { int i, j; for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) { - struct ath11k_ext_irq_grp *irq_grp = &sc->ext_irq_grp[i]; + struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; for (j = 0; j < irq_grp->num_irq; j++) - free_irq(sc->irq_num[irq_grp->irqs[j]], irq_grp); + free_irq(ab->irq_num[irq_grp->irqs[j]], irq_grp); } } -static void ath11k_ahb_free_irq(struct ath11k_base *sc) +static void ath11k_ahb_free_irq(struct ath11k_base *ab) { int irq_idx; int i; @@ -705,26 +705,26 @@ static void ath11k_ahb_free_irq(struct ath11k_base *sc) if (ath11k_ce_get_attr_flags(i) & CE_ATTR_DIS_INTR) continue; irq_idx = ATH11K_IRQ_CE0_OFFSET + i; - free_irq(sc->irq_num[irq_idx], &sc->ce.ce_pipe[i]); + free_irq(ab->irq_num[irq_idx], &ab->ce.ce_pipe[i]); } - ath11k_ahb_free_ext_irq(sc); + ath11k_ahb_free_ext_irq(ab); } static void ath11k_ahb_ce_tasklet(unsigned long data) { struct ath11k_ce_pipe *ce_pipe = (struct ath11k_ce_pipe *)data; - ath11k_ce_per_engine_service(ce_pipe->sc, ce_pipe->pipe_num); + ath11k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num); - ath11k_ahb_ce_irq_enable(ce_pipe->sc, ce_pipe->pipe_num); + ath11k_ahb_ce_irq_enable(ce_pipe->ab, ce_pipe->pipe_num); } static irqreturn_t ath11k_ahb_ce_interrupt_handler(int irq, void *arg) { struct ath11k_ce_pipe *ce_pipe = arg; - ath11k_ahb_ce_irq_disable(ce_pipe->sc, ce_pipe->pipe_num); + ath11k_ahb_ce_irq_disable(ce_pipe->ab, ce_pipe->pipe_num); tasklet_schedule(&ce_pipe->intr_tq); @@ -736,7 +736,7 @@ static int ath11k_ahb_ext_grp_napi_poll(struct napi_struct *napi, int budget) struct ath11k_ext_irq_grp *irq_grp = container_of(napi, struct ath11k_ext_irq_grp, napi); - struct ath11k_base *ab = irq_grp->sc; + struct ath11k_base *ab = irq_grp->ab; int work_done; work_done = ath11k_dp_service_srng(ab, irq_grp, budget); @@ -762,17 +762,17 @@ static irqreturn_t ath11k_ahb_ext_interrupt_handler(int irq, void *arg) return IRQ_HANDLED; } -static int ath11k_ahb_ext_irq_config(struct ath11k_base *sc) +static int ath11k_ahb_ext_irq_config(struct ath11k_base *ab) { int i, j; int irq; int ret; for (i = 0; i < ATH11K_EXT_IRQ_GRP_NUM_MAX; i++) { - struct ath11k_ext_irq_grp *irq_grp = &sc->ext_irq_grp[i]; + struct ath11k_ext_irq_grp *irq_grp = &ab->ext_irq_grp[i]; u32 num_irq = 0; - irq_grp->sc = sc; + irq_grp->ab = ab; irq_grp->grp_id = i; init_dummy_netdev(&irq_grp->napi_ndev); netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi, @@ -803,22 +803,22 @@ static int ath11k_ahb_ext_irq_config(struct ath11k_base *sc) if (ath11k_rxdma2host_ring_mask[i] & BIT(j)) { irq_grp->irqs[num_irq++] = rxdma2host_destination_ring_mac1 - - ath11k_core_get_hw_mac_id(sc, j); + - ath11k_core_get_hw_mac_id(ab, j); } if (ath11k_host2rxdma_ring_mask[i] & BIT(j)) { irq_grp->irqs[num_irq++] = host2rxdma_host_buf_ring_mac1 - - ath11k_core_get_hw_mac_id(sc, j); + - ath11k_core_get_hw_mac_id(ab, j); } if (rx_mon_status_ring_mask[i] & BIT(j)) { irq_grp->irqs[num_irq++] = ppdu_end_interrupts_mac1 - - ath11k_core_get_hw_mac_id(sc, j); + ath11k_core_get_hw_mac_id(ab, j); irq_grp->irqs[num_irq++] = rxdma2host_monitor_status_ring_mac1 - - ath11k_core_get_hw_mac_id(sc, j); + ath11k_core_get_hw_mac_id(ab, j); } } } @@ -827,15 +827,15 @@ static int ath11k_ahb_ext_irq_config(struct ath11k_base *sc) for (j = 0; j < irq_grp->num_irq; j++) { int irq_idx = irq_grp->irqs[j]; - irq = platform_get_irq_byname(sc->pdev, + irq = platform_get_irq_byname(ab->pdev, irq_name[irq_idx]); - sc->irq_num[irq_idx] = irq; + ab->irq_num[irq_idx] = irq; irq_set_status_flags(irq, IRQ_NOAUTOEN); ret = request_irq(irq, ath11k_ahb_ext_interrupt_handler, IRQF_TRIGGER_RISING, irq_name[irq_idx], irq_grp); if (ret) { - ath11k_err(sc, "failed request_irq for %d\n", + ath11k_err(ab, "failed request_irq for %d\n", irq); } } @@ -844,14 +844,14 @@ static int ath11k_ahb_ext_irq_config(struct ath11k_base *sc) return 0; } -static int ath11k_ahb_config_irq(struct ath11k_base *sc) +static int ath11k_ahb_config_irq(struct ath11k_base *ab) { int irq, irq_idx, i; int ret; /* Configure CE irqs */ for (i = 0; i < CE_COUNT; i++) { - struct ath11k_ce_pipe *ce_pipe = &sc->ce.ce_pipe[i]; + struct ath11k_ce_pipe *ce_pipe = &ab->ce.ce_pipe[i]; if (ath11k_ce_get_attr_flags(i) & CE_ATTR_DIS_INTR) continue; @@ -860,23 +860,23 @@ static int ath11k_ahb_config_irq(struct ath11k_base *sc) tasklet_init(&ce_pipe->intr_tq, ath11k_ahb_ce_tasklet, (unsigned long)ce_pipe); - irq = platform_get_irq_byname(sc->pdev, irq_name[irq_idx]); + irq = platform_get_irq_byname(ab->pdev, irq_name[irq_idx]); ret = request_irq(irq, ath11k_ahb_ce_interrupt_handler, IRQF_TRIGGER_RISING, irq_name[irq_idx], ce_pipe); if (ret) return ret; - sc->irq_num[irq_idx] = irq; + ab->irq_num[irq_idx] = irq; } /* Configure external interrupts */ - ret = ath11k_ahb_ext_irq_config(sc); + ret = ath11k_ahb_ext_irq_config(ab); return ret; } -int ath11k_ahb_map_service_to_pipe(struct ath11k_base *sc, u16 service_id, +int ath11k_ahb_map_service_to_pipe(struct ath11k_base *ab, u16 service_id, u8 *ul_pipe, u8 *dl_pipe) { const struct service_to_pipe *entry; @@ -921,7 +921,7 @@ int ath11k_ahb_map_service_to_pipe(struct ath11k_base *sc, u16 service_id, static int ath11k_ahb_probe(struct platform_device *pdev) { - struct ath11k_base *sc; + struct ath11k_base *ab; const struct of_device_id *of_id; struct resource *mem_res; void __iomem *mem; @@ -951,52 +951,52 @@ static int ath11k_ahb_probe(struct platform_device *pdev) return ret; } - sc = ath11k_core_alloc(&pdev->dev); - if (!sc) { + ab = ath11k_core_alloc(&pdev->dev); + if (!ab) { dev_err(&pdev->dev, "failed to allocate ath11k base\n"); return -ENOMEM; } - sc->pdev = pdev; - sc->hw_rev = (enum ath11k_hw_rev)of_id->data; - sc->mem = mem; - sc->mem_len = resource_size(mem_res); - platform_set_drvdata(pdev, sc); + ab->pdev = pdev; + ab->hw_rev = (enum ath11k_hw_rev)of_id->data; + ab->mem = mem; + ab->mem_len = resource_size(mem_res); + platform_set_drvdata(pdev, ab); - ret = ath11k_hal_srng_init(sc); + ret = ath11k_hal_srng_init(ab); if (ret) goto err_core_free; - ret = ath11k_ce_alloc_pipes(sc); + ret = ath11k_ce_alloc_pipes(ab); if (ret) { - ath11k_err(sc, "failed to allocate ce pipes: %d\n", ret); + ath11k_err(ab, "failed to allocate ce pipes: %d\n", ret); goto err_hal_srng_deinit; } - ath11k_ahb_init_qmi_ce_config(sc); + ath11k_ahb_init_qmi_ce_config(ab); - ret = ath11k_ahb_config_irq(sc); + ret = ath11k_ahb_config_irq(ab); if (ret) { - ath11k_err(sc, "failed to configure irq: %d\n", ret); + ath11k_err(ab, "failed to configure irq: %d\n", ret); goto err_ce_free; } - ret = ath11k_core_init(sc); + ret = ath11k_core_init(ab); if (ret) { - ath11k_err(sc, "failed to init core: %d\n", ret); + ath11k_err(ab, "failed to init core: %d\n", ret); goto err_ce_free; } return 0; err_ce_free: - ath11k_ce_free_pipes(sc); + ath11k_ce_free_pipes(ab); err_hal_srng_deinit: - ath11k_hal_srng_deinit(sc); + ath11k_hal_srng_deinit(ab); err_core_free: - ath11k_core_free(sc); + ath11k_core_free(ab); platform_set_drvdata(pdev, NULL); return ret; @@ -1004,23 +1004,23 @@ static int ath11k_ahb_probe(struct platform_device *pdev) static int ath11k_ahb_remove(struct platform_device *pdev) { - struct ath11k_base *sc = platform_get_drvdata(pdev); + struct ath11k_base *ab = platform_get_drvdata(pdev); - reinit_completion(&sc->driver_recovery); + reinit_completion(&ab->driver_recovery); - if (test_bit(ATH11K_FLAG_RECOVERY, &sc->dev_flags)) - wait_for_completion_timeout(&sc->driver_recovery, + if (test_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags)) + wait_for_completion_timeout(&ab->driver_recovery, ATH11K_AHB_RECOVERY_TIMEOUT); - set_bit(ATH11K_FLAG_UNREGISTERING, &sc->dev_flags); - cancel_work_sync(&sc->restart_work); + set_bit(ATH11K_FLAG_UNREGISTERING, &ab->dev_flags); + cancel_work_sync(&ab->restart_work); - ath11k_core_deinit(sc); - ath11k_ahb_free_irq(sc); + ath11k_core_deinit(ab); + ath11k_ahb_free_irq(ab); - ath11k_hal_srng_deinit(sc); - ath11k_ce_free_pipes(sc); - ath11k_core_free(sc); + ath11k_hal_srng_deinit(ab); + ath11k_ce_free_pipes(ab); + ath11k_core_free(ab); platform_set_drvdata(pdev, NULL); return 0;