Browse Source

qcacld-3.0: wdi2.0 feature enable, dp hif

wdi20 enable implementation for hsoffload. Large physical address
support and wdi20 interface propagate to IPA.
This is part of HIF and DP.

Change-Id: If898f03a8a75689c98c70d1e55910f476d8fe329
CRs-fixed: 941041
Leo Chang 9 years ago
parent
commit
d85f78d03d

+ 61 - 15
core/dp/htt/htt.c

@@ -471,8 +471,12 @@ void htt_htc_disable_aspm(void)
 }
 
 #ifdef IPA_OFFLOAD
-/*
- * Attach resource for micro controller data path
+/**
+ * htt_ipa_uc_attach() - Allocate UC data path resources
+ * @pdev: handle to the HTT instance
+ *
+ * Return: 0 success
+ *         none 0 fail
  */
 int htt_ipa_uc_attach(struct htt_pdev_t *pdev)
 {
@@ -504,6 +508,12 @@ int htt_ipa_uc_attach(struct htt_pdev_t *pdev)
 	return 0;               /* success */
 }
 
+/**
+ * htt_ipa_uc_attach() - Remove UC data path resources
+ * @pdev: handle to the HTT instance
+ *
+ * Return: None
+ */
 void htt_ipa_uc_detach(struct htt_pdev_t *pdev)
 {
 	/* TX IPA micro controller detach */
@@ -513,32 +523,63 @@ void htt_ipa_uc_detach(struct htt_pdev_t *pdev)
 	htt_rx_ipa_uc_detach(pdev);
 }
 
-/*
- * Distribute micro controller resource to control module
+/**
+ * htt_ipa_uc_get_resource() - Get uc resource from htt and lower layer
+ * @pdev: handle to the HTT instance
+ * @ce_sr_base_paddr: copy engine source ring base physical address
+ * @ce_sr_ring_size: copy engine source ring size
+ * @ce_reg_paddr: copy engine register physical address
+ * @tx_comp_ring_base_paddr: tx comp ring base physical address
+ * @tx_comp_ring_size: tx comp ring size
+ * @tx_num_alloc_buffer: number of allocated tx buffer
+ * @rx_rdy_ring_base_paddr: rx ready ring base physical address
+ * @rx_rdy_ring_size: rx ready ring size
+ * @rx_proc_done_idx_paddr: rx process done index physical address
+ * @rx_proc_done_idx_vaddr: rx process done index virtual address
+ * @rx2_rdy_ring_base_paddr: rx done ring base physical address
+ * @rx2_rdy_ring_size: rx done ring size
+ * @rx2_proc_done_idx_paddr: rx done index physical address
+ * @rx2_proc_done_idx_vaddr: rx done index virtual address
+ *
+ * Return: 0 success
  */
 int
 htt_ipa_uc_get_resource(htt_pdev_handle pdev,
-			uint32_t *ce_sr_base_paddr,
+			cdf_dma_addr_t *ce_sr_base_paddr,
 			uint32_t *ce_sr_ring_size,
 			cdf_dma_addr_t *ce_reg_paddr,
-			uint32_t *tx_comp_ring_base_paddr,
+			cdf_dma_addr_t *tx_comp_ring_base_paddr,
 			uint32_t *tx_comp_ring_size,
 			uint32_t *tx_num_alloc_buffer,
-			uint32_t *rx_rdy_ring_base_paddr,
+			cdf_dma_addr_t *rx_rdy_ring_base_paddr,
 			uint32_t *rx_rdy_ring_size,
-			uint32_t *rx_proc_done_idx_paddr)
+			cdf_dma_addr_t *rx_proc_done_idx_paddr,
+			void **rx_proc_done_idx_vaddr,
+			cdf_dma_addr_t *rx2_rdy_ring_base_paddr,
+			uint32_t *rx2_rdy_ring_size,
+			cdf_dma_addr_t *rx2_proc_done_idx_paddr,
+			void **rx2_proc_done_idx_vaddr)
 {
 	/* Release allocated resource to client */
 	*tx_comp_ring_base_paddr =
-		(uint32_t) pdev->ipa_uc_tx_rsc.tx_comp_base.paddr;
+		pdev->ipa_uc_tx_rsc.tx_comp_base.paddr;
 	*tx_comp_ring_size =
 		(uint32_t) ol_cfg_ipa_uc_tx_max_buf_cnt(pdev->ctrl_pdev);
 	*tx_num_alloc_buffer = (uint32_t) pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt;
 	*rx_rdy_ring_base_paddr =
-		(uint32_t) pdev->ipa_uc_rx_rsc.rx_ind_ring_base.paddr;
+		pdev->ipa_uc_rx_rsc.rx_ind_ring_base.paddr;
 	*rx_rdy_ring_size = (uint32_t) pdev->ipa_uc_rx_rsc.rx_ind_ring_size;
 	*rx_proc_done_idx_paddr =
-		(uint32_t) pdev->ipa_uc_rx_rsc.rx_ipa_prc_done_idx.paddr;
+		pdev->ipa_uc_rx_rsc.rx_ipa_prc_done_idx.paddr;
+	*rx_proc_done_idx_vaddr =
+		(void *)pdev->ipa_uc_rx_rsc.rx_ipa_prc_done_idx.vaddr;
+	*rx2_rdy_ring_base_paddr =
+		pdev->ipa_uc_rx_rsc.rx2_ind_ring_base.paddr;
+	*rx2_rdy_ring_size = (uint32_t) pdev->ipa_uc_rx_rsc.rx2_ind_ring_size;
+	*rx2_proc_done_idx_paddr =
+		pdev->ipa_uc_rx_rsc.rx2_ipa_prc_done_idx.paddr;
+	*rx2_proc_done_idx_vaddr =
+		(void *)pdev->ipa_uc_rx_rsc.rx2_ipa_prc_done_idx.vaddr;
 
 	/* Get copy engine, bus resource */
 	htc_ipa_get_ce_resource(pdev->htc_pdev,
@@ -548,13 +589,18 @@ htt_ipa_uc_get_resource(htt_pdev_handle pdev,
 	return 0;
 }
 
-/*
- * Distribute micro controller doorbell register to firmware
+/**
+ * htt_ipa_uc_set_doorbell_paddr() - Propagate IPA doorbell address
+ * @pdev: handle to the HTT instance
+ * @ipa_uc_tx_doorbell_paddr: TX doorbell base physical address
+ * @ipa_uc_rx_doorbell_paddr: RX doorbell base physical address
+ *
+ * Return: 0 success
  */
 int
 htt_ipa_uc_set_doorbell_paddr(htt_pdev_handle pdev,
-			      uint32_t ipa_uc_tx_doorbell_paddr,
-			      uint32_t ipa_uc_rx_doorbell_paddr)
+			      cdf_dma_addr_t ipa_uc_tx_doorbell_paddr,
+			      cdf_dma_addr_t ipa_uc_rx_doorbell_paddr)
 {
 	pdev->ipa_uc_tx_rsc.tx_comp_idx_paddr = ipa_uc_tx_doorbell_paddr;
 	pdev->ipa_uc_rx_rsc.rx_rdy_idx_paddr = ipa_uc_rx_doorbell_paddr;

+ 31 - 11
core/dp/htt/htt_h2t.c

@@ -641,6 +641,13 @@ htt_h2t_aggr_cfg_msg(struct htt_pdev_t *pdev,
 }
 
 #ifdef IPA_OFFLOAD
+/**
+ * htt_h2t_ipa_uc_rsc_cfg_msg() - Send WDI IPA config message to firmware
+ * @pdev: handle to the HTT instance
+ *
+ * Return: 0 success
+ *         A_NO_MEMORY No memory fail
+ */
 int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
 {
 	struct htt_htc_pkt *pkt;
@@ -649,7 +656,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
 
 	pkt = htt_htc_pkt_alloc(pdev);
 	if (!pkt)
-		return A_NO_MEMORY;
+		return -A_NO_MEMORY;
 
 	/* show that this is not a tx frame download
 	 * (not required, but helpful)
@@ -663,7 +670,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
 			     false);
 	if (!msg) {
 		htt_htc_pkt_free(pdev, pkt);
-		return A_NO_MEMORY;
+		return -A_NO_MEMORY;
 	}
 	/* set the length of the message */
 	cdf_nbuf_put_tail(msg, HTT_WDI_IPA_CFG_SZ);
@@ -756,7 +763,7 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
 	msg_word++;
 	*msg_word = 0;
 	HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(*msg_word,
-		(unsigned int)pdev->ipa_uc_rx_rsc.rx_ipa_prc_done_idx.paddr);
+		(unsigned int)pdev->ipa_uc_rx_rsc.rx2_ipa_prc_done_idx.paddr);
 	msg_word++;
 	*msg_word = 0;
 	HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(*msg_word,
@@ -765,15 +772,12 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
 	msg_word++;
 	*msg_word = 0;
 	HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(*msg_word,
-		(unsigned int)pdev->ipa_uc_rx_rsc.rx2_rdy_idx_paddr);
+		(unsigned int)pdev->ipa_uc_rx_rsc.rx2_ipa_prc_done_idx.paddr);
 	msg_word++;
 	*msg_word = 0;
 	HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(*msg_word,
 		0);
 
-	cdf_trace_hex_dump(CDF_MODULE_ID_HTT, CDF_TRACE_LEVEL_FATAL,
-		(void *)cdf_nbuf_data(msg), 40);
-
 	SET_HTC_PACKET_INFO_TX(&pkt->htc_pkt,
 			       htt_h2t_send_complete_free_netbuf,
 			       cdf_nbuf_data(msg),
@@ -788,6 +792,15 @@ int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
 	return A_OK;
 }
 
+/**
+ * htt_h2t_ipa_uc_set_active() - Propagate WDI path enable/disable to firmware
+ * @pdev: handle to the HTT instance
+ * @uc_active: WDI UC path enable or not
+ * @is_tx: TX path or RX path
+ *
+ * Return: 0 success
+ *         A_NO_MEMORY No memory fail
+ */
 int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
 			      bool uc_active, bool is_tx)
 {
@@ -798,7 +811,7 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
 
 	pkt = htt_htc_pkt_alloc(pdev);
 	if (!pkt)
-		return A_NO_MEMORY;
+		return -A_NO_MEMORY;
 
 	/* show that this is not a tx frame download
 	 * (not required, but helpful)
@@ -813,7 +826,7 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
 			     false);
 	if (!msg) {
 		htt_htc_pkt_free(pdev, pkt);
-		return A_NO_MEMORY;
+		return -A_NO_MEMORY;
 	}
 	/* set the length of the message */
 	cdf_nbuf_put_tail(msg, HTT_WDI_IPA_OP_REQUEST_SZ);
@@ -851,6 +864,13 @@ int htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev,
 	return A_OK;
 }
 
+/**
+ * htt_h2t_ipa_uc_get_stats() - WDI UC state query request to firmware
+ * @pdev: handle to the HTT instance
+ *
+ * Return: 0 success
+ *         A_NO_MEMORY No memory fail
+ */
 int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
 {
 	struct htt_htc_pkt *pkt;
@@ -859,7 +879,7 @@ int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
 
 	pkt = htt_htc_pkt_alloc(pdev);
 	if (!pkt)
-		return A_NO_MEMORY;
+		return -A_NO_MEMORY;
 
 	/* show that this is not a tx frame download
 	 * (not required, but helpful)
@@ -874,7 +894,7 @@ int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
 			     false);
 	if (!msg) {
 		htt_htc_pkt_free(pdev, pkt);
-		return A_NO_MEMORY;
+		return -A_NO_MEMORY;
 	}
 	/* set the length of the message */
 	cdf_nbuf_put_tail(msg, HTT_WDI_IPA_OP_REQUEST_SZ);

+ 16 - 0
core/dp/htt/htt_internal.h

@@ -480,6 +480,15 @@ int htt_tx_ipa_uc_detach(struct htt_pdev_t *pdev);
 
 int htt_rx_ipa_uc_detach(struct htt_pdev_t *pdev);
 #else
+/**
+ * htt_tx_ipa_uc_attach() - attach htt ipa uc tx resource
+ * @pdev: htt context
+ * @uc_tx_buf_sz: single tx buffer size
+ * @uc_tx_buf_cnt: total tx buffer count
+ * @uc_tx_partition_base: tx buffer partition start
+ *
+ * Return: 0 success
+ */
 static inline int
 htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
 		     unsigned int uc_tx_buf_sz,
@@ -489,6 +498,13 @@ htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
 	return 0;
 }
 
+/**
+ * htt_rx_ipa_uc_attach() - attach htt ipa uc rx resource
+ * @pdev: htt context
+ * @rx_ind_ring_size: rx ring size
+ *
+ * Return: 0 success
+ */
 static inline int
 htt_rx_ipa_uc_attach(struct htt_pdev_t *pdev, unsigned int rx_ind_ring_size)
 {

+ 10 - 13
core/dp/htt/htt_rx.c

@@ -2288,14 +2288,16 @@ fail1:
 }
 
 #ifdef IPA_OFFLOAD
+/**
+ * htt_rx_ipa_uc_attach() - attach htt ipa uc rx resource
+ * @pdev: htt context
+ * @rx_ind_ring_size: rx ring size
+ *
+ * Return: 0 success
+ */
 int htt_rx_ipa_uc_attach(struct htt_pdev_t *pdev,
 			 unsigned int rx_ind_ring_elements)
 {
-	/* Allocate RX indication ring */
-	/* RX IND ring element
-	 *   4bytes: pointer
-	 *   2bytes: VDEV ID
-	 *   2bytes: length */
 	pdev->ipa_uc_rx_rsc.rx_ind_ring_base.vaddr =
 		cdf_os_mem_alloc_consistent(
 			pdev->osdev,
@@ -2339,16 +2341,11 @@ int htt_rx_ipa_uc_attach(struct htt_pdev_t *pdev,
 	}
 	cdf_mem_zero(pdev->ipa_uc_rx_rsc.rx_ipa_prc_done_idx.vaddr, 4);
 
-	/* Allocate RX2 indication ring */
-	/* RX2 IND ring element
-	 *   4bytes: pointer
-	 *   2bytes: VDEV ID
-	 *   2bytes: length */
 	pdev->ipa_uc_rx_rsc.rx2_ind_ring_base.vaddr =
 		cdf_os_mem_alloc_consistent(
 			pdev->osdev,
 			rx_ind_ring_elements *
-			sizeof(struct ipa_uc_rx_ring_elem_t),
+			sizeof(cdf_dma_addr_t),
 			&pdev->ipa_uc_rx_rsc.rx2_ind_ring_base.paddr,
 			cdf_get_dma_mem_context((&pdev->ipa_uc_rx_rsc.
 						 rx2_ind_ring_base),
@@ -2360,7 +2357,7 @@ int htt_rx_ipa_uc_attach(struct htt_pdev_t *pdev,
 
 	/* RX indication ring size, by bytes */
 	pdev->ipa_uc_rx_rsc.rx2_ind_ring_size =
-		rx_ind_ring_elements * sizeof(struct ipa_uc_rx_ring_elem_t);
+		rx_ind_ring_elements * sizeof(cdf_dma_addr_t);
 	cdf_mem_zero(pdev->ipa_uc_rx_rsc.rx2_ind_ring_base.vaddr,
 		pdev->ipa_uc_rx_rsc.rx2_ind_ring_size);
 
@@ -2432,7 +2429,7 @@ int htt_rx_ipa_uc_detach(struct htt_pdev_t *pdev)
 			rx_ipa_prc_done_idx.vaddr,
 			pdev->ipa_uc_rx_rsc.rx2_ipa_prc_done_idx.paddr,
 			cdf_get_dma_mem_context((&pdev->ipa_uc_rx_rsc.
-						 rx_ipa_prc_done_idx),
+						 rx2_ipa_prc_done_idx),
 						memctx));
 	}
 	return 0;

+ 12 - 1
core/dp/htt/htt_tx.c

@@ -833,6 +833,16 @@ void htt_tx_desc_display(void *tx_desc)
 #endif
 
 #ifdef IPA_OFFLOAD
+/**
+ * htt_tx_ipa_uc_attach() - attach htt ipa uc tx resource
+ * @pdev: htt context
+ * @uc_tx_buf_sz: single tx buffer size
+ * @uc_tx_buf_cnt: total tx buffer count
+ * @uc_tx_partition_base: tx buffer partition start
+ *
+ * Return: 0 success
+ *         ENOBUFS No memory fail
+ */
 int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
 			 unsigned int uc_tx_buf_sz,
 			 unsigned int uc_tx_buf_cnt,
@@ -840,7 +850,7 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
 {
 	unsigned int tx_buffer_count;
 	cdf_nbuf_t buffer_vaddr;
-	uint32_t buffer_paddr;
+	cdf_dma_addr_t buffer_paddr;
 	uint32_t *header_ptr;
 	uint32_t *ring_vaddr;
 	int return_code = 0;
@@ -929,6 +939,7 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev,
 
 		/* chanreq, peerid */
 		*header_ptr = 0xFFFFFFFF;
+		header_ptr++;
 
 		/* FRAG Header */
 		/* 6 words TSO header */

+ 20 - 5
core/dp/htt/htt_types.h

@@ -137,8 +137,17 @@ struct htt_ipa_uc_tx_resource_t {
 	uint32_t alloc_tx_buf_cnt;
 };
 
-/* Micro controller datapath offload
- * WLAN RX resources */
+/**
+ * struct htt_ipa_uc_rx_resource_t
+ * @rx_rdy_idx_paddr: rx ready index physical address
+ * @rx_ind_ring_base: rx indication ring base memory info
+ * @rx_ipa_prc_done_idx: rx process done index memory info
+ * @rx_ind_ring_size: rx process done ring size
+ * @rx2_rdy_idx_paddr: rx process done index physical address
+ * @rx2_ind_ring_base: rx process done indication ring base memory info
+ * @rx2_ipa_prc_done_idx: rx process done index memory info
+ * @rx2_ind_ring_size: rx process done ring size
+ */
 struct htt_ipa_uc_rx_resource_t {
 	cdf_dma_addr_t rx_rdy_idx_paddr;
 	struct uc_shared_mem_t rx_ind_ring_base;
@@ -152,10 +161,16 @@ struct htt_ipa_uc_rx_resource_t {
 	uint32_t rx2_ind_ring_size;
 };
 
+/**
+ * struct ipa_uc_rx_ring_elem_t
+ * @rx_packet_paddr: rx packet physical address
+ * @vdev_id: virtual interface id
+ * @rx_packet_leng: packet length
+ */
 struct ipa_uc_rx_ring_elem_t {
-	uint32_t rx_packet_paddr;
-	uint16_t vdev_id;
-	uint16_t rx_packet_leng;
+	cdf_dma_addr_t rx_packet_paddr;
+	uint32_t vdev_id;
+	uint32_t rx_packet_leng;
 };
 
 #if defined(HELIUMPLUS_PADDR64)

+ 79 - 66
core/dp/ol/inc/ol_htt_api.h

@@ -214,111 +214,98 @@ void htt_display(htt_pdev_handle pdev, int indent);
 #define htt_rx_reorder_log_print(pdev)
 
 #ifdef IPA_OFFLOAD
-/**
- * @brief send IPA UC resource config message to firmware with HTT message
- * @details
- *  send IPA UC resource config message to firmware with HTT message
- *
- * @param pdev - handle to the HTT instance
- */
 int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev);
 
-/**
- * @brief Client request resource information
- * @details
- *  OL client will reuqest IPA UC related resource information
- *  Resource information will be distributted to IPA module
- *  All of the required resources should be pre-allocated
- *
- * @param pdev - handle to the HTT instance
- * @param ce_sr_base_paddr - copy engine source ring base physical address
- * @param ce_sr_ring_size - copy engine source ring size
- * @param ce_reg_paddr - copy engine register physical address
- * @param tx_comp_ring_base_paddr - tx comp ring base physical address
- * @param tx_comp_ring_size - tx comp ring size
- * @param tx_num_alloc_buffer - number of allocated tx buffer
- * @param rx_rdy_ring_base_paddr - rx ready ring base physical address
- * @param rx_rdy_ring_size - rx ready ring size
- * @param rx_proc_done_idx_paddr - rx process done index physical address
- */
 int
 htt_ipa_uc_get_resource(htt_pdev_handle pdev,
-			uint32_t *ce_sr_base_paddr,
+			cdf_dma_addr_t *ce_sr_base_paddr,
 			uint32_t *ce_sr_ring_size,
 			cdf_dma_addr_t *ce_reg_paddr,
-			uint32_t *tx_comp_ring_base_paddr,
+			cdf_dma_addr_t *tx_comp_ring_base_paddr,
 			uint32_t *tx_comp_ring_size,
 			uint32_t *tx_num_alloc_buffer,
-			uint32_t *rx_rdy_ring_base_paddr,
+			cdf_dma_addr_t *rx_rdy_ring_base_paddr,
 			uint32_t *rx_rdy_ring_size,
-			uint32_t *rx_proc_done_idx_paddr);
+			cdf_dma_addr_t *rx_proc_done_idx_paddr,
+			void **rx_proc_done_idx_vaddr,
+			cdf_dma_addr_t *rx2_rdy_ring_base_paddr,
+			uint32_t *rx2_rdy_ring_size,
+			cdf_dma_addr_t *rx2_proc_done_idx_paddr,
+			void **rx2_proc_done_idx_vaddr);
 
-/**
- * @brief Client set IPA UC doorbell register
- * @details
- *  IPA UC let know doorbell register physical address
- *  WLAN firmware will use this physical address to notify IPA UC
- *
- * @param pdev - handle to the HTT instance
- * @param ipa_uc_tx_doorbell_paddr - tx comp doorbell physical address
- * @param ipa_uc_rx_doorbell_paddr - rx ready doorbell physical address
- */
 int
 htt_ipa_uc_set_doorbell_paddr(htt_pdev_handle pdev,
-			      uint32_t ipa_uc_tx_doorbell_paddr,
-			      uint32_t ipa_uc_rx_doorbell_paddr);
+			      cdf_dma_addr_t ipa_uc_tx_doorbell_paddr,
+			      cdf_dma_addr_t ipa_uc_rx_doorbell_paddr);
 
-/**
- * @brief Client notify IPA UC data path active or not
- *
- * @param pdev - handle to the HTT instance
- * @param uc_active - UC data path is active or not
- * @param is_tx - UC TX is active or not
- */
 int
 htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev, bool uc_active, bool is_tx);
 
-/**
- * @brief query uc data path stats
- *
- * @param pdev - handle to the HTT instance
- */
 int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev);
 
-/**
- * @brief Attach IPA UC data path
- *
- * @param pdev - handle to the HTT instance
- */
 int htt_ipa_uc_attach(struct htt_pdev_t *pdev);
 
+void htt_ipa_uc_detach(struct htt_pdev_t *pdev);
+#else
 /**
- * @brief detach IPA UC data path
+ * htt_h2t_ipa_uc_rsc_cfg_msg() - Send WDI IPA config message to firmware
+ * @pdev: handle to the HTT instance
  *
- * @param pdev - handle to the HTT instance
+ * Return: 0 success
  */
-void htt_ipa_uc_detach(struct htt_pdev_t *pdev);
-#else
 static inline int htt_h2t_ipa_uc_rsc_cfg_msg(struct htt_pdev_t *pdev)
 {
 	return 0;
 }
 
+/**
+ * htt_ipa_uc_get_resource() - Get uc resource from htt and lower layer
+ * @pdev: handle to the HTT instance
+ * @ce_sr_base_paddr: copy engine source ring base physical address
+ * @ce_sr_ring_size: copy engine source ring size
+ * @ce_reg_paddr: copy engine register physical address
+ * @tx_comp_ring_base_paddr: tx comp ring base physical address
+ * @tx_comp_ring_size: tx comp ring size
+ * @tx_num_alloc_buffer: number of allocated tx buffer
+ * @rx_rdy_ring_base_paddr: rx ready ring base physical address
+ * @rx_rdy_ring_size: rx ready ring size
+ * @rx_proc_done_idx_paddr: rx process done index physical address
+ * @rx_proc_done_idx_vaddr: rx process done index virtual address
+ * @rx2_rdy_ring_base_paddr: rx done ring base physical address
+ * @rx2_rdy_ring_size: rx done ring size
+ * @rx2_proc_done_idx_paddr: rx done index physical address
+ * @rx2_proc_done_idx_vaddr: rx done index virtual address
+ *
+ * Return: 0 success
+ */
 static inline int
 htt_ipa_uc_get_resource(htt_pdev_handle pdev,
-			uint32_t *ce_sr_base_paddr,
+			cdf_dma_addr_t *ce_sr_base_paddr,
 			uint32_t *ce_sr_ring_size,
 			cdf_dma_addr_t *ce_reg_paddr,
-			uint32_t *tx_comp_ring_base_paddr,
+			cdf_dma_addr_t *tx_comp_ring_base_paddr,
 			uint32_t *tx_comp_ring_size,
 			uint32_t *tx_num_alloc_buffer,
-			uint32_t *rx_rdy_ring_base_paddr,
+			cdf_dma_addr_t *rx_rdy_ring_base_paddr,
 			uint32_t *rx_rdy_ring_size,
-			uint32_t *rx_proc_done_idx_paddr)
+			cdf_dma_addr_t *rx_proc_done_idx_paddr,
+			void **rx_proc_done_idx_vaddr,
+			cdf_dma_addr_t *rx2_rdy_ring_base_paddr,
+			uint32_t *rx2_rdy_ring_size,
+			cdf_dma_addr_t *rx2_proc_done_idx_paddr,
+			void **rx2_proc_done_idx_vaddr)
 {
 	return 0;
 }
 
+/**
+ * htt_ipa_uc_set_doorbell_paddr() - Propagate IPA doorbell address
+ * @pdev: handle to the HTT instance
+ * @ipa_uc_tx_doorbell_paddr: TX doorbell base physical address
+ * @ipa_uc_rx_doorbell_paddr: RX doorbell base physical address
+ *
+ * Return: 0 success
+ */
 static inline int
 htt_ipa_uc_set_doorbell_paddr(htt_pdev_handle pdev,
 			      uint32_t ipa_uc_tx_doorbell_paddr,
@@ -327,6 +314,14 @@ htt_ipa_uc_set_doorbell_paddr(htt_pdev_handle pdev,
 	return 0;
 }
 
+/**
+ * htt_h2t_ipa_uc_set_active() - Propagate WDI path enable/disable to firmware
+ * @pdev: handle to the HTT instance
+ * @uc_active: WDI UC path enable or not
+ * @is_tx: TX path or RX path
+ *
+ * Return: 0 success
+ */
 static inline int
 htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev, bool uc_active,
 	bool is_tx)
@@ -334,16 +329,34 @@ htt_h2t_ipa_uc_set_active(struct htt_pdev_t *pdev, bool uc_active,
 	return 0;
 }
 
+/**
+ * htt_h2t_ipa_uc_get_stats() - WDI UC state query request to firmware
+ * @pdev: handle to the HTT instance
+ *
+ * Return: 0 success
+ */
 static inline int htt_h2t_ipa_uc_get_stats(struct htt_pdev_t *pdev)
 {
 	return 0;
 }
 
+/**
+ * htt_ipa_uc_attach() - Allocate UC data path resources
+ * @pdev: handle to the HTT instance
+ *
+ * Return: 0 success
+ */
 static inline int htt_ipa_uc_attach(struct htt_pdev_t *pdev)
 {
 	return 0;
 }
 
+/**
+ * htt_ipa_uc_attach() - Remove UC data path resources
+ * @pdev: handle to the HTT instance
+ *
+ * Return: 0 success
+ */
 static inline void htt_ipa_uc_detach(struct htt_pdev_t *pdev)
 {
 	return;

+ 89 - 72
core/dp/ol/inc/ol_txrx_ctrl_api.h

@@ -1090,119 +1090,115 @@ void ol_vdev_rx_set_intrabss_fwd(ol_txrx_vdev_handle vdev, bool val);
 
 
 #ifdef IPA_OFFLOAD
-/**
- * @brief Client request resource information
- * @details
- *  OL client will reuqest IPA UC related resource information
- *  Resource information will be distributted to IPA module
- *  All of the required resources should be pre-allocated
- *
- * @param pdev - handle to the HTT instance
- * @param ce_sr_base_paddr - copy engine source ring base physical address
- * @param ce_sr_ring_size - copy engine source ring size
- * @param ce_reg_paddr - copy engine register physical address
- * @param tx_comp_ring_base_paddr - tx comp ring base physical address
- * @param tx_comp_ring_size - tx comp ring size
- * @param tx_num_alloc_buffer - number of allocated tx buffer
- * @param rx_rdy_ring_base_paddr - rx ready ring base physical address
- * @param rx_rdy_ring_size - rx ready ring size
- * @param rx_proc_done_idx_paddr - rx process done index physical address
- */
 void
 ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev,
-			    uint32_t *ce_sr_base_paddr,
+			    cdf_dma_addr_t *ce_sr_base_paddr,
 			    uint32_t *ce_sr_ring_size,
 			    cdf_dma_addr_t *ce_reg_paddr,
-			    uint32_t *tx_comp_ring_base_paddr,
+			    cdf_dma_addr_t *tx_comp_ring_base_paddr,
 			    uint32_t *tx_comp_ring_size,
 			    uint32_t *tx_num_alloc_buffer,
-			    uint32_t *rx_rdy_ring_base_paddr,
+			    cdf_dma_addr_t *rx_rdy_ring_base_paddr,
 			    uint32_t *rx_rdy_ring_size,
-			    uint32_t *rx_proc_done_idx_paddr);
+			    cdf_dma_addr_t *rx_proc_done_idx_paddr,
+			    void **rx_proc_done_idx_vaddr,
+			    cdf_dma_addr_t *rx2_rdy_ring_base_paddr,
+			    uint32_t *rx2_rdy_ring_size,
+			    cdf_dma_addr_t *rx2_proc_done_idx_paddr,
+			    void **rx2_proc_done_idx_vaddr);
+
 
-/**
- * @brief Client set IPA UC doorbell register
- * @details
- *  IPA UC let know doorbell register physical address
- *  WLAN firmware will use this physical address to notify IPA UC
- *
- * @param pdev - handle to the HTT instance
- * @param ipa_uc_tx_doorbell_paddr - tx comp doorbell physical address
- * @param ipa_uc_rx_doorbell_paddr - rx ready doorbell physical address
- */
 void
 ol_txrx_ipa_uc_set_doorbell_paddr(ol_txrx_pdev_handle pdev,
-				  uint32_t ipa_tx_uc_doorbell_paddr,
-				  uint32_t ipa_rx_uc_doorbell_paddr);
+				  cdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
+				  cdf_dma_addr_t ipa_rx_uc_doorbell_paddr);
 
-/**
- * @brief Client notify IPA UC data path active or not
- *
- * @param pdev - handle to the HTT instance
- * @param uc_active - UC data path is active or not
- * @param is_tx - UC TX is active or not
- */
 void
 ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev, bool uc_active, bool is_tx);
 
-/**
- * @brief Offload data path activation notificaiton
- * @details
- *  Firmware notification handler for offload datapath activity
- *
- * @param pdev - handle to the HTT instance
- * @param op_code - activated for tx or rx data patrh
- */
 void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg);
 
-/**
- * @brief callback function registration
- * @details
- *  OSIF layer callback function registration API
- *  OSIF layer will register firmware offload datapath activity
- *  notification callback
- *
- * @param pdev - handle to the HTT instance
- * @param ipa_uc_op_cb_type - callback function pointer should be registered
- * @param osif_dev - osif instance pointer
- */
 void ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev,
 				   void (*ipa_uc_op_cb_type)(uint8_t *op_msg,
 							     void *osif_ctxt),
 				   void *osif_dev);
 
+void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev);
+#else
 /**
- * @brief query uc data path stats
- * @details
- *  Query uc data path stats from firmware
+ * ol_txrx_ipa_uc_get_resource() - Client request resource information
+ * @pdev: handle to the HTT instance
+ * @ce_sr_base_paddr: copy engine source ring base physical address
+ * @ce_sr_ring_size: copy engine source ring size
+ * @ce_reg_paddr: copy engine register physical address
+ * @tx_comp_ring_base_paddr: tx comp ring base physical address
+ * @tx_comp_ring_size: tx comp ring size
+ * @tx_num_alloc_buffer: number of allocated tx buffer
+ * @rx_rdy_ring_base_paddr: rx ready ring base physical address
+ * @rx_rdy_ring_size: rx ready ring size
+ * @rx_proc_done_idx_paddr: rx process done index physical address
+ * @rx_proc_done_idx_vaddr: rx process done index virtual address
+ * @rx2_rdy_ring_base_paddr: rx done ring base physical address
+ * @rx2_rdy_ring_size: rx done ring size
+ * @rx2_proc_done_idx_paddr: rx done index physical address
+ * @rx2_proc_done_idx_vaddr: rx done index virtual address
  *
- * @param pdev - handle to the HTT instance
+ *  OL client will reuqest IPA UC related resource information
+ *  Resource information will be distributted to IPA module
+ *  All of the required resources should be pre-allocated
+ *
+ * Return: none
  */
-void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev);
-#else
 static inline void
 ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev,
-			    uint32_t *ce_sr_base_paddr,
+			    cdf_dma_addr_t *ce_sr_base_paddr,
 			    uint32_t *ce_sr_ring_size,
 			    cdf_dma_addr_t *ce_reg_paddr,
-			    uint32_t *tx_comp_ring_base_paddr,
+			    cdf_dma_addr_t *tx_comp_ring_base_paddr,
 			    uint32_t *tx_comp_ring_size,
 			    uint32_t *tx_num_alloc_buffer,
-			    uint32_t *rx_rdy_ring_base_paddr,
+			    cdf_dma_addr_t *rx_rdy_ring_base_paddr,
 			    uint32_t *rx_rdy_ring_size,
-			    uint32_t *rx_proc_done_idx_paddr)
+			    cdf_dma_addr_t *rx_proc_done_idx_paddr,
+			    void **rx_proc_done_idx_vaddr,
+			    cdf_dma_addr_t *rx2_rdy_ring_base_paddr,
+			    uint32_t *rx2_rdy_ring_size,
+			    cdf_dma_addr_t *rx2_proc_done_idx_paddr,
+			    void **rx2_proc_done_idx_vaddr)
 {
 	return;
 }
 
+/**
+ * ol_txrx_ipa_uc_set_doorbell_paddr() - Client set IPA UC doorbell register
+ * @pdev: handle to the HTT instance
+ * @ipa_uc_tx_doorbell_paddr: tx comp doorbell physical address
+ * @ipa_uc_rx_doorbell_paddr: rx ready doorbell physical address
+ *
+ *  IPA UC let know doorbell register physical address
+ *  WLAN firmware will use this physical address to notify IPA UC
+ *
+ * Return: none
+ */
 static inline void
 ol_txrx_ipa_uc_set_doorbell_paddr(ol_txrx_pdev_handle pdev,
-				  uint32_t ipa_tx_uc_doorbell_paddr,
-				  uint32_t ipa_rx_uc_doorbell_paddr)
+				  cdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
+				  cdf_dma_addr_t ipa_rx_uc_doorbell_paddr)
 {
 	return;
 }
 
+/**
+ * ol_txrx_ipa_uc_set_active() - Client notify IPA UC data path active or not
+ * @pdev: handle to the HTT instance
+ * @ipa_uc_tx_doorbell_paddr: tx comp doorbell physical address
+ * @ipa_uc_rx_doorbell_paddr: rx ready doorbell physical address
+ *
+ *  IPA UC let know doorbell register physical address
+ *  WLAN firmware will use this physical address to notify IPA UC
+ *
+ * Return: none
+ */
 static inline void
 ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev,
 	bool uc_active, bool is_tx)
@@ -1210,12 +1206,27 @@ ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev,
 	return;
 }
 
+/**
+ * ol_txrx_ipa_uc_op_response() - Handle OP command response from firmware
+ * @pdev: handle to the HTT instance
+ * @op_msg: op response message from firmware
+ *
+ * Return: none
+ */
 static inline void
 ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg)
 {
 	return;
 }
 
+/**
+ * ol_txrx_ipa_uc_register_op_cb() - Register OP handler function
+ * @pdev: handle to the HTT instance
+ * @op_cb: handler function pointer
+ * @osif_dev: register client context
+ *
+ * Return: none
+ */
 static inline void
 ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev,
 				   void (*ipa_uc_op_cb_type)(uint8_t *op_msg,
@@ -1225,6 +1236,12 @@ ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev,
 	return;
 }
 
+/**
+ * ol_txrx_ipa_uc_get_stat() - Get firmware wdi status
+ * @pdev: handle to the HTT instance
+ *
+ * Return: none
+ */
 static inline void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev)
 {
 	return;

+ 83 - 8
core/dp/txrx/ol_txrx.c

@@ -2585,17 +2585,46 @@ inline void ol_txrx_flow_control_cb(ol_txrx_vdev_handle vdev,
 #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
 
 #ifdef IPA_OFFLOAD
+/**
+ * ol_txrx_ipa_uc_get_resource() - Client request resource information
+ * @pdev: handle to the HTT instance
+ * @ce_sr_base_paddr: copy engine source ring base physical address
+ * @ce_sr_ring_size: copy engine source ring size
+ * @ce_reg_paddr: copy engine register physical address
+ * @tx_comp_ring_base_paddr: tx comp ring base physical address
+ * @tx_comp_ring_size: tx comp ring size
+ * @tx_num_alloc_buffer: number of allocated tx buffer
+ * @rx_rdy_ring_base_paddr: rx ready ring base physical address
+ * @rx_rdy_ring_size: rx ready ring size
+ * @rx_proc_done_idx_paddr: rx process done index physical address
+ * @rx_proc_done_idx_vaddr: rx process done index virtual address
+ * @rx2_rdy_ring_base_paddr: rx done ring base physical address
+ * @rx2_rdy_ring_size: rx done ring size
+ * @rx2_proc_done_idx_paddr: rx done index physical address
+ * @rx2_proc_done_idx_vaddr: rx done index virtual address
+ *
+ *  OL client will reuqest IPA UC related resource information
+ *  Resource information will be distributted to IPA module
+ *  All of the required resources should be pre-allocated
+ *
+ * Return: none
+ */
 void
 ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev,
-			    uint32_t *ce_sr_base_paddr,
+			    cdf_dma_addr_t *ce_sr_base_paddr,
 			    uint32_t *ce_sr_ring_size,
 			    cdf_dma_addr_t *ce_reg_paddr,
-			    uint32_t *tx_comp_ring_base_paddr,
+			    cdf_dma_addr_t *tx_comp_ring_base_paddr,
 			    uint32_t *tx_comp_ring_size,
 			    uint32_t *tx_num_alloc_buffer,
-			    uint32_t *rx_rdy_ring_base_paddr,
+			    cdf_dma_addr_t *rx_rdy_ring_base_paddr,
 			    uint32_t *rx_rdy_ring_size,
-			    uint32_t *rx_proc_done_idx_paddr)
+			    cdf_dma_addr_t *rx_proc_done_idx_paddr,
+			    void **rx_proc_done_idx_vaddr,
+			    cdf_dma_addr_t *rx2_rdy_ring_base_paddr,
+			    uint32_t *rx2_rdy_ring_size,
+			    cdf_dma_addr_t *rx2_proc_done_idx2_paddr,
+			    void **rx2_proc_done_idx2_vaddr)
 {
 	htt_ipa_uc_get_resource(pdev->htt_pdev,
 				ce_sr_base_paddr,
@@ -2605,19 +2634,45 @@ ol_txrx_ipa_uc_get_resource(ol_txrx_pdev_handle pdev,
 				tx_comp_ring_size,
 				tx_num_alloc_buffer,
 				rx_rdy_ring_base_paddr,
-				rx_rdy_ring_size, rx_proc_done_idx_paddr);
+				rx_rdy_ring_size, rx_proc_done_idx_paddr,
+				rx_proc_done_idx_vaddr,
+				rx2_rdy_ring_base_paddr,
+				rx2_rdy_ring_size, rx2_proc_done_idx2_paddr,
+				rx2_proc_done_idx2_vaddr);
 }
 
+/**
+ * ol_txrx_ipa_uc_set_doorbell_paddr() - Client set IPA UC doorbell register
+ * @pdev: handle to the HTT instance
+ * @ipa_uc_tx_doorbell_paddr: tx comp doorbell physical address
+ * @ipa_uc_rx_doorbell_paddr: rx ready doorbell physical address
+ *
+ *  IPA UC let know doorbell register physical address
+ *  WLAN firmware will use this physical address to notify IPA UC
+ *
+ * Return: none
+ */
 void
 ol_txrx_ipa_uc_set_doorbell_paddr(ol_txrx_pdev_handle pdev,
-				  uint32_t ipa_tx_uc_doorbell_paddr,
-				  uint32_t ipa_rx_uc_doorbell_paddr)
+				  cdf_dma_addr_t ipa_tx_uc_doorbell_paddr,
+				  cdf_dma_addr_t ipa_rx_uc_doorbell_paddr)
 {
 	htt_ipa_uc_set_doorbell_paddr(pdev->htt_pdev,
 				      ipa_tx_uc_doorbell_paddr,
 				      ipa_rx_uc_doorbell_paddr);
 }
 
+/**
+ * ol_txrx_ipa_uc_set_active() - Client notify IPA UC data path active or not
+ * @pdev: handle to the HTT instance
+ * @ipa_uc_tx_doorbell_paddr: tx comp doorbell physical address
+ * @ipa_uc_rx_doorbell_paddr: rx ready doorbell physical address
+ *
+ *  IPA UC let know doorbell register physical address
+ *  WLAN firmware will use this physical address to notify IPA UC
+ *
+ * Return: none
+ */
 void
 ol_txrx_ipa_uc_set_active(ol_txrx_pdev_handle pdev, bool uc_active, bool is_tx)
 {
@@ -2651,7 +2706,13 @@ void ol_txrx_ipa_uc_fw_op_event_handler(void *context,
 			      "%s: ipa_uc_op_cb NULL", __func__);
 }
 
-
+/**
+ * ol_txrx_ipa_uc_op_response() - Handle OP command response from firmware
+ * @pdev: handle to the HTT instance
+ * @op_msg: op response message from firmware
+ *
+ * Return: none
+ */
 void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg)
 {
 	p_cds_sched_context sched_ctx = get_cds_sched_ctxt();
@@ -2674,6 +2735,14 @@ void ol_txrx_ipa_uc_op_response(ol_txrx_pdev_handle pdev, uint8_t *op_msg)
 	cds_indicate_rxpkt(sched_ctx, pkt);
 }
 
+/**
+ * ol_txrx_ipa_uc_register_op_cb() - Register OP handler function
+ * @pdev: handle to the HTT instance
+ * @op_cb: handler function pointer
+ * @osif_dev: register client context
+ *
+ * Return: none
+ */
 void ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev,
 				   ipa_uc_op_cb_type op_cb, void *osif_dev)
 {
@@ -2681,6 +2750,12 @@ void ol_txrx_ipa_uc_register_op_cb(ol_txrx_pdev_handle pdev,
 	pdev->osif_dev = osif_dev;
 }
 
+/**
+ * ol_txrx_ipa_uc_get_stat() - Get firmware wdi status
+ * @pdev: handle to the HTT instance
+ *
+ * Return: none
+ */
 void ol_txrx_ipa_uc_get_stat(ol_txrx_pdev_handle pdev)
 {
 	htt_h2t_ipa_uc_get_stats(pdev->htt_pdev);

+ 15 - 7
core/hif/inc/hif.h

@@ -535,18 +535,26 @@ void hif_enable_fastpath(struct ol_softc *hif_dev);
 #endif
 
 #ifdef IPA_OFFLOAD
-/*
- * IPA micro controller data path offload feature enabled,
- * HIF should release copy engine related resource information to IPA UC
- * IPA UC will access hardware resource with released information
- */
 void hif_ipa_get_ce_resource(struct ol_softc *scn,
-			     uint32_t *ce_sr_base_paddr,
+			     cdf_dma_addr_t *ce_sr_base_paddr,
 			     uint32_t *ce_sr_ring_size,
 			     cdf_dma_addr_t *ce_reg_paddr);
 #else
+/**
+ * hif_ipa_get_ce_resource() - get uc resource on hif
+ * @scn: bus context
+ * @ce_sr_base_paddr: copyengine source ring base physical address
+ * @ce_sr_ring_size: copyengine source ring size
+ * @ce_reg_paddr: copyengine register physical address
+ *
+ * IPA micro controller data path offload feature enabled,
+ * HIF should release copy engine related resource information to IPA UC
+ * IPA UC will access hardware resource with released information
+ *
+ * Return: None
+ */
 static inline void hif_ipa_get_ce_resource(struct ol_softc *scn,
-			     uint32_t *ce_sr_base_paddr,
+			     cdf_dma_addr_t *ce_sr_base_paddr,
 			     uint32_t *ce_sr_ring_size,
 			     cdf_dma_addr_t *ce_reg_paddr)
 {

+ 17 - 9
core/hif/src/ce/ce_api.h

@@ -430,20 +430,28 @@ struct ce_sendlist {
 #define ATH_ISR_NOTMINE  0x0002  /* for shared IRQ's */
 
 #ifdef IPA_OFFLOAD
-/*
- * Copy engine should release resource to micro controller
- * Micro controller needs
-   - Copy engine source descriptor base address
-   - Copy engine source descriptor size
-   - PCI BAR address to access copy engine regiser
- */
 void ce_ipa_get_resource(struct CE_handle *ce,
-			 uint32_t *ce_sr_base_paddr,
+			 cdf_dma_addr_t *ce_sr_base_paddr,
 			 uint32_t *ce_sr_ring_size,
 			 cdf_dma_addr_t *ce_reg_paddr);
 #else
+/**
+ * ce_ipa_get_resource() - get uc resource on copyengine
+ * @ce: copyengine context
+ * @ce_sr_base_paddr: copyengine source ring base physical address
+ * @ce_sr_ring_size: copyengine source ring size
+ * @ce_reg_paddr: copyengine register physical address
+ *
+ * Copy engine should release resource to micro controller
+ * Micro controller needs
+ *  - Copy engine source descriptor base address
+ *  - Copy engine source descriptor size
+ *  - PCI BAR address to access copy engine regiser
+ *
+ * Return: None
+ */
 static inline void ce_ipa_get_resource(struct CE_handle *ce,
-			 uint32_t *ce_sr_base_paddr,
+			 cdf_dma_addr_t *ce_sr_base_paddr,
 			 uint32_t *ce_sr_ring_size,
 			 cdf_dma_addr_t *ce_reg_paddr)
 {

+ 14 - 1
core/hif/src/ce/ce_main.c

@@ -2025,8 +2025,21 @@ err:
 
 
 #ifdef IPA_OFFLOAD
+/**
+ * hif_ipa_get_ce_resource() - get uc resource on hif
+ * @scn: bus context
+ * @ce_sr_base_paddr: copyengine source ring base physical address
+ * @ce_sr_ring_size: copyengine source ring size
+ * @ce_reg_paddr: copyengine register physical address
+ *
+ * IPA micro controller data path offload feature enabled,
+ * HIF should release copy engine related resource information to IPA UC
+ * IPA UC will access hardware resource with released information
+ *
+ * Return: None
+ */
 void hif_ipa_get_ce_resource(struct ol_softc *scn,
-			     uint32_t *ce_sr_base_paddr,
+			     cdf_dma_addr_t *ce_sr_base_paddr,
 			     uint32_t *ce_sr_ring_size,
 			     cdf_dma_addr_t *ce_reg_paddr)
 {

+ 16 - 7
core/hif/src/ce/ce_service.c

@@ -1654,15 +1654,23 @@ void ce_enable_msi(struct ol_softc *scn, unsigned int CE_id,
 }
 
 #ifdef IPA_OFFLOAD
-/*
+/**
+ * ce_ipa_get_resource() - get uc resource on copyengine
+ * @ce: copyengine context
+ * @ce_sr_base_paddr: copyengine source ring base physical address
+ * @ce_sr_ring_size: copyengine source ring size
+ * @ce_reg_paddr: copyengine register physical address
+ *
  * Copy engine should release resource to micro controller
  * Micro controller needs
-   - Copy engine source descriptor base address
-   - Copy engine source descriptor size
-   - PCI BAR address to access copy engine regiser
+ *  - Copy engine source descriptor base address
+ *  - Copy engine source descriptor size
+ *  - PCI BAR address to access copy engine regiser
+ *
+ * Return: None
  */
 void ce_ipa_get_resource(struct CE_handle *ce,
-			 uint32_t *ce_sr_base_paddr,
+			 cdf_dma_addr_t *ce_sr_base_paddr,
 			 uint32_t *ce_sr_ring_size,
 			 cdf_dma_addr_t *ce_reg_paddr)
 {
@@ -1690,8 +1698,9 @@ void ce_ipa_get_resource(struct CE_handle *ce,
 	/* Get BAR address */
 	hif_read_phy_mem_base(CE_state->scn, &phy_mem_base);
 
-	*ce_sr_base_paddr = (uint32_t) CE_state->src_ring->base_addr_CE_space;
-	*ce_sr_ring_size = (uint32_t) CE_state->src_ring->nentries;
+	*ce_sr_base_paddr = CE_state->src_ring->base_addr_CE_space;
+	*ce_sr_ring_size = (uint32_t) (CE_state->src_ring->nentries *
+		sizeof(struct CE_src_desc));
 	*ce_reg_paddr = phy_mem_base + CE_BASE_ADDRESS(CE_state->id) +
 			SR_WR_INDEX_ADDRESS;
 	return;

+ 10 - 1
core/htc/htc.c

@@ -801,8 +801,17 @@ void htc_cancel_deferred_target_sleep(void *context)
 }
 
 #ifdef IPA_OFFLOAD
+/**
+ * htc_ipa_get_ce_resource() - get uc resource on lower layer
+ * @htc_handle: htc context
+ * @ce_sr_base_paddr: copyengine source ring base physical address
+ * @ce_sr_ring_size: copyengine source ring size
+ * @ce_reg_paddr: copyengine register physical address
+ *
+ * Return: None
+ */
 void htc_ipa_get_ce_resource(HTC_HANDLE htc_handle,
-			     uint32_t *ce_sr_base_paddr,
+			     cdf_dma_addr_t *ce_sr_base_paddr,
 			     uint32_t *ce_sr_ring_size,
 			     cdf_dma_addr_t *ce_reg_paddr)
 {

+ 1 - 1
core/htc/htc_api.h

@@ -700,7 +700,7 @@ void htc_disable_aspm(void);
 
 #ifdef IPA_OFFLOAD
 void htc_ipa_get_ce_resource(HTC_HANDLE htc_handle,
-			     uint32_t *ce_sr_base_paddr,
+			     cdf_dma_addr_t *ce_sr_base_paddr,
 			     uint32_t *ce_sr_ring_size,
 			     cdf_dma_addr_t *ce_reg_paddr);
 #else