Browse Source

qcacmn: Add CDP APIs for configuring interrupt

Add CDP API for interrupt configuration to decouple interrupt
setup from soc attach / detach.

Change-Id: I422205ff5687fdc4a0936c68850455cc4e733e4d
CRs-fixed: 2046055
Venkateswara Swamy Bandaru 8 years ago
parent
commit
a95b324a8c
3 changed files with 26 additions and 4 deletions
  1. 22 0
      dp/inc/cdp_txrx_cmn.h
  2. 2 0
      dp/inc/cdp_txrx_ops.h
  3. 2 4
      dp/wifi3.0/dp_main.c

+ 22 - 0
dp/inc/cdp_txrx_cmn.h

@@ -507,6 +507,28 @@ int cdp_txrx_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	return 0;
 }
 
+/**
+  * cdp_txrx_intr_attach(): function to attach and configure interrupt
+  * @soc: soc handle
+  */
+static inline QDF_STATUS cdp_txrx_intr_attach(ol_txrx_soc_handle soc)
+{
+	if (soc->ops->cmn_drv_ops->txrx_intr_attach)
+		return soc->ops->cmn_drv_ops->txrx_intr_attach(soc);
+
+	return 0;
+}
+
+/**
+  * cdp_txrx_intr_detach(): function to detach interrupt
+  * @soc: soc handle
+  */
+static inline void cdp_txrx_intr_detach(ol_txrx_soc_handle soc)
+{
+	if (soc->ops->cmn_drv_ops->txrx_intr_detach)
+		soc->ops->cmn_drv_ops->txrx_intr_detach(soc);
+}
+
 /**
   * cdp_display_stats(): function to map to dump stats
   * @soc: soc handle

+ 2 - 0
dp/inc/cdp_txrx_ops.h

@@ -206,6 +206,8 @@ struct cdp_cmn_ops {
 	void (*txrx_soc_set_nss_cfg)(ol_txrx_soc_handle soc, int config);
 
 	int(*txrx_soc_get_nss_cfg)(ol_txrx_soc_handle soc);
+	QDF_STATUS (*txrx_intr_attach)(void *soc);
+	void (*txrx_intr_detach)(void *soc);
 };
 
 struct cdp_ctrl_ops {

+ 2 - 4
dp/wifi3.0/dp_main.c

@@ -965,8 +965,6 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
 		goto fail1;
 	}
 
-	dp_soc_interrupt_attach(soc);
-
 	/* Setup HW REO */
 	qdf_mem_zero(&reo_params, sizeof(reo_params));
 
@@ -1413,8 +1411,6 @@ static void dp_soc_detach_wifi3(void *txrx_soc)
 
 	qdf_atomic_set(&soc->cmn_init_done, 0);
 
-	dp_soc_interrupt_detach(soc);
-
 	for (i = 0; i < MAX_PDEV_CNT; i++) {
 		if (soc->pdev_list[i])
 			dp_pdev_detach_wifi3(
@@ -3779,6 +3775,8 @@ static struct cdp_cmn_ops dp_ops_cmn = {
 	.display_stats = dp_txrx_dump_stats,
 	.txrx_soc_set_nss_cfg = dp_soc_set_nss_cfg_wifi3,
 	.txrx_soc_get_nss_cfg = dp_soc_get_nss_cfg_wifi3,
+	.txrx_intr_attach = dp_soc_interrupt_attach,
+	.txrx_intr_detach = dp_soc_interrupt_detach,
 	/* TODO: Add other functions */
 };