Sfoglia il codice sorgente

qcacmn: Remove kernel includes from datapath

To abstract kernel header inclusion, create a new QDF APIs for all IPA
APIs and redirect all IPA API calls through QDF interfaces.

Change-Id: I7bff975ad7cb32fc128320c124633594471e0a1f
CRs-Fixed: 2098907
Yun Park 7 anni fa
parent
commit
fd269b5021

+ 3 - 4
dp/inc/cdp_txrx_ipa.h

@@ -32,8 +32,7 @@
 #define _CDP_TXRX_IPA_H_
 
 #ifdef IPA_OFFLOAD
-
-#include <linux/ipa.h>
+#include <qdf_ipa.h>
 #include <cdp_txrx_mob_def.h>
 #include "cdp_txrx_handle.h"
 
@@ -419,8 +418,8 @@ cdp_ipa_cleanup(ol_txrx_soc_handle soc, uint32_t tx_pipe_handle,
  */
 static inline QDF_STATUS
 cdp_ipa_setup_iface(ol_txrx_soc_handle soc, char *ifname, uint8_t *mac_addr,
-		    enum ipa_client_type prod_client,
-		    enum ipa_client_type cons_client,
+		    qdf_ipa_client_type_t prod_client,
+		    qdf_ipa_client_type_t cons_client,
 		    uint8_t session_id, bool is_ipv6_enabled)
 {
 	if (!soc || !soc->ops || !soc->ops->ipa_ops) {

+ 4 - 3
dp/inc/cdp_txrx_ops.h

@@ -32,8 +32,9 @@
 #include "cdp_txrx_handle.h"
 #include <cdp_txrx_mon_struct.h>
 #include "wlan_objmgr_psoc_obj.h"
+
 #ifdef IPA_OFFLOAD
-#include <linux/ipa.h>
+#include <qdf_ipa.h>
 #endif
 
 /**
@@ -828,8 +829,8 @@ struct cdp_ipa_ops {
 	QDF_STATUS (*ipa_cleanup)(uint32_t tx_pipe_handle,
 		uint32_t rx_pipe_handle);
 	QDF_STATUS (*ipa_setup_iface)(char *ifname, uint8_t *mac_addr,
-		enum ipa_client_type prod_client,
-		enum ipa_client_type cons_client,
+		qdf_ipa_client_type_t prod_client,
+		qdf_ipa_client_type_t cons_client,
 		uint8_t session_id, bool is_ipv6_enabled);
 	QDF_STATUS (*ipa_cleanup_iface)(char *ifname, bool is_ipv6_enabled);
 	QDF_STATUS (*ipa_enable_pipes)(struct cdp_pdev *pdev);

+ 99 - 85
dp/wifi3.0/dp_ipa.c

@@ -16,7 +16,7 @@
 
 #ifdef IPA_OFFLOAD
 
-#include <linux/ipa_wdi3.h>
+#include <qdf_ipa_wdi3.h>
 #include <qdf_types.h>
 #include <qdf_lock.h>
 #include <hal_api.h>
@@ -605,10 +605,10 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 	struct dp_pdev *pdev = (struct dp_pdev *)ppdev;
 	struct dp_soc *soc = pdev->soc;
 	struct dp_ipa_resources *ipa_res = &pdev->ipa_resource;
-	struct ipa_wdi3_setup_info tx;
-	struct ipa_wdi3_setup_info rx;
-	struct ipa_wdi3_conn_in_params pipe_in;
-	struct ipa_wdi3_conn_out_params pipe_out;
+	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;
 	struct tcl_data_cmd *tcl_desc_ptr;
 	uint8_t *desc_addr;
 	uint32_t desc_size;
@@ -616,8 +616,8 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 
 	qdf_mem_zero(&tx, sizeof(struct ipa_wdi3_setup_info));
 	qdf_mem_zero(&rx, sizeof(struct ipa_wdi3_setup_info));
-	qdf_mem_zero(&pipe_in, sizeof(struct ipa_wdi3_conn_in_params));
-	qdf_mem_zero(&pipe_out, sizeof(struct ipa_wdi3_conn_out_params));
+	qdf_mem_zero(&pipe_in, sizeof(pipe_in));
+	qdf_mem_zero(&pipe_out, sizeof(pipe_out));
 
 	/* TX PIPE */
 	/**
@@ -626,30 +626,39 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 	 * Event Ring: TCL ring
 	 * Event Ring Doorbell PA: TCL Head Pointer Address
 	 */
-	tx.ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
-	tx.ipa_ep_cfg.hdr.hdr_len = DP_IPA_UC_WLAN_TX_HDR_LEN;
-	tx.ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid = 0;
-	tx.ipa_ep_cfg.hdr.hdr_ofst_pkt_size = 0;
-	tx.ipa_ep_cfg.hdr.hdr_additional_const_len = 0;
-	tx.ipa_ep_cfg.mode.mode = IPA_BASIC;
-	tx.ipa_ep_cfg.hdr_ext.hdr_little_endian = true;
-	tx.client = IPA_CLIENT_WLAN1_CONS;
-	tx.transfer_ring_base_pa = ipa_res->tx_comp_ring_base_paddr;
-	tx.transfer_ring_size = ipa_res->tx_comp_ring_size;
-	tx.transfer_ring_doorbell_pa = /* WBM Tail 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) =
+		ipa_res->tx_comp_ring_base_paddr;
+	QDF_IPA_WDI3_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) =
 		soc->ipa_uc_tx_rsc.ipa_wbm_tp_paddr;
-	tx.event_ring_base_pa = ipa_res->tx_ring_base_paddr;
-	tx.event_ring_size = ipa_res->tx_ring_size;
-	tx.event_ring_doorbell_pa = /* TCL Head Pointer Address */
+	QDF_IPA_WDI3_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;
+	/* TCL Head Pointer Address */
+	QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx) =
 		soc->ipa_uc_tx_rsc.ipa_tcl_hp_paddr;
-	tx.num_pkt_buffers = ipa_res->tx_num_alloc_buffer;
-	tx.pkt_offset = 0;
+	QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(tx) =
+		ipa_res->tx_num_alloc_buffer;
+	QDF_IPA_WDI3_SETUP_INFO_PKT_OFFSET(tx) = 0;
 
 	/* Preprogram TCL descriptor */
-	desc_addr = (uint8_t *)(tx.desc_format_template);
+	desc_addr =
+		(uint8_t *)QDF_IPA_WDI3_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 *)(tx.desc_format_template+1);
+	tcl_desc_ptr = (struct tcl_data_cmd *)
+		(QDF_IPA_WDI3_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 */
@@ -663,29 +672,28 @@ QDF_STATUS dp_ipa_setup(struct cdp_pdev *ppdev, void *ipa_i2w_cb,
 	 * Event Ring: FW ring
 	 * Event Ring Doorbell PA: FW Head Pointer Address
 	 */
-	rx.ipa_ep_cfg.nat.nat_en = IPA_BYPASS_NAT;
-	rx.ipa_ep_cfg.hdr.hdr_len = DP_IPA_UC_WLAN_RX_HDR_LEN;
-	rx.ipa_ep_cfg.hdr.hdr_ofst_metadata_valid = 0;
-	rx.ipa_ep_cfg.hdr.hdr_metadata_reg_valid = 1;
-	rx.ipa_ep_cfg.mode.mode = IPA_BASIC;
-	rx.client = IPA_CLIENT_WLAN1_PROD;
-	rx.transfer_ring_base_pa = ipa_res->rx_rdy_ring_base_paddr;
-	rx.transfer_ring_size = ipa_res->rx_rdy_ring_size;
-	rx.transfer_ring_doorbell_pa = /* REO Tail 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;
-	rx.event_ring_base_pa = ipa_res->rx_refill_ring_base_paddr;
-	rx.event_ring_size = ipa_res->rx_refill_ring_size;
-	rx.event_ring_doorbell_pa = /* FW Head Pointer Address */
+	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;
-	rx.pkt_offset = RX_PKT_TLVS_LEN + L3_HEADER_PADDING;
+	QDF_IPA_WDI3_SETUP_INFO_PKT_OFFSET(rx) = RX_PKT_TLVS_LEN + L3_HEADER_PADDING;
 
-	pipe_in.notify = ipa_w2i_cb;
-	pipe_in.priv = ipa_priv;
-	memcpy(&pipe_in.tx, &tx, sizeof(struct ipa_wdi3_setup_info));
-	memcpy(&pipe_in.rx, &rx, sizeof(struct ipa_wdi3_setup_info));
+	QDF_IPA_WDI3_CONN_IN_PARAMS_NOTIFY(&pipe_in) = ipa_w2i_cb;
+	QDF_IPA_WDI3_CONN_IN_PARAMS_PRIV(&pipe_in) = ipa_priv;
 
 	/* Connect WDI IPA PIPE */
-	ret = ipa_wdi3_conn_pipes(&pipe_in, &pipe_out);
+	ret = qdf_ipa_wdi3_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",
@@ -697,30 +705,33 @@ 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)pipe_out.tx_uc_db_pa,
-		  (unsigned int)pipe_out.rx_uc_db_pa);
+		(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));
 
-	ipa_res->tx_comp_doorbell_paddr = pipe_out.tx_uc_db_pa;
-	ipa_res->tx_comp_doorbell_vaddr = pipe_out.tx_uc_db_va;
-	ipa_res->rx_ready_doorbell_paddr = pipe_out.rx_uc_db_pa;
+	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);
+	ipa_res->rx_ready_doorbell_paddr =
+		QDF_IPA_WDI3_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 *)pipe_in.tx.transfer_ring_base_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_BASE_PA(tx),
 		  "transfer_ring_size",
-		  pipe_in.tx.transfer_ring_size,
+		  QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_SIZE(tx),
 		  "transfer_ring_doorbell_pa",
-		  (void *)pipe_in.tx.transfer_ring_doorbell_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(tx),
 		  "event_ring_base_pa",
-		  (void *)pipe_in.tx.event_ring_base_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_BASE_PA(tx),
 		  "event_ring_size",
-		  pipe_in.tx.event_ring_size,
+		  QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_SIZE(tx),
 		  "event_ring_doorbell_pa",
-		  (void *)pipe_in.tx.event_ring_doorbell_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(tx),
 		  "num_pkt_buffers",
-		  pipe_in.tx.num_pkt_buffers,
+		  QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(tx),
 		  "tx_comp_doorbell_paddr",
 		  (void *)ipa_res->tx_comp_doorbell_paddr);
 
@@ -728,19 +739,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 *)pipe_in.rx.transfer_ring_base_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_BASE_PA(rx),
 		  "transfer_ring_size",
-		  pipe_in.rx.transfer_ring_size,
+		  QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_SIZE(rx),
 		  "transfer_ring_doorbell_pa",
-		  (void *)pipe_in.rx.transfer_ring_doorbell_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_TRANSFER_RING_DOORBELL_PA(rx),
 		  "event_ring_base_pa",
-		  (void *)pipe_in.rx.event_ring_base_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_BASE_PA(rx),
 		  "event_ring_size",
-		  pipe_in.rx.event_ring_size,
+		  QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_SIZE(rx),
 		  "event_ring_doorbell_pa",
-		  (void *)pipe_in.rx.event_ring_doorbell_pa,
+		  (void *)QDF_IPA_WDI3_SETUP_INFO_EVENT_RING_DOORBELL_PA(rx),
 		  "num_pkt_buffers",
-		  pipe_in.rx.num_pkt_buffers,
+		  QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(rx),
 		  "tx_comp_doorbell_paddr",
 		  (void *)ipa_res->rx_ready_doorbell_paddr);
 
@@ -758,7 +769,7 @@ QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle, uint32_t rx_pipe_handle)
 {
 	int ret;
 
-	ret = ipa_wdi3_disconn_pipes();
+	ret = qdf_ipa_wdi3_disconn_pipes();
 	if (ret) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 		    "%s: ipa_wdi3_disconn_pipes: IPA pipe cleanup failed: ret=%d",
@@ -781,12 +792,12 @@ QDF_STATUS dp_ipa_cleanup(uint32_t tx_pipe_handle, uint32_t rx_pipe_handle)
  * Return: QDF_STATUS
  */
 QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
-			      enum ipa_client_type prod_client,
-			      enum ipa_client_type cons_client,
+			      qdf_ipa_client_type_t prod_client,
+			      qdf_ipa_client_type_t cons_client,
 			      uint8_t session_id, bool is_ipv6_enabled)
 {
-	struct ipa_wdi3_reg_intf_in_params in;
-	struct ipa_wdi3_hdr_info hdr_info;
+	qdf_ipa_wdi3_reg_intf_in_params_t in;
+	qdf_ipa_wdi3_hdr_info_t hdr_info;
 	struct dp_ipa_uc_tx_hdr uc_tx_hdr;
 	int ret = -EINVAL;
 
@@ -794,31 +805,34 @@ QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
 		  "%s: Add Partial hdr: %s, %pM",
 		  __func__, ifname, mac_addr);
 
-	qdf_mem_zero(&hdr_info, sizeof(struct ipa_wdi3_hdr_info));
+	qdf_mem_zero(&hdr_info, sizeof(qdf_ipa_wdi3_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);
 
-	hdr_info.hdr = (uint8_t *)&uc_tx_hdr;
-	hdr_info.hdr_len = DP_IPA_UC_WLAN_TX_HDR_LEN;
-	hdr_info.hdr_type = IPA_HDR_L2_ETHERNET_II;
-	hdr_info.dst_mac_addr_offset = DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
+	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) =
+		DP_IPA_UC_WLAN_HDR_DES_MAC_OFFSET;
 
-	in.netdev_name = ifname;
-	memcpy(&(in.hdr_info[0]), &hdr_info, sizeof(struct ipa_wdi3_hdr_info));
-	in.is_meta_data_valid = 1;
-	in.meta_data = htonl(session_id << 16);
-	in.meta_data_mask = htonl(0x00FF0000);
+	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) =
+		htonl(session_id << 16);
+	QDF_IPA_WDI3_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(&(in.hdr_info[1]), &hdr_info,
-				sizeof(struct ipa_wdi3_hdr_info));
+		memcpy(&(QDF_IPA_WDI3_REG_INTF_IN_PARAMS_HDR_INFO(&in)[1]),
+			&hdr_info, sizeof(qdf_ipa_wdi3_hdr_info_t));
 	}
 
-	ret = ipa_wdi3_reg_intf(&in);
+	ret = qdf_ipa_wdi3_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",
@@ -840,7 +854,7 @@ QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled)
 {
 	int ret;
 
-	ret = ipa_wdi3_dereg_intf(ifname);
+	ret = qdf_ipa_wdi3_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",
@@ -861,7 +875,7 @@ QDF_STATUS dp_ipa_enable_pipes(struct cdp_pdev *ppdev)
 {
 	QDF_STATUS result;
 
-	result = ipa_wdi3_enable_pipes();
+	result = qdf_ipa_wdi3_enable_pipes();
 	if (result) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Enable WDI PIPE fail, code %d",
@@ -882,7 +896,7 @@ QDF_STATUS dp_ipa_disable_pipes(struct cdp_pdev *ppdev)
 {
 	QDF_STATUS result;
 
-	result = ipa_wdi3_disable_pipes();
+	result = qdf_ipa_wdi3_disable_pipes();
 	if (result) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Disable WDI PIPE fail, code %d",
@@ -902,13 +916,13 @@ 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)
 {
-	struct ipa_wdi3_perf_profile profile;
+	qdf_ipa_wdi3_perf_profile_t profile;
 	QDF_STATUS result;
 
 	profile.client = client;
 	profile.max_supported_bw_mbps = max_supported_bw_mbps;
 
-	result = ipa_wdi3_set_perf_profile(&profile);
+	result = qdf_ipa_wdi3_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",

+ 2 - 2
dp/wifi3.0/dp_ipa.h

@@ -65,8 +65,8 @@ int dp_ipa_add_header_info(char *ifname, uint8_t *mac_addr,
 		uint8_t session_id, bool is_ipv6_enabled);
 int dp_ipa_register_interface(char *ifname, bool is_ipv6_enabled);
 QDF_STATUS dp_ipa_setup_iface(char *ifname, uint8_t *mac_addr,
-		enum ipa_client_type prod_client,
-		enum ipa_client_type cons_client,
+		qdf_ipa_client_type_t prod_client,
+		qdf_ipa_client_type_t cons_client,
 		uint8_t session_id, bool is_ipv6_enabled);
 QDF_STATUS dp_ipa_cleanup_iface(char *ifname, bool is_ipv6_enabled);
 QDF_STATUS dp_ipa_enable_pipes(struct cdp_pdev *pdev);

+ 0 - 1
dp/wifi3.0/dp_rx.c

@@ -22,7 +22,6 @@
 #include "hal_rx.h"
 #include "hal_api.h"
 #include "qdf_nbuf.h"
-#include <linux/ieee80211.h>
 #ifdef MESH_MODE_SUPPORT
 #include "if_meta_hdr.h"
 #endif

+ 0 - 1
dp/wifi3.0/dp_rx_mon_dest.c

@@ -24,7 +24,6 @@
 #include "qdf_trace.h"
 #include "qdf_nbuf.h"
 #include "hal_api_mon.h"
-#include "linux/ieee80211.h"
 #include "dp_rx_mon.h"
 #include "wlan_cfg.h"
 

+ 0 - 1
dp/wifi3.0/dp_rx_mon_status.c

@@ -23,7 +23,6 @@
 #include "qdf_trace.h"
 #include "qdf_nbuf.h"
 #include "hal_api_mon.h"
-#include "linux/ieee80211.h"
 #include "dp_rx_mon.h"
 #include "dp_internal.h"
 #include "qdf_mem.h"   /* qdf_mem_malloc,free */

+ 607 - 0
qdf/inc/qdf_ipa.h

@@ -0,0 +1,607 @@
+/*
+ * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _QDF_IPA_H
+#define _QDF_IPA_H
+
+#include <i_qdf_ipa.h>
+
+/**
+ * qdf_ipa_wdi_meter_evt_type_t - type of event client callback is
+ * for AP+STA mode metering
+ * @IPA_GET_WDI_SAP_STATS: get IPA_stats betwen SAP and STA -
+ *			use ipa_get_wdi_sap_stats structure
+ * @IPA_SET_WIFI_QUOTA: set quota limit on STA -
+ *			use ipa_set_wifi_quota structure
+ */
+typedef __qdf_ipa_wdi_meter_evt_type_t qdf_ipa_wdi_meter_evt_type_t;
+
+typedef __qdf_ipa_get_wdi_sap_stats_t qdf_ipa_get_wdi_sap_stats_t;
+
+/**
+ * qdf_ipa_set_wifi_quota_t - structure used for
+ *                                   IPA_SET_WIFI_QUOTA.
+ */
+typedef __qdf_ipa_set_wifi_quota_t qdf_ipa_set_wifi_quota_t;
+
+/**
+ * qdf_ipa_connect_params_t - low-level client connect input parameters. Either
+ * client allocates the data and desc FIFO and specifies that in data+desc OR
+ * specifies sizes and pipe_mem pref and IPA does the allocation.
+ */
+typedef __qdf_ipa_connect_params_t qdf_ipa_connect_params_t;
+
+/**
+ * qdf_ipa_tx_meta_t - meta-data for the TX packet
+ */
+typedef __qdf_ipa_tx_meta_t qdf_ipa_tx_meta_t;
+
+/**
+ *  __qdf_ipa_sps_params_t - SPS related output parameters resulting from
+ */
+typedef __qdf_ipa_sps_params_t qdf_ipa_sps_params_t;
+
+/**
+ * qdf_ipa_tx_intf_t - interface tx properties
+ */
+typedef __qdf_ipa_tx_intf_t qdf_ipa_tx_intf_t;
+
+/**
+ * qdf_ipa_rx_intf_t - interface rx properties
+ */
+typedef __qdf_ipa_rx_intf_t qdf_ipa_rx_intf_t;
+
+/**
+ * qdf_ipa_ext_intf_t - interface ext properties
+ */
+typedef __qdf_ipa_ext_intf_t qdf_ipa_ext_intf_t;
+
+/**
+ * qdf_ipa_sys_connect_params_t - information needed to setup an IPA end-point
+ * in system-BAM mode
+ */
+typedef __qdf_ipa_sys_connect_params_t qdf_ipa_sys_connect_params_t;
+
+/**
+ * __qdf_pa_rm_event_t - IPA RM events
+ *
+ * Indicate the resource state change
+ */
+typedef __qdf_ipa_rm_event_t qdf_ipa_rm_event_t;
+
+/**
+ * struct qdf_ipa_rm_register_params_t - information needed to
+ *      register IPA RM client with IPA RM
+ */
+typedef __qdf_ipa_rm_register_params_t qdf_ipa_rm_register_params_t;
+
+/**
+ * struct qdf_ipa_rm_create_params_t - information needed to initialize
+ *				the resource
+ *
+ * IPA RM client is expected to perform non blocking operations only
+ * in request_resource and release_resource functions and
+ * release notification context as soon as possible.
+ */
+typedef __qdf_ipa_rm_create_params_t qdf_ipa_rm_create_params_t;
+
+/**
+ * qdf_ipa_rm_perf_profile_t - information regarding IPA RM client performance
+ * profile
+ */
+typedef __qdf_ipa_rm_perf_profile_t qdf_ipa_rm_perf_profile_t;
+
+/**
+ * qdf_ipa_tx_data_desc_t - information needed
+ * to send data packet to HW link: link to data descriptors
+ * priv: client specific private data
+ */
+typedef __qdf_ipa_tx_data_desc_t qdf_ipa_tx_data_desc_t;
+
+/**
+ * qdf_ipa_rx_data_t - information needed
+ * to send to wlan driver on receiving data from ipa hw
+ */
+typedef __qdf_ipa_rx_data_t qdf_ipa_rx_data_t;
+
+/**
+ * qdf_ipa_wdi_ul_params_t - WDI_RX configuration
+ */
+typedef __qdf_ipa_wdi_ul_params_t qdf_ipa_wdi_ul_params_t;
+
+/**
+ * qdf_ipa_wdi_ul_params_smmu_t - WDI_RX configuration (with WLAN SMMU)
+ */
+typedef __qdf_ipa_wdi_ul_params_smmu_t qdf_ipa_wdi_ul_params_smmu_t;
+
+/**
+ * qdf_ipa_wdi_dl_params_t - WDI_TX configuration
+ */
+typedef __qdf_ipa_wdi_dl_params_t qdf_ipa_wdi_dl_params_t;
+
+/**
+ * qdf_ipa_wdi_dl_params_smmu_t - WDI_TX configuration (with WLAN SMMU)
+ */
+typedef __qdf_ipa_wdi_dl_params_smmu_t qdf_ipa_wdi_dl_params_smmu_t;
+
+/**
+ * qdf_ipa_wdi_in_params_t - information provided by WDI client
+ */
+typedef __qdf_ipa_wdi_in_params_t qdf_ipa_wdi_in_params_t;
+
+/**
+ * qdf_ipa_wdi_out_params_t - information provided to WDI client
+ */
+typedef __qdf_ipa_wdi_out_params_t qdf_ipa_wdi_out_params_t;
+
+/**
+ * qdf_ipa_wdi_db_params_t - information provided to retrieve
+ *       physical address of uC doorbell
+ */
+typedef __qdf_ipa_wdi_db_params_t qdf_ipa_wdi_db_params_t;
+
+/**
+ * qdf_ipa_wdi_uc_ready_params_t - uC ready CB parameters
+ */
+typedef void (*qdf_ipa_uc_ready_cb)(void *priv);
+typedef __qdf_ipa_wdi_uc_ready_params_t qdf_ipa_wdi_uc_ready_params_t;
+
+/**
+ * qdf_ipa_wdi_buffer_info_t - address info of a WLAN allocated buffer
+ *
+ * IPA driver will create/release IOMMU mapping in IPA SMMU from iova->pa
+ */
+typedef __qdf_ipa_wdi_buffer_info_t qdf_ipa_wdi_buffer_info_t;
+
+/**
+ * qdf_ipa_gsi_ep_config_t - IPA GSI endpoint configurations
+ */
+typedef __qdf_ipa_gsi_ep_config_t qdf_ipa_gsi_ep_config_t;
+
+/**
+ * qdf_ipa_dp_evt_type_t - type of event client callback is
+ * invoked for on data path
+ * @IPA_RECEIVE: data is struct sk_buff
+ * @IPA_WRITE_DONE: data is struct sk_buff
+ */
+typedef __qdf_ipa_dp_evt_type_t qdf_ipa_dp_evt_type_t;
+
+typedef __qdf_ipa_hdr_add_t qdf_ipa_hdr_add_t;
+typedef __qdf_ipa_hdr_del_t qdf_ipa_hdr_del_t;
+typedef __qdf_ipa_ioc_add_hdr_t qdf_ipa_ioc_add_hdr_t;
+typedef __qdf_ipa_ioc_del_hdr_t qdf_ipa_ioc_del_hdr_t;
+typedef __qdf_ipa_ioc_get_hdr_t qdf_ipa_ioc_get_hdr_t;
+typedef __qdf_ipa_ioc_copy_hdr_t qdf_ipa_ioc_copy_hdr_t;
+typedef __qdf_ipa_ioc_add_hdr_proc_ctx_t qdf_ipa_ioc_add_hdr_proc_ctx_t;
+typedef __qdf_ipa_ioc_del_hdr_proc_ctx_t qdf_ipa_ioc_del_hdr_proc_ctx_t;
+typedef __qdf_ipa_msg_meta_t qdf_ipa_msg_meta_t;
+typedef __qdf_ipa_client_type_t qdf_ipa_client_type_t;
+typedef __qdf_ipa_hw_stats_wdi_info_data_t qdf_ipa_hw_stats_wdi_info_data_t;
+typedef __qdf_ipa_rm_resource_name_t  qdf_ipa_rm_resource_name_t;
+typedef __qdf_ipa_wlan_event_t qdf_ipa_wlan_event_t;
+typedef __qdf_ipa_wlan_msg_t qdf_ipa_wlan_msg_t;
+typedef __qdf_ipa_wlan_msg_ex_t qdf_ipa_wlan_msg_ex_t;
+typedef __qdf_ipa_ioc_tx_intf_prop_t qdf_ipa_ioc_tx_intf_prop_t;
+typedef __qdf_ipa_ioc_rx_intf_prop_t qdf_ipa_ioc_rx_intf_prop_t;
+typedef __qdf_ipa_wlan_hdr_attrib_val_t qdf_ipa_wlan_hdr_attrib_val_t;
+typedef int (*qdf_ipa_msg_pull_fn)(void *buff, u32 len, u32 type);
+typedef void (*qdf_ipa_ready_cb)(void *user_data);
+
+/*
+ * Connect / Disconnect
+ */
+static inline int qdf_ipa_connect(const __qdf_ipa_connect_params_t *in,
+		qdf_ipa_sps_params_t *sps,	u32 *clnt_hdl)
+{
+	return __qdf_ipa_connect(in, sps, clnt_hdl);
+}
+
+static inline int qdf_ipa_disconnect(u32 clnt_hdl)
+{
+	return __qdf_ipa_disconnect(clnt_hdl);
+}
+
+/*
+ * Resume / Suspend
+ */
+static inline int qdf_ipa_reset_endpoint(u32 clnt_hdl)
+{
+	return __qdf_ipa_reset_endpoint(clnt_hdl);
+}
+
+/*
+ * Remove ep delay
+ */
+static inline int qdf_ipa_clear_endpoint_delay(u32 clnt_hdl)
+{
+	return __qdf_ipa_clear_endpoint_delay(clnt_hdl);
+}
+
+/*
+ * Header removal / addition
+ */
+static inline int qdf_ipa_add_hdr(qdf_ipa_ioc_add_hdr_t *hdrs)
+{
+	return __qdf_ipa_add_hdr(hdrs);
+}
+
+static inline int qdf_ipa_del_hdr(qdf_ipa_ioc_del_hdr_t *hdls)
+{
+	return __qdf_ipa_del_hdr(hdls);
+}
+
+static inline int qdf_ipa_commit_hdr(void)
+{
+	return __qdf_ipa_commit_hdr();
+}
+
+static inline int qdf_ipa_reset_hdr(void)
+{
+	return __qdf_ipa_reset_hdr();
+}
+
+static inline int qdf_ipa_get_hdr(qdf_ipa_ioc_get_hdr_t *lookup)
+{
+	return __qdf_ipa_get_hdr(lookup);
+}
+
+static inline int qdf_ipa_put_hdr(u32 hdr_hdl)
+{
+	return __qdf_ipa_put_hdr(hdr_hdl);
+}
+
+static inline int qdf_ipa_copy_hdr(qdf_ipa_ioc_copy_hdr_t *copy)
+{
+	return __qdf_ipa_copy_hdr(copy);
+}
+
+/*
+ * Header Processing Context
+ */
+static inline int qdf_ipa_add_hdr_proc_ctx(
+				qdf_ipa_ioc_add_hdr_proc_ctx_t *proc_ctxs)
+{
+	return __qdf_ipa_add_hdr_proc_ctx(proc_ctxs);
+}
+
+static inline int qdf_ipa_del_hdr_proc_ctx(qdf_ipa_ioc_del_hdr_proc_ctx_t *hdls)
+{
+	return __qdf_ipa_del_hdr_proc_ctx(hdls);
+}
+
+/*
+ * Messaging
+ */
+static inline int qdf_ipa_send_msg(qdf_ipa_msg_meta_t *meta, void *buff,
+		ipa_msg_free_fn callback)
+{
+	return __qdf_ipa_send_msg(meta, buff, callback);
+}
+
+static inline int qdf_ipa_register_pull_msg(qdf_ipa_msg_meta_t *meta,
+		qdf_ipa_msg_pull_fn callback)
+{
+	return __qdf_ipa_register_pull_msg(meta, callback);
+}
+
+static inline int qdf_ipa_deregister_pull_msg(qdf_ipa_msg_meta_t *meta)
+{
+	return __qdf_ipa_deregister_pull_msg(meta);
+}
+
+/*
+ * Interface
+ */
+static inline int qdf_ipa_register_intf(const char *name,
+				     const qdf_ipa_tx_intf_t *tx,
+				     const qdf_ipa_rx_intf_t *rx)
+{
+	return __qdf_ipa_register_intf(name, tx, rx);
+}
+
+static inline int qdf_ipa_register_intf_ext(const char *name,
+		const qdf_ipa_tx_intf_t *tx,
+		const qdf_ipa_rx_intf_t *rx,
+		const qdf_ipa_ext_intf_t *ext)
+{
+	return __qdf_ipa_register_intf_ext(name, tx, rx, ext);
+}
+
+static inline int qdf_ipa_deregister_intf(const char *name)
+{
+	return __qdf_ipa_deregister_intf(name);
+}
+
+/*
+ * Data path
+ */
+static inline int qdf_ipa_tx_dp(qdf_ipa_client_type_t dst, struct sk_buff *skb,
+		qdf_ipa_tx_meta_t *metadata)
+{
+	return __qdf_ipa_tx_dp(dst, skb, metadata);
+}
+
+/*
+ * To transfer multiple data packets
+ */
+static inline int qdf_ipa_tx_dp_mul(
+	qdf_ipa_client_type_t dst,
+	qdf_ipa_tx_data_desc_t *data_desc)
+{
+	return __qdf_ipa_tx_dp_mul(dst, data_desc);
+}
+
+static inline void qdf_ipa_free_skb(qdf_ipa_rx_data_t *rx_in)
+{
+	return __qdf_ipa_free_skb(rx_in);;
+}
+
+/*
+ * System pipes
+ */
+static inline u16 qdf_ipa_get_smem_restr_bytes(void)
+{
+	return __qdf_ipa_get_smem_restr_bytes();
+}
+
+static inline int qdf_ipa_setup_sys_pipe(qdf_ipa_sys_connect_params_t *sys_in,
+		u32 *clnt_hdl)
+{
+	return __qdf_ipa_setup_sys_pipe(sys_in, clnt_hdl);
+}
+
+static inline int qdf_ipa_teardown_sys_pipe(u32 clnt_hdl)
+{
+	return __qdf_ipa_teardown_sys_pipe(clnt_hdl);
+}
+
+static inline int qdf_ipa_connect_wdi_pipe(qdf_ipa_wdi_in_params_t *in,
+		qdf_ipa_wdi_out_params_t *out)
+{
+	return __qdf_ipa_connect_wdi_pipe(in, out);
+}
+
+static inline int qdf_ipa_disconnect_wdi_pipe(u32 clnt_hdl)
+{
+	return __qdf_ipa_disconnect_wdi_pipe(clnt_hdl);
+}
+
+static inline int qdf_ipa_enable_wdi_pipe(u32 clnt_hdl)
+{
+	return __qdf_ipa_enable_wdi_pipe(clnt_hdl);
+}
+
+static inline int qdf_ipa_disable_wdi_pipe(u32 clnt_hdl)
+{
+	return __qdf_ipa_disable_wdi_pipe(clnt_hdl);
+}
+
+static inline int qdf_ipa_resume_wdi_pipe(u32 clnt_hdl)
+{
+	return __qdf_ipa_resume_wdi_pipe(clnt_hdl);
+}
+
+static inline int qdf_ipa_suspend_wdi_pipe(u32 clnt_hdl)
+{
+	return __qdf_ipa_suspend_wdi_pipe(clnt_hdl);
+}
+
+static inline int qdf_ipa_uc_wdi_get_dbpa(
+	qdf_ipa_wdi_db_params_t *out)
+{
+	return __qdf_ipa_uc_wdi_get_dbpa(out);
+}
+
+static inline int qdf_ipa_uc_reg_rdyCB(
+	qdf_ipa_wdi_uc_ready_params_t *param)
+{
+	return __qdf_ipa_uc_reg_rdyCB(param);
+}
+
+static inline int qdf_ipa_uc_dereg_rdyCB(void)
+{
+	return __qdf_ipa_uc_dereg_rdyCB();
+}
+
+
+/*
+ * Resource manager
+ */
+static inline int qdf_ipa_rm_create_resource(
+		qdf_ipa_rm_create_params_t *create_params)
+{
+	return __qdf_ipa_rm_create_resource(create_params);
+}
+
+static inline int qdf_ipa_rm_delete_resource(
+		qdf_ipa_rm_resource_name_t resource_name)
+{
+	return __qdf_ipa_rm_delete_resource(resource_name);
+}
+
+static inline int qdf_ipa_rm_register(qdf_ipa_rm_resource_name_t resource_name,
+			qdf_ipa_rm_register_params_t *reg_params)
+{
+	return __qdf_ipa_rm_register(resource_name, reg_params);
+}
+
+static inline int qdf_ipa_rm_set_perf_profile(
+		qdf_ipa_rm_resource_name_t resource_name,
+		qdf_ipa_rm_perf_profile_t *profile)
+{
+	return __qdf_ipa_rm_set_perf_profile(resource_name, profile);
+}
+
+static inline int qdf_ipa_rm_deregister(qdf_ipa_rm_resource_name_t resource_name,
+			qdf_ipa_rm_register_params_t *reg_params)
+{
+	return __qdf_ipa_rm_deregister(resource_name, reg_params);
+}
+
+static inline int qdf_ipa_rm_add_dependency(
+		qdf_ipa_rm_resource_name_t resource_name,
+		qdf_ipa_rm_resource_name_t depends_on_name)
+{
+	return __qdf_ipa_rm_add_dependency(resource_name, depends_on_name);
+}
+
+static inline int qdf_ipa_rm_add_dependency_sync(
+		qdf_ipa_rm_resource_name_t resource_name,
+		qdf_ipa_rm_resource_name_t depends_on_name)
+{
+	return __qdf_ipa_rm_add_dependency_sync(resource_name, depends_on_name);
+}
+
+static inline int qdf_ipa_rm_delete_dependency(
+		qdf_ipa_rm_resource_name_t resource_name,
+		qdf_ipa_rm_resource_name_t depends_on_name)
+{
+	return __qdf_ipa_rm_delete_dependency(resource_name, depends_on_name);
+}
+
+static inline int qdf_ipa_rm_request_resource(
+		qdf_ipa_rm_resource_name_t resource_name)
+{
+	return __qdf_ipa_rm_request_resource(resource_name);
+}
+
+static inline int qdf_ipa_rm_release_resource(
+		qdf_ipa_rm_resource_name_t resource_name)
+{
+	return __qdf_ipa_rm_release_resource(resource_name);
+}
+
+static inline int qdf_ipa_rm_notify_completion(qdf_ipa_rm_event_t event,
+		qdf_ipa_rm_resource_name_t resource_name)
+{
+	return __qdf_ipa_rm_notify_completion(event, resource_name);
+}
+
+static inline int qdf_ipa_rm_inactivity_timer_init(
+		qdf_ipa_rm_resource_name_t resource_name,
+			unsigned long msecs)
+{
+	return __qdf_ipa_rm_inactivity_timer_init(resource_name, msecs);
+}
+
+static inline int qdf_ipa_rm_inactivity_timer_destroy(
+		qdf_ipa_rm_resource_name_t resource_name)
+{
+	return __qdf_ipa_rm_inactivity_timer_destroy(resource_name);
+}
+
+static inline int qdf_ipa_rm_inactivity_timer_request_resource(
+				qdf_ipa_rm_resource_name_t resource_name)
+{
+	return __qdf_ipa_rm_inactivity_timer_request_resource(resource_name);
+}
+
+static inline int qdf_ipa_rm_inactivity_timer_release_resource(
+				qdf_ipa_rm_resource_name_t resource_name)
+{
+	return __qdf_ipa_rm_inactivity_timer_release_resource(resource_name);
+}
+
+/*
+ * Miscellaneous
+ */
+static inline void qdf_ipa_bam_reg_dump(void)
+{
+	return __qdf_ipa_bam_reg_dump();
+}
+
+static inline int qdf_ipa_get_wdi_stats(qdf_ipa_hw_stats_wdi_info_data_t *stats)
+{
+	return __qdf_ipa_get_wdi_stats(stats);
+}
+
+static inline int qdf_ipa_get_ep_mapping(qdf_ipa_client_type_t client)
+{
+	return __qdf_ipa_get_ep_mapping(client);
+}
+
+static inline bool qdf_ipa_is_ready(void)
+{
+	return __qdf_ipa_is_ready();
+}
+
+static inline void qdf_ipa_proxy_clk_vote(void)
+{
+	return __qdf_ipa_proxy_clk_vote();
+}
+
+static inline void qdf_ipa_proxy_clk_unvote(void)
+{
+	return __qdf_ipa_proxy_clk_unvote();
+}
+
+static inline bool qdf_ipa_is_client_handle_valid(u32 clnt_hdl)
+{
+	return __qdf_ipa_is_client_handle_valid(clnt_hdl);
+}
+
+static inline qdf_ipa_client_type_t qdf_ipa_get_client_mapping(int pipe_idx)
+{
+	return __qdf_ipa_get_client_mapping(pipe_idx);
+}
+
+static inline qdf_ipa_rm_resource_name_t qdf_ipa_get_rm_resource_from_ep(
+	int pipe_idx)
+{
+	return __qdf_ipa_get_rm_resource_from_ep(pipe_idx);
+}
+
+static inline bool qdf_ipa_get_modem_cfg_emb_pipe_flt(void)
+{
+	return __qdf_ipa_get_modem_cfg_emb_pipe_flt();
+}
+
+static inline int qdf_ipa_create_wdi_mapping(u32 num_buffers,
+		__qdf_ipa_wdi_buffer_info_t *info)
+{
+	return __qdf_ipa_create_wdi_mapping(num_buffers, info);
+}
+
+static inline int qdf_ipa_release_wdi_mapping(u32 num_buffers,
+		qdf_ipa_wdi_buffer_info_t *info)
+{
+	return __qdf_ipa_release_wdi_mapping(num_buffers, info);
+}
+
+static inline int qdf_ipa_disable_apps_wan_cons_deaggr(uint32_t agg_size,
+		uint32_t agg_count)
+{
+	return __qdf_ipa_disable_apps_wan_cons_deaggr(agg_size, agg_count);
+}
+
+static inline const qdf_ipa_gsi_ep_config_t *qdf_ipa_get_gsi_ep_info(qdf_ipa_client_type_t client)
+{
+	return __qdf_ipa_get_gsi_ep_info(client);
+}
+
+static inline int qdf_ipa_stop_gsi_channel(u32 clnt_hdl)
+{
+	return __qdf_ipa_stop_gsi_channel(clnt_hdl);
+}
+
+static inline int qdf_ipa_register_ipa_ready_cb(
+	void (*qdf_ipa_ready_cb)(void *user_data),
+	void *user_data)
+{
+	return __qdf_ipa_register_ipa_ready_cb(qdf_ipa_ready_cb, user_data);
+}
+
+#endif /* _QDF_IPA_H */

+ 157 - 0
qdf/inc/qdf_ipa_wdi3.h

@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: qdf_ipa_wdi3.h
+ * This file provides OS abstraction for IPA WDI3 APIs.
+ */
+
+#ifndef _QDF_IPA_WDI3_H
+#define _QDF_IPA_WDI3_H
+
+#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

+ 903 - 0
qdf/linux/src/i_qdf_ipa.h

@@ -0,0 +1,903 @@
+/*
+ * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _I_QDF_IPA_H
+#define _I_QDF_IPA_H
+
+#include <linux/ipa.h>
+
+/**
+ * __qdf_ipa_wdi_meter_evt_type_t - type of event client callback is
+ * for AP+STA mode metering
+ * @IPA_GET_WDI_SAP_STATS: get IPA_stats betwen SAP and STA -
+ *			use ipa_get_wdi_sap_stats structure
+ * @IPA_SET_WIFI_QUOTA: set quota limit on STA -
+ *			use ipa_set_wifi_quota structure
+ */
+typedef enum ipa_wdi_meter_evt_type __qdf_ipa_wdi_meter_evt_type_t;
+
+typedef struct ipa_get_wdi_sap_stats __qdf_ipa_get_wdi_sap_stats_t;
+
+#define QDF_IPA_GET_WDI_SAP_STATS_RESET_STATS(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->reset_stats)
+#define QDF_IPA_GET_WDI_SAP_STATS_STATS_VALID(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->stats_valid)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV4_TX_PACKETS(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv4_tx_packets)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV4_TX_BYTES(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv4_tx_bytes)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV4_RX_PACKETS(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv4_rx_packets)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV4_RX_BYTES(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv4_rx_bytes)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV6_TX_PACKETS(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv6_tx_packets)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV6_TX_BYTES(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv6_tx_bytes)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV6_RX_PACKETS(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv6_rx_packets)
+#define QDF_IPA_GET_WDI_SAP_STATS_IPV6_RX_BYTES(wdi_sap_stats)	\
+	(((struct ipa_get_wdi_sap_stats *)(wdi_sap_stats))->ipv6_rx_bytes)
+
+/**
+ * __qdf_ipa_set_wifi_quota_t - structure used for
+ *                                   IPA_SET_WIFI_QUOTA.
+ */
+typedef struct ipa_set_wifi_quota __qdf_ipa_set_wifi_quota_t;
+
+#define QDF_IPA_SET_WIFI_QUOTA_BYTES(ipa_set_quota)	\
+	(((struct ipa_set_wifi_quota *)(ipa_set_quota))->quota_bytes)
+#define QDF_IPA_SET_WIFI_QUOTA_SET_QUOTA(ipa_set_quota)	\
+	(((struct ipa_set_wifi_quota *)(ipa_set_quota))->set_quota)
+#define QDF_IPA_SET_WIFI_QUOTA_SET_VALID(ipa_set_quota)	\
+	(((struct ipa_set_wifi_quota *)(ipa_set_quota))->set_valid)
+
+/**
+ * __qdf_ipa_connect_params_t - low-level client connect input parameters. Either
+ * client allocates the data and desc FIFO and specifies that in data+desc OR
+ * specifies sizes and pipe_mem pref and IPA does the allocation.
+ */
+typedef struct ipa_connect_params __qdf_ipa_connect_params_t;
+
+/**
+ * __qdf_ipa_tx_meta_t - meta-data for the TX packet
+ */
+typedef struct ipa_tx_meta __qdf_ipa_tx_meta_t;
+
+/**
+ * __qdf_ipa_msg_free_fn_t - callback function
+ *
+ * Message callback registered by kernel client with IPA driver to
+ * free message payload after IPA driver processing is complete
+ */
+typedef void (*__qdf_ipa_msg_free_fn_t)(void *buff, u32 len, u32 type);
+
+/**
+ *  __qdf_ipa_sps_params_t - SPS related output parameters resulting from
+ */
+typedef struct ipa_sps_params __qdf_ipa_sps_params_t;
+
+/**
+ * __qdf_ipa_tx_intf_t - interface tx properties
+ */
+typedef struct ipa_tx_intf __qdf_ipa_tx_intf_t;
+
+#define QDF_IPA_TX_INTF_PROP(tx_intf)	\
+	(((struct ipa_tx_intf *)(tx_intf))->prop)
+
+/**
+ * __qdf_ipa_rx_intf_t - interface rx properties
+ */
+typedef struct ipa_rx_intf __qdf_ipa_rx_intf_t;
+
+#define QDF_IPA_RX_INTF_PROP(rx_intf)	\
+	(((struct ipa_rx_intf *)(rx_intf))->prop)
+
+/**
+ * __qdf_ipa_ext_intf_t - interface ext properties
+ */
+typedef struct ipa_ext_intf __qdf_ipa_ext_intf_t;
+
+/**
+ * __qdf_ipa_sys_connect_params_t - information needed to setup an IPA end-point
+ * in system-BAM mode
+ */
+typedef struct ipa_sys_connect_params __qdf_ipa_sys_connect_params_t;
+
+#define QDF_IPA_SYS_PARAMS_NAT_EN(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->ipa_ep_cfg.nat.nat_en)
+#define QDF_IPA_SYS_PARAMS_HDR_LEN(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->ipa_ep_cfg.hdr.hdr_len)
+#define QDF_IPA_SYS_PARAMS_HDR_ADDITIONAL_CONST_LEN(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->ipa_ep_cfg.hdr.hdr_additional_const_len)
+#define QDF_IPA_SYS_PARAMS_HDR_OFST_PKT_SIZE_VALID(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid)
+#define QDF_IPA_SYS_PARAMS_HDR_OFST_PKT_SIZE(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->ipa_ep_cfg.hdr.hdr_ofst_pkt_size)
+#define QDF_IPA_SYS_PARAMS_HDR_LITTLE_ENDIAN(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->ipa_ep_cfg.hdr_ext.hdr_little_endian)
+#define QDF_IPA_SYS_PARAMS_MODE(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->ipa_ep_cfg.mode.mode)
+#define QDF_IPA_SYS_PARAMS_CLIENT(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->client)
+#define QDF_IPA_SYS_PARAMS_DESC_FIFO_SZ(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->desc_fifo_sz)
+#define QDF_IPA_SYS_PARAMS_PRIV(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->priv)
+#define QDF_IPA_SYS_PARAMS_NOTIFY(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->notify)
+#define QDF_IPA_SYS_PARAMS_SKIP_EP_CFG(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->skip_ep_cfg)
+#define QDF_IPA_SYS_PARAMS_KEEP_IPA_AWAKE(ipa_sys_params)	\
+	(((struct ipa_sys_connect_params *)(ipa_sys_params))->keep_ipa_awake)
+
+/**
+ * __qdf_pa_rm_event_t - IPA RM events
+ *
+ * Indicate the resource state change
+ */
+typedef enum ipa_rm_event __qdf_ipa_rm_event_t;
+
+/**
+ * struct __qdf_ipa_rm_register_params_t - information needed to
+ *      register IPA RM client with IPA RM
+ */
+typedef struct ipa_rm_register_params __qdf_ipa_rm_register_params_t;
+
+/**
+ * struct __qdf_ipa_rm_create_params_t - information needed to initialize
+ *				the resource
+ *
+ * IPA RM client is expected to perform non blocking operations only
+ * in request_resource and release_resource functions and
+ * release notification context as soon as possible.
+ */
+typedef struct ipa_rm_create_params __qdf_ipa_rm_create_params_t;
+
+#define QDF_IPA_RM_CREATE_PARAMS_NAME(create_params)	\
+	(((struct ipa_rm_create_params *)(create_params))->name)
+#define QDF_IPA_RM_CREATE_PARAMS_USER_DATA(create_params)	\
+	(((struct ipa_rm_create_params *)(create_params))->reg_params.user_data)
+#define QDF_IPA_RM_CREATE_PARAMS_NOTIFY_CB(create_params)	\
+	(((struct ipa_rm_create_params *)(create_params))->reg_params.notify_cb)
+#define QDF_IPA_RM_CREATE_PARAMS_REQUEST_RESOURCE(create_params)	\
+	(((struct ipa_rm_create_params *)(create_params))->request_resource)
+#define QDF_IPA_RM_CREATE_PARAMS_RELEASE_RESOURCE(create_params)	\
+	(((struct ipa_rm_create_params *)(create_params))->release_resource)
+#define QDF_IPA_RM_CREATE_PARAMS_FLOOR_VOLTAGE(create_params)	\
+	(((struct ipa_rm_create_params *)(create_params))->floor_voltage)
+
+/**
+ * __qdf_ipa_rm_perf_profile_t - information regarding IPA RM client performance
+ * profile
+ */
+typedef struct ipa_rm_perf_profile __qdf_ipa_rm_perf_profile_t;
+
+#define QDF_IPA_RM_PERF_PROFILE_MAX_SUPPORTED_BANDWIDTH_MBPS(profile)	\
+	(((struct ipa_rm_perf_profile *)(profile))->max_supported_bandwidth_mbps)
+
+/**
+ * __qdf_ipa_tx_data_desc_t - information needed
+ * to send data packet to HW link: link to data descriptors
+ * priv: client specific private data
+ */
+typedef struct ipa_tx_data_desc __qdf_ipa_tx_data_desc_t;
+
+/**
+ * __qdf_ipa_rx_data_t - information needed
+ * to send to wlan driver on receiving data from ipa hw
+ */
+typedef struct ipa_rx_data __qdf_ipa_rx_data_t;
+
+#define QDF_IPA_RX_DATA_SKB(desc)	\
+	(((struct ipa_rx_data *)(desc))->skb)
+#define QDF_IPA_RX_DATA_SKB_LEN(desc)	\
+	(((struct ipa_rx_data *)(desc))->skb->len)
+#define QDF_IPA_RX_DATA_DMA_ADDR(desc)	\
+	(((struct ipa_rx_data *)(desc))->dma_addr)
+
+/**
+ * __qdf_ipa_wdi_ul_params_t - WDI_RX configuration
+ */
+typedef struct ipa_wdi_ul_params __qdf_ipa_wdi_ul_params_t;
+
+/**
+ * __qdf_ipa_wdi_ul_params_smmu_t - WDI_RX configuration (with WLAN SMMU)
+ */
+typedef struct ipa_wdi_ul_params_smmu __qdf_ipa_wdi_ul_params_smmu_t;
+
+/**
+ * __qdf_ipa_wdi_dl_params_t - WDI_TX configuration
+ */
+typedef struct ipa_wdi_dl_params __qdf_ipa_wdi_dl_params_t;
+
+/**
+ * __qdf_ipa_wdi_dl_params_smmu_t - WDI_TX configuration (with WLAN SMMU)
+ */
+typedef struct ipa_wdi_dl_params_smmu __qdf_ipa_wdi_dl_params_smmu_t;
+
+/**
+ * __qdf_ipa_wdi_in_params_t - information provided by WDI client
+ */
+typedef struct ipa_wdi_in_params __qdf_ipa_wdi_in_params_t;
+
+#define QDF_IPA_PIPE_IN_NAT_EN(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.nat.nat_en)
+#define QDF_IPA_PIPE_IN_HDR_LEN(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.hdr.hdr_len)
+#define QDF_IPA_PIPE_IN_HDR_OFST_METADATA_VALID(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.hdr.hdr_ofst_metadata_valid)
+#define QDF_IPA_PIPE_IN_HDR_METADATA_REG_VALID(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.hdr.hdr_metadata_reg_valid)
+#define QDF_IPA_PIPE_IN_HDR_OFST_PKT_SIZE_VALID(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.hdr.hdr_ofst_pkt_size_valid)
+#define QDF_IPA_PIPE_IN_HDR_OFST_PKT_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.hdr.hdr_ofst_pkt_size)
+#define QDF_IPA_PIPE_IN_HDR_ADDITIONAL_CONST_LEN(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.hdr.hdr_additional_const_len)
+#define QDF_IPA_PIPE_IN_MODE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.mode.mode)
+#define QDF_IPA_PIPE_IN_CLIENT(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.client)
+#define QDF_IPA_PIPE_IN_DESC_FIFO_SZ(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.desc_fifo_sz)
+#define QDF_IPA_PIPE_IN_PRIV(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.priv)
+#define QDF_IPA_PIPE_IN_HDR_LITTLE_ENDIAN(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.ipa_ep_cfg.hdr_ext.hdr_little_endian)
+#define QDF_IPA_PIPE_IN_NOTIFY(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.notify)
+#define QDF_IPA_PIPE_IN_KEEP_IPA_AWAKE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.keep_ipa_awake)
+#define QDF_IPA_PIPE_IN_KEEP_IPA_AWAKE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->sys.keep_ipa_awake)
+#define QDF_IPA_PIPE_IN_SMMU_ENABLED(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->smmu_enabled)
+#ifdef FEATURE_METERING
+#define QDF_IPA_PIPE_IN_WDI_NOTIFY(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->wdi_notify)
+#endif
+#define QDF_IPA_PIPE_IN_DL_SMMU_COMP_RING(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl_smmu.comp_ring)
+#define QDF_IPA_PIPE_IN_DL_SMMU_CE_RING(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl_smmu.ce_ring)
+#define QDF_IPA_PIPE_IN_DL_SMMU_COMP_RING_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl_smmu.comp_ring_size)
+#define QDF_IPA_PIPE_IN_DL_SMMU_CE_RING_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl_smmu.ce_ring_size)
+#define QDF_IPA_PIPE_IN_DL_SMMU_CE_DOOR_BELL_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl_smmu.ce_door_bell_pa)
+#define QDF_IPA_PIPE_IN_DL_SMMU_NUM_TX_BUFFERS(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl_smmu.num_tx_buffers)
+#define QDF_IPA_PIPE_IN_DL_COMP_RING_BASE_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl.comp_ring_base_pa)
+#define QDF_IPA_PIPE_IN_DL_COMP_RING_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl.comp_ring_size)
+#define QDF_IPA_PIPE_IN_DL_CE_RING_BASE_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl.ce_ring_base_pa)
+#define QDF_IPA_PIPE_IN_DL_CE_RING_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl.ce_ring_size)
+#define QDF_IPA_PIPE_IN_DL_CE_DOOR_BELL_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl.ce_door_bell_pa)
+#define QDF_IPA_PIPE_IN_DL_NUM_TX_BUFFERS(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.dl.num_tx_buffers)
+
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_RING(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_ring)
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_RING_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_ring_size)
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_RING_RP_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_ring_rp_pa)
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_RING_RP_VA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_ring_rp_va)
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_COMP_RING(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_comp_ring)
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_COMP_RING_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_comp_ring_size)
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_COMP_RING_WP_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_comp_ring_wp_pa)
+#define QDF_IPA_PIPE_IN_UL_SMMU_RDY_COMP_RING_WP_VA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul_smmu.rdy_comp_ring_wp_va)
+#define QDF_IPA_PIPE_IN_UL_RDY_RING_BASE_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul.rdy_ring_base_pa)
+#define QDF_IPA_PIPE_IN_UL_RDY_RING_SIZE(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul.rdy_ring_size)
+#define QDF_IPA_PIPE_IN_UL_RDY_RING_RP_PA(pipe_in)	\
+	(((struct ipa_wdi_in_params *)(pipe_in))->u.ul.rdy_ring_rp_pa)
+
+/**
+ * __qdf_ipa_wdi_out_params_t - information provided to WDI client
+ */
+typedef struct ipa_wdi_out_params __qdf_ipa_wdi_out_params_t;
+
+#define QDF_IPA_PIPE_OUT_UC_DOOR_BELL_PA(pipe_out)	\
+	(((struct ipa_wdi_out_params *)(pipe_out))->uc_door_bell_pa)
+#define QDF_IPA_PIPE_OUT_CLNT_HDL(pipe_out)	\
+	(((struct ipa_wdi_out_params *)(pipe_out))->clnt_hdl)
+
+/**
+ * __qdf_ipa_wdi_db_params_t - information provided to retrieve
+ *       physical address of uC doorbell
+ */
+typedef struct ipa_wdi_db_params __qdf_ipa_wdi_db_params_t;
+
+/**
+ * __qdf_ipa_wdi_uc_ready_params_t - uC ready CB parameters
+ */
+typedef void (*__qdf_ipa_uc_ready_cb)(void *priv);
+typedef struct ipa_wdi_uc_ready_params __qdf_ipa_wdi_uc_ready_params_t;
+
+#define QDF_IPA_UC_READY_PARAMS_IS_UC_READY(uc_ready_param)	\
+	(((struct ipa_wdi_uc_ready_params *)(uc_ready_param))->is_uC_ready)
+#define QDF_IPA_UC_READY_PARAMS_PRIV(uc_ready_param)	\
+	(((struct ipa_wdi_uc_ready_params *)(uc_ready_param))->priv)
+#define QDF_IPA_UC_READY_PARAMS_NOTIFY(uc_ready_param)	\
+	(((struct ipa_wdi_uc_ready_params *)(uc_ready_param))->notify)
+
+/**
+ * __qdf_ipa_wdi_buffer_info_t - address info of a WLAN allocated buffer
+ *
+ * IPA driver will create/release IOMMU mapping in IPA SMMU from iova->pa
+ */
+typedef struct ipa_wdi_buffer_info __qdf_ipa_wdi_buffer_info_t;
+
+/**
+ * __qdf_ipa_gsi_ep_config_t - IPA GSI endpoint configurations
+ */
+typedef struct ipa_gsi_ep_config __qdf_ipa_gsi_ep_config_t;
+
+/**
+ * __qdf_ipa_dp_evt_type_t - type of event client callback is
+ * invoked for on data path
+ * @IPA_RECEIVE: data is struct sk_buff
+ * @IPA_WRITE_DONE: data is struct sk_buff
+ */
+typedef enum ipa_dp_evt_type __qdf_ipa_dp_evt_type_t;
+
+typedef struct ipa_hdr_add __qdf_ipa_hdr_add_t;
+typedef struct ipa_hdr_del __qdf_ipa_hdr_del_t;
+typedef struct ipa_ioc_add_hdr __qdf_ipa_ioc_add_hdr_t;
+
+#define QDF_IPA_IOC_ADD_HDR_COMMIT(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->commit)
+#define QDF_IPA_IOC_ADD_HDR_NUM_HDRS(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->num_hdrs)
+#define QDF_IPA_IOC_ADD_HDR_NAME(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].name)
+#define QDF_IPA_IOC_ADD_HDR_HDR(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].hdr)
+#define QDF_IPA_IOC_ADD_HDR_HDR_LEN(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].hdr_len)
+#define QDF_IPA_IOC_ADD_HDR_TYPE(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].type)
+#define QDF_IPA_IOC_ADD_HDR_IS_PARTIAL(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].is_partial)
+#define QDF_IPA_IOC_ADD_HDR_HDR_HDL(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].hdr_hdl)
+#define QDF_IPA_IOC_ADD_HDR_STATUS(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].status)
+#define QDF_IPA_IOC_ADD_HDR_IS_ETH2_OFST_VALID(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].is_eth2_ofst_valid)
+#define QDF_IPA_IOC_ADD_HDR_ETH2_OFST(ipa_hdr)	\
+	(((struct ipa_ioc_add_hdr *)(ipa_hdr))->hdr[0].eth2_ofst)
+
+typedef struct ipa_ioc_del_hdr __qdf_ipa_ioc_del_hdr_t;
+
+#define QDF_IPA_IOC_DEL_HDR_COMMIT(ipa_hdr)	\
+	(((struct ipa_ioc_del_hdr *)(ipa_hdr))->commit)
+#define QDF_IPA_IOC_DEL_HDR_NUM_HDRS(ipa_hdr)	\
+	(((struct ipa_ioc_del_hdr *)(ipa_hdr))->num_hdls)
+#define QDF_IPA_IOC_DEL_HDR_HDL(ipa_hdr)	\
+	(((struct ipa_ioc_del_hdr *)(ipa_hdr))->hdl[0].hdl)
+#define QDF_IPA_IOC_DEL_HDR_STATUS(ipa_hdr)	\
+	(((struct ipa_ioc_del_hdr *)(ipa_hdr))->hdl[0].status)
+
+typedef struct ipa_ioc_get_hdr __qdf_ipa_ioc_get_hdr_t;
+
+#define QDF_IPA_IOC_GET_HDR_NAME(ipa_hdr)	\
+	(((struct ipa_ioc_get_hdr *)(ipa_hdr))->name)
+#define QDF_IPA_IOC_GET_HDR_HDL(ipa_hdr)	\
+	(((struct ipa_ioc_get_hdr *)(ipa_hdr))->hdl)
+
+typedef struct ipa_ioc_copy_hdr __qdf_ipa_ioc_copy_hdr_t;
+typedef struct ipa_ioc_add_hdr_proc_ctx __qdf_ipa_ioc_add_hdr_proc_ctx_t;
+typedef struct ipa_ioc_del_hdr_proc_ctx __qdf_ipa_ioc_del_hdr_proc_ctx_t;
+typedef struct ipa_msg_meta __qdf_ipa_msg_meta_t;
+
+#define QDF_IPA_MSG_META_MSG_TYPE(meta)	\
+	(((struct ipa_msg_meta *)(meta))->msg_type)
+#define QDF_IPA_MSG_META_MSG_LEN(meta)	\
+	(((struct ipa_msg_meta *)(meta))->msg_len)
+
+typedef enum ipa_client_type __qdf_ipa_client_type_t;
+typedef struct IpaHwStatsWDIInfoData_t __qdf_ipa_hw_stats_wdi_info_data_t;
+typedef enum ipa_rm_resource_name __qdf_ipa_rm_resource_name_t;
+typedef enum ipa_wlan_event __qdf_ipa_wlan_event_t;
+typedef struct ipa_wlan_msg __qdf_ipa_wlan_msg_t;
+
+#define QDF_IPA_WLAN_MSG_NAME(ipa_msg)	\
+	(((struct ipa_wlan_msg *)(ipa_msg))->name)
+#define QDF_IPA_WLAN_MSG_MAC_ADDR(ipa_msg)	\
+	(((struct ipa_wlan_msg *)(ipa_msg))->mac_addr)
+
+typedef struct ipa_wlan_msg_ex __qdf_ipa_wlan_msg_ex_t;
+
+#define QDF_IPA_WLAN_MSG_EX_NAME(ipa_msg)	\
+	(((struct ipa_wlan_msg_ex *)(ipa_msg))->name)
+#define QDF_IPA_WLAN_MSG_EX_EXNUM_OF_ATTRIBS(ipa_msg)	\
+	(((struct ipa_wlan_msg_ex *)(ipa_msg))->num_of_attribs)
+#define QDF_IPA_WLAN_MSG_EX_ATTRIB_TYPE(ipa_msg)	\
+	(((struct ipa_wlan_msg_ex *)(ipa_msg))->attribs.attrib_type)
+#define QDF_IPA_WLAN_MSG_EX_OFFSET(ipa_msg)	\
+	(((struct ipa_wlan_msg_ex *)(ipa_msg))->attribs.offset)
+#define QDF_IPA_WLAN_MSG_EX_MAC_ADDR(ipa_msg)	\
+	(((struct ipa_wlan_msg_ex *)(ipa_msg))->attribs.u.mac_addr)
+
+typedef struct ipa_ioc_tx_intf_prop __qdf_ipa_ioc_tx_intf_prop_t;
+
+#define QDF_IPA_IOC_TX_INTF_PROP_IP(tx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->ip)
+#define QDF_IPA_IOC_TX_INTF_PROP_ATTRIB_MASK(tx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->attrib.attrib_mask)
+#define QDF_IPA_IOC_TX_INTF_PROP_META_DATA(rx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->attrib.meta_data)
+#define QDF_IPA_IOC_TX_INTF_PROP_META_DATA_MASK(rx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->attrib.meta_data_mask)
+#define QDF_IPA_IOC_TX_INTF_PROP_DST_PIPE(tx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->dst_pipe)
+#define QDF_IPA_IOC_TX_INTF_PROP_ALT_DST_PIPE(tx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->alt_dst_pipe)
+#define QDF_IPA_IOC_TX_INTF_PROP_HDR_NAME(tx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->hdr_name)
+#define QDF_IPA_IOC_TX_INTF_PROP_HDR_L2_TYPE(tx_prop)	\
+	(((struct ipa_ioc_tx_intf_prop *)(tx_prop))->hdr_l2_type)
+
+typedef struct ipa_ioc_rx_intf_prop __qdf_ipa_ioc_rx_intf_prop_t;
+
+#define QDF_IPA_IOC_RX_INTF_PROP_IP(rx_prop)	\
+	(((struct ipa_ioc_rx_intf_prop *)(rx_prop))->ip)
+#define QDF_IPA_IOC_RX_INTF_PROP_ATTRIB_MASK(rx_prop)	\
+	(((struct ipa_ioc_rx_intf_prop *)(rx_prop))->attrib.attrib_mask)
+#define QDF_IPA_IOC_RX_INTF_PROP_META_DATA(rx_prop)	\
+	(((struct ipa_ioc_rx_intf_prop *)(rx_prop))->attrib.meta_data)
+#define QDF_IPA_IOC_RX_INTF_PROP_META_DATA_MASK(rx_prop)	\
+	(((struct ipa_ioc_rx_intf_prop *)(rx_prop))->attrib.meta_data_mask)
+#define QDF_IPA_IOC_RX_INTF_PROP_SRC_PIPE(rx_prop)	\
+	(((struct ipa_ioc_rx_intf_prop *)(rx_prop))->src_pipe)
+#define QDF_IPA_IOC_RX_INTF_PROP_HDR_L2_TYPE(rx_prop)	\
+	(((struct ipa_ioc_rx_intf_prop *)(rx_prop))->hdr_l2_type)
+
+typedef struct ipa_wlan_hdr_attrib_val __qdf_ipa_wlan_hdr_attrib_val_t;
+
+/*
+ * Connect / Disconnect
+ */
+static inline int __qdf_ipa_connect(const struct ipa_connect_params *in,
+		__qdf_ipa_sps_params_t *sps,	u32 *clnt_hdl)
+{
+	return ipa_connect(in, sps, clnt_hdl);
+}
+
+static inline int __qdf_ipa_disconnect(u32 clnt_hdl)
+{
+	return ipa_disconnect(clnt_hdl);
+}
+
+/*
+ * Resume / Suspend
+ */
+static inline int __qdf_ipa_reset_endpoint(u32 clnt_hdl)
+{
+	return ipa_reset_endpoint(clnt_hdl);
+}
+
+/*
+ * Remove ep delay
+ */
+static inline int __qdf_ipa_clear_endpoint_delay(u32 clnt_hdl)
+{
+	return ipa_clear_endpoint_delay(clnt_hdl);
+}
+
+/*
+ * Header removal / addition
+ */
+static inline int __qdf_ipa_add_hdr(struct ipa_ioc_add_hdr *hdrs)
+{
+	return ipa_add_hdr(hdrs);
+}
+
+static inline int __qdf_ipa_del_hdr(struct ipa_ioc_del_hdr *hdls)
+{
+	return ipa_del_hdr(hdls);
+}
+
+static inline int __qdf_ipa_commit_hdr(void)
+{
+	return ipa_commit_hdr();
+}
+
+static inline int __qdf_ipa_reset_hdr(void)
+{
+	return ipa_reset_hdr();
+}
+
+static inline int __qdf_ipa_get_hdr(struct ipa_ioc_get_hdr *lookup)
+{
+	return ipa_get_hdr(lookup);
+}
+
+static inline int __qdf_ipa_put_hdr(u32 hdr_hdl)
+{
+	return ipa_put_hdr(hdr_hdl);
+}
+
+static inline int __qdf_ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy)
+{
+	return ipa_copy_hdr(copy);
+}
+
+/*
+ * Header Processing Context
+ */
+static inline int __qdf_ipa_add_hdr_proc_ctx(
+				struct ipa_ioc_add_hdr_proc_ctx *proc_ctxs)
+{
+	return ipa_add_hdr_proc_ctx(proc_ctxs);
+}
+
+static inline int __qdf_ipa_del_hdr_proc_ctx(struct ipa_ioc_del_hdr_proc_ctx *hdls)
+{
+	return ipa_del_hdr_proc_ctx(hdls);
+}
+
+/*
+ * Messaging
+ */
+static inline int __qdf_ipa_send_msg(struct ipa_msg_meta *meta, void *buff,
+		ipa_msg_free_fn callback)
+{
+	return ipa_send_msg(meta, buff, callback);
+}
+
+static inline int __qdf_ipa_register_pull_msg(struct ipa_msg_meta *meta,
+		ipa_msg_pull_fn callback)
+{
+	return ipa_register_pull_msg(meta, callback);
+}
+
+static inline int __qdf_ipa_deregister_pull_msg(struct ipa_msg_meta *meta)
+{
+	return ipa_deregister_pull_msg(meta);
+}
+
+/*
+ * Interface
+ */
+static inline int __qdf_ipa_register_intf(const char *name,
+				     const struct ipa_tx_intf *tx,
+				     const struct ipa_rx_intf *rx)
+{
+	return ipa_register_intf(name, tx, rx);
+}
+
+static inline int __qdf_ipa_register_intf_ext(const char *name,
+		const struct ipa_tx_intf *tx,
+		const struct ipa_rx_intf *rx,
+		const struct ipa_ext_intf *ext)
+{
+	return ipa_register_intf_ext(name, tx, rx, ext);
+}
+
+static inline int __qdf_ipa_deregister_intf(const char *name)
+{
+	return ipa_deregister_intf(name);
+}
+
+/*
+ * Data path
+ */
+static inline int __qdf_ipa_tx_dp(enum ipa_client_type dst, struct sk_buff *skb,
+		struct ipa_tx_meta *metadata)
+{
+	return ipa_tx_dp(dst, skb, metadata);
+}
+
+/*
+ * To transfer multiple data packets
+ */
+static inline int __qdf_ipa_tx_dp_mul(
+	enum ipa_client_type dst,
+	struct ipa_tx_data_desc *data_desc)
+{
+	return ipa_tx_dp_mul(dst, data_desc);
+}
+
+static inline void __qdf_ipa_free_skb(struct ipa_rx_data *rx_in)
+{
+	return ipa_free_skb(rx_in);;
+}
+
+/*
+ * System pipes
+ */
+static inline u16 __qdf_ipa_get_smem_restr_bytes(void)
+{
+	return ipa_get_smem_restr_bytes();
+}
+
+static inline int __qdf_ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in,
+		u32 *clnt_hdl)
+{
+	return ipa_setup_sys_pipe(sys_in, clnt_hdl);
+}
+
+static inline int __qdf_ipa_teardown_sys_pipe(u32 clnt_hdl)
+{
+	return ipa_teardown_sys_pipe(clnt_hdl);
+}
+
+static inline int __qdf_ipa_connect_wdi_pipe(struct ipa_wdi_in_params *in,
+		struct ipa_wdi_out_params *out)
+{
+	return ipa_connect_wdi_pipe(in, out);
+}
+
+static inline int __qdf_ipa_disconnect_wdi_pipe(u32 clnt_hdl)
+{
+	return ipa_disconnect_wdi_pipe(clnt_hdl);
+}
+
+static inline int __qdf_ipa_enable_wdi_pipe(u32 clnt_hdl)
+{
+	return ipa_enable_wdi_pipe(clnt_hdl);
+}
+
+static inline int __qdf_ipa_disable_wdi_pipe(u32 clnt_hdl)
+{
+	return ipa_disable_wdi_pipe(clnt_hdl);
+}
+
+static inline int __qdf_ipa_resume_wdi_pipe(u32 clnt_hdl)
+{
+	return ipa_resume_wdi_pipe(clnt_hdl);
+}
+
+static inline int __qdf_ipa_suspend_wdi_pipe(u32 clnt_hdl)
+{
+	return ipa_suspend_wdi_pipe(clnt_hdl);
+}
+
+static inline int __qdf_ipa_uc_wdi_get_dbpa(
+	struct ipa_wdi_db_params *out)
+{
+	return ipa_uc_wdi_get_dbpa(out);
+}
+
+static inline int __qdf_ipa_uc_reg_rdyCB(
+	struct ipa_wdi_uc_ready_params *param)
+{
+	return ipa_uc_reg_rdyCB(param);
+}
+
+static inline int __qdf_ipa_uc_dereg_rdyCB(void)
+{
+	return ipa_uc_dereg_rdyCB();
+}
+
+
+/*
+ * Resource manager
+ */
+static inline int __qdf_ipa_rm_create_resource(
+		struct ipa_rm_create_params *create_params)
+{
+	return ipa_rm_create_resource(create_params);
+}
+
+static inline int __qdf_ipa_rm_delete_resource(
+		enum ipa_rm_resource_name resource_name)
+{
+	return ipa_rm_delete_resource(resource_name);
+}
+
+static inline int __qdf_ipa_rm_register(enum ipa_rm_resource_name resource_name,
+			struct ipa_rm_register_params *reg_params)
+{
+	return ipa_rm_register(resource_name, reg_params);
+}
+
+static inline int __qdf_ipa_rm_set_perf_profile(
+		enum ipa_rm_resource_name resource_name,
+		struct ipa_rm_perf_profile *profile)
+{
+	return ipa_rm_set_perf_profile(resource_name, profile);
+}
+
+static inline int __qdf_ipa_rm_deregister(enum ipa_rm_resource_name resource_name,
+			struct ipa_rm_register_params *reg_params)
+{
+	return ipa_rm_deregister(resource_name, reg_params);
+}
+
+static inline int __qdf_ipa_rm_add_dependency(
+		enum ipa_rm_resource_name resource_name,
+		enum ipa_rm_resource_name depends_on_name)
+{
+	return ipa_rm_add_dependency(resource_name, depends_on_name);
+}
+
+static inline int __qdf_ipa_rm_add_dependency_sync(
+		enum ipa_rm_resource_name resource_name,
+		enum ipa_rm_resource_name depends_on_name)
+{
+	return ipa_rm_add_dependency_sync(resource_name, depends_on_name);
+}
+
+static inline int __qdf_ipa_rm_delete_dependency(
+		enum ipa_rm_resource_name resource_name,
+		enum ipa_rm_resource_name depends_on_name)
+{
+	return ipa_rm_delete_dependency(resource_name, depends_on_name);
+}
+
+static inline int __qdf_ipa_rm_request_resource(
+		enum ipa_rm_resource_name resource_name)
+{
+	return ipa_rm_request_resource(resource_name);
+}
+
+static inline int __qdf_ipa_rm_release_resource(
+		enum ipa_rm_resource_name resource_name)
+{
+	return ipa_rm_release_resource(resource_name);
+}
+
+static inline int __qdf_ipa_rm_notify_completion(enum ipa_rm_event event,
+		enum ipa_rm_resource_name resource_name)
+{
+	return ipa_rm_notify_completion(event, resource_name);
+}
+
+static inline int __qdf_ipa_rm_inactivity_timer_init(
+		enum ipa_rm_resource_name resource_name,
+			unsigned long msecs)
+{
+	return ipa_rm_inactivity_timer_init(resource_name, msecs);
+}
+
+static inline int __qdf_ipa_rm_inactivity_timer_destroy(
+		enum ipa_rm_resource_name resource_name)
+{
+	return ipa_rm_inactivity_timer_destroy(resource_name);
+}
+
+static inline int __qdf_ipa_rm_inactivity_timer_request_resource(
+				enum ipa_rm_resource_name resource_name)
+{
+	return ipa_rm_inactivity_timer_request_resource(resource_name);
+}
+
+static inline int __qdf_ipa_rm_inactivity_timer_release_resource(
+				enum ipa_rm_resource_name resource_name)
+{
+	return ipa_rm_inactivity_timer_release_resource(resource_name);
+}
+
+/*
+ * Miscellaneous
+ */
+static inline void __qdf_ipa_bam_reg_dump(void)
+{
+	return ipa_bam_reg_dump();
+}
+
+static inline int __qdf_ipa_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats)
+{
+	return ipa_get_wdi_stats(stats);
+}
+
+static inline int __qdf_ipa_get_ep_mapping(enum ipa_client_type client)
+{
+	return ipa_get_ep_mapping(client);
+}
+
+static inline bool __qdf_ipa_is_ready(void)
+{
+	return ipa_is_ready();
+}
+
+static inline void __qdf_ipa_proxy_clk_vote(void)
+{
+	return ipa_proxy_clk_vote();
+}
+
+static inline void __qdf_ipa_proxy_clk_unvote(void)
+{
+	return ipa_proxy_clk_unvote();
+}
+
+static inline bool __qdf_ipa_is_client_handle_valid(u32 clnt_hdl)
+{
+	return ipa_is_client_handle_valid(clnt_hdl);
+}
+
+static inline enum ipa_client_type __qdf_ipa_get_client_mapping(int pipe_idx)
+{
+	return ipa_get_client_mapping(pipe_idx);
+}
+
+static inline enum ipa_rm_resource_name __qdf_ipa_get_rm_resource_from_ep(
+	int pipe_idx)
+{
+	return ipa_get_rm_resource_from_ep(pipe_idx);
+}
+
+static inline bool __qdf_ipa_get_modem_cfg_emb_pipe_flt(void)
+{
+	return ipa_get_modem_cfg_emb_pipe_flt();
+}
+
+static inline enum ipa_transport_type __qdf_ipa_get_transport_type(void)
+{
+	return ipa_get_transport_type();
+}
+
+static inline struct device *__qdf_ipa_get_dma_dev(void)
+{
+	return ipa_get_dma_dev();
+}
+
+static inline struct iommu_domain *__qdf_ipa_get_smmu_domain(void)
+{
+	return ipa_get_smmu_domain();
+}
+
+static inline int __qdf_ipa_create_wdi_mapping(u32 num_buffers,
+		__qdf_ipa_wdi_buffer_info_t *info)
+{
+	return ipa_create_wdi_mapping(num_buffers, info);
+}
+
+static inline int __qdf_ipa_release_wdi_mapping(u32 num_buffers,
+		struct ipa_wdi_buffer_info *info)
+{
+	return ipa_release_wdi_mapping(num_buffers, info);
+}
+
+static inline int __qdf_ipa_disable_apps_wan_cons_deaggr(uint32_t agg_size, uint32_t agg_count)
+{
+	return ipa_disable_apps_wan_cons_deaggr(agg_size, agg_count);
+}
+
+static inline const struct ipa_gsi_ep_config *__qdf_ipa_get_gsi_ep_info(enum ipa_client_type client)
+{
+	return ipa_get_gsi_ep_info(client);
+}
+
+static inline int __qdf_ipa_stop_gsi_channel(u32 clnt_hdl)
+{
+	return ipa_stop_gsi_channel(clnt_hdl);
+}
+
+static inline int __qdf_ipa_register_ipa_ready_cb(
+	void (*ipa_ready_cb)(void *user_data),
+	void *user_data)
+{
+	return ipa_register_ipa_ready_cb(ipa_ready_cb, user_data);
+}
+
+#endif /* _I_QDF_IPA_H */

+ 239 - 0
qdf/linux/src/i_qdf_ipa_wdi3.h

@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: i_qdf_ipa_wdi3.h
+ * This file provides OS dependent IPA WDI3 APIs.
+ */
+
+#ifndef I_QDF_IPA_WDI3_H
+#define I_QDF_IPA_WDI3_H
+
+#include <qdf_status.h>         /* QDF_STATUS */
+#include <linux/ipa_wdi3.h>
+
+/**
+ * __qdf_ipa_wdi3_hdr_info_t - Header to install on IPA HW
+ */
+typedef struct ipa_wdi3_hdr_info  __qdf_ipa_wdi3_hdr_info_t;
+
+#define QDF_IPA_WDI3_HDR_INFO_HDR(hdr_info)	\
+	(((struct ipa_wdi3_hdr_info *)(hdr_info))->hdr)
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_hdr_info *)(hdr_info))->dst_mac_addr_offset)
+#define QDF_IPA_WDI3_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
+ *	interface registration
+ */
+typedef struct ipa_wdi3_reg_intf_in_params  __qdf_ipa_wdi3_reg_intf_in_params_t;
+
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_reg_intf_in_params *)(in))->hdr_info)
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_reg_intf_in_params *)(in))->meta_data)
+#define QDF_IPA_WDI3_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
+ */
+typedef struct ipa_wdi3_setup_info  __qdf_ipa_wdi3_setup_info_t;
+
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_len)
+#define QDF_IPA_WDI3_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)	\
+	(((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)	\
+	(((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)	\
+	(((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)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr.hdr_additional_const_len)
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->ipa_ep_cfg.hdr_ext.hdr_little_endian)
+
+#define QDF_IPA_WDI3_SETUP_INFO_CLIENT(txrx)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->client)
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->transfer_ring_size)
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->event_ring_base_pa)
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->event_ring_doorbell_pa)
+#define QDF_IPA_WDI3_SETUP_INFO_NUM_PKT_BUFFERS(txrx)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->num_pkt_buffers)
+#define QDF_IPA_WDI3_SETUP_INFO_PKT_OFFSET(txrx)	\
+	(((struct ipa_wdi3_setup_info *)(txrx))->pkt_offset)
+#define QDF_IPA_WDI3_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
+ *		uC offload client
+ */
+typedef struct ipa_wdi3_conn_in_params  __qdf_ipa_wdi3_conn_in_params_t;
+
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_conn_in_params *)(pipe_in))->priv)
+#define QDF_IPA_WDI3_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)	\
+	(((struct ipa_wdi3_conn_in_params *)(pipe_in))->rx)
+
+/**
+ * __qdf_ipa_wdi3_conn_out_params_t - information provided
+ *				to WLAN druver
+ */
+typedef struct ipa_wdi3_conn_out_params  __qdf_ipa_wdi3_conn_out_params_t;
+
+#define QDF_IPA_WDI3_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)	\
+	(((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)	\
+	(((struct ipa_wdi3_conn_out_params *)(pipe_out))->rx_uc_db_pa)
+
+/**
+ * __qdf_ipa_wdi3_perf_profile_t - To set BandWidth profile
+ */
+typedef struct ipa_wdi3_perf_profile  __qdf_ipa_wdi3_perf_profile_t;
+
+#define QDF_IPA_WDI3_PERF_PROFILE_CLIENT(profile)	\
+	(((struct ipa_wdi3_perf_profile *)(profile))->client)
+#define QDF_IPA_WDI3_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
+ * 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 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 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 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 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 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 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 ipa_wdi3_set_perf_profile(profile);
+}
+
+#endif