ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab
@ 2019-08-08 13:02 Maharaja Kennadyrajan
  2019-08-08 13:02 ` [PATCH 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c Maharaja Kennadyrajan
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:02 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

Struct ath11k_base is represented as 'sc' and 'ab'.
In order to avoid confusion and better readability,
renamed the ath11k_base struct representation from
'sc' to 'ab.

No functional changes are made in this patchset.

Maharaja Kennadyrajan (15):
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.h
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.h
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.h
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.h
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp_rx.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.h
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in qmi.h
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.c
  ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.h

 drivers/net/wireless/ath/ath11k/ahb.c   | 202 +++++++--------
 drivers/net/wireless/ath/ath11k/ce.c    |  96 +++----
 drivers/net/wireless/ath/ath11k/ce.h    |  10 +-
 drivers/net/wireless/ath/ath11k/core.c  | 328 ++++++++++++------------
 drivers/net/wireless/ath/ath11k/core.h  |   4 +-
 drivers/net/wireless/ath/ath11k/debug.c |  12 +-
 drivers/net/wireless/ath/ath11k/debug.h |  14 +-
 drivers/net/wireless/ath/ath11k/dp.c    |  40 +--
 drivers/net/wireless/ath/ath11k/dp.h    |   8 +-
 drivers/net/wireless/ath/ath11k/dp_rx.c |   6 +-
 drivers/net/wireless/ath/ath11k/hal.c   | 134 +++++-----
 drivers/net/wireless/ath/ath11k/hal.h   |   8 +-
 drivers/net/wireless/ath/ath11k/qmi.h   |   8 +-
 drivers/net/wireless/ath/ath11k/wmi.c   |  94 +++----
 drivers/net/wireless/ath/ath11k/wmi.h   |  16 +-
 15 files changed, 490 insertions(+), 490 deletions(-)

-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
@ 2019-08-08 13:02 ` Maharaja Kennadyrajan
  2019-08-12 14:51   ` Kalle Valo
  2019-08-08 13:02 ` [PATCH 02/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.c Maharaja Kennadyrajan
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:02 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab'.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 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;
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 02/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
  2019-08-08 13:02 ` [PATCH 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c Maharaja Kennadyrajan
@ 2019-08-08 13:02 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 03/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.h Maharaja Kennadyrajan
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:02 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in ce.c file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 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, &params);
+	ret = ath11k_hal_srng_setup(ab, type, ce_id, 0, &params);
 	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;
 		}
 	}
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 03/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.h
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
  2019-08-08 13:02 ` [PATCH 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c Maharaja Kennadyrajan
  2019-08-08 13:02 ` [PATCH 02/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.c Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 04/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.c Maharaja Kennadyrajan
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in ce.h file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/ce.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/ce.h b/drivers/net/wireless/ath/ath11k/ce.h
index 9f25bad504e9..5cc3fea55e0f 100644
--- a/drivers/net/wireless/ath/ath11k/ce.h
+++ b/drivers/net/wireless/ath/ath11k/ce.h
@@ -143,7 +143,7 @@ struct ath11k_ce_ring {
 };
 
 struct ath11k_ce_pipe {
-	struct ath11k_base *sc;
+	struct ath11k_base *ab;
 	u16 pipe_num;
 	unsigned int attr_flags;
 	unsigned int buf_sz;
@@ -177,10 +177,10 @@ void ath11k_ce_rx_replenish_retry(struct timer_list *t);
 void ath11k_ce_per_engine_service(struct ath11k_base *ab, u16 ce_id);
 int ath11k_ce_send(struct ath11k_base *ab, struct sk_buff *skb, u8 pipe_id,
 		   u16 transfer_id);
-void ath11k_ce_rx_post_buf(struct ath11k_base *sc);
-int ath11k_ce_init_pipes(struct ath11k_base *sc);
-int ath11k_ce_alloc_pipes(struct ath11k_base *sc);
-void ath11k_ce_free_pipes(struct ath11k_base *sc);
+void ath11k_ce_rx_post_buf(struct ath11k_base *ab);
+int ath11k_ce_init_pipes(struct ath11k_base *ab);
+int ath11k_ce_alloc_pipes(struct ath11k_base *ab);
+void ath11k_ce_free_pipes(struct ath11k_base *ab);
 int ath11k_ce_get_attr_flags(int ce_id);
 void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id);
 #endif
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 04/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (2 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 03/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.h Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 05/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.h Maharaja Kennadyrajan
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in core.c file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/core.c | 328 ++++++++++++-------------
 1 file changed, 164 insertions(+), 164 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 2e523afc4da8..9324dcb45bbe 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -43,7 +43,7 @@ u8 ath11k_core_get_hw_mac_id(struct ath11k_base *ab, int pdev_idx)
 	}
 }
 
-static int ath11k_core_create_board_name(struct ath11k_base *sc, char *name,
+static int ath11k_core_create_board_name(struct ath11k_base *ab, char *name,
 					 size_t name_len)
 {
 	/* Note: bus is fixed to ahb. When other bus type supported,
@@ -51,15 +51,15 @@ static int ath11k_core_create_board_name(struct ath11k_base *sc, char *name,
 	 */
 	scnprintf(name, name_len,
 		  "bus=ahb,qmi-chip-id=%d,qmi-board-id=%d",
-		  sc->qmi.target.chip_id,
-		  sc->qmi.target.board_id);
+		  ab->qmi.target.chip_id,
+		  ab->qmi.target.board_id);
 
-	ath11k_dbg(sc, ATH11K_DBG_BOOT, "boot using board name '%s'\n", name);
+	ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot using board name '%s'\n", name);
 
 	return 0;
 }
 
-static const struct firmware *ath11k_fetch_fw_file(struct ath11k_base *sc,
+static const struct firmware *ath11k_fetch_fw_file(struct ath11k_base *ab,
 						   const char *dir,
 						   const char *file)
 {
@@ -74,19 +74,19 @@ static const struct firmware *ath11k_fetch_fw_file(struct ath11k_base *sc,
 		dir = ".";
 
 	snprintf(filename, sizeof(filename), "%s/%s", dir, file);
-	ret = firmware_request_nowarn(&fw, filename, sc->dev);
-	ath11k_dbg(sc, ATH11K_DBG_BOOT, "boot fw request '%s': %d\n",
+	ret = firmware_request_nowarn(&fw, filename, ab->dev);
+	ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot fw request '%s': %d\n",
 		   filename, ret);
 
 	if (ret)
 		return ERR_PTR(ret);
-	ath11k_warn(sc, "Downloading BDF: %s, size: %zu\n",
+	ath11k_warn(ab, "Downloading BDF: %s, size: %zu\n",
 		    filename, fw->size);
 
 	return fw;
 }
 
-void ath11k_core_free_bdf(struct ath11k_base *sc, struct ath11k_board_data *bd)
+void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd)
 {
 	if (!IS_ERR(bd->fw))
 		release_firmware(bd->fw);
@@ -94,7 +94,7 @@ void ath11k_core_free_bdf(struct ath11k_base *sc, struct ath11k_board_data *bd)
 	memset(bd, 0, sizeof(*bd));
 }
 
-static int ath11k_core_parse_bd_ie_board(struct ath11k_base *sc,
+static int ath11k_core_parse_bd_ie_board(struct ath11k_base *ab,
 					 struct ath11k_board_data *bd,
 					 const void *buf, size_t buf_len,
 					 const char *boardname,
@@ -119,7 +119,7 @@ static int ath11k_core_parse_bd_ie_board(struct ath11k_base *sc,
 		buf += sizeof(*hdr);
 
 		if (buf_len < ALIGN(board_ie_len, 4)) {
-			ath11k_err(sc, "invalid ATH11K_BD_IE_BOARD length: %zu < %zu\n",
+			ath11k_err(ab, "invalid ATH11K_BD_IE_BOARD length: %zu < %zu\n",
 				   buf_len, ALIGN(board_ie_len, 4));
 			ret = -EINVAL;
 			goto out;
@@ -127,7 +127,7 @@ static int ath11k_core_parse_bd_ie_board(struct ath11k_base *sc,
 
 		switch (board_ie_id) {
 		case ATH11K_BD_IE_BOARD_NAME:
-			ath11k_dbg_dump(sc, ATH11K_DBG_BOOT, "board name", "",
+			ath11k_dbg_dump(ab, ATH11K_DBG_BOOT, "board name", "",
 					board_ie_data, board_ie_len);
 
 			if (board_ie_len != strlen(boardname))
@@ -138,7 +138,7 @@ static int ath11k_core_parse_bd_ie_board(struct ath11k_base *sc,
 				break;
 
 			name_match_found = true;
-			ath11k_dbg(sc, ATH11K_DBG_BOOT,
+			ath11k_dbg(ab, ATH11K_DBG_BOOT,
 				   "boot found match for name '%s'",
 				   boardname);
 			break;
@@ -147,7 +147,7 @@ static int ath11k_core_parse_bd_ie_board(struct ath11k_base *sc,
 				/* no match found */
 				break;
 
-			ath11k_dbg(sc, ATH11K_DBG_BOOT,
+			ath11k_dbg(ab, ATH11K_DBG_BOOT,
 				   "boot found board data for '%s'", boardname);
 
 			bd->data = board_ie_data;
@@ -156,7 +156,7 @@ static int ath11k_core_parse_bd_ie_board(struct ath11k_base *sc,
 			ret = 0;
 			goto out;
 		default:
-			ath11k_warn(sc, "unknown ATH11K_BD_IE_BOARD found: %d\n",
+			ath11k_warn(ab, "unknown ATH11K_BD_IE_BOARD found: %d\n",
 				    board_ie_id);
 			break;
 		}
@@ -175,7 +175,7 @@ static int ath11k_core_parse_bd_ie_board(struct ath11k_base *sc,
 	return ret;
 }
 
-static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *sc,
+static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *ab,
 					      struct ath11k_board_data *bd,
 					      const char *boardname)
 {
@@ -187,8 +187,8 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *sc,
 	int ret, ie_id;
 
 	if (!bd->fw)
-		bd->fw = ath11k_fetch_fw_file(sc,
-					      sc->hw_params.fw.dir,
+		bd->fw = ath11k_fetch_fw_file(ab,
+					      ab->hw_params.fw.dir,
 					      filename);
 	if (IS_ERR(bd->fw))
 		return PTR_ERR(bd->fw);
@@ -199,14 +199,14 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *sc,
 	/* magic has extra null byte padded */
 	magic_len = strlen(ATH11K_BOARD_MAGIC) + 1;
 	if (len < magic_len) {
-		ath11k_err(sc, "failed to find magic value in %s/%s, file too short: %zu\n",
-			   sc->hw_params.fw.dir, filename, len);
+		ath11k_err(ab, "failed to find magic value in %s/%s, file too short: %zu\n",
+			   ab->hw_params.fw.dir, filename, len);
 		ret = -EINVAL;
 		goto err;
 	}
 
 	if (memcmp(data, ATH11K_BOARD_MAGIC, magic_len)) {
-		ath11k_err(sc, "found invalid board magic\n");
+		ath11k_err(ab, "found invalid board magic\n");
 		ret = -EINVAL;
 		goto err;
 	}
@@ -214,8 +214,8 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *sc,
 	/* magic is padded to 4 bytes */
 	magic_len = ALIGN(magic_len, 4);
 	if (len < magic_len) {
-		ath11k_err(sc, "failed: %s/%s too small to contain board data, len: %zu\n",
-			   sc->hw_params.fw.dir, filename, len);
+		ath11k_err(ab, "failed: %s/%s too small to contain board data, len: %zu\n",
+			   ab->hw_params.fw.dir, filename, len);
 		ret = -EINVAL;
 		goto err;
 	}
@@ -232,14 +232,14 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *sc,
 		data = hdr->data;
 
 		if (len < ALIGN(ie_len, 4)) {
-			ath11k_err(sc, "invalid length for board ie_id %d ie_len %zu len %zu\n",
+			ath11k_err(ab, "invalid length for board ie_id %d ie_len %zu len %zu\n",
 				   ie_id, ie_len, len);
 			return -EINVAL;
 		}
 
 		switch (ie_id) {
 		case ATH11K_BD_IE_BOARD:
-			ret = ath11k_core_parse_bd_ie_board(sc, bd, data,
+			ret = ath11k_core_parse_bd_ie_board(ab, bd, data,
 							    ie_len,
 							    boardname,
 							    ATH11K_BD_IE_BOARD);
@@ -262,9 +262,9 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *sc,
 
 out:
 	if (!bd->data || !bd->len) {
-		ath11k_err(sc,
+		ath11k_err(ab,
 			   "failed to fetch board data for %s from %s/%s\n",
-			   boardname, sc->hw_params.fw.dir, filename);
+			   boardname, ab->hw_params.fw.dir, filename);
 		ret = -ENODATA;
 		goto err;
 	}
@@ -272,15 +272,15 @@ static int ath11k_core_fetch_board_data_api_n(struct ath11k_base *sc,
 	return 0;
 
 err:
-	ath11k_core_free_bdf(sc, bd);
+	ath11k_core_free_bdf(ab, bd);
 	return ret;
 }
 
-static int ath11k_core_fetch_board_data_api_1(struct ath11k_base *sc,
+static int ath11k_core_fetch_board_data_api_1(struct ath11k_base *ab,
 					      struct ath11k_board_data *bd)
 {
-	bd->fw = ath11k_fetch_fw_file(sc,
-				      sc->hw_params.fw.dir,
+	bd->fw = ath11k_fetch_fw_file(ab,
+				      ab->hw_params.fw.dir,
 				      ATH11K_DEFAULT_BOARD_FILE);
 	if (IS_ERR(bd->fw))
 		return PTR_ERR(bd->fw);
@@ -292,192 +292,192 @@ static int ath11k_core_fetch_board_data_api_1(struct ath11k_base *sc,
 }
 
 #define BOARD_NAME_SIZE 100
-int ath11k_core_fetch_bdf(struct ath11k_base *sc, struct ath11k_board_data *bd)
+int ath11k_core_fetch_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd)
 {
 	char boardname[BOARD_NAME_SIZE];
 	int ret;
 
-	ret = ath11k_core_create_board_name(sc, boardname, BOARD_NAME_SIZE);
+	ret = ath11k_core_create_board_name(ab, boardname, BOARD_NAME_SIZE);
 	if (ret) {
-		ath11k_err(sc, "failed to create board name: %d", ret);
+		ath11k_err(ab, "failed to create board name: %d", ret);
 		return ret;
 	}
 
-	sc->bd_api = 2;
-	ret = ath11k_core_fetch_board_data_api_n(sc, bd, boardname);
+	ab->bd_api = 2;
+	ret = ath11k_core_fetch_board_data_api_n(ab, bd, boardname);
 	if (!ret)
 		goto success;
 
-	sc->bd_api = 1;
-	ret = ath11k_core_fetch_board_data_api_1(sc, bd);
+	ab->bd_api = 1;
+	ret = ath11k_core_fetch_board_data_api_1(ab, bd);
 	if (ret) {
-		ath11k_err(sc, "failed to fetch board-2.bin or board.bin from %s\n",
-			   sc->hw_params.fw.dir);
+		ath11k_err(ab, "failed to fetch board-2.bin or board.bin from %s\n",
+			   ab->hw_params.fw.dir);
 		return ret;
 	}
 
 success:
-	ath11k_dbg(sc, ATH11K_DBG_BOOT, "using board api %d\n", sc->bd_api);
+	ath11k_dbg(ab, ATH11K_DBG_BOOT, "using board api %d\n", ab->bd_api);
 	return 0;
 }
 
-static void ath11k_core_stop(struct ath11k_base *sc)
+static void ath11k_core_stop(struct ath11k_base *ab)
 {
-	if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, &sc->dev_flags))
-		ath11k_qmi_firmware_stop(sc);
-	ath11k_ahb_stop(sc);
-	ath11k_wmi_detach(sc);
+	if (!test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags))
+		ath11k_qmi_firmware_stop(ab);
+	ath11k_ahb_stop(ab);
+	ath11k_wmi_detach(ab);
 
 	/* De-Init of components as needed */
 }
 
-static int ath11k_core_soc_create(struct ath11k_base *sc)
+static int ath11k_core_soc_create(struct ath11k_base *ab)
 {
 	int ret;
 
-	ret = ath11k_qmi_init_service(sc);
+	ret = ath11k_qmi_init_service(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to initialize qmi :%d\n", ret);
+		ath11k_err(ab, "failed to initialize qmi :%d\n", ret);
 		return ret;
 	}
 
-	ret = ath11k_debug_soc_create(sc);
+	ret = ath11k_debug_soc_create(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to create ath11k debugfs\n");
+		ath11k_err(ab, "failed to create ath11k debugfs\n");
 		goto err_qmi_deinit;
 	}
 
-	ret = ath11k_ahb_power_up(sc);
+	ret = ath11k_ahb_power_up(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to power up :%d\n", ret);
+		ath11k_err(ab, "failed to power up :%d\n", ret);
 		goto err_debugfs_reg;
 	}
 
 	return 0;
 
 err_debugfs_reg:
-	ath11k_debug_soc_destroy(sc);
+	ath11k_debug_soc_destroy(ab);
 err_qmi_deinit:
-	ath11k_qmi_deinit_service(sc);
+	ath11k_qmi_deinit_service(ab);
 	return ret;
 }
 
-static void ath11k_core_soc_destroy(struct ath11k_base *sc)
+static void ath11k_core_soc_destroy(struct ath11k_base *ab)
 {
-	ath11k_debug_soc_destroy(sc);
-	ath11k_dp_free(sc);
-	ath11k_reg_free(sc);
-	ath11k_qmi_deinit_service(sc);
+	ath11k_debug_soc_destroy(ab);
+	ath11k_dp_free(ab);
+	ath11k_reg_free(ab);
+	ath11k_qmi_deinit_service(ab);
 }
 
-static int ath11k_core_pdev_create(struct ath11k_base *sc)
+static int ath11k_core_pdev_create(struct ath11k_base *ab)
 {
 	int ret;
 
-	ret = ath11k_mac_create(sc);
+	ret = ath11k_mac_create(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to create new hw device with mac80211 :%d\n",
+		ath11k_err(ab, "failed to create new hw device with mac80211 :%d\n",
 			   ret);
 		return ret;
 	}
 
-	ret = ath11k_dp_pdev_alloc(sc);
+	ret = ath11k_dp_pdev_alloc(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to attach DP pdev: %d\n", ret);
+		ath11k_err(ab, "failed to attach DP pdev: %d\n", ret);
 		goto err_mac_destroy;
 	}
 
 	return 0;
 
 err_mac_destroy:
-	ath11k_mac_destroy(sc);
+	ath11k_mac_destroy(ab);
 
 	return ret;
 }
 
-static void ath11k_core_pdev_destroy(struct ath11k_base *sc)
+static void ath11k_core_pdev_destroy(struct ath11k_base *ab)
 {
-	ath11k_mac_unregister(sc);
-	ath11k_ahb_ext_irq_disable(sc);
-	ath11k_dp_pdev_free(sc);
+	ath11k_mac_unregister(ab);
+	ath11k_ahb_ext_irq_disable(ab);
+	ath11k_dp_pdev_free(ab);
 }
 
-static int ath11k_core_start(struct ath11k_base *sc,
+static int ath11k_core_start(struct ath11k_base *ab,
 			     enum ath11k_firmware_mode mode)
 {
 	int ret;
 
-	ret = ath11k_qmi_firmware_start(sc, mode);
+	ret = ath11k_qmi_firmware_start(ab, mode);
 	if (ret) {
-		ath11k_err(sc, "failed to attach wmi: %d\n", ret);
+		ath11k_err(ab, "failed to attach wmi: %d\n", ret);
 		return ret;
 	}
 
-	ret = ath11k_wmi_attach(sc);
+	ret = ath11k_wmi_attach(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to attach wmi: %d\n", ret);
+		ath11k_err(ab, "failed to attach wmi: %d\n", ret);
 		goto err_firmware_stop;
 	}
 
-	ret = ath11k_htc_init(sc);
+	ret = ath11k_htc_init(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to init htc: %d\n", ret);
+		ath11k_err(ab, "failed to init htc: %d\n", ret);
 		goto err_wmi_detach;
 	}
 
-	ret = ath11k_ahb_start(sc);
+	ret = ath11k_ahb_start(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to start HIF: %d\n", ret);
+		ath11k_err(ab, "failed to start HIF: %d\n", ret);
 		goto err_wmi_detach;
 	}
 
-	ret = ath11k_htc_wait_target(&sc->htc);
+	ret = ath11k_htc_wait_target(&ab->htc);
 	if (ret) {
-		ath11k_err(sc, "failed to connect to HTC: %d\n", ret);
+		ath11k_err(ab, "failed to connect to HTC: %d\n", ret);
 		goto err_hif_stop;
 	}
 
-	ret = ath11k_dp_htt_connect(&sc->dp);
+	ret = ath11k_dp_htt_connect(&ab->dp);
 	if (ret) {
-		ath11k_err(sc, "failed to connect to HTT: %d\n", ret);
+		ath11k_err(ab, "failed to connect to HTT: %d\n", ret);
 		goto err_hif_stop;
 	}
 
-	ret = ath11k_wmi_connect(sc);
+	ret = ath11k_wmi_connect(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to connect wmi: %d\n", ret);
+		ath11k_err(ab, "failed to connect wmi: %d\n", ret);
 		goto err_hif_stop;
 	}
 
-	ret = ath11k_htc_start(&sc->htc);
+	ret = ath11k_htc_start(&ab->htc);
 	if (ret) {
-		ath11k_err(sc, "failed to start HTC: %d\n", ret);
+		ath11k_err(ab, "failed to start HTC: %d\n", ret);
 		goto err_hif_stop;
 	}
 
-	ret = ath11k_wmi_wait_for_service_ready(sc);
+	ret = ath11k_wmi_wait_for_service_ready(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to receive wmi service ready event: %d\n",
+		ath11k_err(ab, "failed to receive wmi service ready event: %d\n",
 			   ret);
 		goto err_hif_stop;
 	}
 
-	ret = ath11k_wmi_cmd_init(sc);
+	ret = ath11k_wmi_cmd_init(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to send wmi init cmd: %d\n", ret);
+		ath11k_err(ab, "failed to send wmi init cmd: %d\n", ret);
 		goto err_hif_stop;
 	}
 
-	ret = ath11k_wmi_wait_for_unified_ready(sc);
+	ret = ath11k_wmi_wait_for_unified_ready(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to receive wmi unified ready event: %d\n",
+		ath11k_err(ab, "failed to receive wmi unified ready event: %d\n",
 			   ret);
 		goto err_hif_stop;
 	}
 
-	ret = ath11k_dp_tx_htt_h2t_ver_req_msg(sc);
+	ret = ath11k_dp_tx_htt_h2t_ver_req_msg(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to send htt version request message: %d\n",
+		ath11k_err(ab, "failed to send htt version request message: %d\n",
 			   ret);
 		goto err_hif_stop;
 	}
@@ -485,11 +485,11 @@ static int ath11k_core_start(struct ath11k_base *sc,
 	return 0;
 
 err_hif_stop:
-	ath11k_ahb_stop(sc);
+	ath11k_ahb_stop(ab);
 err_wmi_detach:
-	ath11k_wmi_detach(sc);
+	ath11k_wmi_detach(ab);
 err_firmware_stop:
-	ath11k_qmi_firmware_stop(sc);
+	ath11k_qmi_firmware_stop(ab);
 
 	return ret;
 }
@@ -534,44 +534,44 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
 	return ret;
 }
 
-static int ath11k_core_reconfigure_on_crash(struct ath11k_base *sc)
+static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)
 {
 	int ret;
 
-	mutex_lock(&sc->core_lock);
-	ath11k_ahb_ext_irq_disable(sc);
-	ath11k_dp_pdev_free(sc);
-	ath11k_ahb_stop(sc);
-	ath11k_wmi_detach(sc);
-	mutex_unlock(&sc->core_lock);
+	mutex_lock(&ab->core_lock);
+	ath11k_ahb_ext_irq_disable(ab);
+	ath11k_dp_pdev_free(ab);
+	ath11k_ahb_stop(ab);
+	ath11k_wmi_detach(ab);
+	mutex_unlock(&ab->core_lock);
 
-	ath11k_dp_free(sc);
-	ath11k_hal_srng_deinit(sc);
+	ath11k_dp_free(ab);
+	ath11k_hal_srng_deinit(ab);
 
-	sc->free_vdev_map = (1LL << (sc->num_radios * TARGET_NUM_VDEVS)) - 1;
+	ab->free_vdev_map = (1LL << (ab->num_radios * TARGET_NUM_VDEVS)) - 1;
 
-	ret = ath11k_hal_srng_init(sc);
+	ret = ath11k_hal_srng_init(ab);
 	if (ret)
 		return ret;
 
-	clear_bit(ATH11K_FLAG_CRASH_FLUSH, &sc->dev_flags);
+	clear_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags);
 
-	ret = ath11k_core_qmi_firmware_ready(sc);
+	ret = ath11k_core_qmi_firmware_ready(ab);
 	if (ret)
 		goto err_hal_srng_deinit;
 
-	clear_bit(ATH11K_FLAG_RECOVERY, &sc->dev_flags);
+	clear_bit(ATH11K_FLAG_RECOVERY, &ab->dev_flags);
 
 	return 0;
 
 err_hal_srng_deinit:
-	ath11k_hal_srng_deinit(sc);
+	ath11k_hal_srng_deinit(ab);
 	return ret;
 }
 
 void ath11k_core_halt(struct ath11k *ar)
 {
-	struct ath11k_base *sc = ar->ab;
+	struct ath11k_base *ab = ar->ab;
 
 	lockdep_assert_held(&ar->conf_mutex);
 
@@ -582,7 +582,7 @@ void ath11k_core_halt(struct ath11k *ar)
 	cancel_delayed_work_sync(&ar->scan.timeout);
 	cancel_work_sync(&ar->regd_update_work);
 
-	rcu_assign_pointer(sc->pdevs_active[ar->pdev_idx], NULL);
+	rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx], NULL);
 	synchronize_rcu();
 	INIT_LIST_HEAD(&ar->arvifs);
 	idr_init(&ar->txmgmt_idr);
@@ -590,17 +590,17 @@ void ath11k_core_halt(struct ath11k *ar)
 
 static void ath11k_core_restart(struct work_struct *work)
 {
-	struct ath11k_base *sc = container_of(work, struct ath11k_base, restart_work);
+	struct ath11k_base *ab = container_of(work, struct ath11k_base, restart_work);
 	struct ath11k *ar;
 	struct ath11k_pdev *pdev;
 	int i, ret = 0;
 
-	spin_lock_bh(&sc->base_lock);
-	sc->stats.fw_crash_counter++;
-	spin_unlock_bh(&sc->base_lock);
+	spin_lock_bh(&ab->base_lock);
+	ab->stats.fw_crash_counter++;
+	spin_unlock_bh(&ab->base_lock);
 
-	for (i = 0; i < sc->num_radios; i++) {
-		pdev = &sc->pdevs[i];
+	for (i = 0; i < ab->num_radios; i++) {
+		pdev = &ab->pdevs[i];
 		ar = pdev->ar;
 		if (!ar || ar->state == ATH11K_STATE_OFF)
 			continue;
@@ -620,17 +620,17 @@ static void ath11k_core_restart(struct work_struct *work)
 		idr_destroy(&ar->txmgmt_idr);
 	}
 
-	wake_up(&sc->wmi_sc.tx_credits_wq);
-	wake_up(&sc->peer_mapping_wq);
+	wake_up(&ab->wmi_sc.tx_credits_wq);
+	wake_up(&ab->peer_mapping_wq);
 
-	ret = ath11k_core_reconfigure_on_crash(sc);
+	ret = ath11k_core_reconfigure_on_crash(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to reconfigure driver on crash recovery\n");
+		ath11k_err(ab, "failed to reconfigure driver on crash recovery\n");
 		return;
 	}
 
-	for (i = 0; i < sc->num_radios; i++) {
-		pdev = &sc->pdevs[i];
+	for (i = 0; i < ab->num_radios; i++) {
+		pdev = &ab->pdevs[i];
 		ar = pdev->ar;
 		if (!ar || ar->state == ATH11K_STATE_OFF)
 			continue;
@@ -644,7 +644,7 @@ static void ath11k_core_restart(struct work_struct *work)
 			ieee80211_restart_hw(ar->hw);
 			break;
 		case ATH11K_STATE_OFF:
-			ath11k_warn(sc,
+			ath11k_warn(ab,
 				    "cannot restart radio %d that hasn't been started\n",
 				    i);
 			break;
@@ -654,91 +654,91 @@ static void ath11k_core_restart(struct work_struct *work)
 			ar->state = ATH11K_STATE_WEDGED;
 			/* fall through */
 		case ATH11K_STATE_WEDGED:
-			ath11k_warn(sc,
+			ath11k_warn(ab,
 				    "device is wedged, will not restart radio %d\n", i);
 			break;
 		}
 		mutex_unlock(&ar->conf_mutex);
 	}
-	complete(&sc->driver_recovery);
+	complete(&ab->driver_recovery);
 }
 
-int ath11k_core_init(struct ath11k_base *sc)
+int ath11k_core_init(struct ath11k_base *ab)
 {
-	struct device *dev = sc->dev;
+	struct device *dev = ab->dev;
 	struct rproc *prproc;
 	phandle rproc_phandle;
 	int ret;
 
 	if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) {
-		ath11k_err(sc, "failed to get q6_rproc handle\n");
+		ath11k_err(ab, "failed to get q6_rproc handle\n");
 		return -ENOENT;
 	}
 
 	prproc = rproc_get_by_phandle(rproc_phandle);
 	if (!prproc) {
-		ath11k_err(sc, "failed to get rproc\n");
+		ath11k_err(ab, "failed to get rproc\n");
 		return -EINVAL;
 	}
-	sc->tgt_rproc = prproc;
-	sc->hw_params = ath11k_hw_params;
+	ab->tgt_rproc = prproc;
+	ab->hw_params = ath11k_hw_params;
 
-	ret = ath11k_core_soc_create(sc);
+	ret = ath11k_core_soc_create(ab);
 	if (ret) {
-		ath11k_err(sc, "failed to create soc core: %d\n", ret);
+		ath11k_err(ab, "failed to create soc core: %d\n", ret);
 		return ret;
 	}
 
 	return 0;
 }
 
-void ath11k_core_deinit(struct ath11k_base *sc)
+void ath11k_core_deinit(struct ath11k_base *ab)
 {
-	mutex_lock(&sc->core_lock);
+	mutex_lock(&ab->core_lock);
 
-	ath11k_core_pdev_destroy(sc);
-	ath11k_core_stop(sc);
+	ath11k_core_pdev_destroy(ab);
+	ath11k_core_stop(ab);
 
-	mutex_unlock(&sc->core_lock);
+	mutex_unlock(&ab->core_lock);
 
-	ath11k_ahb_power_down(sc);
-	ath11k_mac_destroy(sc);
-	ath11k_core_soc_destroy(sc);
+	ath11k_ahb_power_down(ab);
+	ath11k_mac_destroy(ab);
+	ath11k_core_soc_destroy(ab);
 }
 
-void ath11k_core_free(struct ath11k_base *sc)
+void ath11k_core_free(struct ath11k_base *ab)
 {
-	kfree(sc);
+	kfree(ab);
 }
 
 struct ath11k_base *ath11k_core_alloc(struct device *dev)
 {
-	struct ath11k_base *sc;
+	struct ath11k_base *ab;
 
-	sc = kzalloc(sizeof(*sc), GFP_KERNEL);
-	if (!sc)
+	ab = kzalloc(sizeof(*ab), GFP_KERNEL);
+	if (!ab)
 		return NULL;
 
-	init_completion(&sc->driver_recovery);
+	init_completion(&ab->driver_recovery);
 
-	sc->workqueue = create_singlethread_workqueue("ath11k_wq");
-	if (!sc->workqueue)
+	ab->workqueue = create_singlethread_workqueue("ath11k_wq");
+	if (!ab->workqueue)
 		goto err_sc_free;
 
-	mutex_init(&sc->core_lock);
-	spin_lock_init(&sc->base_lock);
+	mutex_init(&ab->core_lock);
+	spin_lock_init(&ab->base_lock);
 
-	INIT_LIST_HEAD(&sc->peers);
-	init_waitqueue_head(&sc->peer_mapping_wq);
-	init_waitqueue_head(&sc->wmi_sc.tx_credits_wq);
-	INIT_WORK(&sc->restart_work, ath11k_core_restart);
-	timer_setup(&sc->rx_replenish_retry, ath11k_ce_rx_replenish_retry, 0);
-	sc->dev = dev;
+	INIT_LIST_HEAD(&ab->peers);
+	init_waitqueue_head(&ab->peer_mapping_wq);
+	init_waitqueue_head(&ab->wmi_sc.tx_credits_wq);
+	INIT_WORK(&ab->restart_work, ath11k_core_restart);
+	timer_setup(&ab->rx_replenish_retry, ath11k_ce_rx_replenish_retry, 0);
+	ab->dev = dev;
 
-	return sc;
+	return ab;
 
 err_sc_free:
-	kfree(sc);
+	kfree(ab);
 	return NULL;
 }
 
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 05/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.h
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (3 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 04/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.c Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 06/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.c Maharaja Kennadyrajan
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in core.h file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/core.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/core.h b/drivers/net/wireless/ath/ath11k/core.h
index 79134c4fb2e7..55c636e33367 100644
--- a/drivers/net/wireless/ath/ath11k/core.h
+++ b/drivers/net/wireless/ath/ath11k/core.h
@@ -104,7 +104,7 @@ extern const u8 ath11k_host2rxdma_ring_mask[ATH11K_EXT_IRQ_GRP_NUM_MAX];
 extern const u8 rx_mon_status_ring_mask[ATH11K_EXT_IRQ_GRP_NUM_MAX];
 
 struct ath11k_ext_irq_grp {
-	struct ath11k_base *sc;
+	struct ath11k_base *ab;
 	u32 irqs[ATH11K_EXT_IRQ_NUM_MAX];
 	u32 num_irq;
 	u32 grp_id;
@@ -783,7 +783,7 @@ struct ath11k_base *ath11k_core_alloc(struct device *dev);
 void ath11k_core_free(struct ath11k_base *ath11k);
 int ath11k_core_fetch_bdf(struct ath11k_base *ath11k,
 			  struct ath11k_board_data *bd);
-void ath11k_core_free_bdf(struct ath11k_base *sc, struct ath11k_board_data *bd);
+void ath11k_core_free_bdf(struct ath11k_base *ab, struct ath11k_board_data *bd);
 
 void ath11k_core_halt(struct ath11k *ar);
 u8 ath11k_core_get_hw_mac_id(struct ath11k_base *ab, int pdev_idx);
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 06/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (4 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 05/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.h Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 07/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.h Maharaja Kennadyrajan
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in debug.c file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/debug.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/debug.c b/drivers/net/wireless/ath/ath11k/debug.c
index 4fd99417585c..e62a409185f4 100644
--- a/drivers/net/wireless/ath/ath11k/debug.c
+++ b/drivers/net/wireless/ath/ath11k/debug.c
@@ -12,7 +12,7 @@
 #include "debug_htt_stats.h"
 #include "peer.h"
 
-void ath11k_info(struct ath11k_base *sc, const char *fmt, ...)
+void ath11k_info(struct ath11k_base *ab, const char *fmt, ...)
 {
 	struct va_format vaf = {
 		.fmt = fmt,
@@ -21,12 +21,12 @@ void ath11k_info(struct ath11k_base *sc, const char *fmt, ...)
 
 	va_start(args, fmt);
 	vaf.va = &args;
-	dev_info(sc->dev, "%pV", &vaf);
+	dev_info(ab->dev, "%pV", &vaf);
 	/* TODO: Trace the log */
 	va_end(args);
 }
 
-void ath11k_err(struct ath11k_base *sc, const char *fmt, ...)
+void ath11k_err(struct ath11k_base *ab, const char *fmt, ...)
 {
 	struct va_format vaf = {
 		.fmt = fmt,
@@ -35,12 +35,12 @@ void ath11k_err(struct ath11k_base *sc, const char *fmt, ...)
 
 	va_start(args, fmt);
 	vaf.va = &args;
-	dev_err(sc->dev, "%pV", &vaf);
+	dev_err(ab->dev, "%pV", &vaf);
 	/* TODO: Trace the log */
 	va_end(args);
 }
 
-void ath11k_warn(struct ath11k_base *sc, const char *fmt, ...)
+void ath11k_warn(struct ath11k_base *ab, const char *fmt, ...)
 {
 	struct va_format vaf = {
 		.fmt = fmt,
@@ -49,7 +49,7 @@ void ath11k_warn(struct ath11k_base *sc, const char *fmt, ...)
 
 	va_start(args, fmt);
 	vaf.va = &args;
-	dev_warn_ratelimited(sc->dev, "%pV", &vaf);
+	dev_warn_ratelimited(ab->dev, "%pV", &vaf);
 	/* TODO: Trace the log */
 	va_end(args);
 }
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 07/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.h
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (5 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 06/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.c Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 08/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.c Maharaja Kennadyrajan
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in debug.h file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/debug.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/debug.h b/drivers/net/wireless/ath/ath11k/debug.h
index ce1f414a95e9..fac6cb4aa597 100644
--- a/drivers/net/wireless/ath/ath11k/debug.h
+++ b/drivers/net/wireless/ath/ath11k/debug.h
@@ -100,9 +100,9 @@ enum ath11k_pktlog_enum {
 	ATH11K_PKTLOG_TYPE_LITE_RX      = 24,
 };
 
-__printf(2, 3) void ath11k_info(struct ath11k_base *sc, const char *fmt, ...);
-__printf(2, 3) void ath11k_err(struct ath11k_base *sc, const char *fmt, ...);
-__printf(2, 3) void ath11k_warn(struct ath11k_base *sc, const char *fmt, ...);
+__printf(2, 3) void ath11k_info(struct ath11k_base *ab, const char *fmt, ...);
+__printf(2, 3) void ath11k_err(struct ath11k_base *ab, const char *fmt, ...);
+__printf(2, 3) void ath11k_warn(struct ath11k_base *ab, const char *fmt, ...);
 
 extern unsigned int ath11k_debug_mask;
 
@@ -131,8 +131,8 @@ static inline void ath11k_dbg_dump(struct ath11k_base *ab,
 #endif /* CONFIG_ATH11K_DEBUG */
 
 #ifdef CONFIG_ATH11K_DEBUGFS
-int ath11k_debug_soc_create(struct ath11k_base *sc);
-void ath11k_debug_soc_destroy(struct ath11k_base *sc);
+int ath11k_debug_soc_create(struct ath11k_base *ab);
+void ath11k_debug_soc_destroy(struct ath11k_base *ab);
 int ath11k_debug_register(struct ath11k *ar);
 void ath11k_debug_unregister(struct ath11k *ar);
 void ath11k_dbg_htt_ext_stats_handler(struct ath11k_base *ab,
@@ -168,12 +168,12 @@ static inline int ath11k_debug_is_extd_rx_stats_enabled(struct ath11k *ar)
 	return ar->debug.extd_rx_stats;
 }
 #else
-static inline int ath11k_debug_soc_create(struct ath11k_base *sc)
+static inline int ath11k_debug_soc_create(struct ath11k_base *ab)
 {
 	return 0;
 }
 
-static inline void ath11k_debug_soc_destroy(struct ath11k_base *sc)
+static inline void ath11k_debug_soc_destroy(struct ath11k_base *ab)
 {
 }
 
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 08/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (6 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 07/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.h Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 09/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.h Maharaja Kennadyrajan
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in dp.c file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp.c | 40 ++++++++++++++--------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp.c b/drivers/net/wireless/ath/ath11k/dp.c
index 18a354d75d00..b55d9d023a55 100644
--- a/drivers/net/wireless/ath/ath11k/dp.c
+++ b/drivers/net/wireless/ath/ath11k/dp.c
@@ -11,7 +11,7 @@
 #include "dp_rx.h"
 #include "peer.h"
 
-static void ath11k_dp_htt_htc_tx_complete(struct ath11k_base *sc,
+static void ath11k_dp_htt_htc_tx_complete(struct ath11k_base *ab,
 					  struct sk_buff *skb)
 {
 	dev_kfree_skb_any(skb);
@@ -745,7 +745,7 @@ int ath11k_dp_htt_connect(struct ath11k_dp *dp)
 	/* connect to control service */
 	conn_req.service_id = ATH11K_HTC_SVC_ID_HTT_DATA_MSG;
 
-	status = ath11k_htc_connect_service(&dp->sc->htc, &conn_req,
+	status = ath11k_htc_connect_service(&dp->ab->htc, &conn_req,
 					    &conn_resp);
 
 	if (status)
@@ -805,22 +805,22 @@ static int ath11k_dp_tx_pending_cleanup(int buf_id, void *skb, void *ctx)
 	return 0;
 }
 
-void ath11k_dp_free(struct ath11k_base *sc)
+void ath11k_dp_free(struct ath11k_base *ab)
 {
-	struct ath11k_dp *dp = &sc->dp;
+	struct ath11k_dp *dp = &ab->dp;
 	int i;
 
-	ath11k_dp_link_desc_cleanup(sc, dp->link_desc_banks,
+	ath11k_dp_link_desc_cleanup(ab, dp->link_desc_banks,
 				    HAL_WBM_IDLE_LINK, &dp->wbm_idle_ring);
 
-	ath11k_dp_srng_common_cleanup(sc);
+	ath11k_dp_srng_common_cleanup(ab);
 
-	ath11k_dp_reo_cmd_list_cleanup(sc);
+	ath11k_dp_reo_cmd_list_cleanup(ab);
 
 	for (i = 0; i < DP_TCL_NUM_RING_MAX; i++) {
 		spin_lock_bh(&dp->tx_ring[i].tx_idr_lock);
 		idr_for_each(&dp->tx_ring[i].txbuf_idr,
-			     ath11k_dp_tx_pending_cleanup, sc);
+			     ath11k_dp_tx_pending_cleanup, ab);
 		idr_destroy(&dp->tx_ring[i].txbuf_idr);
 		spin_unlock_bh(&dp->tx_ring[i].tx_idr_lock);
 
@@ -832,37 +832,37 @@ void ath11k_dp_free(struct ath11k_base *sc)
 	/* Deinit any SOC level resource */
 }
 
-int ath11k_dp_alloc(struct ath11k_base *sc)
+int ath11k_dp_alloc(struct ath11k_base *ab)
 {
-	struct ath11k_dp *dp = &sc->dp;
+	struct ath11k_dp *dp = &ab->dp;
 	struct hal_srng *srng = NULL;
 	size_t size = 0;
 	u32 n_link_desc = 0;
 	int ret;
 	int i;
 
-	dp->sc = sc;
+	dp->ab = ab;
 
 	INIT_LIST_HEAD(&dp->reo_cmd_list);
 	INIT_LIST_HEAD(&dp->reo_cmd_cache_flush_list);
 	spin_lock_init(&dp->reo_cmd_lock);
 
-	ret = ath11k_wbm_idle_ring_setup(sc, &n_link_desc);
+	ret = ath11k_wbm_idle_ring_setup(ab, &n_link_desc);
 	if (ret) {
-		ath11k_warn(sc, "failed to setup wbm_idle_ring: %d\n", ret);
+		ath11k_warn(ab, "failed to setup wbm_idle_ring: %d\n", ret);
 		return ret;
 	}
 
-	srng = &sc->hal.srng_list[dp->wbm_idle_ring.ring_id];
+	srng = &ab->hal.srng_list[dp->wbm_idle_ring.ring_id];
 
-	ret = ath11k_dp_link_desc_setup(sc, dp->link_desc_banks,
+	ret = ath11k_dp_link_desc_setup(ab, dp->link_desc_banks,
 					HAL_WBM_IDLE_LINK, srng, n_link_desc);
 	if (ret) {
-		ath11k_warn(sc, "failed to setup link desc: %d\n", ret);
+		ath11k_warn(ab, "failed to setup link desc: %d\n", ret);
 		return ret;
 	}
 
-	ret = ath11k_dp_srng_common_setup(sc);
+	ret = ath11k_dp_srng_common_setup(ab);
 	if (ret)
 		goto fail_link_desc_cleanup;
 
@@ -881,17 +881,17 @@ int ath11k_dp_alloc(struct ath11k_base *sc)
 	}
 
 	for (i = 0; i < HAL_DSCP_TID_MAP_TBL_NUM_ENTRIES_MAX; i++)
-		ath11k_hal_tx_set_dscp_tid_map(sc, i);
+		ath11k_hal_tx_set_dscp_tid_map(ab, i);
 
 	/* Init any SOC level resource for DP */
 
 	return 0;
 
 fail_cmn_srng_cleanup:
-	ath11k_dp_srng_common_cleanup(sc);
+	ath11k_dp_srng_common_cleanup(ab);
 
 fail_link_desc_cleanup:
-	ath11k_dp_link_desc_cleanup(sc, dp->link_desc_banks,
+	ath11k_dp_link_desc_cleanup(ab, dp->link_desc_banks,
 				    HAL_WBM_IDLE_LINK, &dp->wbm_idle_ring);
 
 	return ret;
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 09/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.h
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (7 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 08/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.c Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 10/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp_rx.c Maharaja Kennadyrajan
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in dp.h file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h
index bda5ac27f20d..c968d5a6217e 100644
--- a/drivers/net/wireless/ath/ath11k/dp.h
+++ b/drivers/net/wireless/ath/ath11k/dp.h
@@ -193,7 +193,7 @@ struct ath11k_pdev_dp {
 #define DP_TX_DESC_ID_POOL_ID GENMASK(20, 19)
 
 struct ath11k_dp {
-	struct ath11k_base *sc;
+	struct ath11k_base *ab;
 	enum ath11k_htc_ep_id eid;
 	struct completion htt_tgt_version_received;
 	u8 htt_tgt_ver_major;
@@ -1498,13 +1498,13 @@ static inline void ath11k_dp_get_mac_addr(u32 addr_l32, u16 addr_h16, u8 *addr)
 	memcpy(addr + 4, &addr_h16, ETH_ALEN - 4);
 }
 
-int ath11k_dp_service_srng(struct ath11k_base *sc,
+int ath11k_dp_service_srng(struct ath11k_base *ab,
 			   struct ath11k_ext_irq_grp *irq_grp,
 			   int budget);
 int ath11k_dp_htt_connect(struct ath11k_dp *dp);
 void ath11k_dp_vdev_tx_attach(struct ath11k *ar, struct ath11k_vif *arvif);
-void ath11k_dp_free(struct ath11k_base *sc);
-int ath11k_dp_alloc(struct ath11k_base *sc);
+void ath11k_dp_free(struct ath11k_base *ab);
+int ath11k_dp_alloc(struct ath11k_base *ab);
 int ath11k_dp_pdev_alloc(struct ath11k_base *ab);
 void ath11k_dp_pdev_free(struct ath11k_base *ab);
 int ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id,
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 10/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp_rx.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (8 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 09/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.h Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 11/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.c Maharaja Kennadyrajan
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in dp_rx.c file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 7d6b0c3689b9..cc3bf25c9a91 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -505,10 +505,10 @@ static void ath11k_dp_reo_cmd_free(struct ath11k_dp *dp, void *ctx,
 	struct dp_rx_tid *rx_tid = ctx;
 
 	if (status != HAL_REO_CMD_SUCCESS)
-		ath11k_warn(dp->sc, "failed to flush rx tid hw desc, tid %d status %d\n",
+		ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n",
 			    rx_tid->tid, status);
 
-	dma_unmap_single(dp->sc->dev, rx_tid->paddr, rx_tid->size,
+	dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size,
 			 DMA_BIDIRECTIONAL);
 	kfree(rx_tid->vaddr);
 }
@@ -555,7 +555,7 @@ static void ath11k_dp_reo_cache_flush(struct ath11k_base *ab,
 static void ath11k_dp_rx_tid_del_func(struct ath11k_dp *dp, void *ctx,
 				      enum hal_reo_cmd_status status)
 {
-	struct ath11k_base *ab = dp->sc;
+	struct ath11k_base *ab = dp->ab;
 	struct dp_rx_tid *rx_tid = ctx;
 	struct dp_reo_cache_flush_elem *elem, *tmp;
 
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 11/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (9 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 10/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp_rx.c Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 12/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.h Maharaja Kennadyrajan
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in hal.c file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/hal.c | 134 +++++++++++++-------------
 1 file changed, 67 insertions(+), 67 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/hal.c b/drivers/net/wireless/ath/ath11k/hal.c
index 9eac3113de23..e0ec7c5f8112 100644
--- a/drivers/net/wireless/ath/ath11k/hal.c
+++ b/drivers/net/wireless/ath/ath11k/hal.c
@@ -285,13 +285,13 @@ static const struct hal_srng_config hw_srng_config[] = {
 	},
 };
 
-static int ath11k_hal_alloc_cont_rdp(struct ath11k_base *sc)
+static int ath11k_hal_alloc_cont_rdp(struct ath11k_base *ab)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	size_t size;
 
 	size = sizeof(u32) * HAL_SRNG_RING_ID_MAX;
-	hal->rdp.vaddr = dma_alloc_coherent(sc->dev, size, &hal->rdp.paddr,
+	hal->rdp.vaddr = dma_alloc_coherent(ab->dev, size, &hal->rdp.paddr,
 					    GFP_KERNEL);
 	if (!hal->rdp.vaddr)
 		return -ENOMEM;
@@ -299,27 +299,27 @@ static int ath11k_hal_alloc_cont_rdp(struct ath11k_base *sc)
 	return 0;
 }
 
-static void ath11k_hal_free_cont_rdp(struct ath11k_base *sc)
+static void ath11k_hal_free_cont_rdp(struct ath11k_base *ab)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	size_t size;
 
 	if (!hal->rdp.vaddr)
 		return;
 
 	size = sizeof(u32) * HAL_SRNG_RING_ID_MAX;
-	dma_free_coherent(sc->dev, size,
+	dma_free_coherent(ab->dev, size,
 			  hal->rdp.vaddr, hal->rdp.paddr);
 	hal->rdp.vaddr = NULL;
 }
 
-static int ath11k_hal_alloc_cont_wrp(struct ath11k_base *sc)
+static int ath11k_hal_alloc_cont_wrp(struct ath11k_base *ab)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	size_t size;
 
 	size = sizeof(u32) * HAL_SRNG_NUM_LMAC_RINGS;
-	hal->wrp.vaddr = dma_alloc_coherent(sc->dev, size, &hal->wrp.paddr,
+	hal->wrp.vaddr = dma_alloc_coherent(ab->dev, size, &hal->wrp.paddr,
 					    GFP_KERNEL);
 	if (!hal->wrp.vaddr)
 		return -ENOMEM;
@@ -327,21 +327,21 @@ static int ath11k_hal_alloc_cont_wrp(struct ath11k_base *sc)
 	return 0;
 }
 
-static void ath11k_hal_free_cont_wrp(struct ath11k_base *sc)
+static void ath11k_hal_free_cont_wrp(struct ath11k_base *ab)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	size_t size;
 
 	if (!hal->wrp.vaddr)
 		return;
 
 	size = sizeof(u32) * HAL_SRNG_NUM_LMAC_RINGS;
-	dma_free_coherent(sc->dev, size,
+	dma_free_coherent(ab->dev, size,
 			  hal->wrp.vaddr, hal->wrp.paddr);
 	hal->wrp.vaddr = NULL;
 }
 
-static void ath11k_hal_ce_dst_setup(struct ath11k_base *sc,
+static void ath11k_hal_ce_dst_setup(struct ath11k_base *ab,
 				    struct hal_srng *srng, int ring_num)
 {
 	const struct hal_srng_config *srng_config = &hw_srng_config[HAL_CE_DST];
@@ -351,17 +351,17 @@ static void ath11k_hal_ce_dst_setup(struct ath11k_base *sc,
 	addr = HAL_CE_DST_RING_CTRL +
 	       srng_config->reg_start[HAL_SRNG_REG_GRP_R0] +
 	       ring_num * srng_config->reg_size[HAL_SRNG_REG_GRP_R0];
-	val = ath11k_ahb_read32(sc, addr);
+	val = ath11k_ahb_read32(ab, addr);
 	val &= ~HAL_CE_DST_R0_DEST_CTRL_MAX_LEN;
 	val |= FIELD_PREP(HAL_CE_DST_R0_DEST_CTRL_MAX_LEN,
 			  srng->u.dst_ring.max_buffer_length);
-	ath11k_ahb_write32(sc, addr, val);
+	ath11k_ahb_write32(ab, addr, val);
 }
 
-static void ath11k_hal_srng_dst_hw_init(struct ath11k_base *sc,
+static void ath11k_hal_srng_dst_hw_init(struct ath11k_base *ab,
 					struct hal_srng *srng)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	u32 val;
 	u64 hp_addr;
 	u32 reg_base;
@@ -369,7 +369,7 @@ static void ath11k_hal_srng_dst_hw_init(struct ath11k_base *sc,
 	reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R0];
 
 	if (srng->flags & HAL_SRNG_FLAGS_MSI_INTR) {
-		ath11k_ahb_write32(sc, reg_base +
+		ath11k_ahb_write32(ab, reg_base +
 				       HAL_REO1_RING_MSI1_BASE_LSB_OFFSET,
 				   (u32)srng->msi_addr);
 
@@ -377,26 +377,26 @@ static void ath11k_hal_srng_dst_hw_init(struct ath11k_base *sc,
 				 ((u64)srng->msi_addr >>
 				  HAL_ADDR_MSB_REG_SHIFT)) |
 		      HAL_REO1_RING_MSI1_BASE_MSB_MSI1_ENABLE;
-		ath11k_ahb_write32(sc, reg_base +
+		ath11k_ahb_write32(ab, reg_base +
 				       HAL_REO1_RING_MSI1_BASE_MSB_OFFSET, val);
 
-		ath11k_ahb_write32(sc,
+		ath11k_ahb_write32(ab,
 				   reg_base + HAL_REO1_RING_MSI1_DATA_OFFSET,
 				   srng->msi_data);
 	}
 
-	ath11k_ahb_write32(sc, reg_base, (u32)srng->ring_base_paddr);
+	ath11k_ahb_write32(ab, reg_base, (u32)srng->ring_base_paddr);
 
 	val = FIELD_PREP(HAL_REO1_RING_BASE_MSB_RING_BASE_ADDR_MSB,
 			 ((u64)srng->ring_base_paddr >>
 			  HAL_ADDR_MSB_REG_SHIFT)) |
 	      FIELD_PREP(HAL_REO1_RING_BASE_MSB_RING_SIZE,
 			 (srng->entry_size * srng->num_entries));
-	ath11k_ahb_write32(sc, reg_base + HAL_REO1_RING_BASE_MSB_OFFSET, val);
+	ath11k_ahb_write32(ab, reg_base + HAL_REO1_RING_BASE_MSB_OFFSET, val);
 
 	val = FIELD_PREP(HAL_REO1_RING_ID_RING_ID, srng->ring_id) |
 	      FIELD_PREP(HAL_REO1_RING_ID_ENTRY_SIZE, srng->entry_size);
-	ath11k_ahb_write32(sc, reg_base + HAL_REO1_RING_ID_OFFSET, val);
+	ath11k_ahb_write32(ab, reg_base + HAL_REO1_RING_ID_OFFSET, val);
 
 	/* interrupt setup */
 	val = FIELD_PREP(HAL_REO1_RING_PRDR_INT_SETUP_INTR_TMR_THOLD,
@@ -406,22 +406,22 @@ static void ath11k_hal_srng_dst_hw_init(struct ath11k_base *sc,
 			  (srng->intr_batch_cntr_thres_entries *
 			   srng->entry_size));
 
-	ath11k_ahb_write32(sc,
+	ath11k_ahb_write32(ab,
 			   reg_base + HAL_REO1_RING_PRODUCER_INT_SETUP_OFFSET,
 			   val);
 
 	hp_addr = hal->rdp.paddr +
 		  ((unsigned long)srng->u.dst_ring.hp_addr -
 		   (unsigned long)hal->rdp.vaddr);
-	ath11k_ahb_write32(sc, reg_base + HAL_REO1_RING_HP_ADDR_LSB_OFFSET,
+	ath11k_ahb_write32(ab, reg_base + HAL_REO1_RING_HP_ADDR_LSB_OFFSET,
 			   hp_addr & HAL_ADDR_LSB_REG_MASK);
-	ath11k_ahb_write32(sc, reg_base + HAL_REO1_RING_HP_ADDR_MSB_OFFSET,
+	ath11k_ahb_write32(ab, reg_base + HAL_REO1_RING_HP_ADDR_MSB_OFFSET,
 			   hp_addr >> HAL_ADDR_MSB_REG_SHIFT);
 
 	/* Initialize head and tail pointers to indicate ring is empty */
 	reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R2];
-	ath11k_ahb_write32(sc, reg_base, 0);
-	ath11k_ahb_write32(sc, reg_base + HAL_REO1_RING_TP_OFFSET, 0);
+	ath11k_ahb_write32(ab, reg_base, 0);
+	ath11k_ahb_write32(ab, reg_base + HAL_REO1_RING_TP_OFFSET, 0);
 	*srng->u.dst_ring.hp_addr = 0;
 
 	reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R0];
@@ -434,13 +434,13 @@ static void ath11k_hal_srng_dst_hw_init(struct ath11k_base *sc,
 		val |= HAL_REO1_RING_MISC_MSI_SWAP;
 	val |= HAL_REO1_RING_MISC_SRNG_ENABLE;
 
-	ath11k_ahb_write32(sc, reg_base + HAL_REO1_RING_MISC_OFFSET, val);
+	ath11k_ahb_write32(ab, reg_base + HAL_REO1_RING_MISC_OFFSET, val);
 }
 
-static void ath11k_hal_srng_src_hw_init(struct ath11k_base *sc,
+static void ath11k_hal_srng_src_hw_init(struct ath11k_base *ab,
 					struct hal_srng *srng)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	u32 val;
 	u64 tp_addr;
 	u32 reg_base;
@@ -448,7 +448,7 @@ static void ath11k_hal_srng_src_hw_init(struct ath11k_base *sc,
 	reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R0];
 
 	if (srng->flags & HAL_SRNG_FLAGS_MSI_INTR) {
-		ath11k_ahb_write32(sc, reg_base +
+		ath11k_ahb_write32(ab, reg_base +
 				       HAL_TCL1_RING_MSI1_BASE_LSB_OFFSET,
 				   (u32)srng->msi_addr);
 
@@ -456,26 +456,26 @@ static void ath11k_hal_srng_src_hw_init(struct ath11k_base *sc,
 				 ((u64)srng->msi_addr >>
 				  HAL_ADDR_MSB_REG_SHIFT)) |
 		      HAL_TCL1_RING_MSI1_BASE_MSB_MSI1_ENABLE;
-		ath11k_ahb_write32(sc, reg_base +
+		ath11k_ahb_write32(ab, reg_base +
 				       HAL_TCL1_RING_MSI1_BASE_MSB_OFFSET,
 				   val);
 
-		ath11k_ahb_write32(sc, reg_base +
+		ath11k_ahb_write32(ab, reg_base +
 				       HAL_TCL1_RING_MSI1_DATA_OFFSET,
 				   srng->msi_data);
 	}
 
-	ath11k_ahb_write32(sc, reg_base, (u32)srng->ring_base_paddr);
+	ath11k_ahb_write32(ab, reg_base, (u32)srng->ring_base_paddr);
 
 	val = FIELD_PREP(HAL_TCL1_RING_BASE_MSB_RING_BASE_ADDR_MSB,
 			 ((u64)srng->ring_base_paddr >>
 			  HAL_ADDR_MSB_REG_SHIFT)) |
 	      FIELD_PREP(HAL_TCL1_RING_BASE_MSB_RING_SIZE,
 			 (srng->entry_size * srng->num_entries));
-	ath11k_ahb_write32(sc, reg_base + HAL_TCL1_RING_BASE_MSB_OFFSET, val);
+	ath11k_ahb_write32(ab, reg_base + HAL_TCL1_RING_BASE_MSB_OFFSET, val);
 
 	val = FIELD_PREP(HAL_REO1_RING_ID_ENTRY_SIZE, srng->entry_size);
-	ath11k_ahb_write32(sc, reg_base + HAL_TCL1_RING_ID_OFFSET, val);
+	ath11k_ahb_write32(ab, reg_base + HAL_TCL1_RING_ID_OFFSET, val);
 
 	/* interrupt setup */
 	/* NOTE: IPQ8074 v2 requires the interrupt timer threshold in the
@@ -488,7 +488,7 @@ static void ath11k_hal_srng_src_hw_init(struct ath11k_base *sc,
 			  (srng->intr_batch_cntr_thres_entries *
 			   srng->entry_size));
 
-	ath11k_ahb_write32(sc,
+	ath11k_ahb_write32(ab,
 			   reg_base + HAL_TCL1_RING_CONSR_INT_SETUP_IX0_OFFSET,
 			   val);
 
@@ -497,7 +497,7 @@ static void ath11k_hal_srng_src_hw_init(struct ath11k_base *sc,
 		val |= FIELD_PREP(HAL_TCL1_RING_CONSR_INT_SETUP_IX1_LOW_THOLD,
 				  srng->u.src_ring.low_threshold);
 	}
-	ath11k_ahb_write32(sc,
+	ath11k_ahb_write32(ab,
 			   reg_base + HAL_TCL1_RING_CONSR_INT_SETUP_IX1_OFFSET,
 			   val);
 
@@ -505,18 +505,18 @@ static void ath11k_hal_srng_src_hw_init(struct ath11k_base *sc,
 		tp_addr = hal->rdp.paddr +
 			  ((unsigned long)srng->u.src_ring.tp_addr -
 			   (unsigned long)hal->rdp.vaddr);
-		ath11k_ahb_write32(sc,
+		ath11k_ahb_write32(ab,
 				   reg_base + HAL_TCL1_RING_TP_ADDR_LSB_OFFSET,
 				   tp_addr & HAL_ADDR_LSB_REG_MASK);
-		ath11k_ahb_write32(sc,
+		ath11k_ahb_write32(ab,
 				   reg_base + HAL_TCL1_RING_TP_ADDR_MSB_OFFSET,
 				   tp_addr >> HAL_ADDR_MSB_REG_SHIFT);
 	}
 
 	/* Initialize head and tail pointers to indicate ring is empty */
 	reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R2];
-	ath11k_ahb_write32(sc, reg_base, 0);
-	ath11k_ahb_write32(sc, reg_base + HAL_TCL1_RING_TP_OFFSET, 0);
+	ath11k_ahb_write32(ab, reg_base, 0);
+	ath11k_ahb_write32(ab, reg_base + HAL_TCL1_RING_TP_OFFSET, 0);
 	*srng->u.src_ring.tp_addr = 0;
 
 	reg_base = srng->hwreg_base[HAL_SRNG_REG_GRP_R0];
@@ -533,19 +533,19 @@ static void ath11k_hal_srng_src_hw_init(struct ath11k_base *sc,
 
 	val |= HAL_TCL1_RING_MISC_SRNG_ENABLE;
 
-	ath11k_ahb_write32(sc, reg_base + HAL_TCL1_RING_MISC_OFFSET, val);
+	ath11k_ahb_write32(ab, reg_base + HAL_TCL1_RING_MISC_OFFSET, val);
 }
 
-static void ath11k_hal_srng_hw_init(struct ath11k_base *sc,
+static void ath11k_hal_srng_hw_init(struct ath11k_base *ab,
 				    struct hal_srng *srng)
 {
 	if (srng->ring_dir == HAL_SRNG_DIR_SRC)
-		ath11k_hal_srng_src_hw_init(sc, srng);
+		ath11k_hal_srng_src_hw_init(ab, srng);
 	else
-		ath11k_hal_srng_dst_hw_init(sc, srng);
+		ath11k_hal_srng_dst_hw_init(ab, srng);
 }
 
-static int ath11k_hal_srng_get_ring_id(struct ath11k_base *sc,
+static int ath11k_hal_srng_get_ring_id(struct ath11k_base *ab,
 				       enum hal_ring_type type,
 				       int ring_num, int mac_id)
 {
@@ -553,7 +553,7 @@ static int ath11k_hal_srng_get_ring_id(struct ath11k_base *sc,
 	int ring_id;
 
 	if (ring_num >= srng_config->max_rings) {
-		ath11k_warn(sc, "invalid ring number :%d\n", ring_num);
+		ath11k_warn(ab, "invalid ring number :%d\n", ring_num);
 		return -EINVAL;
 	}
 
@@ -806,7 +806,7 @@ u32 *ath11k_hal_srng_src_get_next_entry(struct ath11k_base *ab,
 	return desc;
 }
 
-u32 *ath11k_hal_srng_src_reap_next(struct ath11k_base *sc,
+u32 *ath11k_hal_srng_src_reap_next(struct ath11k_base *ab,
 				   struct hal_srng *srng)
 {
 	u32 *desc;
@@ -826,7 +826,7 @@ u32 *ath11k_hal_srng_src_reap_next(struct ath11k_base *sc,
 	return desc;
 }
 
-u32 *ath11k_hal_srng_src_get_next_reaped(struct ath11k_base *sc,
+u32 *ath11k_hal_srng_src_get_next_reaped(struct ath11k_base *ab,
 					 struct hal_srng *srng)
 {
 	u32 *desc;
@@ -843,7 +843,7 @@ u32 *ath11k_hal_srng_src_get_next_reaped(struct ath11k_base *sc,
 	return desc;
 }
 
-u32 *ath11k_hal_srng_src_peek(struct ath11k_base *sc, struct hal_srng *srng)
+u32 *ath11k_hal_srng_src_peek(struct ath11k_base *ab, struct hal_srng *srng)
 {
 	lockdep_assert_held(&srng->lock);
 
@@ -988,11 +988,11 @@ void ath11k_hal_setup_link_idle_list(struct ath11k_base *ab,
 			   HAL_WBM_IDLE_LINK_RING_MISC_ADDR, 0x40);
 }
 
-int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type,
+int ath11k_hal_srng_setup(struct ath11k_base *ab, enum hal_ring_type type,
 			  int ring_num, int mac_id,
 			  struct hal_srng_params *params)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	const struct hal_srng_config *srng_config = &hw_srng_config[type];
 	struct hal_srng *srng;
 	int ring_id;
@@ -1000,7 +1000,7 @@ int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type,
 	int i;
 	u32 reg_base;
 
-	ring_id = ath11k_hal_srng_get_ring_id(sc, type, ring_num, mac_id);
+	ring_id = ath11k_hal_srng_get_ring_id(ab, type, ring_num, mac_id);
 	if (ring_id < 0)
 		return ring_id;
 
@@ -1048,7 +1048,7 @@ int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type,
 			srng->flags |= HAL_SRNG_FLAGS_LMAC_RING;
 		} else {
 			srng->u.src_ring.hp_addr =
-				(u32 *)((unsigned long)sc->mem + reg_base);
+				(u32 *)((unsigned long)ab->mem + reg_base);
 		}
 	} else {
 		/* During initialization loop count in all the descriptors
@@ -1073,7 +1073,7 @@ int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type,
 			srng->flags |= HAL_SRNG_FLAGS_LMAC_RING;
 		} else {
 			srng->u.dst_ring.tp_addr =
-				(u32 *)((unsigned long)sc->mem + reg_base +
+				(u32 *)((unsigned long)ab->mem + reg_base +
 					(HAL_REO1_RING_TP - HAL_REO1_RING_HP));
 		}
 	}
@@ -1081,44 +1081,44 @@ int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type,
 	if (srng_config->lmac_ring)
 		return ring_id;
 
-	ath11k_hal_srng_hw_init(sc, srng);
+	ath11k_hal_srng_hw_init(ab, srng);
 
 	if (type == HAL_CE_DST) {
 		srng->u.dst_ring.max_buffer_length = params->max_buffer_len;
-		ath11k_hal_ce_dst_setup(sc, srng, ring_num);
+		ath11k_hal_ce_dst_setup(ab, srng, ring_num);
 	}
 
 	return ring_id;
 }
 
-int ath11k_hal_srng_init(struct ath11k_base *sc)
+int ath11k_hal_srng_init(struct ath11k_base *ab)
 {
-	struct ath11k_hal *hal = &sc->hal;
+	struct ath11k_hal *hal = &ab->hal;
 	int ret;
 
 	memset(hal, 0, sizeof(*hal));
 
 	hal->srng_config = hw_srng_config;
 
-	ret = ath11k_hal_alloc_cont_rdp(sc);
+	ret = ath11k_hal_alloc_cont_rdp(ab);
 	if (ret)
 		goto err_hal;
 
-	ret = ath11k_hal_alloc_cont_wrp(sc);
+	ret = ath11k_hal_alloc_cont_wrp(ab);
 	if (ret)
 		goto err_free_cont_rdp;
 
 	return 0;
 
 err_free_cont_rdp:
-	ath11k_hal_free_cont_rdp(sc);
+	ath11k_hal_free_cont_rdp(ab);
 
 err_hal:
 	return ret;
 }
 
-void ath11k_hal_srng_deinit(struct ath11k_base *sc)
+void ath11k_hal_srng_deinit(struct ath11k_base *ab)
 {
-	ath11k_hal_free_cont_rdp(sc);
-	ath11k_hal_free_cont_wrp(sc);
+	ath11k_hal_free_cont_rdp(ab);
+	ath11k_hal_free_cont_wrp(ab);
 }
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 12/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.h
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (10 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 11/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.c Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 13/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in qmi.h Maharaja Kennadyrajan
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in hal.h file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/hal.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/hal.h b/drivers/net/wireless/ath/ath11k/hal.h
index c57f683f8c84..c80b068f0baf 100644
--- a/drivers/net/wireless/ath/ath11k/hal.h
+++ b/drivers/net/wireless/ath/ath11k/hal.h
@@ -876,10 +876,10 @@ u32 *ath11k_hal_srng_dst_get_next_entry(struct ath11k_base *ab,
 u32 *ath11k_hal_srng_dst_peek(struct ath11k_base *ab, struct hal_srng *srng);
 int ath11k_hal_srng_dst_num_free(struct ath11k_base *ab, struct hal_srng *srng,
 				 bool sync_hw_ptr);
-u32 *ath11k_hal_srng_src_peek(struct ath11k_base *sc, struct hal_srng *srng);
-u32 *ath11k_hal_srng_src_get_next_reaped(struct ath11k_base *sc,
+u32 *ath11k_hal_srng_src_peek(struct ath11k_base *ab, struct hal_srng *srng);
+u32 *ath11k_hal_srng_src_get_next_reaped(struct ath11k_base *ab,
 					 struct hal_srng *srng);
-u32 *ath11k_hal_srng_src_reap_next(struct ath11k_base *sc,
+u32 *ath11k_hal_srng_src_reap_next(struct ath11k_base *ab,
 				   struct hal_srng *srng);
 u32 *ath11k_hal_srng_src_get_next_entry(struct ath11k_base *ab,
 					struct hal_srng *srng);
@@ -888,7 +888,7 @@ int ath11k_hal_srng_src_num_free(struct ath11k_base *ab, struct hal_srng *srng,
 void ath11k_hal_srng_access_begin(struct ath11k_base *ab,
 				  struct hal_srng *srng);
 void ath11k_hal_srng_access_end(struct ath11k_base *ab, struct hal_srng *srng);
-int ath11k_hal_srng_setup(struct ath11k_base *sc, enum hal_ring_type type,
+int ath11k_hal_srng_setup(struct ath11k_base *ab, enum hal_ring_type type,
 			  int ring_num, int mac_id,
 			  struct hal_srng_params *params);
 int ath11k_hal_srng_init(struct ath11k_base *ath11k);
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 13/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in qmi.h
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (11 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 12/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.h Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 14/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.c Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 15/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.h Maharaja Kennadyrajan
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in qmi.h file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/qmi.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/qmi.h b/drivers/net/wireless/ath/ath11k/qmi.h
index ff9203d46810..f388dc6030a4 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.h
+++ b/drivers/net/wireless/ath/ath11k/qmi.h
@@ -432,12 +432,12 @@ struct qmi_wlanfw_wlan_cfg_resp_msg_v01 {
 	struct qmi_response_type_v01 resp;
 };
 
-int ath11k_qmi_firmware_start(struct ath11k_base *sc,
+int ath11k_qmi_firmware_start(struct ath11k_base *ab,
 			      u32 mode);
-void ath11k_qmi_firmware_stop(struct ath11k_base *sc);
+void ath11k_qmi_firmware_stop(struct ath11k_base *ab);
 void ath11k_qmi_event_work(struct work_struct *work);
 void ath11k_qmi_msg_recv_work(struct work_struct *work);
-void ath11k_qmi_deinit_service(struct ath11k_base *sc);
-int ath11k_qmi_init_service(struct ath11k_base *sc);
+void ath11k_qmi_deinit_service(struct ath11k_base *ab);
+int ath11k_qmi_init_service(struct ath11k_base *ab);
 
 #endif
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 14/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.c
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (12 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 13/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in qmi.h Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  2019-08-08 13:03 ` [PATCH 15/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.h Maharaja Kennadyrajan
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in wmi.c file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/wmi.c | 94 +++++++++++++--------------
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index e7a74e0e0b80..a873ca1782c8 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -205,7 +205,7 @@ static int ath11k_wmi_cmd_send_nowait(struct ath11k_pdev_wmi *wmi, struct sk_buf
 				      u32 cmd_id)
 {
 	struct ath11k_skb_cb *skb_cb = ATH11K_SKB_CB(skb);
-	struct ath11k_base *sc = wmi->wmi_sc->sc;
+	struct ath11k_base *ab = wmi->wmi_sc->ab;
 	struct wmi_cmd_hdr *cmd_hdr;
 	int ret;
 	u32 cmd = 0;
@@ -219,7 +219,7 @@ static int ath11k_wmi_cmd_send_nowait(struct ath11k_pdev_wmi *wmi, struct sk_buf
 	cmd_hdr->cmd_id = cmd;
 
 	memset(skb_cb, 0, sizeof(*skb_cb));
-	ret = ath11k_htc_send(&sc->htc, wmi->eid, skb);
+	ret = ath11k_htc_send(&ab->htc, wmi->eid, skb);
 
 	if (ret)
 		goto err_pull;
@@ -242,14 +242,14 @@ int ath11k_wmi_cmd_send(struct ath11k_pdev_wmi *wmi, struct sk_buff *skb,
 	wait_event_timeout(wmi_sc->tx_credits_wq, ({
 		ret = ath11k_wmi_cmd_send_nowait(wmi, skb, cmd_id);
 
-		if (ret && test_bit(ATH11K_FLAG_CRASH_FLUSH, &wmi_sc->sc->dev_flags))
+		if (ret && test_bit(ATH11K_FLAG_CRASH_FLUSH, &wmi_sc->ab->dev_flags))
 			ret = -ESHUTDOWN;
 
 		(ret != -EAGAIN);
 	}), WMI_SEND_TIMEOUT_HZ);
 
 	if (ret == -EAGAIN)
-		ath11k_warn(wmi_sc->sc, "wmi command %d timeout\n", cmd_id);
+		ath11k_warn(wmi_sc->ab, "wmi command %d timeout\n", cmd_id);
 
 	return ret;
 }
@@ -506,7 +506,7 @@ static int ath11k_service_ready_event(struct ath11k_base *ab, struct sk_buff *sk
 struct sk_buff *ath11k_wmi_alloc_skb(struct ath11k_wmi_base *wmi_sc, u32 len)
 {
 	struct sk_buff *skb;
-	struct ath11k_base *ab = wmi_sc->sc;
+	struct ath11k_base *ab = wmi_sc->ab;
 	u32 round_len = roundup(len, 4);
 
 	skb = ath11k_htc_alloc_skb(ab, WMI_SKB_HEADROOM + round_len);
@@ -1346,7 +1346,7 @@ int ath11k_wmi_set_sta_ps_param(struct ath11k *ar, u32 vdev_id,
 int ath11k_send_crash_inject_cmd(struct ath11k_pdev_wmi *wmi_handle,
 				 struct crash_inject *param)
 {
-	struct ath11k_base *ab = wmi_handle->wmi_sc->sc;
+	struct ath11k_base *ab = wmi_handle->wmi_sc->ab;
 	struct wmi_force_fw_hang_cmd *cmd;
 	struct sk_buff *skb;
 	int ret, len;
@@ -2551,7 +2551,7 @@ ath11k_wmi_copy_resource_config(struct wmi_resource_config *wmi_cfg,
 static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
 				struct wmi_init_cmd_param *param)
 {
-	struct ath11k_base *ab = wmi->wmi_sc->sc;
+	struct ath11k_base *ab = wmi->wmi_sc->ab;
 	struct sk_buff *skb;
 	struct wmi_init_cmd *cmd;
 	struct wmi_resource_config *cfg;
@@ -2662,11 +2662,11 @@ static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
 	return ret;
 }
 
-int ath11k_wmi_wait_for_service_ready(struct ath11k_base *sc)
+int ath11k_wmi_wait_for_service_ready(struct ath11k_base *ab)
 {
 	unsigned long time_left;
 
-	time_left = wait_for_completion_timeout(&sc->wmi_sc.service_ready,
+	time_left = wait_for_completion_timeout(&ab->wmi_sc.service_ready,
 						WMI_SERVICE_READY_TIMEOUT_HZ);
 	if (!time_left)
 		return -ETIMEDOUT;
@@ -2674,11 +2674,11 @@ int ath11k_wmi_wait_for_service_ready(struct ath11k_base *sc)
 	return 0;
 }
 
-int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *sc)
+int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *ab)
 {
 	unsigned long time_left;
 
-	time_left = wait_for_completion_timeout(&sc->wmi_sc.unified_ready,
+	time_left = wait_for_completion_timeout(&ab->wmi_sc.unified_ready,
 						WMI_SERVICE_READY_TIMEOUT_HZ);
 	if (!time_left)
 		return -ETIMEDOUT;
@@ -2686,21 +2686,21 @@ int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *sc)
 	return 0;
 }
 
-int ath11k_wmi_cmd_init(struct ath11k_base *sc)
+int ath11k_wmi_cmd_init(struct ath11k_base *ab)
 {
-	struct ath11k_wmi_base *wmi_sc = &sc->wmi_sc;
+	struct ath11k_wmi_base *wmi_sc = &ab->wmi_sc;
 	struct wmi_init_cmd_param init_param;
 	struct target_resource_config  config;
 
 	memset(&init_param, 0, sizeof(init_param));
 	memset(&config, 0, sizeof(config));
 
-	config.num_vdevs = sc->num_radios * TARGET_NUM_VDEVS;
+	config.num_vdevs = ab->num_radios * TARGET_NUM_VDEVS;
 
-	if (sc->num_radios == 2) {
+	if (ab->num_radios == 2) {
 		config.num_peers = TARGET_NUM_PEERS(DBS);
 		config.num_tids = TARGET_NUM_TIDS(DBS);
-	} else if (sc->num_radios == 3) {
+	} else if (ab->num_radios == 3) {
 		config.num_peers = TARGET_NUM_PEERS(DBS_SBS);
 		config.num_tids = TARGET_NUM_TIDS(DBS_SBS);
 	} else {
@@ -2712,8 +2712,8 @@ int ath11k_wmi_cmd_init(struct ath11k_base *sc)
 	config.num_offload_reorder_buffs = TARGET_NUM_OFFLD_REORDER_BUFFS;
 	config.num_peer_keys = TARGET_NUM_PEER_KEYS;
 	config.ast_skid_limit = TARGET_AST_SKID_LIMIT;
-	config.tx_chain_mask = (1 << sc->target_caps.num_rf_chains) - 1;
-	config.rx_chain_mask = (1 << sc->target_caps.num_rf_chains) - 1;
+	config.tx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1;
+	config.rx_chain_mask = (1 << ab->target_caps.num_rf_chains) - 1;
 	config.rx_timeout_pri[0] = TARGET_RX_TIMEOUT_LO_PRI;
 	config.rx_timeout_pri[1] = TARGET_RX_TIMEOUT_LO_PRI;
 	config.rx_timeout_pri[2] = TARGET_RX_TIMEOUT_LO_PRI;
@@ -2734,7 +2734,7 @@ int ath11k_wmi_cmd_init(struct ath11k_base *sc)
 	config.vow_config = TARGET_VOW_CONFIG;
 	config.gtk_offload_max_vdev = TARGET_GTK_OFFLOAD_MAX_VDEV;
 	config.num_msdu_desc = TARGET_NUM_MSDU_DESC;
-	config.beacon_tx_offload_max_vdev = sc->num_radios * TARGET_MAX_BCN_OFFLD;
+	config.beacon_tx_offload_max_vdev = ab->num_radios * TARGET_MAX_BCN_OFFLD;
 	config.rx_batchmode = TARGET_RX_BATCHMODE;
 	config.peer_map_unmap_v2_support = 1;
 
@@ -2748,9 +2748,9 @@ int ath11k_wmi_cmd_init(struct ath11k_base *sc)
 	if (wmi_sc->preferred_hw_mode == WMI_HOST_HW_MODE_SINGLE)
 		init_param.hw_mode_id = WMI_HOST_HW_MODE_MAX;
 
-	init_param.num_band_to_mac = sc->num_radios;
+	init_param.num_band_to_mac = ab->num_radios;
 
-	ath11k_fill_band_to_mac_param(sc, init_param.band_to_mac);
+	ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac);
 
 	return ath11k_init_cmd_send(&wmi_sc->wmi[0], &init_param);
 }
@@ -4322,13 +4322,13 @@ void ath11k_wmi_fw_stats_fill(struct ath11k *ar,
 		buf[len] = 0;
 }
 
-static void ath11k_wmi_op_ep_tx_credits(struct ath11k_base *sc)
+static void ath11k_wmi_op_ep_tx_credits(struct ath11k_base *ab)
 {
 	/* try to send pending beacons first. they take priority */
-	wake_up(&sc->wmi_sc.tx_credits_wq);
+	wake_up(&ab->wmi_sc.tx_credits_wq);
 }
 
-static void ath11k_wmi_htc_tx_complete(struct ath11k_base *sc,
+static void ath11k_wmi_htc_tx_complete(struct ath11k_base *ab,
 				       struct sk_buff *skb)
 {
 	dev_kfree_skb(skb);
@@ -5434,7 +5434,7 @@ static void ath11k_wmi_tlv_op_rx(struct ath11k_base *ab, struct sk_buff *skb)
 	dev_kfree_skb(skb);
 }
 
-static int ath11k_connect_pdev_htc_service(struct ath11k_base *sc,
+static int ath11k_connect_pdev_htc_service(struct ath11k_base *ab,
 					   u32 pdev_idx)
 {
 	int status;
@@ -5456,16 +5456,16 @@ static int ath11k_connect_pdev_htc_service(struct ath11k_base *sc,
 	/* connect to control service */
 	conn_req.service_id = svc_id[pdev_idx];
 
-	status = ath11k_htc_connect_service(&sc->htc, &conn_req, &conn_resp);
+	status = ath11k_htc_connect_service(&ab->htc, &conn_req, &conn_resp);
 	if (status) {
-		ath11k_warn(sc, "failed to connect to WMI CONTROL service status: %d\n",
+		ath11k_warn(ab, "failed to connect to WMI CONTROL service status: %d\n",
 			    status);
 		return status;
 	}
 
-	sc->wmi_sc.wmi_endpoint_id[pdev_idx] = conn_resp.eid;
-	sc->wmi_sc.wmi[pdev_idx].eid = conn_resp.eid;
-	sc->wmi_sc.max_msg_len[pdev_idx] = conn_resp.max_msg_len;
+	ab->wmi_sc.wmi_endpoint_id[pdev_idx] = conn_resp.eid;
+	ab->wmi_sc.wmi[pdev_idx].eid = conn_resp.eid;
+	ab->wmi_sc.max_msg_len[pdev_idx] = conn_resp.max_msg_len;
 
 	return 0;
 }
@@ -5564,22 +5564,22 @@ int ath11k_wmi_simulate_radar(struct ath11k *ar)
 	return ath11k_wmi_send_unit_test_cmd(ar, wmi_ut, dfs_args);
 }
 
-int ath11k_wmi_connect(struct ath11k_base *sc)
+int ath11k_wmi_connect(struct ath11k_base *ab)
 {
 	u32 i;
 	u8 wmi_ep_count;
 
-	wmi_ep_count = sc->htc.wmi_ep_count;
+	wmi_ep_count = ab->htc.wmi_ep_count;
 	if (wmi_ep_count > MAX_RADIOS)
 		return -1;
 
 	for (i = 0; i < wmi_ep_count; i++)
-		ath11k_connect_pdev_htc_service(sc, i);
+		ath11k_connect_pdev_htc_service(ab, i);
 
 	return 0;
 }
 
-static void ath11k_wmi_pdev_detach(struct ath11k_base *sc, u8 pdev_id)
+static void ath11k_wmi_pdev_detach(struct ath11k_base *ab, u8 pdev_id)
 {
 	if (WARN_ON(pdev_id >= MAX_RADIOS))
 		return;
@@ -5587,7 +5587,7 @@ static void ath11k_wmi_pdev_detach(struct ath11k_base *sc, u8 pdev_id)
 	/* TODO: Deinit any pdev specific wmi resource */
 }
 
-int ath11k_wmi_pdev_attach(struct ath11k_base *sc,
+int ath11k_wmi_pdev_attach(struct ath11k_base *ab,
 			   u8 pdev_id)
 {
 	struct ath11k_pdev_wmi *wmi_handle;
@@ -5595,40 +5595,40 @@ int ath11k_wmi_pdev_attach(struct ath11k_base *sc,
 	if (pdev_id >= MAX_RADIOS)
 		return -EINVAL;
 
-	wmi_handle = &sc->wmi_sc.wmi[pdev_id];
+	wmi_handle = &ab->wmi_sc.wmi[pdev_id];
 
-	wmi_handle->wmi_sc = &sc->wmi_sc;
+	wmi_handle->wmi_sc = &ab->wmi_sc;
 
-	sc->wmi_sc.sc = sc;
+	ab->wmi_sc.ab = ab;
 	/* TODO: Init remaining resource specific to pdev */
 
 	return 0;
 }
 
-int ath11k_wmi_attach(struct ath11k_base *sc)
+int ath11k_wmi_attach(struct ath11k_base *ab)
 {
 	int ret;
 
-	ret = ath11k_wmi_pdev_attach(sc, 0);
+	ret = ath11k_wmi_pdev_attach(ab, 0);
 	if (ret)
 		return ret;
 
-	sc->wmi_sc.sc = sc;
-	sc->wmi_sc.preferred_hw_mode = WMI_HOST_HW_MODE_MAX;
+	ab->wmi_sc.ab = ab;
+	ab->wmi_sc.preferred_hw_mode = WMI_HOST_HW_MODE_MAX;
 
 	/* TODO: Init remaining wmi soc resources required */
-	init_completion(&sc->wmi_sc.service_ready);
-	init_completion(&sc->wmi_sc.unified_ready);
+	init_completion(&ab->wmi_sc.service_ready);
+	init_completion(&ab->wmi_sc.unified_ready);
 
 	return 0;
 }
 
-void ath11k_wmi_detach(struct ath11k_base *sc)
+void ath11k_wmi_detach(struct ath11k_base *ab)
 {
 	int i;
 
 	/* TODO: Deinit wmi resource specific to SOC as required */
 
-	for (i = 0; i < sc->htc.wmi_ep_count; i++)
-		ath11k_wmi_pdev_detach(sc, i);
+	for (i = 0; i < ab->htc.wmi_ep_count; i++)
+		ath11k_wmi_pdev_detach(ab, i);
 }
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 15/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.h
  2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
                   ` (13 preceding siblings ...)
  2019-08-08 13:03 ` [PATCH 14/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.c Maharaja Kennadyrajan
@ 2019-08-08 13:03 ` Maharaja Kennadyrajan
  14 siblings, 0 replies; 17+ messages in thread
From: Maharaja Kennadyrajan @ 2019-08-08 13:03 UTC (permalink / raw)
  To: ath11k; +Cc: Maharaja Kennadyrajan

To avoid confusion and better readability, renamed the
ath11k_base struct from 'sc' to 'ab' in wmi.h file.

Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/wmi.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/wmi.h b/drivers/net/wireless/ath/ath11k/wmi.h
index f1930339e633..ff31aa7d8058 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.h
+++ b/drivers/net/wireless/ath/ath11k/wmi.h
@@ -4553,7 +4553,7 @@ struct target_resource_config {
 #define WMI_SEND_TIMEOUT_HZ (3 * HZ)
 
 struct ath11k_wmi_base {
-	struct ath11k_base *sc;
+	struct ath11k_base *ab;
 	struct ath11k_pdev_wmi wmi[MAX_RADIOS];
 	enum ath11k_htc_ep_id wmi_endpoint_id[MAX_RADIOS];
 	u32 max_msg_len[MAX_RADIOS];
@@ -4591,14 +4591,14 @@ int ath11k_wmi_set_peer_param(struct ath11k *ar, const u8 *peer_addr,
 			      u32 vdev_id, u32 param_id, u32 param_val);
 int ath11k_wmi_pdev_set_param(struct ath11k *ar, u32 param_id,
 			      u32 param_value, u8 pdev_id);
-int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *sc);
-int ath11k_wmi_cmd_init(struct ath11k_base *sc);
-int ath11k_wmi_wait_for_service_ready(struct ath11k_base *sc);
-int ath11k_wmi_connect(struct ath11k_base *sc);
-int ath11k_wmi_pdev_attach(struct ath11k_base *sc,
+int ath11k_wmi_wait_for_unified_ready(struct ath11k_base *ab);
+int ath11k_wmi_cmd_init(struct ath11k_base *ab);
+int ath11k_wmi_wait_for_service_ready(struct ath11k_base *ab);
+int ath11k_wmi_connect(struct ath11k_base *ab);
+int ath11k_wmi_pdev_attach(struct ath11k_base *ab,
 			   u8 pdev_id);
-int ath11k_wmi_attach(struct ath11k_base *sc);
-void ath11k_wmi_detach(struct ath11k_base *sc);
+int ath11k_wmi_attach(struct ath11k_base *ab);
+void ath11k_wmi_detach(struct ath11k_base *ab);
 int ath11k_wmi_vdev_create(struct ath11k *ar, u8 *macaddr,
 			   struct vdev_create_params *param);
 int ath11k_wmi_peer_rx_reorder_queue_setup(struct ath11k *ar, int vdev_id,
-- 
2.21.0


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c
  2019-08-08 13:02 ` [PATCH 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c Maharaja Kennadyrajan
@ 2019-08-12 14:51   ` Kalle Valo
  0 siblings, 0 replies; 17+ messages in thread
From: Kalle Valo @ 2019-08-12 14:51 UTC (permalink / raw)
  To: Maharaja Kennadyrajan; +Cc: ath11k

Maharaja Kennadyrajan <mkenna@codeaurora.org> wrote:

> To avoid confusion and better readability, renamed the
> ath11k_base struct from 'sc' to 'ab'.
> 
> Signed-off-by: Maharaja Kennadyrajan <mkenna@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

15 patches applied to ath11k-bringup branch of ath.git, thanks.

e9a9c7ce20c3 ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c
97b7d50e442e ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.c
921875d8447e ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.h
f89c8045c71e ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.c
032c9ae20492 ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.h
f3ce3b075ce9 ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.c
53ac892df561 ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.h
ff68b8aeec52 ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.c
ce0b4c3b9fed ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.h
ef79f7734a4b ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp_rx.c
3b5143219077 ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.c
f657f4579186 ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.h
deeb215c52fa ath11k: Rename ath11k_base struct from 'sc' to 'ab in qmi.h
eef18cfbb399 ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.c
4680dac93f46 ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.h

-- 
https://patchwork.kernel.org/patch/11084107/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2019-08-12 14:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-08 13:02 [PATCH 00/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab Maharaja Kennadyrajan
2019-08-08 13:02 ` [PATCH 01/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ahb.c Maharaja Kennadyrajan
2019-08-12 14:51   ` Kalle Valo
2019-08-08 13:02 ` [PATCH 02/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.c Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 03/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in ce.h Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 04/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.c Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 05/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in core.h Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 06/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.c Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 07/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in debug.h Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 08/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.c Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 09/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp.h Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 10/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in dp_rx.c Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 11/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.c Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 12/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in hal.h Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 13/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in qmi.h Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 14/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.c Maharaja Kennadyrajan
2019-08-08 13:03 ` [PATCH 15/15] ath11k: Rename ath11k_base struct from 'sc' to 'ab in wmi.h Maharaja Kennadyrajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox