qcacld-3.0: Create IPA CLD component

As part of converged driver model remove IPA from
HDD and create a new IPA CLD component. Add files for
IPA core, dispatcher and target_if. Define IPA related
public and private structures.

Change-Id: I8848331edc7dd878f9fc51ef9f5e311ad91ed70b
CRs-Fixed: 2177925
diff --git a/Kbuild b/Kbuild
index 4468454..1aa6abb 100644
--- a/Kbuild
+++ b/Kbuild
@@ -1071,6 +1071,18 @@
 		$(OCB_DIR)/core/src/wlan_ocb_main.o
 endif
 
+######## IPA ##############
+IPA_DIR := components/ipa
+IPA_INC := -I$(WLAN_ROOT)/$(IPA_DIR)/core/inc \
+		-I$(WLAN_ROOT)/$(IPA_DIR)/dispatcher/inc
+
+ifeq ($(CONFIG_IPA_OFFLOAD), 1)
+IPA_OBJS :=	$(IPA_DIR)/dispatcher/src/wlan_ipa_ucfg_api.o \
+		$(IPA_DIR)/dispatcher/src/wlan_ipa_obj_mgmt_api.o \
+		$(IPA_DIR)/dispatcher/src/wlan_ipa_tgt_api.o \
+		$(IPA_DIR)/core/src/wlan_ipa_main.o
+endif
+
 ########## CLD TARGET_IF #######
 CLD_TARGET_IF_DIR := components/target_if
 
@@ -1099,6 +1111,11 @@
 CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/disa/src/target_if_disa.o
 endif
 
+ifeq ($(CONFIG_IPA_OFFLOAD), 1)
+CLD_TARGET_IF_INC += -I$(WLAN_ROOT)/$(CLD_TARGET_IF_DIR)/ipa/inc
+CLD_TARGET_IF_OBJ += $(CLD_TARGET_IF_DIR)/ipa/src/target_if_ipa.o
+endif
+
 ############## UMAC P2P ###########
 P2P_DIR := umac/p2p
 P2P_CORE_DIR := $(P2P_DIR)/core
@@ -1681,6 +1698,8 @@
 INCS +=		$(PLD_INC)
 INCS +=		$(OCB_INC)
 
+INCS +=		$(IPA_INC)
+
 ifeq ($(CONFIG_REMOVE_PKT_LOG), 0)
 INCS +=		$(PKTLOG_INC)
 endif
@@ -1755,6 +1774,10 @@
 OBJS +=		$(OCB_OBJS)
 endif
 
+ifeq ($(CONFIG_IPA_OFFLOAD), 1)
+OBJS +=		$(IPA_OBJS)
+endif
+
 ifeq ($(CONFIG_REMOVE_PKT_LOG), 0)
 OBJS +=		$(PKTLOG_OBJS)
 endif
diff --git a/components/ipa/core/inc/wlan_ipa_main.h b/components/ipa/core/inc/wlan_ipa_main.h
new file mode 100644
index 0000000..c61601a
--- /dev/null
+++ b/components/ipa/core/inc/wlan_ipa_main.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2018 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: declare various api which shall be used by
+ * IPA user configuration and target interface
+ */
+
+#ifndef _WLAN_IPA_MAIN_H_
+#define _WLAN_IPA_MAIN_H_
+
+#ifdef IPA_OFFLOAD
+
+#include <wlan_objmgr_psoc_obj.h>
+#include <wlan_objmgr_pdev_obj.h>
+#include <wlan_ipa_public_struct.h>
+#include <wlan_ipa_priv.h>
+
+#define ipa_log(level, args...) QDF_TRACE(QDF_MODULE_ID_IPA, level, ## args)
+#define ipa_logfl(level, format, args...) ipa_log(level, FL(format), ## args)
+
+#define ipa_fatal(format, args...) \
+		ipa_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args)
+#define ipa_err(format, args...) \
+		ipa_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args)
+#define ipa_warn(format, args...) \
+		ipa_logfl(QDF_TRACE_LEVEL_WARN, format, ## args)
+#define ipa_info(format, args...) \
+		ipa_logfl(QDF_TRACE_LEVEL_INFO, format, ## args)
+#define ipa_debug(format, args...) \
+		ipa_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args)
+
+#define IPA_ENTER() ipa_debug("enter")
+#define IPA_EXIT() ipa_debug("exit")
+
+/**
+ * wlan_ipa_is_present() - get IPA hw status
+ *
+ * ipa_uc_reg_rdyCB is not directly designed to check
+ * ipa hw status. This is an undocumented function which
+ * has confirmed with IPA team.
+ *
+ * Return: true - ipa hw present
+ *         false - ipa hw not present
+ */
+bool wlan_ipa_is_present(void);
+
+/**
+ * wlan_get_pdev_ipa_obj() - private API to get ipa pdev object
+ * @pdev: pdev object
+ *
+ * Return: ipa object
+ */
+static inline struct wlan_ipa_priv *
+ipa_pdev_get_priv_obj(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_ipa_priv *pdev_obj;
+
+	pdev_obj = (struct wlan_ipa_priv *)
+		wlan_objmgr_pdev_get_comp_private_obj(pdev,
+				WLAN_UMAC_COMP_IPA);
+
+	return pdev_obj;
+}
+
+/**
+ * ipa_send_uc_offload_enable_disable() - wdi enable/disable notify to fw
+ * @pdev: objmgr pdev object
+ * @req: ipa offload control request
+ *
+ * Return: QDF status success or failure
+ */
+QDF_STATUS ipa_send_uc_offload_enable_disable(struct wlan_objmgr_pdev *pdev,
+				struct ipa_uc_offload_control_params *req);
+#endif /* IPA_OFFLOAD */
+#endif /* end  of _WLAN_IPA_MAIN_H_ */
diff --git a/components/ipa/core/inc/wlan_ipa_priv.h b/components/ipa/core/inc/wlan_ipa_priv.h
new file mode 100644
index 0000000..8f5d737
--- /dev/null
+++ b/components/ipa/core/inc/wlan_ipa_priv.h
@@ -0,0 +1,721 @@
+/*
+ * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * 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.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+/**
+ * DOC: Declare various struct, macros which are used privately in IPA
+ * component.
+ */
+
+#ifndef _WLAN_IPA_PRIV_STRUCT_H_
+#define _WLAN_IPA_PRIV_STRUCT_H_
+
+#ifdef IPA_OFFLOAD
+
+#ifdef CONFIG_IPA_WDI_UNIFIED_API
+#include <qdf_ipa_wdi3.h>
+#else
+#include <qdf_ipa.h>
+#endif
+
+#include <qdf_net_types.h>
+#include <qdf_mc_timer.h>
+#include <qdf_list.h>
+#include <qdf_defer.h>
+#include <qdf_event.h>
+#include "wlan_ipa_public_struct.h"
+
+#define WLAN_IPA_RX_INACTIVITY_MSEC_DELAY   1000
+#define WLAN_IPA_UC_WLAN_8023_HDR_SIZE      14
+
+#define WLAN_IPA_UC_NUM_WDI_PIPE            2
+#define WLAN_IPA_UC_MAX_PENDING_EVENT       33
+
+#define WLAN_IPA_UC_DEBUG_DUMMY_MEM_SIZE    32000
+#define WLAN_IPA_UC_RT_DEBUG_PERIOD         300
+#define WLAN_IPA_UC_RT_DEBUG_BUF_COUNT      30
+#define WLAN_IPA_UC_RT_DEBUG_FILL_INTERVAL  10000
+
+#define WLAN_IPA_WLAN_HDR_DES_MAC_OFFSET    0
+#define WLAN_IPA_MAX_IFACE                  3
+#define WLAN_IPA_MAX_SYSBAM_PIPE            4
+#define WLAN_IPA_MAX_SESSION                5
+#define WLAN_IPA_MAX_STA_COUNT              41
+
+#define WLAN_IPA_RX_PIPE                    WLAN_IPA_MAX_IFACE
+#define WLAN_IPA_ENABLE_MASK                BIT(0)
+#define WLAN_IPA_PRE_FILTER_ENABLE_MASK     BIT(1)
+#define WLAN_IPA_IPV6_ENABLE_MASK           BIT(2)
+#define WLAN_IPA_RM_ENABLE_MASK             BIT(3)
+#define WLAN_IPA_CLK_SCALING_ENABLE_MASK    BIT(4)
+#define WLAN_IPA_UC_ENABLE_MASK             BIT(5)
+#define WLAN_IPA_UC_STA_ENABLE_MASK         BIT(6)
+#define WLAN_IPA_REAL_TIME_DEBUGGING        BIT(8)
+
+#define WLAN_IPA_MAX_BANDWIDTH              800
+
+#define WLAN_IPA_MAX_PENDING_EVENT_COUNT    20
+
+#define IPA_WLAN_RX_SOFTIRQ_THRESH 16
+
+/**
+ * enum - IPA UC operation message
+ *
+ * @WLAN_IPA_UC_OPCODE_TX_SUSPEND: IPA WDI TX pipe suspend
+ * @WLAN_IPA_UC_OPCODE_TX_RESUME: IPA WDI TX pipe resume
+ * @WLAN_IPA_UC_OPCODE_RX_SUSPEND: IPA WDI RX pipe suspend
+ * @WLAN_IPA_UC_OPCODE_RX_RESUME: IPA WDI RX pipe resume
+ * @WLAN_IPA_UC_OPCODE_STATS: IPA UC stats
+ * @WLAN_IPA_UC_OPCODE_SHARING_STATS: IPA UC sharing stats
+ * @WLAN_IPA_UC_OPCODE_QUOTA_RSP: IPA UC quota response
+ * @WLAN_IPA_UC_OPCODE_QUOTA_IND: IPA UC quota indication
+ * @WLAN_IPA_UC_OPCODE_UC_READY: IPA UC ready indication
+ * @WLAN_IPA_UC_OPCODE_MAX: IPA UC max operation code
+ */
+enum wlan_ipa_uc_op_code {
+	WLAN_IPA_UC_OPCODE_TX_SUSPEND = 0,
+	WLAN_IPA_UC_OPCODE_TX_RESUME = 1,
+	WLAN_IPA_UC_OPCODE_RX_SUSPEND = 2,
+	WLAN_IPA_UC_OPCODE_RX_RESUME = 3,
+	WLAN_IPA_UC_OPCODE_STATS = 4,
+#ifdef FEATURE_METERING
+	WLAN_IPA_UC_OPCODE_SHARING_STATS = 5,
+	WLAN_IPA_UC_OPCODE_QUOTA_RSP = 6,
+	WLAN_IPA_UC_OPCODE_QUOTA_IND = 7,
+#endif
+	WLAN_IPA_UC_OPCODE_UC_READY = 8,
+	/* keep this last */
+	WLAN_IPA_UC_OPCODE_MAX
+};
+
+/**
+ * enum - Reason codes for stat query
+ *
+ * @WLAN_IPA_UC_STAT_REASON_NONE: Initial value
+ * @WLAN_IPA_UC_STAT_REASON_DEBUG: For debug/info
+ * @WLAN_IPA_UC_STAT_REASON_BW_CAL: For bandwidth calibration
+ * @WLAN_IPA_UC_STAT_REASON_DUMP_INFO: For debug info dump
+ */
+enum {
+	WLAN_IPA_UC_STAT_REASON_NONE,
+	WLAN_IPA_UC_STAT_REASON_DEBUG,
+	WLAN_IPA_UC_STAT_REASON_BW_CAL
+};
+
+/**
+ * enum wlan_ipa_rm_state - IPA resource manager state
+ * @WLAN_IPA_RM_RELEASED:      PROD pipe resource released
+ * @WLAN_IPA_RM_GRANT_PENDING: PROD pipe resource requested but not granted yet
+ * @WLAN_IPA_RM_GRANTED:       PROD pipe resource granted
+ */
+enum wlan_ipa_rm_state {
+	WLAN_IPA_RM_RELEASED,
+	WLAN_IPA_RM_GRANT_PENDING,
+	WLAN_IPA_RM_GRANTED,
+};
+
+/**
+ * enum wlan_ipa_forward_type: Type of forward packet received from IPA
+ * @WLAN_IPA_FORWARD_PKT_NONE: No forward packet
+ * @WLAN_IPA_FORWARD_PKT_LOCAL_STACK: Packet forwarded to kernel network stack
+ * @WLAN_IPA_FORWARD_PKT_DISCARD: Discarded packet before sending to kernel
+ */
+enum wlan_ipa_forward_type {
+	WLAN_IPA_FORWARD_PKT_NONE = 0,
+	WLAN_IPA_FORWARD_PKT_LOCAL_STACK = 1,
+	WLAN_IPA_FORWARD_PKT_DISCARD = 2
+};
+
+/**
+ * struct llc_snap_hdr - LLC snap header
+ * @dsap: Destination service access point
+ * @ssap: Source service access point
+ * @resv: Reserved for future use
+ * @eth_type: Ether type
+ */
+struct llc_snap_hdr {
+	uint8_t dsap;
+	uint8_t ssap;
+	uint8_t resv[4];
+	qdf_be16_t eth_type;
+} qdf_packed;
+
+/**
+ * struct wlan_ipa_tx_hdr - header type which IPA should handle to TX packet
+ * @eth:      ether II header
+ * @llc_snap: LLC snap header
+ */
+struct wlan_ipa_tx_hdr {
+	qdf_ether_header_t eth;
+	struct llc_snap_hdr llc_snap;
+} qdf_packed;
+
+/**
+ * struct frag_header - fragment header type registered to IPA hardware
+ * @length:    fragment length
+ * @reserved1: Reserved not used
+ * @reserved2: Reserved not used
+ */
+struct frag_header {
+	uint16_t length;
+	uint32_t reserved1;
+	uint32_t reserved2;
+} qdf_packed;
+
+/**
+ * struct ipa_header - ipa header type registered to IPA hardware
+ * @vdev_id:  vdev id
+ * @reserved: Reserved not used
+ */
+struct ipa_header {
+	uint32_t
+		vdev_id:8,	/* vdev_id field is LSB of IPA DESC */
+		reserved:24;
+} qdf_packed;
+
+/**
+ * struct wlan_ipa_uc_tx_hdr - full tx header registered to IPA hardware
+ * @frag_hd: fragment header
+ * @ipa_hd:  ipa header
+ * @eth:     ether II header
+ */
+struct wlan_ipa_uc_tx_hdr {
+	struct frag_header frag_hd;
+	struct ipa_header ipa_hd;
+	qdf_ether_header_t eth;
+} qdf_packed;
+
+/**
+ * struct wlan_ipa_cld_hdr - IPA CLD Header
+ * @reserved: reserved fields
+ * @iface_id: interface ID
+ * @sta_id: Station ID
+ *
+ * Packed 32-bit structure
+ * +----------+----------+--------------+--------+
+ * | Reserved | QCMAP ID | interface id | STA ID |
+ * +----------+----------+--------------+--------+
+ */
+struct wlan_ipa_cld_hdr {
+	uint8_t reserved[2];
+	uint8_t iface_id;
+	uint8_t sta_id;
+} qdf_packed;
+
+/**
+ * struct wlan_ipa_rx_hdr - IPA RX header
+ * @cld_hdr: IPA CLD header
+ * @eth:     ether II header
+ */
+struct wlan_ipa_rx_hdr {
+	struct wlan_ipa_cld_hdr cld_hdr;
+	qdf_ether_header_t eth;
+} qdf_packed;
+
+/**
+ * struct wlan_ipa_pm_tx_cb - PM resume TX callback
+ * @exception: Exception packet
+ * @iface_context: Interface context
+ * @ipa_tx_desc: IPA TX descriptor
+ */
+struct wlan_ipa_pm_tx_cb {
+	bool exception;
+	struct wlan_ipa_iface_context *iface_context;
+	qdf_ipa_rx_data_t *ipa_tx_desc;
+};
+
+/**
+ * struct wlan_ipa_sys_pipe - IPA system pipe
+ * @conn_hdl: IPA system pipe connection handle
+ * @conn_hdl_valid: IPA system pipe valid flag
+ * @ipa_sys_params: IPA system pipe params
+ */
+struct wlan_ipa_sys_pipe {
+	uint32_t conn_hdl;
+	uint8_t conn_hdl_valid;
+	qdf_ipa_sys_connect_params_t ipa_sys_params;
+};
+
+/**
+ * struct wlan_ipa_iface_stats - IPA system pipe
+ * @num_tx: Number of TX packets
+ * @num_tx_drop: Number of TX packet drops
+ * @num_tx_err: Number of TX packet errors
+ * @num_tx_cac_drop: Number of TX packet drop due to CAC
+ * @num_rx_ipa_excep: Number of RX IPA exception packets
+ */
+struct wlan_ipa_iface_stats {
+	uint64_t num_tx;
+	uint64_t num_tx_drop;
+	uint64_t num_tx_err;
+	uint64_t num_tx_cac_drop;
+	uint64_t num_rx_ipa_excep;
+};
+
+/* IPA private context structure */
+struct wlan_ipa_priv;
+
+/**
+ * struct wlan_ipa_iface_context - IPA interface context
+ * @ipa_ctx: IPA private context
+ * @tl_context: TL context
+ * @cons_client: IPA consumer pipe
+ * @prod_client: IPA producer pipe
+ * @prod_client: IPA producer pipe
+ * @iface_id: IPA interface ID
+ * @dev: Net device structure
+ * @device_mode: Interface device mode
+ * @sta_id: Interface station ID
+ * @session_id: Session ID
+ * @interface_lock: Interface lock
+ * @ifa_address: Interface address
+ * @stats: Interface stats
+ */
+struct wlan_ipa_iface_context {
+	struct wlan_ipa_priv *ipa_ctx;
+	void *tl_context;
+
+	qdf_ipa_client_type_t cons_client;
+	qdf_ipa_client_type_t prod_client;
+
+	uint8_t iface_id;       /* This iface ID */
+	qdf_device_t dev;
+	enum tQDF_ADAPTER_MODE device_mode;
+	uint8_t sta_id;         /* This iface station ID */
+	uint8_t session_id;
+	qdf_spinlock_t interface_lock;
+	uint32_t ifa_address;
+	struct wlan_ipa_iface_stats stats;
+};
+
+/**
+ * struct wlan_ipa_stats - IPA system stats
+ * @event: WLAN IPA event record
+ * @num_send_msg: Number of sent IPA messages
+ * @num_rm_grant: Number of times IPA RM resource granted
+ * @num_rm_release: Number of times IPA RM resource released
+ * @num_rm_grant_imm: Number of immediate IPA RM granted
+ e @num_cons_perf_req: Number of CONS pipe perf request
+ * @num_prod_perf_req: Number of PROD pipe perf request
+ * @num_rx_drop: Number of RX packet drops
+ * @num_tx_desc_q_cnt: Number of TX descriptor queue count
+ * @num_tx_desc_err: Number of TX descriptor error
+ * @num_tx_comp_cnt: Number of TX qdf_event_t count
+ * @num_tx_queued: Number of TX queued
+ * @num_tx_dequeued: Number of TX dequeued
+ * @num_max_pm_queue: Number of packets in PM queue
+ * @num_rx_excep: Number of RX IPA exception packets
+ * @num_tx_fwd_ok: Number of TX forward packet success
+ * @num_tx_fwd_err: Number of TX forward packet failures
+ */
+struct wlan_ipa_stats {
+	uint32_t event[IPA_WLAN_EVENT_MAX];
+	uint64_t num_send_msg;
+	uint64_t num_free_msg;
+	uint64_t num_rm_grant;
+	uint64_t num_rm_release;
+	uint64_t num_rm_grant_imm;
+	uint64_t num_cons_perf_req;
+	uint64_t num_prod_perf_req;
+	uint64_t num_rx_drop;
+	uint64_t num_tx_desc_q_cnt;
+	uint64_t num_tx_desc_error;
+	uint64_t num_tx_comp_cnt;
+	uint64_t num_tx_queued;
+	uint64_t num_tx_dequeued;
+	uint64_t num_max_pm_queue;
+	uint64_t num_rx_excep;
+	uint64_t num_tx_fwd_ok;
+	uint64_t num_tx_fwd_err;
+};
+
+/**
+ * struct ipa_uc_stas_map - IPA UC assoc station map
+ * @is_reserved: STA reserved flag
+ * @sta_id: Station ID
+ * @mac_addr: Station mac address
+ */
+struct ipa_uc_stas_map {
+	bool is_reserved;
+	uint8_t sta_id;
+	struct qdf_mac_addr mac_addr;
+};
+
+/**
+ * struct op_msg_type - IPA operation message type
+ * @msg_t: Message type
+ * @rsvd: Reserved
+ * @op_code: IPA Operation type
+ * @len: IPA message length
+ * @rsvd_snd: Reserved
+ */
+struct op_msg_type {
+	uint8_t msg_t;
+	uint8_t rsvd;
+	uint16_t op_code;
+	uint16_t len;
+	uint16_t rsvd_snd;
+};
+
+/**
+ * struct ipa_uc_fw_stats - IPA FW stats
+ * @tx_comp_ring_size: TX completion ring size
+ * @txcomp_ring_dbell_addr: TX comp ring door bell address
+ * @txcomp_ring_dbell_ind_val: TX cop ring door bell indication
+ * @txcomp_ring_dbell_cached_val: TX cop ring cached value
+ * @txpkts_enqueued: TX packets enqueued
+ * @txpkts_completed: TX packets completed
+ * @tx_is_suspend: TX suspend flag
+ * @tx_reserved: Reserved for TX stat
+ * @rx_ind_ring_base: RX indication ring base addess
+ * @rx_ind_ring_size: RX indication ring size
+ * @rx_ind_ring_dbell_addr: RX indication ring doorbell address
+ * @rx_ind_ring_dbell_ind_val: RX indication ring doorbell indication
+ * @rx_ind_ring_dbell_ind_cached_val: RX indication ring doorbell cached value
+ * @rx_ind_ring_rdidx_addr: RX indication ring read index address
+ * @rx_ind_ring_rd_idx_cached_val: RX indication ring read index cached value
+ * @rx_refill_idx: RX ring refill index
+ * @rx_num_pkts_indicated: Number of RX packets indicated
+ * @rx_buf_refilled: Number of RX buffer refilled
+ * @rx_num_ind_drop_no_space: Number of RX indication drops due to no space
+ * @rx_num_ind_drop_no_buf: Number of RX indication drops due to no buffer
+ * @rx_is_suspend: RX suspend flag
+ * @rx_reserved: Reserved for RX stat
+ */
+struct ipa_uc_fw_stats {
+	uint32_t tx_comp_ring_base;
+	uint32_t tx_comp_ring_size;
+	uint32_t tx_comp_ring_dbell_addr;
+	uint32_t tx_comp_ring_dbell_ind_val;
+	uint32_t tx_comp_ring_dbell_cached_val;
+	uint32_t tx_pkts_enqueued;
+	uint32_t tx_pkts_completed;
+	uint32_t tx_is_suspend;
+	uint32_t tx_reserved;
+	uint32_t rx_ind_ring_base;
+	uint32_t rx_ind_ring_size;
+	uint32_t rx_ind_ring_dbell_addr;
+	uint32_t rx_ind_ring_dbell_ind_val;
+	uint32_t rx_ind_ring_dbell_ind_cached_val;
+	uint32_t rx_ind_ring_rdidx_addr;
+	uint32_t rx_ind_ring_rd_idx_cached_val;
+	uint32_t rx_refill_idx;
+	uint32_t rx_num_pkts_indicated;
+	uint32_t rx_buf_refilled;
+	uint32_t rx_num_ind_drop_no_space;
+	uint32_t rx_num_ind_drop_no_buf;
+	uint32_t rx_is_suspend;
+	uint32_t rx_reserved;
+};
+
+/**
+ * struct wlan_ipa_uc_pending_event - WLAN IPA UC pending event
+ * @node: Pending event list node
+ * @type: WLAN IPA event type
+ * @device_mode: Device mode
+ * @sta_id: Station ID
+ * @session_id: Session ID
+ * @mac_addr: Mac address
+ * @is_loading: Driver loading flag
+ */
+struct wlan_ipa_uc_pending_event {
+	qdf_list_node_t node;
+	qdf_ipa_wlan_event_t type;
+	qdf_netdev_t net_dev;
+	uint8_t device_mode;
+	uint8_t sta_id;
+	uint8_t session_id;
+	uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
+	bool is_loading;
+};
+
+/**
+ * struct uc_rm_work_struct
+ * @work: uC RM work
+ * @event: IPA RM event
+ */
+struct uc_rm_work_struct {
+	qdf_work_t work;
+	qdf_ipa_rm_event_t event;
+};
+
+/**
+ * struct uc_op_work_struct
+ * @work: uC OP work
+ * @msg: OP message
+ */
+struct uc_op_work_struct {
+	qdf_work_t work;
+	struct op_msg_type *msg;
+};
+
+/**
+ * struct uc_rt_debug_info
+ * @time: system time
+ * @ipa_excep_count: IPA exception packet count
+ * @rx_drop_count: IPA Rx drop packet count
+ * @net_sent_count: IPA Rx packet sent to network stack count
+ * @rx_discard_count: IPA Rx discard packet count
+ * @tx_fwd_ok_count: IPA Tx forward success packet count
+ * @tx_fwd_count: IPA Tx forward packet count
+ * @rx_destructor_call: IPA Rx packet destructor count
+ */
+struct uc_rt_debug_info {
+	uint64_t time;
+	uint64_t ipa_excep_count;
+	uint64_t rx_drop_count;
+	uint64_t net_sent_count;
+	uint64_t rx_discard_count;
+	uint64_t tx_fwd_ok_count;
+	uint64_t tx_fwd_count;
+	uint64_t rx_destructor_call;
+};
+
+#ifdef FEATURE_METERING
+/**
+ * struct ipa_uc_sharing_stats - IPA UC sharing stats
+ * @ipv4_rx_packets: IPv4 RX packets
+ * @ipv4_rx_bytes: IPv4 RX bytes
+ * @ipv6_rx_packets: IPv6 RX packets
+ * @ipv6_rx_bytes: IPv6 RX bytes
+ * @ipv4_tx_packets: IPv4 TX packets
+ * @ipv4_tx_bytes: IPv4 TX bytes
+ * @ipv6_tx_packets: IPv4 TX packets
+ * @ipv6_tx_bytes: IPv6 TX bytes
+ */
+struct ipa_uc_sharing_stats {
+	uint64_t ipv4_rx_packets;
+	uint64_t ipv4_rx_bytes;
+	uint64_t ipv6_rx_packets;
+	uint64_t ipv6_rx_bytes;
+	uint64_t ipv4_tx_packets;
+	uint64_t ipv4_tx_bytes;
+	uint64_t ipv6_tx_packets;
+	uint64_t ipv6_tx_bytes;
+};
+
+/**
+ * struct ipa_uc_quota_rsp - IPA UC quota response
+ * @success: Success or fail flag
+ * @reserved[3]: Reserved
+ * @quota_lo: Quota limit low bytes
+ * @quota_hi: Quota limit high bytes
+ */
+struct ipa_uc_quota_rsp {
+	uint8_t success;
+	uint8_t reserved[3];
+	uint32_t quota_lo;
+	uint32_t quota_hi;
+};
+
+/**
+ * struct ipa_uc_quota_ind
+ * @quota_bytes: Quota bytes to set
+ */
+struct ipa_uc_quota_ind {
+	uint64_t quota_bytes;
+};
+#endif
+
+/**
+ * struct wlan_ipa_tx_desc
+ * @node: TX descriptor node
+ * @priv: pointer to priv list entry
+ * @id: Tx desc idex
+ * @ipa_tx_desc_ptr: pointer to IPA Tx descriptor
+ */
+struct wlan_ipa_tx_desc {
+	qdf_list_node_t node;
+	void *priv;
+	uint32_t id;
+	qdf_ipa_rx_data_t *ipa_tx_desc_ptr;
+};
+
+typedef int (*wlan_ipa_softap_xmit)(qdf_nbuf_t skb, qdf_netdev_t dev);
+
+/* IPA private context structure definition */
+struct wlan_ipa_priv {
+	struct wlan_ipa_sys_pipe sys_pipe[WLAN_IPA_MAX_SYSBAM_PIPE];
+	struct wlan_ipa_iface_context iface_context[WLAN_IPA_MAX_IFACE];
+	uint8_t num_iface;
+	void *dp_soc;
+	void *dp_pdev;
+	struct wlan_ipa_config *config;
+	enum wlan_ipa_rm_state rm_state;
+	/*
+	 * IPA driver can send RM notifications with IRQ disabled so using qdf
+	 * APIs as it is taken care gracefully. Without this, kernel would throw
+	 * an warning if spin_lock_bh is used while IRQ is disabled
+	 */
+	qdf_spinlock_t rm_lock;
+	struct uc_rm_work_struct uc_rm_work;
+	struct uc_op_work_struct uc_op_work[WLAN_IPA_UC_OPCODE_MAX];
+	qdf_wake_lock_t wake_lock;
+	qdf_delayed_work_t wake_lock_work;
+	bool wake_lock_released;
+
+	qdf_atomic_t tx_ref_cnt;
+	qdf_nbuf_queue_t pm_queue_head;
+	qdf_work_t pm_work;
+	qdf_spinlock_t pm_lock;
+	bool suspended;
+
+	qdf_spinlock_t q_lock;
+
+	qdf_list_node_t pend_desc_head;
+	qdf_list_t tx_desc_list;
+
+	struct wlan_ipa_stats stats;
+
+	uint32_t curr_prod_bw;
+	uint32_t curr_cons_bw;
+
+	uint8_t activated_fw_pipe;
+	uint8_t sap_num_connected_sta;
+	uint8_t sta_connected;
+	uint32_t tx_pipe_handle;
+	uint32_t rx_pipe_handle;
+	bool resource_loading;
+	bool resource_unloading;
+	bool pending_cons_req;
+	struct ipa_uc_stas_map assoc_stas_map[WLAN_IPA_MAX_STA_COUNT];
+	qdf_list_t pending_event;
+	qdf_mutex_t event_lock;
+	bool ipa_pipes_down;
+	uint32_t ipa_tx_packets_diff;
+	uint32_t ipa_rx_packets_diff;
+	uint32_t ipa_p_tx_packets;
+	uint32_t ipa_p_rx_packets;
+	uint32_t stat_req_reason;
+	uint64_t ipa_tx_forward;
+	uint64_t ipa_rx_discard;
+	uint64_t ipa_rx_net_send_count;
+	uint64_t ipa_rx_internal_drop_count;
+	uint64_t ipa_rx_destructor_count;
+	qdf_mc_timer_t rt_debug_timer;
+	struct uc_rt_debug_info rt_bug_buffer[WLAN_IPA_UC_RT_DEBUG_BUF_COUNT];
+	unsigned int rt_buf_fill_index;
+	qdf_ipa_wdi_in_params_t cons_pipe_in;
+	qdf_ipa_wdi_in_params_t prod_pipe_in;
+	bool uc_loaded;
+	bool wdi_enabled;
+	qdf_mc_timer_t rt_debug_fill_timer;
+	qdf_mutex_t rt_debug_lock;
+	qdf_mutex_t ipa_lock;
+
+	uint8_t vdev_to_iface[WLAN_IPA_MAX_SESSION];
+	bool vdev_offload_enabled[WLAN_IPA_MAX_SESSION];
+	bool mcc_mode;
+	bool ap_disable_ibss_fwd;
+	bool dfs_cac_block_tx;
+#ifdef FEATURE_METERING
+	struct ipa_uc_sharing_stats ipa_sharing_stats;
+	struct ipa_uc_quota_rsp ipa_quota_rsp;
+	struct ipa_uc_quota_ind ipa_quota_ind;
+	qdf_event_t ipa_uc_sharing_stats_comp;
+	qdf_event_t ipa_uc_set_quota_comp;
+#endif
+
+	wlan_ipa_softap_xmit softap_xmit;
+	ipa_uc_offload_control_req ipa_tx_op;
+
+	qdf_event_t ipa_resource_comp;
+
+	uint32_t wdi_version;
+	bool is_smmu_enabled;	/* IPA caps returned from ipa_wdi_init */
+};
+
+#define WLAN_IPA_WLAN_FRAG_HEADER        sizeof(struct frag_header)
+#define WLAN_IPA_WLAN_IPA_HEADER         sizeof(struct ipa_header)
+#define WLAN_IPA_WLAN_CLD_HDR_LEN        sizeof(struct wlan_ipa_cld_hdr)
+#define WLAN_IPA_UC_WLAN_CLD_HDR_LEN     0
+#define WLAN_IPA_WLAN_TX_HDR_LEN         sizeof(struct wlan_ipa_tx_hdr)
+#define WLAN_IPA_UC_WLAN_TX_HDR_LEN      sizeof(struct wlan_ipa_uc_tx_hdr)
+#define WLAN_IPA_WLAN_RX_HDR_LEN         sizeof(struct wlan_ipa_rx_hdr)
+#define WLAN_IPA_UC_WLAN_HDR_DES_MAC_OFFSET \
+	(WLAN_IPA_WLAN_FRAG_HEADER + WLAN_IPA_WLAN_IPA_HEADER)
+
+#define WLAN_IPA_GET_IFACE_ID(_data) \
+	(((struct wlan_ipa_cld_hdr *) (_data))->iface_id)
+
+#define WLAN_IPA_LOG(LVL, fmt, args ...) \
+	QDF_TRACE(QDF_MODULE_ID_IPA, LVL, \
+		  "%s:%d: "fmt, __func__, __LINE__, ## args)
+
+#define WLAN_IPA_IS_CONFIG_ENABLED(_ipa_cfg, _mask) \
+	(((_ipa_cfg)->ipa_config & (_mask)) == (_mask))
+
+#define BW_GET_DIFF(_x, _y) (unsigned long)((ULONG_MAX - (_y)) + (_x) + 1)
+
+#if defined(QCA_WIFI_3_0) && defined(CONFIG_IPA3)
+#define WLAN_IPA_CHECK_HW() ipa_uc_reg_rdyCB(NULL)
+#else
+/* Do nothing */
+#define WLAN_IPA_CHECK_HW() 0
+#endif /* IPA3 */
+
+#define WLAN_IPA_DBG_DUMP_RX_LEN 84
+#define WLAN_IPA_DBG_DUMP_TX_LEN 48
+
+#define IPA_RESOURCE_COMP_WAIT_TIME	100
+
+/**
+ * wlan_ipa_wlan_event_to_str() - convert IPA WLAN event to string
+ * @event: IPA WLAN event to be converted to a string
+ *
+ * Return: ASCII string representing the IPA WLAN event
+ */
+static inline char *wlan_ipa_wlan_event_to_str(qdf_ipa_wlan_event_t event)
+{
+	switch (event) {
+	CASE_RETURN_STRING(WLAN_CLIENT_CONNECT);
+	CASE_RETURN_STRING(WLAN_CLIENT_DISCONNECT);
+	CASE_RETURN_STRING(WLAN_CLIENT_POWER_SAVE_MODE);
+	CASE_RETURN_STRING(WLAN_CLIENT_NORMAL_MODE);
+	CASE_RETURN_STRING(SW_ROUTING_ENABLE);
+	CASE_RETURN_STRING(SW_ROUTING_DISABLE);
+	CASE_RETURN_STRING(WLAN_AP_CONNECT);
+	CASE_RETURN_STRING(WLAN_AP_DISCONNECT);
+	CASE_RETURN_STRING(WLAN_STA_CONNECT);
+	CASE_RETURN_STRING(WLAN_STA_DISCONNECT);
+	CASE_RETURN_STRING(WLAN_CLIENT_CONNECT_EX);
+	default:
+		return "UNKNOWN";
+	}
+}
+
+/**
+ * wlan_ipa_get_iface() - Get IPA interface
+ * @ipa_ctx: IPA context
+ * @mode: Interface device mode
+ *
+ * Return: IPA interface address
+ */
+struct wlan_ipa_iface_context
+*wlan_ipa_get_iface(struct wlan_ipa_priv *ipa_ctx, uint8_t mode);
+
+#endif /* IPA_OFFLOAD */
+#endif /* _WLAN_IPA_PRIV_STRUCT_H_ */
diff --git a/components/ipa/core/src/wlan_ipa_main.c b/components/ipa/core/src/wlan_ipa_main.c
new file mode 100644
index 0000000..b30e531
--- /dev/null
+++ b/components/ipa/core/src/wlan_ipa_main.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018 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: contains ipa component main function definitions
+ */
+
+#include "wlan_ipa_main.h"
+#include "wlan_ipa_tgt_api.h"
+
+bool wlan_ipa_is_present(void)
+{
+	/* Check if ipa hw is enabled */
+	if (WLAN_IPA_CHECK_HW() != -EPERM)
+		return true;
+	else
+		return false;
+}
+
+QDF_STATUS ipa_send_uc_offload_enable_disable(struct wlan_objmgr_pdev *pdev,
+				struct ipa_uc_offload_control_params *req)
+{
+	return tgt_ipa_uc_offload_enable_disable(pdev, req);
+}
diff --git a/components/ipa/dispatcher/inc/wlan_ipa_obj_mgmt_api.h b/components/ipa/dispatcher/inc/wlan_ipa_obj_mgmt_api.h
new file mode 100644
index 0000000..b4e7e81
--- /dev/null
+++ b/components/ipa/dispatcher/inc/wlan_ipa_obj_mgmt_api.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2018 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: Declare public API related to the wlan ipa called by north bound
+ */
+
+#ifndef _WLAN_IPA_OBJ_MGMT_H_
+#define _WLAN_IPA_OBJ_MGMT_H_
+
+#include "wlan_ipa_public_struct.h"
+#include "wlan_objmgr_pdev_obj.h"
+
+#ifdef IPA_OFFLOAD
+
+/**
+ * ipa_init() - IPA module initialization
+ *
+ * Return: QDF_STATUS_SUCCESS on success
+ */
+QDF_STATUS ipa_init(void);
+
+/**
+ * ipa_deinit() - IPA module deinitialization
+ *
+ * Return: QDF_STATUS_SUCCESS on success
+ */
+QDF_STATUS ipa_deinit(void);
+#else
+
+static inline QDF_STATUS ipa_init(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS ipa_deinit(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* IPA_OFFLOAD */
+
+#endif /* _WLAN_IPA_OBJ_MGMT_H_ */
diff --git a/components/ipa/dispatcher/inc/wlan_ipa_public_struct.h b/components/ipa/dispatcher/inc/wlan_ipa_public_struct.h
new file mode 100644
index 0000000..ca3a01f
--- /dev/null
+++ b/components/ipa/dispatcher/inc/wlan_ipa_public_struct.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2018 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: contains ipa public structure definitions
+ */
+
+#ifndef _WLAN_IPA_PUBLIC_STRUCT_H_
+#define _WLAN_IPA_PUBLIC_STRUCT_H_
+
+#include <wlan_cmn.h>
+#include <qdf_status.h>
+#include <wlan_objmgr_psoc_obj.h>
+
+/**
+ * struct wlan_ipa_config
+ * @ipa_config: IPA config
+ * @desc_size: IPA descriptor size
+ * @txbuf_count: TX buffer count
+ * @bus_bw_high: Bus bandwidth high threshold
+ * @bus_bw_medium: Bus bandwidth medium threshold
+ * @bus_bw_low: Bus bandwidth low threshold
+ * @ipa_bw_high: IPA bandwidth high threshold
+ * @ipa_bw_medium: IPA bandwidth medium threshold
+ * @ipa_bw_low: IPA bandwidth low threshold
+ */
+struct wlan_ipa_config {
+	uint32_t ipa_config;
+	uint32_t desc_size;
+	uint32_t txbuf_count;
+	uint32_t bus_bw_high;
+	uint32_t bus_bw_medium;
+	uint32_t bus_bw_low;
+	uint32_t ipa_bw_high;
+	uint32_t ipa_bw_medium;
+	uint32_t ipa_bw_low;
+};
+
+/**
+ * enum wlan_ipa_wlan_event - WLAN IPA events
+ * @WLAN_IPA_CLIENT_CONNECT: Client Connects
+ * @WLAN_IPA_CLIENT_DISCONNECT: Client Disconnects
+ * @WLAN_IPA_AP_CONNECT: SoftAP is started
+ * @WLAN_IPA_AP_DISCONNECT: SoftAP is stopped
+ * @WLAN_IPA_STA_CONNECT: STA associates to AP
+ * @WLAN_IPA_STA_DISCONNECT: STA dissociates from AP
+ * @WLAN_IPA_CLIENT_CONNECT_EX: Peer associates/re-associates to softap
+ * @WLAN_IPA_WLAN_EVENT_MAX: Max value for the enum
+ */
+enum wlan_ipa_wlan_event {
+	WLAN_IPA_CLIENT_CONNECT,
+	WLAN_IPA_CLIENT_DISCONNECT,
+	WLAN_IPA_AP_CONNECT,
+	WLAN_IPA_AP_DISCONNECT,
+	WLAN_IPA_STA_CONNECT,
+	WLAN_IPA_STA_DISCONNECT,
+	WLAN_IPA_CLIENT_CONNECT_EX,
+	WLAN_IPA_WLAN_EVENT_MAX
+};
+
+/**
+ * struct ipa_uc_offload_control_params - ipa offload control params
+ * @offload_type: ipa offload type
+ * @vdev_id: vdev id
+ * @enable: ipa offload enable/disable
+ */
+struct ipa_uc_offload_control_params {
+	uint32_t offload_type;
+	uint32_t vdev_id;
+	uint32_t enable;
+};
+
+/* fp to send IPA UC offload cmd */
+typedef QDF_STATUS (*ipa_uc_offload_control_req)(struct wlan_objmgr_psoc *psoc,
+				struct ipa_uc_offload_control_params *req);
+#endif /* end  of _WLAN_IPA_PUBLIC_STRUCT_H_ */
diff --git a/components/ipa/dispatcher/inc/wlan_ipa_tgt_api.h b/components/ipa/dispatcher/inc/wlan_ipa_tgt_api.h
new file mode 100644
index 0000000..417b387
--- /dev/null
+++ b/components/ipa/dispatcher/inc/wlan_ipa_tgt_api.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2018 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: Declare public API for wlan ipa to interact with target/WMI
+ */
+
+#ifndef _WLAN_IPA_TGT_API_H_
+#define _WLAN_IPA_TGT_API_H_
+
+#include "wlan_ipa_public_struct.h"
+
+/**
+ * tgt_ipa_uc_offload_enable_disable() - send ipa offload control to target if
+ * @pdev: objmgr pdev object
+ * @req: ipa offload control request
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS tgt_ipa_uc_offload_enable_disable(struct wlan_objmgr_pdev *pdev,
+				struct ipa_uc_offload_control_params *req);
+#endif /* _WLAN_IPA_TGT_API_H_ */
diff --git a/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h b/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h
new file mode 100644
index 0000000..7c91e30
--- /dev/null
+++ b/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018 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: Declare public API related to the wlan ipa called by north bound
+ */
+
+#ifndef _WLAN_IPA_UCFG_API_H_
+#define _WLAN_IPA_UCFG_API_H_
+
+#include "wlan_ipa_public_struct.h"
+#include "wlan_ipa_obj_mgmt_api.h"
+#include "wlan_objmgr_pdev_obj.h"
+
+#ifdef IPA_OFFLOAD
+
+/**
+ * ucfg_ipa_is_present() - get IPA hw status
+ *
+ * ipa_uc_reg_rdyCB is not directly designed to check
+ * ipa hw status. This is an undocumented function which
+ * has confirmed with IPA team.
+ *
+ * Return: true - ipa hw present
+ *         false - ipa hw not present
+ */
+bool ucfg_ipa_is_present(void);
+#else
+
+static inline bool ucfg_ipa_is_present(void)
+{
+	return false;
+}
+
+#endif /* IPA_OFFLOAD */
+#endif /* _WLAN_IPA_UCFG_API_H_ */
diff --git a/components/ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c b/components/ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c
new file mode 100644
index 0000000..4697b5a
--- /dev/null
+++ b/components/ipa/dispatcher/src/wlan_ipa_obj_mgmt_api.c
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2018 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: public API related to the wlan ipa called by north bound HDD/OSIF
+ */
+
+#include "wlan_ipa_obj_mgmt_api.h"
+#include "wlan_ipa_main.h"
+#include "wlan_objmgr_global_obj.h"
+#include "target_if_ipa.h"
+
+/**
+ * ipa_pdev_obj_destroy_notification() - IPA pdev object destroy notification
+ * @pdev: pdev handle
+ * @arg_list: arguments list
+ *
+ * Return: QDF_STATUS_SUCCESS on success
+ */
+static QDF_STATUS
+ipa_pdev_obj_destroy_notification(struct wlan_objmgr_pdev *pdev,
+				  void *arg_list)
+{
+	QDF_STATUS status;
+	struct wlan_ipa_priv *ipa_obj;
+
+	ipa_obj = wlan_objmgr_pdev_get_comp_private_obj(pdev,
+							WLAN_UMAC_COMP_IPA);
+	if (!ipa_obj) {
+		ipa_err("Failed to get ipa pdev object");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	status = wlan_objmgr_pdev_component_obj_detach(pdev,
+						       WLAN_UMAC_COMP_IPA,
+						       ipa_obj);
+	if (QDF_IS_STATUS_ERROR(status))
+		ipa_err("Failed to detatch ipa pdev object");
+
+	qdf_mem_free(ipa_obj);
+
+	return status;
+}
+
+/**
+ * ipa_pdev_obj_create_notification() - IPA pdev object creation notification
+ * @pdev: pdev handle
+ * @arg_list: arguments list
+ *
+ * Return: QDF_STATUS_SUCCESS on success
+ */
+static QDF_STATUS
+ipa_pdev_obj_create_notification(struct wlan_objmgr_pdev *pdev,
+				 void *arg_list)
+{
+	QDF_STATUS status;
+	struct wlan_ipa_priv *ipa_obj;
+
+	ipa_info("ipa pdev created");
+
+	ipa_obj = qdf_mem_malloc(sizeof(*ipa_obj));
+	if (!ipa_obj) {
+		ipa_err("Failed to allocate memory for ipa pdev object");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	status = wlan_objmgr_pdev_component_obj_attach(pdev,
+						       WLAN_UMAC_COMP_IPA,
+						       (void *)ipa_obj,
+						       QDF_STATUS_SUCCESS);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		ipa_err("Failed to attach pdev ipa component");
+		qdf_mem_free(ipa_obj);
+		return status;
+	}
+
+	target_if_ipa_register_tx_ops(ipa_obj->ipa_tx_op);
+
+	ipa_info("ipa pdev attached");
+
+	return status;
+}
+
+QDF_STATUS ipa_init(void)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	ipa_info("ipa module dispatcher init");
+
+	if (!wlan_ipa_is_present()) {
+		ipa_info("ipa hw not present");
+		return status;
+	}
+
+	status = wlan_objmgr_register_pdev_create_handler(WLAN_UMAC_COMP_IPA,
+		ipa_pdev_obj_create_notification, NULL);
+
+	if (QDF_IS_STATUS_ERROR(status)) {
+		ipa_err("Failed to register pdev create handler for ipa");
+
+		return status;
+	}
+
+	status = wlan_objmgr_register_pdev_destroy_handler(WLAN_UMAC_COMP_IPA,
+		ipa_pdev_obj_destroy_notification, NULL);
+
+	if (QDF_IS_STATUS_ERROR(status)) {
+		ipa_err("Failed to register pdev destroy handler for ipa");
+		goto fail_delete_pdev;
+	}
+
+	return status;
+
+fail_delete_pdev:
+	wlan_objmgr_unregister_pdev_create_handler(WLAN_UMAC_COMP_IPA,
+		ipa_pdev_obj_create_notification, NULL);
+
+	return status;
+}
+
+QDF_STATUS ipa_deinit(void)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+
+	ipa_info("ipa module dispatcher deinit");
+
+	if (!wlan_ipa_is_present()) {
+		ipa_info("ipa hw not present");
+		return status;
+	}
+
+	status = wlan_objmgr_unregister_pdev_destroy_handler(WLAN_UMAC_COMP_IPA,
+				ipa_pdev_obj_destroy_notification, NULL);
+	if (QDF_IS_STATUS_ERROR(status))
+		ipa_err("Failed to unregister pdev destroy handler");
+
+	status = wlan_objmgr_unregister_pdev_create_handler(WLAN_UMAC_COMP_IPA,
+				ipa_pdev_obj_create_notification, NULL);
+	if (QDF_IS_STATUS_ERROR(status))
+		ipa_err("Failed to unregister pdev create handler");
+
+	return status;
+}
diff --git a/components/ipa/dispatcher/src/wlan_ipa_tgt_api.c b/components/ipa/dispatcher/src/wlan_ipa_tgt_api.c
new file mode 100644
index 0000000..c9c1e97
--- /dev/null
+++ b/components/ipa/dispatcher/src/wlan_ipa_tgt_api.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2018 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: Implements public API for ipa to interact with target/WMI
+ */
+
+#include "wlan_ipa_tgt_api.h"
+#include "wlan_ipa_main.h"
+#include "wlan_ipa_public_struct.h"
+#include <wlan_objmgr_global_obj.h>
+#include <wlan_objmgr_pdev_obj.h>
+
+QDF_STATUS tgt_ipa_uc_offload_enable_disable(struct wlan_objmgr_pdev *pdev,
+				struct ipa_uc_offload_control_params *req)
+{
+	struct wlan_ipa_priv *ipa_obj;
+	struct wlan_objmgr_psoc *psoc;
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+
+	IPA_ENTER();
+
+	ipa_obj = ipa_pdev_get_priv_obj(pdev);
+	psoc = wlan_pdev_get_psoc(pdev);
+
+	if (ipa_obj->ipa_tx_op)
+		status = ipa_obj->ipa_tx_op(psoc, req);
+
+	IPA_EXIT();
+	return status;
+}
diff --git a/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c b/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c
new file mode 100644
index 0000000..79b1d71
--- /dev/null
+++ b/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2018 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: public API related to the wlan ipa called by north bound HDD/OSIF
+ */
+
+#include "wlan_ipa_ucfg_api.h"
+#include "wlan_ipa_main.h"
+
+bool ucfg_ipa_is_present(void)
+{
+	return wlan_ipa_is_present();
+}
diff --git a/components/target_if/ipa/inc/target_if_ipa.h b/components/target_if/ipa/inc/target_if_ipa.h
new file mode 100644
index 0000000..689a40d
--- /dev/null
+++ b/components/target_if/ipa/inc/target_if_ipa.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2018 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: Declare various api/struct which shall be used
+ * by ipa component for wmi cmd (tx path)
+ */
+
+#ifndef _TARGET_IF_IPA_H_
+#define _TARGET_IF_IPA_H_
+
+#ifdef IPA_OFFLOAD
+
+#include "wlan_ipa_public_struct.h"
+
+/**
+ * target_if_ipa_register_tx_ops() - Register IPA component TX OPS
+ * @ipa_tx_op: IPA if transmit op
+ *
+ * Return: None
+ */
+void target_if_ipa_register_tx_ops(ipa_uc_offload_control_req ipa_tx_op);
+
+#endif /* IPA_OFFLOAD */
+#endif /* _TARGET_IF_IPA_H_ */
+
diff --git a/components/target_if/ipa/src/target_if_ipa.c b/components/target_if/ipa/src/target_if_ipa.c
new file mode 100644
index 0000000..2c8d34d
--- /dev/null
+++ b/components/target_if/ipa/src/target_if_ipa.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018 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: Target interface file for disa component to
+ * Implement api's which shall be used by ipa component
+ * in target if internally.
+ */
+
+#include <target_if.h>
+#include <qdf_status.h>
+#include <wmi_unified_api.h>
+#include <wmi_unified_priv.h>
+#include <wmi_unified_param.h>
+#include <target_if_ipa.h>
+#include <wlan_objmgr_psoc_obj.h>
+
+/**
+ * target_if_ipa_uc_offload_control_req() - send IPA offload control to FW
+ * @psoc: pointer to PSOC object
+ * @req: IPA UC offload enable/disable control param
+ *
+ * Return: QDF_STATUS_SUCCESS on success
+ */
+static QDF_STATUS
+target_if_ipa_uc_offload_control_req(struct wlan_objmgr_psoc *psoc,
+			struct ipa_uc_offload_control_params *req)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+void target_if_ipa_register_tx_ops(ipa_uc_offload_control_req ipa_tx_op)
+{
+	if (!ipa_tx_op) {
+		target_if_err("ipa_tx_op is null");
+		return;
+	}
+
+	ipa_tx_op = target_if_ipa_uc_offload_control_req;
+}
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index efa64a7..8bc7992 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -131,6 +131,7 @@
 #include <cdp_txrx_cmn_struct.h>
 #include "wlan_hdd_sysfs.h"
 #include "wlan_disa_ucfg_api.h"
+#include "wlan_ipa_ucfg_api.h"
 #include <target_if.h>
 
 #ifdef CNSS_GENL
@@ -11884,6 +11885,7 @@
 	pmo_init();
 	disa_init();
 	ucfg_ocb_init();
+	ipa_init();
 }
 
 /**
@@ -11893,6 +11895,7 @@
  */
 static void component_deinit(void)
 {
+	ipa_deinit();
 	ucfg_ocb_deinit();
 	pmo_deinit();
 	disa_deinit();