Browse Source

qcacmn: Support for WDI3.0 in the Unified WDI APIs

Add support for WDI3.0 in the Unified WDI APIs.

Change-Id: Ic2bd68791e68b8bac5c948839f0258adb7d3f4b9
CRs-Fixed: 2183519
Mohit Khanna 7 years ago
parent
commit
f83015ce04
4 changed files with 735 additions and 367 deletions
  1. 441 102
      dp/wifi3.0/dp_ipa.c
  2. 15 3
      dp/wifi3.0/dp_ipa.h
  3. 155 138
      qdf/inc/qdf_ipa_wdi3.h
  4. 124 124
      qdf/linux/src/i_qdf_ipa_wdi3.h

+ 441 - 102
dp/wifi3.0/dp_ipa.c

@@ -545,6 +545,29 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_pdev *ppdev)
 /* This should be configurable per H/W configuration enable status */
 #define L3_HEADER_PADDING	2
 
+#ifdef CONFIG_IPA_WDI_UNIFIED_API
+
+#ifndef QCA_LL_TX_FLOW_CONTROL_V2
+static inline void dp_setup_mcc_sys_pipes(
+		qdf_ipa_sys_connect_params_t *sys_in,
+		qdf_ipa_wdi_conn_in_params_t *pipe_in)
+{
+	/* Setup MCC sys pipe */
+	QDF_IPA_WDI_CONN_IN_PARAMS_NUM_SYS_PIPE_NEEDED(pipe_in) =
+			DP_IPA_MAX_IFACE;
+	for (int i = 0; i < DP_IPA_MAX_IFACE; i++)
+		memcpy(&QDF_IPA_WDI_CONN_IN_PARAMS_SYS_IN(pipe_in)[i],
+		       &sys_in[i], sizeof(qdf_ipa_sys_connect_params_t));
+}
+#else
+static inline void dp_setup_mcc_sys_pipes(
+		qdf_ipa_sys_connect_params_t *sys_in,
+		qdf_ipa_wdi_conn_in_params_t *pipe_in)
+{
+	QDF_IPA_WDI_CONN_IN_PARAMS_NUM_SYS_PIPE_NEEDED(pipe_in) = 0;
+}
+#endif
+
 /**
  * dp_ipa_setup() - Setup and connect IPA pipes
  * @ppdev - handle to the device instance
@@ -556,6 +579,8 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_pdev *ppdev)
  * @is_rm_enabled: Is IPA RM enabled or not
  * @tx_pipe_handle: pointer to Tx pipe handle
  * @rx_pipe_handle: pointer to Rx pipe handle
+ * @is_smmu_enabled: Is SMMU enabled or not
+ * @sys_in: parameters to setup sys pipe in mcc mode
  *
  * Return: QDF_STATUS
  */
@@ -563,103 +588,158 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 			void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
 			uint32_t ipa_desc_size, void *ipa_priv,
 			bool is_rm_enabled, uint32_t *tx_pipe_handle,
-			uint32_t *rx_pipe_handle)
+			uint32_t *rx_pipe_handle, bool is_smmu_enabled,
+			qdf_ipa_sys_connect_params_t *sys_in)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)ppdev;
 	struct dp_soc *soc = pdev->soc;
 	struct dp_ipa_resources *ipa_res = &pdev->ipa_resource;
-	qdf_ipa_wdi3_setup_info_t *tx;
-	qdf_ipa_wdi3_setup_info_t *rx;
-	qdf_ipa_wdi3_conn_in_params_t pipe_in;
-	qdf_ipa_wdi3_conn_out_params_t pipe_out;
+	qdf_ipa_ep_cfg_t *tx_cfg;
+	qdf_ipa_ep_cfg_t *rx_cfg;
+	qdf_ipa_wdi_pipe_setup_info_t *tx;
+	qdf_ipa_wdi_pipe_setup_info_t *rx;
+	qdf_ipa_wdi_pipe_setup_info_smmu_t *tx_smmu;
+	qdf_ipa_wdi_pipe_setup_info_smmu_t *rx_smmu;
+	qdf_ipa_wdi_conn_in_params_t pipe_in;
+	qdf_ipa_wdi_conn_out_params_t pipe_out;
 	struct tcl_data_cmd *tcl_desc_ptr;
 	uint8_t *desc_addr;
 	uint32_t desc_size;
 	int ret;
 
-	qdf_mem_zero(&tx, sizeof(struct ipa_wdi3_setup_info));
-	qdf_mem_zero(&rx, sizeof(struct ipa_wdi3_setup_info));
+	qdf_mem_zero(&tx, sizeof(qdf_ipa_wdi_pipe_setup_info_t));
+	qdf_mem_zero(&rx, sizeof(qdf_ipa_wdi_pipe_setup_info_t));
 	qdf_mem_zero(&pipe_in, sizeof(pipe_in));
 	qdf_mem_zero(&pipe_out, sizeof(pipe_out));
 
+	if (is_smmu_enabled)
+		QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(&pipe_in) = true;
+	else
+		QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(&pipe_in) = false;
+
+	dp_setup_mcc_sys_pipes(sys_in, &pipe_in);
+
 	/* TX PIPE */
+	if (QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(&pipe_in)) {
+		tx_smmu = &QDF_IPA_WDI_CONN_IN_PARAMS_TX_SMMU(&pipe_in);
+		tx_cfg = &QDF_IPA_WDI_SETUP_INFO_SMMU_EP_CFG(tx_smmu);
+	} else {
+		tx = &QDF_IPA_WDI_CONN_IN_PARAMS_TX(&pipe_in);
+		tx_cfg = &QDF_IPA_WDI_SETUP_INFO_EP_CFG(tx);
+	}
+
+	QDF_IPA_EP_CFG_NAT_EN(tx_cfg) = IPA_BYPASS_NAT;
+	QDF_IPA_EP_CFG_HDR_LEN(tx_cfg) = DP_IPA_UC_WLAN_TX_HDR_LEN;
+	QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE_VALID(tx_cfg) = 0;
+	QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE(tx_cfg) = 0;
+	QDF_IPA_EP_CFG_HDR_ADDITIONAL_CONST_LEN(tx_cfg) = 0;
+	QDF_IPA_EP_CFG_MODE(tx_cfg) = IPA_BASIC;
+	QDF_IPA_EP_CFG_HDR_LITTLE_ENDIAN(tx_cfg) = true;
+
 	/**
 	 * Transfer Ring: WBM Ring
 	 * Transfer Ring Doorbell PA: WBM Tail Pointer Address
 	 * Event Ring: TCL ring
 	 * Event Ring Doorbell PA: TCL Head Pointer Address
 	 */
-	tx = &QDF_IPA_WDI3_CONN_IN_PARAMS_TX(&pipe_in);
-	QDF_IPA_WDI3_SETUP_INFO_NAT_EN(tx) = IPA_BYPASS_NAT;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_LEN(tx) = DP_IPA_UC_WLAN_TX_HDR_LEN;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_OFST_PKT_SIZE_VALID(tx) = 0;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_OFST_PKT_SIZE(tx) = 0;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_ADDITIONAL_CONST_LEN(tx) = 0;
-	QDF_IPA_WDI3_SETUP_INFO_MODE(tx) = IPA_BASIC;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_LITTLE_ENDIAN(tx) = true;
-	QDF_IPA_WDI3_SETUP_INFO_CLIENT(tx) = IPA_CLIENT_WLAN1_CONS;
-	QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_BASE_PA(tx) =
+	if (QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(&pipe_in)) {
+		/* TODO: SMMU implementation on WDI3 */
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			  "%s: SMMU is not implementation on host", __func__);
+			return QDF_STATUS_E_FAILURE;
+	}
+
+	QDF_IPA_WDI_SETUP_INFO_CLIENT(tx) = IPA_CLIENT_WLAN1_CONS;
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(tx) =
 		ipa_res->tx_comp_ring_base_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_SIZE(tx) =
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(tx) =
 		ipa_res->tx_comp_ring_size;
 	/* WBM Tail Pointer Address */
-	QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(tx) =
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(tx) =
 		soc->ipa_uc_tx_rsc.ipa_wbm_tp_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_BASE_PA(tx) =
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(tx) =
 		ipa_res->tx_ring_base_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_SIZE(tx) = ipa_res->tx_ring_size;
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(tx) =
+		ipa_res->tx_ring_size;
 	/* TCL Head Pointer Address */
-	QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx) =
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx) =
 		soc->ipa_uc_tx_rsc.ipa_tcl_hp_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(tx) =
+	QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(tx) =
 		ipa_res->tx_num_alloc_buffer;
-	QDF_IPA_WDI3_SETUP_INFO_PKT_OFFSET(tx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(tx) = 0;
 
 	/* Preprogram TCL descriptor */
 	desc_addr =
-		(uint8_t *)QDF_IPA_WDI3_SETUP_INFO_DESC_FORMAT_TEMPLATE(tx);
+		(uint8_t *)QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(tx);
 	desc_size = sizeof(struct tcl_data_cmd);
 	HAL_TX_DESC_SET_TLV_HDR(desc_addr, HAL_TX_TCL_DATA_TAG, desc_size);
 	tcl_desc_ptr = (struct tcl_data_cmd *)
-		(QDF_IPA_WDI3_SETUP_INFO_DESC_FORMAT_TEMPLATE(tx) + 1);
+		(QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(tx) + 1);
 	tcl_desc_ptr->buf_addr_info.return_buffer_manager =
-						HAL_RX_BUF_RBM_SW2_BM;
+		HAL_RX_BUF_RBM_SW2_BM;
 	tcl_desc_ptr->addrx_en = 1;	/* Address X search enable in ASE */
 	tcl_desc_ptr->encap_type = HAL_TX_ENCAP_TYPE_ETHERNET;
 	tcl_desc_ptr->packet_offset = 2;	/* padding for alignment */
 
+
 	/* RX PIPE */
+	if (QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(&pipe_in)) {
+		rx_smmu = &QDF_IPA_WDI_CONN_IN_PARAMS_RX_SMMU(&pipe_in);
+		rx_cfg = &QDF_IPA_WDI_SETUP_INFO_SMMU_EP_CFG(rx_smmu);
+	} else {
+		rx = &QDF_IPA_WDI_CONN_IN_PARAMS_RX(&pipe_in);
+		rx_cfg = &QDF_IPA_WDI_SETUP_INFO_EP_CFG(rx);
+	}
+
+	QDF_IPA_EP_CFG_NAT_EN(rx_cfg) = IPA_BYPASS_NAT;
+	QDF_IPA_EP_CFG_HDR_LEN(rx_cfg) = DP_IPA_UC_WLAN_RX_HDR_LEN;
+	QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE_VALID(rx_cfg) = 1;
+	QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE(rx_cfg) = 0;
+	QDF_IPA_EP_CFG_HDR_ADDITIONAL_CONST_LEN(rx_cfg) = 0;
+	QDF_IPA_EP_CFG_HDR_OFST_METADATA_VALID(rx_cfg) = 0;
+	QDF_IPA_EP_CFG_HDR_METADATA_REG_VALID(rx_cfg) = 1;
+	QDF_IPA_EP_CFG_MODE(rx_cfg) = IPA_BASIC;
+	QDF_IPA_EP_CFG_HDR_LITTLE_ENDIAN(rx_cfg) = true;
+
 	/**
 	 * Transfer Ring: REO Ring
 	 * Transfer Ring Doorbell PA: REO Tail Pointer Address
 	 * Event Ring: FW ring
 	 * Event Ring Doorbell PA: FW Head Pointer Address
 	 */
-	rx = &QDF_IPA_WDI3_CONN_IN_PARAMS_RX(&pipe_in);
-	QDF_IPA_WDI3_SETUP_INFO_NAT_EN(rx) = IPA_BYPASS_NAT;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_LEN(rx) = DP_IPA_UC_WLAN_TX_HDR_LEN;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_OFST_METADATA_VALID(rx) = 0;
-	QDF_IPA_WDI3_SETUP_INFO_HDR_METADATA_REG_VALID(rx) = 1;
-	QDF_IPA_WDI3_SETUP_INFO_MODE(rx) = IPA_BASIC;
-	QDF_IPA_WDI3_SETUP_INFO_CLIENT(rx) = IPA_CLIENT_WLAN1_PROD;
-	QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_BASE_PA(rx) = ipa_res->rx_rdy_ring_base_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_SIZE(rx) = ipa_res->rx_rdy_ring_size;
-	QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(rx) = /* REO Tail Pointer Address */
-		soc->ipa_uc_rx_rsc.ipa_reo_tp_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_BASE_PA(rx) = ipa_res->rx_refill_ring_base_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_SIZE(rx) = ipa_res->rx_refill_ring_size;
-	QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(rx) = /* FW Head Pointer Address */
-		soc->ipa_uc_rx_rsc.ipa_rx_refill_buf_hp_paddr;
-	QDF_IPA_WDI3_SETUP_INFO_PKT_OFFSET(rx) = RX_PKT_TLVS_LEN + L3_HEADER_PADDING;
-
-	QDF_IPA_WDI3_CONN_IN_PARAMS_NOTIFY(&pipe_in) = ipa_w2i_cb;
-	QDF_IPA_WDI3_CONN_IN_PARAMS_PRIV(&pipe_in) = ipa_priv;
+	if (QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(&pipe_in)) {
+		/* TODO: SMMU implementation on WDI3 */
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			  "%s: SMMU is not implementation on host", __func__);
+			return QDF_STATUS_E_FAILURE;
+	} else {
+		QDF_IPA_WDI_SETUP_INFO_CLIENT(rx) = IPA_CLIENT_WLAN1_PROD;
+		QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(rx) =
+			ipa_res->rx_rdy_ring_base_paddr;
+		QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(rx) =
+			ipa_res->rx_rdy_ring_size;
+		QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(rx) =
+			/* REO Tail Pointer Address */
+			soc->ipa_uc_rx_rsc.ipa_reo_tp_paddr;
+		QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(rx) =
+			ipa_res->rx_refill_ring_base_paddr;
+		QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(rx) =
+			ipa_res->rx_refill_ring_size;
+		QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(rx) =
+			/* FW Head Pointer Address */
+			soc->ipa_uc_rx_rsc.ipa_rx_refill_buf_hp_paddr;
+		QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(rx) =
+			RX_PKT_TLVS_LEN + L3_HEADER_PADDING;
+	}
+
+	QDF_IPA_WDI_CONN_IN_PARAMS_NOTIFY(&pipe_in) = ipa_w2i_cb;
+	QDF_IPA_WDI_CONN_IN_PARAMS_PRIV(&pipe_in) = ipa_priv;
 
 	/* Connect WDI IPA PIPE */
-	ret = qdf_ipa_wdi3_conn_pipes(&pipe_in, &pipe_out);
+	ret = qdf_ipa_wdi_conn_pipes(&pipe_in, &pipe_out);
 	if (ret) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			  "%s: ipa_wdi3_conn_pipes: IPA pipe setup failed: ret=%d",
+			  "%s: ipa_wdi_conn_pipes: IPA pipe setup failed: ret=%d",
 			  __func__, ret);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -668,33 +748,31 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
 		  "%s: Tx DB PA=0x%x, Rx DB PA=0x%x",
 		  __func__,
-		(unsigned int)QDF_IPA_WDI3_CONN_OUT_PARAMS_TX_UC_DB_PA(&pipe_out),
-		(unsigned int)QDF_IPA_WDI3_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out));
+		  (unsigned int)QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(&pipe_out),
+		  (unsigned int)QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out));
 
 	ipa_res->tx_comp_doorbell_paddr =
-		QDF_IPA_WDI3_CONN_OUT_PARAMS_TX_UC_DB_PA(&pipe_out);
-	ipa_res->tx_comp_doorbell_vaddr =
-		QDF_IPA_WDI3_CONN_OUT_PARAMS_TX_UC_DB_VA(&pipe_out);
+		QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(&pipe_out);
 	ipa_res->rx_ready_doorbell_paddr =
-		QDF_IPA_WDI3_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out);
+		QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out);
 
 	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
 		  "%s: Tx: %s=%pK, %s=%d, %s=%pK, %s=%pK, %s=%d, %s=%pK, %s=%d, %s=%pK",
 		  __func__,
 		  "transfer_ring_base_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_BASE_PA(tx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(tx),
 		  "transfer_ring_size",
-		  QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_SIZE(tx),
+		  QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(tx),
 		  "transfer_ring_doorbell_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(tx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(tx),
 		  "event_ring_base_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_BASE_PA(tx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(tx),
 		  "event_ring_size",
-		  QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_SIZE(tx),
+		  QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(tx),
 		  "event_ring_doorbell_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx),
 		  "num_pkt_buffers",
-		  QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(tx),
+		  QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(tx),
 		  "tx_comp_doorbell_paddr",
 		  (void *)ipa_res->tx_comp_doorbell_paddr);
 
@@ -702,19 +780,19 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 		  "%s: Rx: %s=%pK, %s=%d, %s=%pK, %s=%pK, %s=%d, %s=%pK, %s=%d, %s=%pK",
 		  __func__,
 		  "transfer_ring_base_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_BASE_PA(rx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(rx),
 		  "transfer_ring_size",
-		  QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_SIZE(rx),
+		  QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(rx),
 		  "transfer_ring_doorbell_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(rx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(rx),
 		  "event_ring_base_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_BASE_PA(rx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(rx),
 		  "event_ring_size",
-		  QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_SIZE(rx),
+		  QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(rx),
 		  "event_ring_doorbell_pa",
-		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(rx),
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(rx),
 		  "num_pkt_buffers",
-		  QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(rx),
+		  QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(rx),
 		  "tx_comp_doorbell_paddr",
 		  (void *)ipa_res->rx_ready_doorbell_paddr);
 
@@ -722,20 +800,66 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 }
 
 /**
- * dp_ipa_cleanup() - Disconnect IPA pipes
- * @tx_pipe_handle: Tx pipe handle
- * @rx_pipe_handle: Rx pipe handle
+ * dp_ipa_setup_iface() - Setup IPA header and register interface
+ * @ifname: Interface name
+ * @mac_addr: Interface MAC address
+ * @prod_client: IPA prod client type
+ * @cons_client: IPA cons client type
+ * @session_id: Session ID
+ * @is_ipv6_enabled: Is IPV6 enabled or not
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle, uint32_t rx_pipe_handle)
+QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
+			      qdf_ipa_client_type_t prod_client,
+			      qdf_ipa_client_type_t cons_client,
+			      uint8_t session_id, bool is_ipv6_enabled)
 {
-	int ret;
+	qdf_ipa_wdi_reg_intf_in_params_t in;
+	qdf_ipa_wdi_hdr_info_t hdr_info;
+	struct dp_ipa_uc_tx_hdr uc_tx_hdr;
+	struct dp_ipa_uc_tx_hdr uc_tx_hdr_v6;
+	int ret = -EINVAL;
+
+	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
+		  "%s: Add Partial hdr: %s, %pM",
+		  __func__, ifname, mac_addr);
 
-	ret = qdf_ipa_wdi3_disconn_pipes();
+	qdf_mem_zero(&hdr_info, sizeof(qdf_ipa_wdi_hdr_info_t));
+	qdf_ether_addr_copy(uc_tx_hdr.eth.h_source, mac_addr);
+
+	/* IPV4 header */
+	uc_tx_hdr.eth.h_proto = qdf_htons(ETH_P_IP);
+
+	QDF_IPA_WDI_HDR_INFO_HDR(&hdr_info) = (uint8_t *)&uc_tx_hdr;
+	QDF_IPA_WDI_HDR_INFO_HDR_LEN(&hdr_info) = DP_IPA_UC_WLAN_TX_HDR_LEN;
+	QDF_IPA_WDI_HDR_INFO_HDR_TYPE(&hdr_info) = IPA_HDR_L2_ETHERNET_II;
+	QDF_IPA_WDI_HDR_INFO_DST_MAC_ADDR_OFFSET(&hdr_info) =
+		DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
+
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_NETDEV_NAME(&in) = ifname;
+	qdf_mem_copy(&(QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(&in)[IPA_IP_v4]),
+		     &hdr_info, sizeof(qdf_ipa_wdi_hdr_info_t));
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_ALT_DST_PIPE(&in) = cons_client;
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(&in) = 1;
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA(&in) =
+		htonl(session_id << 16);
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA_MASK(&in) = htonl(0x00FF0000);
+
+	/* IPV6 header */
+	if (is_ipv6_enabled) {
+		qdf_mem_copy(&uc_tx_hdr_v6, &uc_tx_hdr,
+			     DP_IPA_UC_WLAN_TX_HDR_LEN);
+		uc_tx_hdr_v6.eth.h_proto = qdf_htons(ETH_P_IPV6);
+		QDF_IPA_WDI_HDR_INFO_HDR(&hdr_info) = (uint8_t *)&uc_tx_hdr_v6;
+		qdf_mem_copy(&(QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(&in)[IPA_IP_v6]),
+			     &hdr_info, sizeof(qdf_ipa_wdi_hdr_info_t));
+	}
+
+	ret = qdf_ipa_wdi_reg_intf(&in);
 	if (ret) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-		    "%s: ipa_wdi3_disconn_pipes: IPA pipe cleanup failed: ret=%d",
+		    "%s: ipa_wdi_reg_intf: register IPA interface falied: ret=%d",
 		    __func__, ret);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -743,6 +867,194 @@ QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle, uint32_t rx_pipe_handle)
 	return QDF_STATUS_SUCCESS;
 }
 
+#else /* CONFIG_IPA_WDI_UNIFIED_API */
+
+/**
+ * dp_ipa_setup() - Setup and connect IPA pipes
+ * @ppdev - handle to the device instance
+ * @ipa_i2w_cb: IPA to WLAN callback
+ * @ipa_w2i_cb: WLAN to IPA callback
+ * @ipa_wdi_meter_notifier_cb: IPA WDI metering callback
+ * @ipa_desc_size: IPA descriptor size
+ * @ipa_priv: handle to the HTT instance
+ * @is_rm_enabled: Is IPA RM enabled or not
+ * @tx_pipe_handle: pointer to Tx pipe handle
+ * @rx_pipe_handle: pointer to Rx pipe handle
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
+			void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
+			uint32_t ipa_desc_size, void *ipa_priv,
+			bool is_rm_enabled, uint32_t *tx_pipe_handle,
+			uint32_t *rx_pipe_handle)
+{
+	struct dp_pdev *pdev = (struct dp_pdev *)ppdev;
+	struct dp_soc *soc = pdev->soc;
+	struct dp_ipa_resources *ipa_res = &pdev->ipa_resource;
+	qdf_ipa_wdi_pipe_setup_info_t *tx;
+	qdf_ipa_wdi_pipe_setup_info_t *rx;
+	qdf_ipa_wdi_conn_in_params_t pipe_in;
+	qdf_ipa_wdi_conn_out_params_t pipe_out;
+	struct tcl_data_cmd *tcl_desc_ptr;
+	uint8_t *desc_addr;
+	uint32_t desc_size;
+	int ret;
+
+	qdf_mem_zero(&tx, sizeof(qdf_ipa_wdi_pipe_setup_info_t));
+	qdf_mem_zero(&rx, sizeof(qdf_ipa_wdi_pipe_setup_info_t));
+	qdf_mem_zero(&pipe_in, sizeof(pipe_in));
+	qdf_mem_zero(&pipe_out, sizeof(pipe_out));
+
+	/* TX PIPE */
+	/**
+	 * Transfer Ring: WBM Ring
+	 * Transfer Ring Doorbell PA: WBM Tail Pointer Address
+	 * Event Ring: TCL ring
+	 * Event Ring Doorbell PA: TCL Head Pointer Address
+	 */
+	tx = &QDF_IPA_WDI_CONN_IN_PARAMS_TX(&pipe_in);
+	QDF_IPA_WDI_SETUP_INFO_NAT_EN(tx) = IPA_BYPASS_NAT;
+	QDF_IPA_WDI_SETUP_INFO_HDR_LEN(tx) = DP_IPA_UC_WLAN_TX_HDR_LEN;
+	QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE_VALID(tx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE(tx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_HDR_ADDITIONAL_CONST_LEN(tx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_MODE(tx) = IPA_BASIC;
+	QDF_IPA_WDI_SETUP_INFO_HDR_LITTLE_ENDIAN(tx) = true;
+	QDF_IPA_WDI_SETUP_INFO_CLIENT(tx) = IPA_CLIENT_WLAN1_CONS;
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(tx) =
+		ipa_res->tx_comp_ring_base_paddr;
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(tx) =
+		ipa_res->tx_comp_ring_size;
+	/* WBM Tail Pointer Address */
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(tx) =
+		soc->ipa_uc_tx_rsc.ipa_wbm_tp_paddr;
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(tx) =
+		ipa_res->tx_ring_base_paddr;
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(tx) = ipa_res->tx_ring_size;
+	/* TCL Head Pointer Address */
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx) =
+		soc->ipa_uc_tx_rsc.ipa_tcl_hp_paddr;
+	QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(tx) =
+		ipa_res->tx_num_alloc_buffer;
+	QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(tx) = 0;
+
+	/* Preprogram TCL descriptor */
+	desc_addr =
+		(uint8_t *)QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(tx);
+	desc_size = sizeof(struct tcl_data_cmd);
+	HAL_TX_DESC_SET_TLV_HDR(desc_addr, HAL_TX_TCL_DATA_TAG, desc_size);
+	tcl_desc_ptr = (struct tcl_data_cmd *)
+		(QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(tx) + 1);
+	tcl_desc_ptr->buf_addr_info.return_buffer_manager =
+						HAL_RX_BUF_RBM_SW2_BM;
+	tcl_desc_ptr->addrx_en = 1;	/* Address X search enable in ASE */
+	tcl_desc_ptr->encap_type = HAL_TX_ENCAP_TYPE_ETHERNET;
+	tcl_desc_ptr->packet_offset = 2;	/* padding for alignment */
+
+	/* RX PIPE */
+	/**
+	 * Transfer Ring: REO Ring
+	 * Transfer Ring Doorbell PA: REO Tail Pointer Address
+	 * Event Ring: FW ring
+	 * Event Ring Doorbell PA: FW Head Pointer Address
+	 */
+	rx = &QDF_IPA_WDI_CONN_IN_PARAMS_RX(&pipe_in);
+	QDF_IPA_WDI_SETUP_INFO_NAT_EN(rx) = IPA_BYPASS_NAT;
+	QDF_IPA_WDI_SETUP_INFO_HDR_LEN(rx) = DP_IPA_UC_WLAN_RX_HDR_LEN;
+	QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE_VALID(rx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE(rx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_HDR_ADDITIONAL_CONST_LEN(rx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_HDR_OFST_METADATA_VALID(rx) = 0;
+	QDF_IPA_WDI_SETUP_INFO_HDR_METADATA_REG_VALID(rx) = 1;
+	QDF_IPA_WDI_SETUP_INFO_MODE(rx) = IPA_BASIC;
+	QDF_IPA_WDI_SETUP_INFO_HDR_LITTLE_ENDIAN(rx) = true;
+	QDF_IPA_WDI_SETUP_INFO_CLIENT(rx) = IPA_CLIENT_WLAN1_PROD;
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(rx) =
+						ipa_res->rx_rdy_ring_base_paddr;
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(rx) =
+						ipa_res->rx_rdy_ring_size;
+	/* REO Tail Pointer Address */
+	QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(rx) =
+					soc->ipa_uc_rx_rsc.ipa_reo_tp_paddr;
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(rx) =
+					ipa_res->rx_refill_ring_base_paddr;
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(rx) =
+						ipa_res->rx_refill_ring_size;
+	/* FW Head Pointer Address */
+	QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(rx) =
+				soc->ipa_uc_rx_rsc.ipa_rx_refill_buf_hp_paddr;
+	QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(rx) = RX_PKT_TLVS_LEN +
+						L3_HEADER_PADDING;
+	QDF_IPA_WDI_CONN_IN_PARAMS_NOTIFY(&pipe_in) = ipa_w2i_cb;
+	QDF_IPA_WDI_CONN_IN_PARAMS_PRIV(&pipe_in) = ipa_priv;
+
+	/* Connect WDI IPA PIPE */
+	ret = qdf_ipa_wdi_conn_pipes(&pipe_in, &pipe_out);
+	if (ret) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			  "%s: ipa_wdi_conn_pipes: IPA pipe setup failed: ret=%d",
+			  __func__, ret);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	/* IPA uC Doorbell registers */
+	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
+		  "%s: Tx DB PA=0x%x, Rx DB PA=0x%x",
+		  __func__,
+		(unsigned int)QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(&pipe_out),
+		(unsigned int)QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out));
+
+	ipa_res->tx_comp_doorbell_paddr =
+		QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(&pipe_out);
+	ipa_res->tx_comp_doorbell_vaddr =
+		QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_VA(&pipe_out);
+	ipa_res->rx_ready_doorbell_paddr =
+		QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(&pipe_out);
+
+	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
+		  "%s: Tx: %s=%pK, %s=%d, %s=%pK, %s=%pK, %s=%d, %s=%pK, %s=%d, %s=%pK",
+		  __func__,
+		  "transfer_ring_base_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(tx),
+		  "transfer_ring_size",
+		  QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(tx),
+		  "transfer_ring_doorbell_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(tx),
+		  "event_ring_base_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(tx),
+		  "event_ring_size",
+		  QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(tx),
+		  "event_ring_doorbell_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx),
+		  "num_pkt_buffers",
+		  QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(tx),
+		  "tx_comp_doorbell_paddr",
+		  (void *)ipa_res->tx_comp_doorbell_paddr);
+
+	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
+		  "%s: Rx: %s=%pK, %s=%d, %s=%pK, %s=%pK, %s=%d, %s=%pK, %s=%d, %s=%pK",
+		  __func__,
+		  "transfer_ring_base_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(rx),
+		  "transfer_ring_size",
+		  QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(rx),
+		  "transfer_ring_doorbell_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(rx),
+		  "event_ring_base_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(rx),
+		  "event_ring_size",
+		  QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(rx),
+		  "event_ring_doorbell_pa",
+		  (void *)QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(rx),
+		  "num_pkt_buffers",
+		  QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(rx),
+		  "tx_comp_doorbell_paddr",
+		  (void *)ipa_res->rx_ready_doorbell_paddr);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * dp_ipa_setup_iface() - Setup IPA header and register interface
  * @ifname: Interface name
@@ -759,47 +1071,73 @@ QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
 			      qdf_ipa_client_type_t cons_client,
 			      uint8_t session_id, bool is_ipv6_enabled)
 {
-	qdf_ipa_wdi3_reg_intf_in_params_t in;
-	qdf_ipa_wdi3_hdr_info_t hdr_info;
+	qdf_ipa_wdi_reg_intf_in_params_t in;
+	qdf_ipa_wdi_hdr_info_t hdr_info;
 	struct dp_ipa_uc_tx_hdr uc_tx_hdr;
+	struct dp_ipa_uc_tx_hdr uc_tx_hdr_v6;
 	int ret = -EINVAL;
 
 	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
 		  "%s: Add Partial hdr: %s, %pM",
 		  __func__, ifname, mac_addr);
 
-	qdf_mem_zero(&hdr_info, sizeof(qdf_ipa_wdi3_hdr_info_t));
+	qdf_mem_zero(&hdr_info, sizeof(qdf_ipa_wdi_hdr_info_t));
 	qdf_ether_addr_copy(uc_tx_hdr.eth.h_source, mac_addr);
 
 	/* IPV4 header */
 	uc_tx_hdr.eth.h_proto = qdf_htons(ETH_P_IP);
 
-	QDF_IPA_WDI3_HDR_INFO_HDR(&hdr_info) = (uint8_t *)&uc_tx_hdr;
-	QDF_IPA_WDI3_HDR_INFO_HDR_LEN(&hdr_info) = DP_IPA_UC_WLAN_TX_HDR_LEN;
-	QDF_IPA_WDI3_HDR_INFO_HDR_TYPE(&hdr_info) = IPA_HDR_L2_ETHERNET_II;
-	QDF_IPA_WDI3_HDR_INFO_DST_MAC_ADDR_OFFSET(&hdr_info) =
+	QDF_IPA_WDI_HDR_INFO_HDR(&hdr_info) = (uint8_t *)&uc_tx_hdr;
+	QDF_IPA_WDI_HDR_INFO_HDR_LEN(&hdr_info) = DP_IPA_UC_WLAN_TX_HDR_LEN;
+	QDF_IPA_WDI_HDR_INFO_HDR_TYPE(&hdr_info) = IPA_HDR_L2_ETHERNET_II;
+	QDF_IPA_WDI_HDR_INFO_DST_MAC_ADDR_OFFSET(&hdr_info) =
 		DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
 
-	QDF_IPA_WDI3_REG_INTF_IN_PARAMS_NETDEV_NAME(&in) = ifname;
-	memcpy(&(QDF_IPA_WDI3_REG_INTF_IN_PARAMS_HDR_INFO(&in)[0]), &hdr_info,
-		sizeof(qdf_ipa_wdi3_hdr_info_t));
-	QDF_IPA_WDI3_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(&in) = 1;
-	QDF_IPA_WDI3_REG_INTF_IN_PARAMS_META_DATA(&in) =
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_NETDEV_NAME(&in) = ifname;
+	qdf_mem_copy(&(QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(&in)[IPA_IP_v4]),
+		     &hdr_info, sizeof(qdf_ipa_wdi_hdr_info_t));
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(&in) = 1;
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA(&in) =
 		htonl(session_id << 16);
-	QDF_IPA_WDI3_REG_INTF_IN_PARAMS_META_DATA_MASK(&in) = htonl(0x00FF0000);
+	QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA_MASK(&in) = htonl(0x00FF0000);
 
 	/* IPV6 header */
 	if (is_ipv6_enabled) {
-		uc_tx_hdr.eth.h_proto = qdf_htons(ETH_P_IPV6);
-		memcpy(&(QDF_IPA_WDI3_REG_INTF_IN_PARAMS_HDR_INFO(&in)[1]),
-			&hdr_info, sizeof(qdf_ipa_wdi3_hdr_info_t));
+		qdf_mem_copy(&uc_tx_hdr_v6, &uc_tx_hdr,
+			     DP_IPA_UC_WLAN_TX_HDR_LEN);
+		uc_tx_hdr_v6.eth.h_proto = qdf_htons(ETH_P_IPV6);
+		QDF_IPA_WDI_HDR_INFO_HDR(&hdr_info) = (uint8_t *)&uc_tx_hdr_v6;
+		qdf_mem_copy(&(QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(&in)[IPA_IP_v6]),
+			     &hdr_info, sizeof(qdf_ipa_wdi_hdr_info_t));
 	}
 
-	ret = qdf_ipa_wdi3_reg_intf(&in);
+	ret = qdf_ipa_wdi_reg_intf(&in);
 	if (ret) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-		    "%s: ipa_wdi3_reg_intf: register IPA interface falied: ret=%d",
-		    __func__, ret);
+		dp_err("ipa_wdi_reg_intf: register IPA interface falied: ret=%d",
+		       ret);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+#endif /* CONFIG_IPA_WDI_UNIFIED_API */
+
+/**
+ * dp_ipa_cleanup() - Disconnect IPA pipes
+ * @tx_pipe_handle: Tx pipe handle
+ * @rx_pipe_handle: Rx pipe handle
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle, uint32_t rx_pipe_handle)
+{
+	int ret;
+
+	ret = qdf_ipa_wdi_disconn_pipes();
+	if (ret) {
+		dp_err("ipa_wdi_disconn_pipes: IPA pipe cleanup failed: ret=%d",
+		       ret);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -817,10 +1155,10 @@ QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled)
 {
 	int ret;
 
-	ret = qdf_ipa_wdi3_dereg_intf(ifname);
+	ret = qdf_ipa_wdi_dereg_intf(ifname);
 	if (ret) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			  "%s: ipa_wdi3_dereg_intf: IPA pipe deregistration failed: ret=%d",
+			  "%s: ipa_wdi_dereg_intf: IPA pipe deregistration failed: ret=%d",
 			  __func__, ret);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -838,7 +1176,7 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_pdev *ppdev)
 {
 	QDF_STATUS result;
 
-	result = qdf_ipa_wdi3_enable_pipes();
+	result = qdf_ipa_wdi_enable_pipes();
 	if (result) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Enable WDI PIPE fail, code %d",
@@ -859,7 +1197,7 @@ QDF_STATUS dp_ipa_disable_pipes(struct cdp_pdev *ppdev)
 {
 	QDF_STATUS result;
 
-	result = qdf_ipa_wdi3_disable_pipes();
+	result = qdf_ipa_wdi_disable_pipes();
 	if (result) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Disable WDI PIPE fail, code %d",
@@ -879,20 +1217,21 @@ QDF_STATUS dp_ipa_disable_pipes(struct cdp_pdev *ppdev)
  */
 QDF_STATUS dp_ipa_set_perf_level(int client, uint32_t max_supported_bw_mbps)
 {
-	qdf_ipa_wdi3_perf_profile_t profile;
+	qdf_ipa_wdi_perf_profile_t profile;
 	QDF_STATUS result;
 
 	profile.client = client;
 	profile.max_supported_bw_mbps = max_supported_bw_mbps;
 
-	result = qdf_ipa_wdi3_set_perf_profile(&profile);
+	result = qdf_ipa_wdi_set_perf_profile(&profile);
 	if (result) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			  "%s: ipa_wdi3_set_perf_profile fail, code %d",
+			  "%s: ipa_wdi_set_perf_profile fail, code %d",
 			  __func__, result);
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	return QDF_STATUS_SUCCESS;
 }
+
 #endif

+ 15 - 3
dp/wifi3.0/dp_ipa.h

@@ -19,6 +19,7 @@
 
 #ifdef IPA_OFFLOAD
 
+#define DP_IPA_MAX_IFACE	3
 #define IPA_TCL_DATA_RING_IDX	2
 #define IPA_TX_COMP_RING_IDX	2
 #define IPA_REO_DEST_RING_IDX	3
@@ -55,10 +56,21 @@ QDF_STATUS dp_ipa_get_stat(struct cdp_pdev *pdev);
 qdf_nbuf_t dp_tx_send_ipa_data_frame(struct cdp_vdev *vdev, qdf_nbuf_t skb);
 QDF_STATUS dp_ipa_enable_autonomy(struct cdp_pdev *pdev);
 QDF_STATUS dp_ipa_disable_autonomy(struct cdp_pdev *pdev);
+#ifdef CONFIG_IPA_WDI_UNIFIED_API
 QDF_STATUS dp_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
-		void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
-		uint32_t ipa_desc_size, void *ipa_priv, bool is_rm_enabled,
-		uint32_t *tx_pipe_handle, uint32_t *rx_pipe_handle);
+			void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
+			uint32_t ipa_desc_size, void *ipa_priv,
+			bool is_rm_enabled, uint32_t *tx_pipe_handle,
+			uint32_t *rx_pipe_handle,
+			bool is_smmu_enabled,
+			qdf_ipa_sys_connect_params_t *sys_in);
+#else /* CONFIG_IPA_WDI_UNIFIED_API */
+QDF_STATUS dp_ipa_setup(struct cdp_pdev *pdev, void *ipa_i2w_cb,
+			void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb,
+			uint32_t ipa_desc_size, void *ipa_priv,
+			bool is_rm_enabled, uint32_t *tx_pipe_handle,
+			uint32_t *rx_pipe_handle);
+#endif /* CONFIG_IPA_WDI_UNIFIED_API */
 QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle,
 		uint32_t rx_pipe_handle);
 QDF_STATUS dp_ipa_remove_header(char *name);

+ 155 - 138
qdf/inc/qdf_ipa_wdi3.h

@@ -24,11 +24,10 @@
 
 #ifdef IPA_OFFLOAD
 
-#ifdef CONFIG_IPA_WDI_UNIFIED_API
-
 #include <qdf_ipa.h>
 #include <i_qdf_ipa_wdi3.h>
 
+#ifdef CONFIG_IPA_WDI_UNIFIED_API
 /**
  * qdf_ipa_wdi_version_t - IPA WDI version
  */
@@ -39,18 +38,75 @@ typedef __qdf_ipa_wdi_version_t qdf_ipa_wdi_version_t;
  */
 typedef __qdf_ipa_wdi_init_in_params_t qdf_ipa_wdi_init_in_params_t;
 
+#define QDF_IPA_WDI_INIT_IN_PARAMS_WDI_VERSION(in_params)	\
+	__QDF_IPA_WDI_INIT_IN_PARAMS_WDI_VERSION(in_params)
+#define QDF_IPA_WDI_INIT_IN_PARAMS_NOTIFY(in_params)	\
+	__QDF_IPA_WDI_INIT_IN_PARAMS_NOTIFY(in_params)
+#define QDF_IPA_WDI_INIT_IN_PARAMS_PRIV(in_params)	\
+	__QDF_IPA_WDI_INIT_IN_PARAMS_PRIV(in_params)
+#define QDF_IPA_WDI_INIT_IN_PARAMS_WDI_NOTIFY(in_params)	\
+	__QDF_IPA_WDI_INIT_IN_PARAMS_WDI_NOTIFY(in_params)
+
 /**
  * qdf_ipa_wdi_init_out_params_t - wdi init output parameters
  */
 typedef __qdf_ipa_wdi_init_out_params_t qdf_ipa_wdi_init_out_params_t;
 
+#define QDF_IPA_WDI_INIT_OUT_PARAMS_IS_UC_READY(out_params)	\
+	__QDF_IPA_WDI_INIT_OUT_PARAMS_IS_UC_READY(out_params)
+#define QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(out_params)	\
+	__QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(out_params)
+
 /**
  * qdf_ipa_wdi_pipe_setup_info_smmu_t - WDI TX/Rx configuration
  */
 typedef __qdf_ipa_wdi_pipe_setup_info_smmu_t qdf_ipa_wdi_pipe_setup_info_smmu_t;
 
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_EP_CFG(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_EP_CFG(txrx)
+
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_CLIENT(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_CLIENT(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_BASE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_BASE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_SIZE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_SIZE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_DOORBELL_PA(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_DOORBELL_PA(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_BASE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_BASE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_SIZE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_SIZE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_DOORBELL_PA(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_DOORBELL_PA(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_NUM_PKT_BUFFERS(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_NUM_PKT_BUFFERS(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_PKT_OFFSET(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_PKT_OFFSET(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_SMMU_DESC_FORMAT_TEMPLATE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_SMMU_DESC_FORMAT_TEMPLATE(txrx)
+
 typedef __qdf_ipa_ep_cfg_t qdf_ipa_ep_cfg_t;
 
+#define QDF_IPA_EP_CFG_NAT_EN(cfg)	\
+	__QDF_IPA_EP_CFG_NAT_EN(cfg)
+#define QDF_IPA_EP_CFG_HDR_LEN(cfg)	\
+	__QDF_IPA_EP_CFG_HDR_LEN(cfg)
+#define QDF_IPA_EP_CFG_HDR_OFST_METADATA_VALID(cfg)	\
+	__QDF_IPA_EP_CFG_HDR_OFST_METADATA_VALID(cfg)
+#define QDF_IPA_EP_CFG_HDR_METADATA_REG_VALID(cfg)	\
+	__QDF_IPA_EP_CFG_HDR_METADATA_REG_VALID(cfg)
+#define QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE_VALID(cfg)	\
+	__QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE_VALID(cfg)
+#define QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE(cfg)	\
+	__QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE(cfg)
+#define QDF_IPA_EP_CFG_HDR_ADDITIONAL_CONST_LEN(cfg)	\
+	__QDF_IPA_EP_CFG_HDR_ADDITIONAL_CONST_LEN(cfg)
+#define QDF_IPA_EP_CFG_MODE(cfg)	\
+	__QDF_IPA_EP_CFG_MODE(cfg)
+#define QDF_IPA_EP_CFG_HDR_LITTLE_ENDIAN(cfg)	\
+	__QDF_IPA_EP_CFG_HDR_LITTLE_ENDIAN(cfg)
+
 /**
  * qdf_ipa_wdi_init - Client should call this function to
  * init WDI IPA offload data path
@@ -76,40 +132,137 @@ static inline int qdf_ipa_wdi_cleanup(void)
 {
 	return __qdf_ipa_wdi_cleanup();
 }
+#endif /* CONFIG_IPA_WDI_UNIFIED_API */
 
 /**
  * qdf_ipa_wdi_hdr_info_t - Header to install on IPA HW
  */
 typedef __qdf_ipa_wdi_hdr_info_t qdf_ipa_wdi_hdr_info_t;
 
+#define QDF_IPA_WDI_HDR_INFO_HDR(hdr_info)	\
+	__QDF_IPA_WDI_HDR_INFO_HDR(hdr_info)
+#define QDF_IPA_WDI_HDR_INFO_HDR_LEN(hdr_info)	\
+	__QDF_IPA_WDI_HDR_INFO_HDR_LEN(hdr_info)
+#define QDF_IPA_WDI_HDR_INFO_DST_MAC_ADDR_OFFSET(hdr_info)	\
+	__QDF_IPA_WDI_HDR_INFO_DST_MAC_ADDR_OFFSET(hdr_info)
+#define QDF_IPA_WDI_HDR_INFO_HDR_TYPE(hdr_info)	\
+	__QDF_IPA_WDI_HDR_INFO_HDR_TYPE(hdr_info)
+
 /**
  * qdf_ipa_wdi_reg_intf_in_params_t - parameters for uC offload
  *	interface registration
  */
 typedef __qdf_ipa_wdi_reg_intf_in_params_t qdf_ipa_wdi_reg_intf_in_params_t;
 
+#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_NETDEV_NAME(in)	\
+	__QDF_IPA_WDI_REG_INTF_IN_PARAMS_NETDEV_NAME(in)
+#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(in)	\
+	__QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(in)
+#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_ALT_DST_PIPE(in)	\
+	__QDF_IPA_WDI_REG_INTF_IN_PARAMS_ALT_DST_PIPE(in)
+#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(in)	\
+	__QDF_IPA_WDI_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(in)
+#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA(in)	\
+	__QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA(in)
+#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA_MASK(in)	\
+	__QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA_MASK(in)
+
 /**
  * qdf_ipa_wdi_pipe_setup_info_t - WDI TX/Rx configuration
  */
 typedef __qdf_ipa_wdi_pipe_setup_info_t qdf_ipa_wdi_pipe_setup_info_t;
 
+#define QDF_IPA_WDI_SETUP_INFO_EP_CFG(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_EP_CFG(txrx)
+
+#define QDF_IPA_WDI_SETUP_INFO_NAT_EN(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_NAT_EN(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_HDR_LEN(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_HDR_LEN(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_HDR_OFST_METADATA_VALID(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_HDR_OFST_METADATA_VALID(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_HDR_METADATA_REG_VALID(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_HDR_METADATA_REG_VALID(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE_VALID(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE_VALID(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_HDR_ADDITIONAL_CONST_LEN(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_HDR_ADDITIONAL_CONST_LEN(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_MODE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_MODE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_HDR_LITTLE_ENDIAN(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_HDR_LITTLE_ENDIAN(txrx)
+
+#define QDF_IPA_WDI_SETUP_INFO_CLIENT(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_CLIENT(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(txrx)
+#define QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(txrx)	\
+	__QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(txrx)
+
 /**
  * qdf_ipa_wdi_conn_in_params_t - information provided by
  *		uC offload client
  */
 typedef __qdf_ipa_wdi_conn_in_params_t qdf_ipa_wdi_conn_in_params_t;
 
+#define QDF_IPA_WDI_CONN_IN_PARAMS_NOTIFY(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_NOTIFY(pipe_in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_PRIV(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_PRIV(pipe_in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(pipe_in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_NUM_SYS_PIPE_NEEDED(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_NUM_SYS_PIPE_NEEDED(pipe_in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_SYS_IN(in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_SYS_IN(in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_TX(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_TX(pipe_in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_TX_SMMU(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_TX_SMMU(pipe_in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_RX(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_RX(pipe_in)
+#define QDF_IPA_WDI_CONN_IN_PARAMS_RX_SMMU(pipe_in)	\
+	__QDF_IPA_WDI_CONN_IN_PARAMS_RX_SMMU(pipe_in)
+
 /**
  * qdf_ipa_wdi_conn_out_params_t - information provided
  *				to WLAN druver
  */
 typedef __qdf_ipa_wdi_conn_out_params_t qdf_ipa_wdi_conn_out_params_t;
 
+#define QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(pipe_out)	\
+	__QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(pipe_out)
+#define QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_VA(pipe_out)	\
+	__QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_VA(pipe_out)
+#define QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(pipe_out)	\
+	__QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(pipe_out)
+
 /**
  * qdf_ipa_wdi_perf_profile_t - To set BandWidth profile
  */
 typedef __qdf_ipa_wdi_perf_profile_t qdf_ipa_wdi_perf_profile_t;
 
+#define QDF_IPA_WDI_PERF_PROFILE_CLIENT(profile)	\
+	__QDF_IPA_WDI_PERF_PROFILE_CLIENT(profile)
+#define QDF_IPA_WDI_PERF_PROFILE_MAX_SUPPORTED_BW_MBPS(profile)	\
+	__QDF_IPA_WDI_PERF_PROFILE_MAX_SUPPORTED_BW_MBPS(profile)
+
 /**
  * qdf_ipa_wdi_reg_intf - Client should call this function to
  * init WDI IPA offload data path
@@ -237,141 +390,5 @@ static inline int qdf_ipa_wdi_release_smmu_mapping(uint32_t num_buffers,
 	return __qdf_ipa_wdi_release_smmu_mapping(num_buffers, info);
 }
 
-#else /* CONFIG_IPA_WDI_UNIFIED_API */
-
-#include <i_qdf_ipa_wdi3.h>
-
-/**
- * qdf_ipa_wdi3_hdr_info_t - Header to install on IPA HW
- */
-typedef __qdf_ipa_wdi3_hdr_info_t qdf_ipa_wdi3_hdr_info_t;
-
-/**
- * qdf_ipa_wdi3_reg_intf_in_params_t - parameters for uC offload
- *	interface registration
- */
-typedef __qdf_ipa_wdi3_reg_intf_in_params_t qdf_ipa_wdi3_reg_intf_in_params_t;
-
-/**
- * qdf_ipa_wdi3_setup_info_t - WDI3 TX/Rx configuration
- */
-typedef __qdf_ipa_wdi3_setup_info_t qdf_ipa_wdi3_setup_info_t;
-
-/**
- * qdf_ipa_wdi3_conn_in_params_t - information provided by
- *		uC offload client
- */
-typedef __qdf_ipa_wdi3_conn_in_params_t qdf_ipa_wdi3_conn_in_params_t;
-
-/**
- * qdf_ipa_wdi3_conn_out_params_t - information provided
- *				to WLAN druver
- */
-typedef __qdf_ipa_wdi3_conn_out_params_t qdf_ipa_wdi3_conn_out_params_t;
-
-/**
- * qdf_ipa_wdi3_perf_profile_t - To set BandWidth profile
- */
-typedef __qdf_ipa_wdi3_perf_profile_t qdf_ipa_wdi3_perf_profile_t;
-
-/**
- * qdf_ipa_wdi3_reg_intf - Client should call this function to
- * init WDI3 IPA offload data path
- *
- * Note: Should not be called from atomic context and only
- * after checking IPA readiness using ipa_register_ipa_ready_cb()
- *
- * @Return 0 on success, negative on failure
- */
-static inline int qdf_ipa_wdi3_reg_intf(
-	struct ipa_wdi3_reg_intf_in_params *in)
-{
-	return __qdf_ipa_wdi3_reg_intf(in);
-}
-
-/**
- * qdf_ipa_wdi3_dereg_intf - Client Driver should call this
- * function to deregister before unload and after disconnect
- *
- * @Return 0 on success, negative on failure
- */
-static inline int qdf_ipa_wdi3_dereg_intf(const char *netdev_name)
-{
-	return __qdf_ipa_wdi3_dereg_intf(netdev_name);
-}
-
-/**
- * qdf_ipa_wdi3_conn_pipes - Client should call this
- * function to connect pipes
- *
- * @in:	[in] input parameters from client
- * @out: [out] output params to client
- *
- * Note: Should not be called from atomic context and only
- * after checking IPA readiness using ipa_register_ipa_ready_cb()
- *
- * @Return 0 on success, negative on failure
- */
-static inline int qdf_ipa_wdi3_conn_pipes(struct ipa_wdi3_conn_in_params *in,
-			struct ipa_wdi3_conn_out_params *out)
-{
-	return __qdf_ipa_wdi3_conn_pipes(in, out);
-}
-
-/**
- * qdf_ipa_wdi3_disconn_pipes() - Client should call this
- *		function to disconnect pipes
- *
- * Note: Should not be called from atomic context
- *
- * Returns: 0 on success, negative on failure
- */
-static inline int qdf_ipa_wdi3_disconn_pipes(void)
-{
-	return __qdf_ipa_wdi3_disconn_pipes();
-}
-
-/**
- * qdf_ipa_wdi3_enable_pipes() - Client should call this
- *		function to enable IPA offload data path
- *
- * Note: Should not be called from atomic context
- *
- * Returns: 0 on success, negative on failure
- */
-static inline int qdf_ipa_wdi3_enable_pipes(void)
-{
-	return __qdf_ipa_wdi3_enable_pipes();
-}
-
-/**
- * qdf_ipa_wdi3_disable_pipes() - Client should call this
- *		function to disable IPA offload data path
- *
- * Note: Should not be called from atomic context
- *
- * Returns: 0 on success, negative on failure
- */
-static inline int qdf_ipa_wdi3_disable_pipes(void)
-{
-	return __qdf_ipa_wdi3_disable_pipes();
-}
-
-/**
- * qdf_ipa_wdi3_set_perf_profile() - Client should call this function to
- *		set IPA clock bandwidth based on data rates
- *
- * @profile: [in] BandWidth profile to use
- *
- * Returns: 0 on success, negative on failure
- */
-static inline int qdf_ipa_wdi3_set_perf_profile(
-			struct ipa_wdi3_perf_profile *profile)
-{
-	return __qdf_ipa_wdi3_set_perf_profile(profile);
-}
-
-#endif /* CONFIG_IPA_WDI_UNIFIED_API */
-
 #endif /* IPA_OFFLOAD */
 #endif /* _QDF_IPA_WDI3_H */

+ 124 - 124
qdf/linux/src/i_qdf_ipa_wdi3.h

@@ -39,13 +39,13 @@ typedef enum ipa_wdi_version __qdf_ipa_wdi_version_t;
  */
 typedef struct ipa_wdi_init_in_params __qdf_ipa_wdi_init_in_params_t;
 
-#define QDF_IPA_WDI_INIT_IN_PARAMS_WDI_VERSION(in_params)	\
+#define __QDF_IPA_WDI_INIT_IN_PARAMS_WDI_VERSION(in_params)	\
 	(((struct ipa_wdi_init_in_params *)(in_params))->wdi_version)
-#define QDF_IPA_WDI_INIT_IN_PARAMS_NOTIFY(in_params)	\
+#define __QDF_IPA_WDI_INIT_IN_PARAMS_NOTIFY(in_params)	\
 	(((struct ipa_wdi_init_in_params *)(in_params))->notify)
-#define QDF_IPA_WDI_INIT_IN_PARAMS_PRIV(in_params)	\
+#define __QDF_IPA_WDI_INIT_IN_PARAMS_PRIV(in_params)	\
 	(((struct ipa_wdi_init_in_params *)(in_params))->priv)
-#define QDF_IPA_WDI_INIT_IN_PARAMS_WDI_NOTIFY(in_params)	\
+#define __QDF_IPA_WDI_INIT_IN_PARAMS_WDI_NOTIFY(in_params)	\
 	(((struct ipa_wdi_init_in_params *)(in_params))->wdi_notify)
 
 /**
@@ -53,9 +53,9 @@ typedef struct ipa_wdi_init_in_params __qdf_ipa_wdi_init_in_params_t;
  */
 typedef struct ipa_wdi_init_out_params __qdf_ipa_wdi_init_out_params_t;
 
-#define QDF_IPA_WDI_INIT_OUT_PARAMS_IS_UC_READY(out_params)	\
+#define __QDF_IPA_WDI_INIT_OUT_PARAMS_IS_UC_READY(out_params)	\
 	(((struct ipa_wdi_init_out_params *)(out_params))->is_uC_ready)
-#define QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(out_params)	\
+#define __QDF_IPA_WDI_INIT_OUT_PARAMS_IS_SMMU_ENABLED(out_params)	\
 	(((struct ipa_wdi_init_out_params *)(out_params))->is_smmu_enabled)
 
 /**
@@ -63,13 +63,13 @@ typedef struct ipa_wdi_init_out_params __qdf_ipa_wdi_init_out_params_t;
  */
 typedef struct ipa_wdi_hdr_info  __qdf_ipa_wdi_hdr_info_t;
 
-#define QDF_IPA_WDI_HDR_INFO_HDR(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_HDR(hdr_info)	\
 	(((struct ipa_wdi_hdr_info *)(hdr_info))->hdr)
-#define QDF_IPA_WDI_HDR_INFO_HDR_LEN(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_HDR_LEN(hdr_info)	\
 	(((struct ipa_wdi_hdr_info *)(hdr_info))->hdr_len)
-#define QDF_IPA_WDI_HDR_INFO_DST_MAC_ADDR_OFFSET(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_DST_MAC_ADDR_OFFSET(hdr_info)	\
 	(((struct ipa_wdi_hdr_info *)(hdr_info))->dst_mac_addr_offset)
-#define QDF_IPA_WDI_HDR_INFO_HDR_TYPE(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_HDR_TYPE(hdr_info)	\
 	(((struct ipa_wdi_hdr_info *)(hdr_info))->hdr_type)
 
 /**
@@ -78,38 +78,38 @@ typedef struct ipa_wdi_hdr_info  __qdf_ipa_wdi_hdr_info_t;
  */
 typedef struct ipa_wdi_reg_intf_in_params  __qdf_ipa_wdi_reg_intf_in_params_t;
 
-#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_NETDEV_NAME(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_NETDEV_NAME(in)	\
 	(((struct ipa_wdi_reg_intf_in_params *)(in))->netdev_name)
-#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(in)	\
 	(((struct ipa_wdi_reg_intf_in_params *)(in))->hdr_info)
-#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_ALT_DST_PIPE(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_ALT_DST_PIPE(in)	\
 	(((struct ipa_wdi_reg_intf_in_params *)(in))->alt_dst_pipe)
-#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(in)	\
 	(((struct ipa_wdi_reg_intf_in_params *)(in))->is_meta_data_valid)
-#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA(in)	\
 	(((struct ipa_wdi_reg_intf_in_params *)(in))->meta_data)
-#define QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA_MASK(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA_MASK(in)	\
 	(((struct ipa_wdi_reg_intf_in_params *)(in))->meta_data_mask)
 
 typedef struct ipa_ep_cfg __qdf_ipa_ep_cfg_t;
 
-#define QDF_IPA_EP_CFG_NAT_EN(cfg)	\
+#define __QDF_IPA_EP_CFG_NAT_EN(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->nat.nat_en)
-#define QDF_IPA_EP_CFG_HDR_LEN(cfg)	\
+#define __QDF_IPA_EP_CFG_HDR_LEN(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->hdr.hdr_len)
-#define QDF_IPA_EP_CFG_HDR_OFST_METADATA_VALID(cfg)	\
+#define __QDF_IPA_EP_CFG_HDR_OFST_METADATA_VALID(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->hdr.hdr_ofst_metadata_valid)
-#define QDF_IPA_EP_CFG_HDR_METADATA_REG_VALID(cfg)	\
+#define __QDF_IPA_EP_CFG_HDR_METADATA_REG_VALID(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->hdr.hdr_metadata_reg_valid)
-#define QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE_VALID(cfg)	\
+#define __QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE_VALID(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->hdr.hdr_ofst_pkt_size_valid)
-#define QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE(cfg)	\
+#define __QDF_IPA_EP_CFG_HDR_OFST_PKT_SIZE(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->hdr.hdr_ofst_pkt_size)
-#define QDF_IPA_EP_CFG_HDR_ADDITIONAL_CONST_LEN(cfg)	\
+#define __QDF_IPA_EP_CFG_HDR_ADDITIONAL_CONST_LEN(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->hdr.hdr_additional_const_len)
-#define QDF_IPA_EP_CFG_MODE(cfg)	\
+#define __QDF_IPA_EP_CFG_MODE(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->mode.mode)
-#define QDF_IPA_EP_CFG_HDR_LITTLE_ENDIAN(cfg)	\
+#define __QDF_IPA_EP_CFG_HDR_LITTLE_ENDIAN(cfg)	\
 	(((struct ipa_ep_cfg *)(cfg))->hdr_ext.hdr_little_endian)
 
 /**
@@ -117,28 +117,28 @@ typedef struct ipa_ep_cfg __qdf_ipa_ep_cfg_t;
  */
 typedef struct ipa_wdi_pipe_setup_info  __qdf_ipa_wdi_pipe_setup_info_t;
 
-#define QDF_IPA_WDI_SETUP_INFO_EP_CFG(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_EP_CFG(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->ipa_ep_cfg)
 
-#define QDF_IPA_WDI_SETUP_INFO_CLIENT(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_CLIENT(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->client)
-#define QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->transfer_ring_base_pa)
-#define QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->transfer_ring_size)
-#define QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->transfer_ring_doorbell_pa)
-#define QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->event_ring_base_pa)
-#define QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->event_ring_size)
-#define QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->event_ring_doorbell_pa)
-#define QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->num_pkt_buffers)
-#define QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->pkt_offset)
-#define QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info *)(txrx))->desc_format_template)
 
 /**
@@ -146,28 +146,28 @@ typedef struct ipa_wdi_pipe_setup_info  __qdf_ipa_wdi_pipe_setup_info_t;
  */
 typedef struct ipa_wdi_pipe_setup_info_smmu __qdf_ipa_wdi_pipe_setup_info_smmu_t;
 
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_EP_CFG(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_EP_CFG(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->ipa_ep_cfg)
 
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_CLIENT(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_CLIENT(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->client)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_BASE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_BASE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->transfer_ring_base)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_SIZE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_SIZE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->transfer_ring_size)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_DOORBELL_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_TRANSFER_RING_DOORBELL_PA(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->transfer_ring_doorbell_pa)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_BASE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_BASE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->event_ring_base)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_SIZE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_SIZE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->event_ring_size)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_DOORBELL_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_EVENT_RING_DOORBELL_PA(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->event_ring_doorbell_pa)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_NUM_PKT_BUFFERS(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_NUM_PKT_BUFFERS(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->num_pkt_buffers)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_PKT_OFFSET(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_PKT_OFFSET(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->pkt_offset)
-#define QDF_IPA_WDI_SETUP_INFO_SMMU_DESC_FORMAT_TEMPLATE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_SMMU_DESC_FORMAT_TEMPLATE(txrx)	\
 	(((struct ipa_wdi_pipe_setup_info_smmu *)(txrx))->desc_format_template)
 
 /**
@@ -176,23 +176,23 @@ typedef struct ipa_wdi_pipe_setup_info_smmu __qdf_ipa_wdi_pipe_setup_info_smmu_t
  */
 typedef struct ipa_wdi_conn_in_params  __qdf_ipa_wdi_conn_in_params_t;
 
-#define QDF_IPA_WDI_CONN_IN_PARAMS_NOTIFY(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_NOTIFY(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->notify)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_PRIV(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_PRIV(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->priv)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_SMMU_ENABLED(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->is_smmu_enabled)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_NUM_SYS_PIPE_NEEDED(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_NUM_SYS_PIPE_NEEDED(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->num_sys_pipe_needed)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_SYS_IN(in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_SYS_IN(in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->sys_in)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_TX(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_TX(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->u_tx.tx)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_TX_SMMU(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_TX_SMMU(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->u_tx.tx_smmu)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_RX(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_RX(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->u_rx.rx)
-#define QDF_IPA_WDI_CONN_IN_PARAMS_RX_SMMU(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_RX_SMMU(pipe_in)	\
 	(((struct ipa_wdi_conn_in_params *)(pipe_in))->u_rx.rx_smmu)
 
 /**
@@ -201,9 +201,9 @@ typedef struct ipa_wdi_conn_in_params  __qdf_ipa_wdi_conn_in_params_t;
  */
 typedef struct ipa_wdi_conn_out_params  __qdf_ipa_wdi_conn_out_params_t;
 
-#define QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(pipe_out)	\
+#define __QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(pipe_out)	\
 	(((struct ipa_wdi_conn_out_params *)(pipe_out))->tx_uc_db_pa)
-#define QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(pipe_out)	\
+#define __QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(pipe_out)	\
 	(((struct ipa_wdi_conn_out_params *)(pipe_out))->rx_uc_db_pa)
 
 /**
@@ -211,9 +211,9 @@ typedef struct ipa_wdi_conn_out_params  __qdf_ipa_wdi_conn_out_params_t;
  */
 typedef struct ipa_wdi_perf_profile  __qdf_ipa_wdi_perf_profile_t;
 
-#define QDF_IPA_WDI_PERF_PROFILE_CLIENT(profile)	\
+#define __QDF_IPA_WDI_PERF_PROFILE_CLIENT(profile)	\
 	(((struct ipa_wdi_perf_profile *)(profile))->client)
-#define QDF_IPA_WDI_PERF_PROFILE_MAX_SUPPORTED_BW_MBPS(profile)	\
+#define __QDF_IPA_WDI_PERF_PROFILE_MAX_SUPPORTED_BW_MBPS(profile)	\
 	(((struct ipa_wdi_perf_profile *)(profile))->max_supported_bw_mbps)
 
 /**
@@ -372,121 +372,121 @@ static inline int __qdf_ipa_wdi_release_smmu_mapping(u32 num_buffers,
 #else /* CONFIG_IPA_WDI_UNIFIED_API */
 
 /**
- * __qdf_ipa_wdi3_hdr_info_t - Header to install on IPA HW
+ * __qdf_ipa_wdi_hdr_info_t - Header to install on IPA HW
  */
-typedef struct ipa_wdi3_hdr_info  __qdf_ipa_wdi3_hdr_info_t;
+typedef struct ipa_wdi3_hdr_info  __qdf_ipa_wdi_hdr_info_t;
 
-#define QDF_IPA_WDI3_HDR_INFO_HDR(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_HDR(hdr_info)	\
 	(((struct ipa_wdi3_hdr_info *)(hdr_info))->hdr)
-#define QDF_IPA_WDI3_HDR_INFO_HDR_LEN(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_HDR_LEN(hdr_info)	\
 	(((struct ipa_wdi3_hdr_info *)(hdr_info))->hdr_len)
-#define QDF_IPA_WDI3_HDR_INFO_DST_MAC_ADDR_OFFSET(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_DST_MAC_ADDR_OFFSET(hdr_info)	\
 	(((struct ipa_wdi3_hdr_info *)(hdr_info))->dst_mac_addr_offset)
-#define QDF_IPA_WDI3_HDR_INFO_HDR_TYPE(hdr_info)	\
+#define __QDF_IPA_WDI_HDR_INFO_HDR_TYPE(hdr_info)	\
 	(((struct ipa_wdi3_hdr_info *)(hdr_info))->hdr_type)
 
 /**
- * __qdf_ipa_wdi3_reg_intf_in_params_t - parameters for uC offload
+ * __qdf_ipa_wdi_reg_intf_in_params_t - parameters for uC offload
  *	interface registration
  */
-typedef struct ipa_wdi3_reg_intf_in_params  __qdf_ipa_wdi3_reg_intf_in_params_t;
+typedef struct ipa_wdi3_reg_intf_in_params  __qdf_ipa_wdi_reg_intf_in_params_t;
 
-#define QDF_IPA_WDI3_REG_INTF_IN_PARAMS_NETDEV_NAME(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_NETDEV_NAME(in)	\
 	(((struct ipa_wdi3_reg_intf_in_params *)(in))->netdev_name)
-#define QDF_IPA_WDI3_REG_INTF_IN_PARAMS_HDR_INFO(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_HDR_INFO(in)	\
 	(((struct ipa_wdi3_reg_intf_in_params *)(in))->hdr_info)
-#define QDF_IPA_WDI3_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_IS_META_DATA_VALID(in)	\
 	(((struct ipa_wdi3_reg_intf_in_params *)(in))->is_meta_data_valid)
-#define QDF_IPA_WDI3_REG_INTF_IN_PARAMS_META_DATA(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA(in)	\
 	(((struct ipa_wdi3_reg_intf_in_params *)(in))->meta_data)
-#define QDF_IPA_WDI3_REG_INTF_IN_PARAMS_META_DATA_MASK(in)	\
+#define __QDF_IPA_WDI_REG_INTF_IN_PARAMS_META_DATA_MASK(in)	\
 	(((struct ipa_wdi3_reg_intf_in_params *)(in))->meta_data_mask)
 
 /**
- * __qdf_ipa_wdi3_setup_info_t - WDI3 TX/Rx configuration
+ * __qdf_ipa_wdi_setup_info_t - WDI3 TX/Rx configuration
  */
-typedef struct ipa_wdi3_setup_info  __qdf_ipa_wdi3_setup_info_t;
+typedef struct ipa_wdi3_setup_info  __qdf_ipa_wdi_pipe_setup_info_t;
 
-#define QDF_IPA_WDI3_SETUP_INFO_NAT_EN(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_NAT_EN(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.nat.nat_en)
-#define QDF_IPA_WDI3_SETUP_INFO_HDR_LEN(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_HDR_LEN(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_len)
-#define QDF_IPA_WDI3_SETUP_INFO_HDR_OFST_METADATA_VALID(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_HDR_OFST_METADATA_VALID(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_ofst_metadata_valid)
-#define QDF_IPA_WDI3_SETUP_INFO_HDR_METADATA_REG_VALID(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_HDR_METADATA_REG_VALID(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_metadata_reg_valid)
-#define QDF_IPA_WDI3_SETUP_INFO_HDR_OFST_PKT_SIZE_VALID(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE_VALID(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid)
-#define QDF_IPA_WDI3_SETUP_INFO_HDR_OFST_PKT_SIZE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_HDR_OFST_PKT_SIZE(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_ofst_pkt_size)
-#define QDF_IPA_WDI3_SETUP_INFO_HDR_ADDITIONAL_CONST_LEN(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_HDR_ADDITIONAL_CONST_LEN(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_additional_const_len)
-#define QDF_IPA_WDI3_SETUP_INFO_MODE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_MODE(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.mode.mode)
-#define QDF_IPA_WDI3_SETUP_INFO_HDR_LITTLE_ENDIAN(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_HDR_LITTLE_ENDIAN(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr_ext.hdr_little_endian)
 
-#define QDF_IPA_WDI3_SETUP_INFO_CLIENT(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_CLIENT(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->client)
-#define QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_BASE_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_BASE_PA(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->transfer_ring_base_pa)
-#define QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_SIZE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_SIZE(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->transfer_ring_size)
-#define QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->transfer_ring_doorbell_pa)
-#define QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_BASE_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_EVENT_RING_BASE_PA(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->event_ring_base_pa)
-#define QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_SIZE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_EVENT_RING_SIZE(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->event_ring_size)
-#define QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_EVENT_RING_DOORBELL_PA(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->event_ring_doorbell_pa)
-#define QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_NUM_PKT_BUFFERS(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->num_pkt_buffers)
-#define QDF_IPA_WDI3_SETUP_INFO_PKT_OFFSET(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_PKT_OFFSET(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->pkt_offset)
-#define QDF_IPA_WDI3_SETUP_INFO_DESC_FORMAT_TEMPLATE(txrx)	\
+#define __QDF_IPA_WDI_SETUP_INFO_DESC_FORMAT_TEMPLATE(txrx)	\
 	(((struct ipa_wdi3_setup_info *)(txrx))->desc_format_template)
 
 /**
- * __qdf_ipa_wdi3_conn_in_params_t - information provided by
+ * __qdf_ipa_wdi_conn_in_params_t - information provided by
  *		uC offload client
  */
-typedef struct ipa_wdi3_conn_in_params  __qdf_ipa_wdi3_conn_in_params_t;
+typedef struct ipa_wdi3_conn_in_params  __qdf_ipa_wdi_conn_in_params_t;
 
-#define QDF_IPA_WDI3_CONN_IN_PARAMS_NOTIFY(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_NOTIFY(pipe_in)	\
 	(((struct ipa_wdi3_conn_in_params *)(pipe_in))->notify)
-#define QDF_IPA_WDI3_CONN_IN_PARAMS_PRIV(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_PRIV(pipe_in)	\
 	(((struct ipa_wdi3_conn_in_params *)(pipe_in))->priv)
-#define QDF_IPA_WDI3_CONN_IN_PARAMS_TX(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_TX(pipe_in)	\
 	(((struct ipa_wdi3_conn_in_params *)(pipe_in))->tx)
-#define QDF_IPA_WDI3_CONN_IN_PARAMS_RX(pipe_in)	\
+#define __QDF_IPA_WDI_CONN_IN_PARAMS_RX(pipe_in)	\
 	(((struct ipa_wdi3_conn_in_params *)(pipe_in))->rx)
 
 /**
- * __qdf_ipa_wdi3_conn_out_params_t - information provided
+ * __qdf_ipa_wdi_conn_out_params_t - information provided
  *				to WLAN druver
  */
-typedef struct ipa_wdi3_conn_out_params  __qdf_ipa_wdi3_conn_out_params_t;
+typedef struct ipa_wdi3_conn_out_params  __qdf_ipa_wdi_conn_out_params_t;
 
-#define QDF_IPA_WDI3_CONN_OUT_PARAMS_TX_UC_DB_PA(pipe_out)	\
+#define __QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_PA(pipe_out)	\
 	(((struct ipa_wdi3_conn_out_params *)(pipe_out))->tx_uc_db_pa)
-#define QDF_IPA_WDI3_CONN_OUT_PARAMS_TX_UC_DB_VA(pipe_out)	\
+#define __QDF_IPA_WDI_CONN_OUT_PARAMS_TX_UC_DB_VA(pipe_out)	\
 	(((struct ipa_wdi3_conn_out_params *)(pipe_out))->tx_uc_db_va)
-#define QDF_IPA_WDI3_CONN_OUT_PARAMS_RX_UC_DB_PA(pipe_out)	\
+#define __QDF_IPA_WDI_CONN_OUT_PARAMS_RX_UC_DB_PA(pipe_out)	\
 	(((struct ipa_wdi3_conn_out_params *)(pipe_out))->rx_uc_db_pa)
 
 /**
- * __qdf_ipa_wdi3_perf_profile_t - To set BandWidth profile
+ * __qdf_ipa_wdi_perf_profile_t - To set BandWidth profile
  */
-typedef struct ipa_wdi3_perf_profile  __qdf_ipa_wdi3_perf_profile_t;
+typedef struct ipa_wdi3_perf_profile  __qdf_ipa_wdi_perf_profile_t;
 
-#define QDF_IPA_WDI3_PERF_PROFILE_CLIENT(profile)	\
+#define __QDF_IPA_WDI_PERF_PROFILE_CLIENT(profile)	\
 	(((struct ipa_wdi3_perf_profile *)(profile))->client)
-#define QDF_IPA_WDI3_PERF_PROFILE_MAX_SUPPORTED_BW_MBPS(profile)	\
+#define __QDF_IPA_WDI_PERF_PROFILE_MAX_SUPPORTED_BW_MBPS(profile)	\
 	(((struct ipa_wdi3_perf_profile *)(profile))->max_supported_bw_mbps)
 
 /**
- * __qdf_ipa_wdi3_reg_intf - Client should call this function to
+ * __qdf_ipa_wdi_reg_intf - Client should call this function to
  * init WDI3 IPA offload data path
  *
  * Note: Should not be called from atomic context and only
@@ -494,25 +494,25 @@ typedef struct ipa_wdi3_perf_profile  __qdf_ipa_wdi3_perf_profile_t;
  *
  * @Return 0 on success, negative on failure
  */
-static inline int __qdf_ipa_wdi3_reg_intf(
+static inline int __qdf_ipa_wdi_reg_intf(
 	struct ipa_wdi3_reg_intf_in_params *in)
 {
 	return ipa_wdi3_reg_intf(in);
 }
 
 /**
- * __qdf_ipa_wdi3_dereg_intf - Client Driver should call this
+ * __qdf_ipa_wdi_dereg_intf - Client Driver should call this
  * function to deregister before unload and after disconnect
  *
  * @Return 0 on success, negative on failure
  */
-static inline int __qdf_ipa_wdi3_dereg_intf(const char *netdev_name)
+static inline int __qdf_ipa_wdi_dereg_intf(const char *netdev_name)
 {
 	return ipa_wdi3_dereg_intf(netdev_name);
 }
 
 /**
- * __qdf_ipa_wdi3_conn_pipes - Client should call this
+ * __qdf_ipa_wdi_conn_pipes - Client should call this
  * function to connect pipes
  *
  * @in:	[in] input parameters from client
@@ -523,60 +523,60 @@ static inline int __qdf_ipa_wdi3_dereg_intf(const char *netdev_name)
  *
  * @Return 0 on success, negative on failure
  */
-static inline int __qdf_ipa_wdi3_conn_pipes(struct ipa_wdi3_conn_in_params *in,
-			struct ipa_wdi3_conn_out_params *out)
+static inline int __qdf_ipa_wdi_conn_pipes(struct ipa_wdi3_conn_in_params *in,
+					   struct ipa_wdi3_conn_out_params *out)
 {
 	return ipa_wdi3_conn_pipes(in, out);
 }
 
 /**
- * __qdf_ipa_wdi3_disconn_pipes() - Client should call this
+ * __qdf_ipa_wdi_disconn_pipes() - Client should call this
  *		function to disconnect pipes
  *
  * Note: Should not be called from atomic context
  *
  * Returns: 0 on success, negative on failure
  */
-static inline int __qdf_ipa_wdi3_disconn_pipes(void)
+static inline int __qdf_ipa_wdi_disconn_pipes(void)
 {
 	return ipa_wdi3_disconn_pipes();
 }
 
 /**
- * __qdf_ipa_wdi3_enable_pipes() - Client should call this
+ * __qdf_ipa_wdi_enable_pipes() - Client should call this
  *		function to enable IPA offload data path
  *
  * Note: Should not be called from atomic context
  *
  * Returns: 0 on success, negative on failure
  */
-static inline int __qdf_ipa_wdi3_enable_pipes(void)
+static inline int __qdf_ipa_wdi_enable_pipes(void)
 {
 	return ipa_wdi3_enable_pipes();
 }
 
 /**
- * __qdf_ipa_wdi3_disable_pipes() - Client should call this
+ * __qdf_ipa_wdi_disable_pipes() - Client should call this
  *		function to disable IPA offload data path
  *
  * Note: Should not be called from atomic context
  *
  * Returns: 0 on success, negative on failure
  */
-static inline int __qdf_ipa_wdi3_disable_pipes(void)
+static inline int __qdf_ipa_wdi_disable_pipes(void)
 {
 	return ipa_wdi3_disable_pipes();
 }
 
 /**
- * __qdf_ipa_wdi3_set_perf_profile() - Client should call this function to
+ * __qdf_ipa_wdi_set_perf_profile() - Client should call this function to
  *		set IPA clock bandwidth based on data rates
  *
  * @profile: [in] BandWidth profile to use
  *
  * Returns: 0 on success, negative on failure
  */
-static inline int __qdf_ipa_wdi3_set_perf_profile(
+static inline int __qdf_ipa_wdi_set_perf_profile(
 			struct ipa_wdi3_perf_profile *profile)
 {
 	return ipa_wdi3_set_perf_profile(profile);