qcacmn: wifi3 compile against cdp

Wifi 3.0 compile against cdp apis.
Make compilable against mobile code base.
selective hw common header include.

Change-Id: I051f917001c0d13c762d9cb5a3ec141cd278d0e7
CRs-fixed: 1075736
diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c
index 228cfeb..47f6705 100644
--- a/dp/wifi3.0/dp_htt.c
+++ b/dp/wifi3.0/dp_htt.c
@@ -18,7 +18,7 @@
 
 #include <htt.h>
 #include <hal_api.h>
-#include <dp_htt.h>
+#include "dp_htt.h"
 
 #define HTT_HTC_PKT_POOL_INIT_SIZE 64
 
@@ -288,7 +288,8 @@
 			 "%s: ring_type %d ring_id %d\n",
 			 __func__, hal_ring_type, srng_params.ring_id);
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			 "hp_addr 0x%x tp_addr 0x%x\n", hp_addr, tp_addr);
+			 "hp_addr 0x%llx tp_addr 0x%llx\n",
+			 (uint64_t)hp_addr, (uint64_t)tp_addr);
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			 "htt_ring_id %d\n", htt_ring_id);
 		break;
@@ -358,14 +359,13 @@
 	HTT_SRING_SETUP_RING_SIZE_SET(*msg_word,
 		(ring_entry_size * srng_params.num_entries));
 	if (htt_ring_type == HTT_SW_TO_HW_RING)
-		HTT_SRING_SETUP_RING_MISC_CFG_LOOPCOUNT_DISABLE_SET(*msg_word,
-		1);
-
-	HTT_SRING_SETUP_RING_MISC_CFG_MSI_SWAP_SET(*msg_word,
+		HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(
+						*msg_word, 1);
+	HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(*msg_word,
 		!!(srng_params.flags & HAL_SRNG_MSI_SWAP));
-	HTT_SRING_SETUP_RING_MISC_CFG_TLV_SWAP_SET(*msg_word,
+	HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(*msg_word,
 		!!(srng_params.flags & HAL_SRNG_DATA_TLV_SWAP));
-	HTT_SRING_SETUP_RING_MISC_CFG_HOST_FW_SWAP_SET(*msg_word,
+	HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(*msg_word,
 		!!(srng_params.flags & HAL_SRNG_RING_PTR_SWAP));
 
 	/* word 4 */
diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h
index d28b910..2b87ed4 100644
--- a/dp/wifi3.0/dp_internal.h
+++ b/dp/wifi3.0/dp_internal.h
@@ -61,5 +61,22 @@
 extern void dp_peer_unref_delete(void *peer_handle);
 extern void dp_rx_discard(struct dp_vdev *vdev, struct dp_peer *peer,
 	unsigned tid, qdf_nbuf_t msdu_list);
-
+extern void *dp_find_peer_by_addr(void *dev,
+	uint8_t *peer_mac_addr, uint8_t *peer_id);
+QDF_STATUS dp_register_peer(void *pdev_handle,
+		struct ol_txrx_desc_type *sta_desc);
+QDF_STATUS dp_clear_peer(void *pdev_handle, uint8_t local_id);
+void *dp_find_peer_by_addr_and_vdev(void *pdev_handle, void *vdev,
+		uint8_t *peer_addr, uint8_t *local_id);
+uint16_t dp_local_peer_id(void *peer);
+void *dp_peer_find_by_local_id(void *pdev_handle, uint8_t local_id);
+QDF_STATUS dp_peer_state_update(void *pdev_handle, uint8_t *peer_mac,
+		enum ol_txrx_peer_state state);
+QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id);
+void *dp_get_vdev_for_peer(void *peer);
+uint8_t *dp_peer_get_peer_mac_addr(void *peer);
+int dp_get_peer_state(void *peer_handle);
+void dp_local_peer_id_pool_init(struct dp_pdev *pdev);
+void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer);
+void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer);
 #endif /* #ifndef _DP_INTERNAL_H_ */
diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c
index bf3577c..16c416c 100644
--- a/dp/wifi3.0/dp_main.c
+++ b/dp/wifi3.0/dp_main.c
@@ -27,7 +27,8 @@
 #include "dp_types.h"
 #include "dp_internal.h"
 #include "dp_tx.h"
-#include "wlan_cfg.h"
+#include "dp_rx.h"
+#include "../../wlan_cfg/wlan_cfg.h"
 
 /**
  * dp_setup_srng - Internal function to setup SRNG rings used by data path
@@ -121,71 +122,6 @@
 void *hif_get_hal_handle(void *hif_handle);
 
 /*
- * dp_soc_attach_wifi3() - Attach txrx SOC
- * @osif_soc:		Opaque SOC handle from OSIF/HDD
- * @htc_handle:	Opaque HTC handle
- * @hif_handle:	Opaque HIF handle
- * @qdf_osdev:	QDF device
- *
- * Return: DP SOC handle on success, NULL on failure
- */
-void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle,
-	HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
-	struct ol_if_ops *ol_ops)
-{
-	struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc));
-
-	if (!soc) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			"%s: DP SOC memory allocation failed\n", __func__);
-		goto fail0;
-	}
-
-	soc->osif_soc = osif_soc;
-	soc->osdev = qdf_osdev;
-	soc->ol_ops = ol_ops;
-	soc->hif_handle = hif_handle;
-	soc->hal_soc = hif_get_hal_handle(hif_handle);
-	soc->htt_handle = htt_soc_attach(soc, osif_soc, htc_handle,
-		soc->hal_soc, qdf_osdev);
-	if (soc->htt_handle == NULL) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			"%s: HTT attach failed\n", __func__);
-		goto fail1;
-	}
-
-	soc->wlan_cfg_ctx = wlan_cfg_soc_attach();
-
-	if (!soc->wlan_cfg_ctx) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-				"%s: wlan_cfg_soc_attach failed\n", __func__);
-		goto fail2;
-	}
-
-
-#ifdef notyet
-	if (wdi_event_attach(soc)) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			"%s: WDI event attach failed\n", __func__);
-		goto fail2;
-	}
-#endif
-
-	if (dp_soc_interrupt_attach(soc) != QDF_STATUS_SUCCESS) {
-		goto fail2;
-	}
-
-	return (void *)soc;
-
-fail2:
-	htt_soc_detach(soc->htt_handle);
-fail1:
-	qdf_mem_free(soc);
-fail0:
-	return NULL;
-}
-
-/*
  * dp_service_srngs() - Top level interrupt handler for DP Ring interrupts
  * @dp_ctx: DP SOC handle
  * @budget: Number of frames/descriptors that can be processed in one shot
@@ -209,6 +145,9 @@
 				work_done =
 					dp_tx_comp_handler(soc, ring, budget);
 				budget -= work_done;
+				if (work_done)
+					DP_TRACE(INFO, "tx mask 0x%x ring %d, budget %d\n",
+						tx_mask, ring, budget);
 				if (budget <= 0)
 					goto budget_done;
 			}
@@ -221,10 +160,12 @@
 			if (rx_mask & (1 << ring)) {
 				work_done =
 					dp_rx_process(soc,
-					soc->reo_dest_ring[ring].hal_srng,
-					budget);
-
+					    soc->reo_dest_ring[ring].hal_srng,
+					    budget);
 				budget -=  work_done;
+				if (work_done)
+					DP_TRACE(INFO, "rx mask 0x%x ring %d, budget %d\n",
+						tx_mask, ring, budget);
 				if (budget <= 0)
 					goto budget_done;
 			}
@@ -317,6 +258,12 @@
 
 
 	for (i = 0; i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++) {
+		int j = 0;
+		int ret = 0;
+
+		/* Map of IRQ ids registered with one interrupt context */
+		int irq_id_map[HIF_MAX_GRP_IRQ];
+
 		int tx_mask =
 			wlan_cfg_get_tx_ring_mask(soc->wlan_cfg_ctx, i);
 		int rx_mask =
@@ -331,12 +278,6 @@
 
 		num_irq = 0;
 
-		int j = 0;
-		int ret = 0;
-
-		/* Map of IRQ ids registered with one interrupt context */
-		int irq_id_map[HIF_MAX_GRP_IRQ];
-
 		for (j = 0; j < HIF_MAX_GRP_IRQ; j++) {
 
 			if (tx_mask & (1 << j)) {
@@ -382,10 +323,13 @@
 void dp_soc_interrupt_detach(void *txrx_soc)
 {
 	struct dp_soc *soc = (struct dp_soc *)txrx_soc;
+	int i;
 
-	soc->intr_ctx[i].tx_ring_mask = 0;
-	soc->intr_ctx[i].rx_ring_mask = 0;
-	soc->intr_ctx[i].rx_mon_ring_mask = 0;
+	for (i = 0; i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++) {
+		soc->intr_ctx[i].tx_ring_mask = 0;
+		soc->intr_ctx[i].rx_ring_mask = 0;
+		soc->intr_ctx[i].rx_mon_ring_mask = 0;
+	}
 }
 #endif
 
@@ -631,8 +575,8 @@
 			soc->wbm_idle_scatter_buf_base_paddr,
 			soc->wbm_idle_scatter_buf_base_vaddr,
 			num_scatter_bufs, soc->wbm_idle_scatter_buf_size,
-			(uint32_t)(scatter_buf_ptr - (unsigned long)(
-			soc->wbm_idle_scatter_buf_base_vaddr[
+			(uint32_t)(scatter_buf_ptr -
+					(uint8_t *)(soc->wbm_idle_scatter_buf_base_vaddr[
 			scatter_buf_num])));
 	}
 	return 0;
@@ -667,7 +611,7 @@
 /*
  * Free link descriptor pool that was setup HW
  */
-static void dp_hw_link_desc_pool_cleanup(struct dp_soc *soc)
+void dp_hw_link_desc_pool_cleanup(struct dp_soc *soc)
 {
 	int i;
 
@@ -726,14 +670,6 @@
 	if (soc->cmn_init_done)
 		return 0;
 
-	soc->wlan_cfg_ctx = wlan_cfg_soc_attach();
-
-	if (!soc->wlan_cfg_ctx) {
-		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-				"%s: wlan_cfg_soc_attach failed\n", __func__);
-		goto fail0;
-	}
-
 	if (dp_peer_find_attach(soc))
 		goto fail0;
 
@@ -875,7 +811,7 @@
 		goto fail1;
 	}
 
-
+	dp_soc_interrupt_attach(soc);
 	/* Setup HW REO */
 	hal_reo_setup(soc->hal_soc);
 
@@ -902,8 +838,8 @@
 *
 * Return: DP PDEV handle on success, NULL on failure
 */
-void *dp_pdev_attach_wifi3(void *txrx_soc, void *ctrl_pdev,
-	HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, int pdev_id)
+void *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc, void *ctrl_pdev,
+	HTC_HANDLE htc_handle, qdf_device_t qdf_osdev, uint8_t pdev_id)
 {
 	struct dp_soc *soc = (struct dp_soc *)txrx_soc;
 	struct dp_pdev *pdev = qdf_mem_malloc(sizeof(*pdev));
@@ -1020,6 +956,15 @@
 		goto fail1;
 	}
 
+	/* Rx specific init */
+	if (dp_rx_pdev_attach(pdev)) {
+			QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+				"%s: dp_rx_pdev_attach failed \n", __func__);
+			goto fail0;
+	}
+
+	/* MCL */
+	dp_local_peer_id_pool_init(pdev);
 
 	return (void *)pdev;
 
@@ -1050,6 +995,8 @@
 			WBM2SW_RELEASE, pdev->pdev_id);
 	}
 
+	dp_rx_pdev_detach(pdev);
+
 	/* Setup per PDEV REO rings if configured */
 	if (wlan_cfg_per_pdev_rx_ring(soc->wlan_cfg_ctx)) {
 		dp_srng_cleanup(soc, &soc->reo_dest_ring[pdev->pdev_id],
@@ -1145,6 +1092,7 @@
 	dp_srng_cleanup(soc, &soc->reo_cmd_ring, REO_CMD, 0);
 	dp_srng_cleanup(soc, &soc->reo_status_ring, REO_STATUS, 0);
 
+	qdf_spinlock_destroy(&soc->peer_ref_mutex);
 	htt_soc_detach(soc->htt_handle);
 }
 
@@ -1152,9 +1100,9 @@
  * dp_soc_attach_target_wifi3() - SOC initialization in the target
  * @txrx_soc: Datapath SOC handle
  */
-int dp_soc_attach_target_wifi3(void *txrx_soc)
+int dp_soc_attach_target_wifi3(struct cdp_soc_t *cdp_soc)
 {
-	struct dp_soc *soc = (struct dp_soc *)txrx_soc;
+	struct dp_soc *soc = (struct dp_soc *)cdp_soc;
 	int i;
 
 	htt_soc_attach_target(soc->htt_handle);
@@ -1275,10 +1223,10 @@
 	vdev->osif_proxy_arp = txrx_ops->proxy_arp;
 #endif
 #endif
-#ifdef notyet
 	/* TODO: Enable the following once Tx code is integrated */
 	txrx_ops->tx.tx = dp_tx_send;
-#endif
+
+	DP_TRACE(ERROR, "DP Vdev Register success");
 }
 
 /*
@@ -1371,6 +1319,7 @@
 		return NULL; /* failure */
 
 	qdf_mem_zero(peer, sizeof(struct dp_peer));
+	qdf_spinlock_create(&peer->peer_info_lock);
 
 	/* store provided params */
 	peer->vdev = vdev;
@@ -1400,12 +1349,10 @@
 	/* TODO: See if hash based search is required */
 	dp_peer_find_hash_add(soc, peer);
 
-	if (soc->ol_ops->peer_set_default_routing) {
-		/* TODO: Check on the destination ring number to be passed
-		 * to FW
-		 */
-		soc->ol_ops->peer_set_default_routing(soc->osif_soc,
-			peer->mac_addr.raw, peer->vdev->vdev_id, 0, 1);
+	if (soc->cdp_soc.ol_ops->peer_set_default_routing) {
+		/* TODO: Check on the destination ring number to be passed to FW */
+		soc->cdp_soc.ol_ops->peer_set_default_routing(soc->osif_soc, peer->mac_addr.raw,
+			peer->vdev->vdev_id, 0, 1);
 	}
 
 	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_HIGH,
@@ -1424,6 +1371,7 @@
 		vdev->vap_bss_peer = peer;
 	}
 
+	dp_local_peer_id_alloc(pdev, peer);
 	return (void *)peer;
 }
 
@@ -1592,4 +1540,246 @@
 	 * reference, added by the PEER_MAP message.
 	 */
 	dp_peer_unref_delete(peer_handle);
+	dp_local_peer_id_free(peer->vdev->pdev, peer);
+	qdf_spinlock_destroy(&peer->peer_info_lock);
+}
+
+/*
+ * dp_get_vdev_mac_addr_wifi3() – Detach txrx peer
+ * @peer_handle:		Datapath peer handle
+ *
+ */
+uint8 *dp_get_vdev_mac_addr_wifi3(void *pvdev)
+{
+	struct dp_vdev *vdev = pvdev;
+
+	return vdev->mac_addr.raw;
+}
+
+/*
+ * dp_get_vdev_from_vdev_id_wifi3() – Detach txrx peer
+ * @peer_handle:		Datapath peer handle
+ *
+ */
+void *dp_get_vdev_from_vdev_id_wifi3(void *dev, uint8_t vdev_id)
+{
+	struct dp_pdev *pdev = dev;
+	struct dp_vdev *vdev = NULL;
+
+	if (qdf_unlikely(!pdev))
+		return NULL;
+
+	TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
+		if (vdev->vdev_id == vdev_id)
+			break;
+	}
+
+	return vdev;
+}
+
+int dp_get_opmode(void *vdev_handle)
+{
+	struct dp_vdev *vdev = vdev_handle;
+
+	return vdev->opmode;
+}
+
+void *dp_get_ctrl_pdev_from_vdev_wifi3(void *pvdev)
+{
+	struct dp_vdev *vdev = pvdev;
+	struct dp_pdev *pdev = vdev->pdev;
+
+	return (void *)pdev->wlan_cfg_ctx;
+}
+
+static struct cdp_cmn_ops dp_ops_cmn = {
+	.txrx_soc_attach_target = dp_soc_attach_target_wifi3,
+	.txrx_vdev_attach = dp_vdev_attach_wifi3,
+	.txrx_vdev_detach = dp_vdev_detach_wifi3,
+	.txrx_pdev_attach = dp_pdev_attach_wifi3,
+	.txrx_pdev_detach = dp_pdev_detach_wifi3,
+	.txrx_peer_attach = dp_peer_attach_wifi3,
+	.txrx_peer_detach = dp_peer_detach_wifi3,
+	.txrx_vdev_register = dp_vdev_register_wifi3,
+	.txrx_soc_detach = dp_soc_detach_wifi3,
+	.txrx_get_vdev_mac_addr = dp_get_vdev_mac_addr_wifi3,
+	.txrx_get_vdev_from_vdev_id = dp_get_vdev_from_vdev_id_wifi3,
+	.txrx_get_ctrl_pdev_from_vdev = dp_get_ctrl_pdev_from_vdev_wifi3,
+	/* TODO: Add other functions */
+};
+
+static struct cdp_ctrl_ops dp_ops_ctrl = {
+	.txrx_peer_authorize = dp_peer_authorize,
+	/* TODO: Add other functions */
+};
+
+static struct cdp_me_ops dp_ops_me = {
+	/* TODO */
+};
+
+static struct cdp_mon_ops dp_ops_mon = {
+	/* TODO */
+};
+
+static struct cdp_host_stats_ops dp_ops_host_stats = {
+	/* TODO */
+};
+
+static struct cdp_wds_ops dp_ops_wds = {
+	/* TODO */
+};
+
+static struct cdp_raw_ops dp_ops_raw = {
+	/* TODO */
+};
+
+#ifdef CONFIG_WIN
+static struct cdp_pflow_ops dp_ops_pflow = {
+	/* TODO */
+};
+#endif /* CONFIG_WIN */
+
+static struct cdp_misc_ops dp_ops_misc = {
+	.get_opmode = dp_get_opmode,
+};
+
+static struct cdp_flowctl_ops dp_ops_flowctl = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_lflowctl_ops dp_ops_l_flowctl = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_ipa_ops dp_ops_ipa = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_lro_ops dp_ops_lro = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_bus_ops dp_ops_bus = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_ocb_ops dp_ops_ocb = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+
+static struct cdp_throttle_ops dp_ops_throttle = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_mob_stats_ops dp_ops_mob_stats = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_cfg_ops dp_ops_cfg = {
+	/* WIFI 3.0 DP NOT IMPLEMENTED YET */
+};
+
+static struct cdp_peer_ops dp_ops_peer = {
+	.register_peer = dp_register_peer,
+	.clear_peer = dp_clear_peer,
+	.find_peer_by_addr = dp_find_peer_by_addr,
+	.find_peer_by_addr_and_vdev = dp_find_peer_by_addr_and_vdev,
+	.local_peer_id = dp_local_peer_id,
+	.peer_find_by_local_id = dp_peer_find_by_local_id,
+	.peer_state_update = dp_peer_state_update,
+	.get_vdevid = dp_get_vdevid,
+	.peer_get_peer_mac_addr = dp_peer_get_peer_mac_addr,
+	.get_vdev_for_peer = dp_get_vdev_for_peer,
+	.get_peer_state = dp_get_peer_state,
+};
+
+static struct cdp_ops dp_txrx_ops = {
+	.cmn_drv_ops = &dp_ops_cmn,
+	.ctrl_ops = &dp_ops_ctrl,
+	.me_ops = &dp_ops_me,
+	.mon_ops = &dp_ops_mon,
+	.host_stats_ops = &dp_ops_host_stats,
+	.wds_ops = &dp_ops_wds,
+	.raw_ops = &dp_ops_raw,
+#ifdef CONFIG_WIN
+	.pflow_ops = &dp_ops_pflow,
+#endif /* CONFIG_WIN */
+	.misc_ops = &dp_ops_misc,
+	.cfg_ops = &dp_ops_cfg,
+	.flowctl_ops = &dp_ops_flowctl,
+	.l_flowctl_ops = &dp_ops_l_flowctl,
+	.ipa_ops = &dp_ops_ipa,
+	.lro_ops = &dp_ops_lro,
+	.bus_ops = &dp_ops_bus,
+	.ocb_ops = &dp_ops_ocb,
+	.peer_ops = &dp_ops_peer,
+	.throttle_ops = &dp_ops_throttle,
+	.mob_stats_ops = &dp_ops_mob_stats,
+};
+
+/*
+ * dp_soc_attach_wifi3() - Attach txrx SOC
+ * @osif_soc:		Opaque SOC handle from OSIF/HDD
+ * @htc_handle:	Opaque HTC handle
+ * @hif_handle:	Opaque HIF handle
+ * @qdf_osdev:	QDF device
+ *
+ * Return: DP SOC handle on success, NULL on failure
+ */
+void *dp_soc_attach_wifi3(void *osif_soc, void *hif_handle,
+	HTC_HANDLE htc_handle, qdf_device_t qdf_osdev,
+	struct ol_if_ops *ol_ops)
+{
+	struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc));
+
+	if (!soc) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			"%s: DP SOC memory allocation failed\n", __func__);
+		goto fail0;
+	}
+
+	soc->cdp_soc.ops = &dp_txrx_ops;
+	soc->cdp_soc.ol_ops = ol_ops;
+	soc->osif_soc = osif_soc;
+	soc->osdev = qdf_osdev;
+	soc->hif_handle = hif_handle;
+
+	soc->hal_soc = hif_get_hal_handle(hif_handle);
+	soc->htt_handle = htt_soc_attach(soc, osif_soc, htc_handle,
+		soc->hal_soc, qdf_osdev);
+	if (soc->htt_handle == NULL) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			"%s: HTT attach failed\n", __func__);
+		goto fail1;
+	}
+
+	soc->wlan_cfg_ctx = wlan_cfg_soc_attach();
+	if (!soc->wlan_cfg_ctx) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+				"%s: wlan_cfg_soc_attach failed\n", __func__);
+		goto fail2;
+	}
+	qdf_spinlock_create(&soc->peer_ref_mutex);
+
+#ifdef notyet
+	if (wdi_event_attach(soc)) {
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
+			"%s: WDI event attach failed\n", __func__);
+		goto fail2;
+	}
+#endif
+
+	if (dp_soc_interrupt_attach(soc) != QDF_STATUS_SUCCESS) {
+		goto fail2;
+	}
+
+	return (void *)soc;
+
+fail2:
+	htt_soc_detach(soc->htt_handle);
+fail1:
+	qdf_mem_free(soc);
+fail0:
+	return NULL;
 }
diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c
index 385b7a1..1b7ecd1 100644
--- a/dp/wifi3.0/dp_peer.c
+++ b/dp/wifi3.0/dp_peer.c
@@ -415,6 +415,31 @@
 }
 
 /*
+ * dp_find_peer_by_addr - find peer instance by mac address
+ * @dev: physical device instance
+ * @peer_mac_addr: peer mac address
+ * @local_id: local id for the peer
+ *
+ * Return: peer instance pointer
+ */
+void *dp_find_peer_by_addr(void *dev, uint8_t *peer_mac_addr,
+		uint8_t *local_id)
+{
+	struct dp_pdev *pdev = dev;
+	struct dp_peer *peer;
+
+	/* WAR, VDEV ID? TEMP 0 */
+	peer = dp_peer_find_hash_find(pdev->soc, peer_mac_addr, 0);
+	if (!peer)
+		return NULL;
+
+	/* Multiple peer ids? How can know peer id? */
+	*local_id = peer->local_id;
+	DP_TRACE(INFO, "%s: peer %p id %d", __func__, peer, *local_id);
+	return peer;
+}
+
+/*
  * dp_rx_tid_update_wifi3() – Update receive TID state
  * @peer: Datapath peer handle
  * @tid: TID
@@ -549,8 +574,8 @@
 	hal_reo_qdesc_setup(soc->hal_soc, tid, ba_window_size, start_seq,
 		hw_qdesc_vaddr, rx_tid->hw_qdesc_paddr, hal_pn_type);
 
-	if (soc->ol_ops->peer_rx_reorder_queue_setup) {
-		soc->ol_ops->peer_rx_reorder_queue_setup(soc->osif_soc,
+	if (soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup) {
+		soc->cdp_soc.ol_ops->peer_rx_reorder_queue_setup(soc->osif_soc,
 			peer->vdev->vdev_id, peer->mac_addr.raw,
 			rx_tid->hw_qdesc_paddr, tid, tid);
 	}
@@ -560,7 +585,7 @@
 /*
  * Rx TID deletion callback to free memory allocated for HW queue descriptor
  */
-static void dp_rx_tid_delete_cb(struct dp_pdev *pdev, void *cb_ctxt, int status)
+void dp_rx_tid_delete_cb(struct dp_pdev *pdev, void *cb_ctxt, int status)
 {
 	struct dp_soc *soc = pdev->soc;
 	struct dp_rx_tid *rx_tid = (struct dp_rx_tid *)cb_ctxt;
@@ -692,7 +717,7 @@
 
 	rx_tid->ba_win_size = baparamset->buffersize;
 	rx_tid->dialogtoken = dialogtoken;
-	rx_tid->statuscode = IEEE80211_STATUS_SUCCESS;
+	rx_tid->statuscode = QDF_STATUS_SUCCESS;
 	rx_tid->ba_status = DP_RX_BA_ACTIVE;
 
 	return 0;
@@ -737,7 +762,7 @@
 	struct ieee80211_delba_parameterset *delbaparamset, uint16_t reasoncode)
 {
 	struct dp_peer *peer = (struct dp_peer *)peer_handle;
-	uint16_t tid = delbaparamset->tid;
+	uint16_t tid = (uint16_t)delbaparamset->tid;
 	struct dp_rx_tid *rx_tid = &peer->rx_tid[tid];
 
 	if (rx_tid->ba_status != DP_RX_BA_ACTIVE)
@@ -799,7 +824,7 @@
 		sec_type);
 	sec_index = is_unicast ? dp_sec_ucast : dp_sec_mcast;
 	peer->security[sec_index].sec_type = sec_type;
-#if notyet /* TODO: See if this is required for defrag support */
+#ifdef notyet /* TODO: See if this is required for defrag support */
 	/* michael key only valid for TKIP, but for simplicity,
 	 * copy it anyway
 	 */
@@ -839,3 +864,305 @@
 	 */
 }
 
+/**
+ * dp_register_peer() - Register peer into physical device
+ * @pdev - data path device instance
+ * @sta_desc - peer description
+ *
+ * Register peer into physical device
+ *
+ * Return: QDF_STATUS_SUCCESS registration success
+ *         QDF_STATUS_E_FAULT peer not found
+ */
+QDF_STATUS dp_register_peer(void *pdev_handle,
+		struct ol_txrx_desc_type *sta_desc)
+{
+	struct dp_peer *peer;
+	struct dp_pdev *pdev = pdev_handle;
+
+	peer = dp_peer_find_by_local_id(pdev, sta_desc->sta_id);
+	if (!peer)
+		return QDF_STATUS_E_FAULT;
+
+	qdf_spin_lock_bh(&peer->peer_info_lock);
+	peer->state = OL_TXRX_PEER_STATE_CONN;
+	qdf_spin_unlock_bh(&peer->peer_info_lock);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * dp_clear_peer() - remove peer from physical device
+ * @pdev - data path device instance
+ * @sta_id - local peer id
+ *
+ * remove peer from physical device
+ *
+ * Return: QDF_STATUS_SUCCESS registration success
+ *         QDF_STATUS_E_FAULT peer not found
+ */
+QDF_STATUS dp_clear_peer(void *pdev_handle, uint8_t local_id)
+{
+	struct dp_peer *peer;
+	struct dp_pdev *pdev = pdev_handle;
+
+	peer = dp_peer_find_by_local_id(pdev, local_id);
+	if (!peer)
+		return QDF_STATUS_E_FAULT;
+
+	qdf_spin_lock_bh(&peer->peer_info_lock);
+	peer->state = OL_TXRX_PEER_STATE_DISC;
+	qdf_spin_unlock_bh(&peer->peer_info_lock);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * dp_find_peer_by_addr_and_vdev() - Find peer by peer mac address within vdev
+ * @pdev - data path device instance
+ * @vdev - virtual interface instance
+ * @peer_addr - peer mac address
+ * @peer_id - local peer id with target mac address
+ *
+ * Find peer by peer mac address within vdev
+ *
+ * Return: peer instance void pointer
+ *         NULL cannot find target peer
+ */
+void *dp_find_peer_by_addr_and_vdev(void *pdev_handle, void *vdev,
+		uint8_t *peer_addr, uint8_t *local_id)
+{
+	struct dp_pdev *pdev = pdev_handle;
+	struct dp_peer *peer;
+
+	DP_TRACE(INFO, "vdev %p peer_addr %p", vdev, peer_addr);
+	peer = dp_peer_find_hash_find(pdev->soc, peer_addr, 0);
+	DP_TRACE(INFO, "peer %p vdev %p", peer, vdev);
+
+	if (!peer)
+		return NULL;
+
+	if (peer->vdev != vdev)
+		return NULL;
+
+	*local_id = peer->local_id;
+
+	DP_TRACE(INFO, "peer %p vdev %p lcoal id %d",
+			peer, vdev, *local_id);
+
+	return peer;
+}
+
+/**
+ * dp_local_peer_id() - Find local peer id within peer instance
+ * @peer - peer instance
+ *
+ * Find local peer id within peer instance
+ *
+ * Return: local peer id
+ */
+uint16_t dp_local_peer_id(void *peer)
+{
+	return ((struct dp_peer *)peer)->local_id;
+}
+
+/**
+ * dp_peer_find_by_local_id() - Find peer by local peer id
+ * @pdev - data path device instance
+ * @local_peer_id - local peer id want to find
+ *
+ * Find peer by local peer id within physical device
+ *
+ * Return: peer instance void pointer
+ *         NULL cannot find target peer
+ */
+void *dp_peer_find_by_local_id(void *pdev_handle, uint8_t local_id)
+{
+	struct dp_peer *peer;
+	struct dp_pdev *pdev = pdev_handle;
+
+	qdf_spin_lock_bh(&pdev->local_peer_ids.lock);
+	peer = pdev->local_peer_ids.map[local_id];
+	qdf_spin_unlock_bh(&pdev->local_peer_ids.lock);
+	DP_TRACE(INFO, "peer %p lcoal id %d",
+			peer, local_id);
+	return peer;
+}
+
+/**
+ * dp_peer_state_update() - update peer local state
+ * @pdev - data path device instance
+ * @peer_addr - peer mac address
+ * @state - new peer local state
+ *
+ * update peer local state
+ *
+ * Return: QDF_STATUS_SUCCESS registration success
+ */
+QDF_STATUS dp_peer_state_update(void *pdev_handle, uint8_t *peer_mac,
+		enum ol_txrx_peer_state state)
+{
+	struct dp_peer *peer;
+	struct dp_pdev *pdev = pdev_handle;
+
+	peer =  dp_peer_find_hash_find(pdev->soc, peer_mac, 0);
+	peer->state = state;
+	DP_TRACE(INFO, "peer %p state %d",
+			peer, peer->state);
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * dp_get_vdevid() - Get virtaul interface id which peer registered
+ * @peer - peer instance
+ * @vdev_id - virtaul interface id which peer registered
+ *
+ * Get virtaul interface id which peer registered
+ *
+ * Return: QDF_STATUS_SUCCESS registration success
+ */
+QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id)
+{
+	struct dp_peer *peer = peer_handle;
+
+	DP_TRACE(INFO, "peer %p vdev %p vdev id %d",
+			peer, peer->vdev, peer->vdev->vdev_id);
+	*vdev_id = peer->vdev->vdev_id;
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * dp_get_vdev_for_peer() - Get virtual interface instance which peer belongs
+ * @peer - peer instance
+ *
+ * Get virtual interface instance which peer belongs
+ *
+ * Return: virtual interface instance pointer
+ *         NULL in case cannot find
+ */
+void *dp_get_vdev_for_peer(void *peer_handle)
+{
+	struct dp_peer *peer = peer_handle;
+
+	DP_TRACE(INFO, "peer %p vdev %p", peer, peer->vdev);
+	return (void *)peer->vdev;
+}
+
+/**
+ * dp_peer_get_peer_mac_addr() - Get peer mac address
+ * @peer - peer instance
+ *
+ * Get peer mac address
+ *
+ * Return: peer mac address pointer
+ *         NULL in case cannot find
+ */
+uint8_t *dp_peer_get_peer_mac_addr(void *peer_handle)
+{
+	struct dp_peer *peer = peer_handle;
+	uint8_t *mac;
+
+	mac = peer->mac_addr.raw;
+	DP_TRACE(INFO, "peer %p mac 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x",
+		peer, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+	return peer->mac_addr.raw;
+}
+
+/**
+ * dp_get_peer_state() - Get local peer state
+ * @peer - peer instance
+ *
+ * Get local peer state
+ *
+ * Return: peer status
+ */
+int dp_get_peer_state(void *peer_handle)
+{
+	struct dp_peer *peer = peer_handle;
+
+	DP_TRACE(INFO, "peer %p stats %d", peer, peer->state);
+	return peer->state;
+}
+
+/**
+ * dp_local_peer_id_pool_init() - local peer id pool alloc for physical device
+ * @pdev - data path device instance
+ *
+ * local peer id pool alloc for physical device
+ *
+ * Return: none
+ */
+void dp_local_peer_id_pool_init(struct dp_pdev *pdev)
+{
+	int i;
+
+	/* point the freelist to the first ID */
+	pdev->local_peer_ids.freelist = 0;
+
+	/* link each ID to the next one */
+	for (i = 0; i < OL_TXRX_NUM_LOCAL_PEER_IDS; i++) {
+		pdev->local_peer_ids.pool[i] = i + 1;
+		pdev->local_peer_ids.map[i] = NULL;
+	}
+
+	/* link the last ID to itself, to mark the end of the list */
+	i = OL_TXRX_NUM_LOCAL_PEER_IDS;
+	pdev->local_peer_ids.pool[i] = i;
+
+	qdf_spinlock_create(&pdev->local_peer_ids.lock);
+	DP_TRACE(INFO, "Peer pool init");
+}
+
+/**
+ * dp_local_peer_id_alloc() - allocate local peer id
+ * @pdev - data path device instance
+ * @peer - new peer instance
+ *
+ * allocate local peer id
+ *
+ * Return: none
+ */
+void dp_local_peer_id_alloc(struct dp_pdev *pdev, struct dp_peer *peer)
+{
+	int i;
+
+	qdf_spin_lock_bh(&pdev->local_peer_ids.lock);
+	i = pdev->local_peer_ids.freelist;
+	if (pdev->local_peer_ids.pool[i] == i) {
+		/* the list is empty, except for the list-end marker */
+		peer->local_id = OL_TXRX_INVALID_LOCAL_PEER_ID;
+	} else {
+		/* take the head ID and advance the freelist */
+		peer->local_id = i;
+		pdev->local_peer_ids.freelist = pdev->local_peer_ids.pool[i];
+		pdev->local_peer_ids.map[i] = peer;
+	}
+	qdf_spin_unlock_bh(&pdev->local_peer_ids.lock);
+	DP_TRACE(INFO, "peer %p, local id %d", peer, peer->local_id);
+}
+
+/**
+ * dp_local_peer_id_free() - remove local peer id
+ * @pdev - data path device instance
+ * @peer - peer instance should be removed
+ *
+ * remove local peer id
+ *
+ * Return: none
+ */
+void dp_local_peer_id_free(struct dp_pdev *pdev, struct dp_peer *peer)
+{
+	int i = peer->local_id;
+	if ((i == OL_TXRX_INVALID_LOCAL_PEER_ID) ||
+	    (i >= OL_TXRX_NUM_LOCAL_PEER_IDS)) {
+		return;
+	}
+
+	/* put this ID on the head of the freelist */
+	qdf_spin_lock_bh(&pdev->local_peer_ids.lock);
+	pdev->local_peer_ids.pool[i] = pdev->local_peer_ids.freelist;
+	pdev->local_peer_ids.freelist = i;
+	pdev->local_peer_ids.map[i] = NULL;
+	qdf_spin_unlock_bh(&pdev->local_peer_ids.lock);
+}
+
diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c
index b84746e..29db47e 100644
--- a/dp/wifi3.0/dp_rx_err.c
+++ b/dp/wifi3.0/dp_rx_err.c
@@ -252,7 +252,7 @@
 		 */
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			"%s %d : "
-			"HAL RING Access For WBM Release SRNG Failed -- %lu\n",
+			"HAL RING Access For WBM Release SRNG Failed -- %p\n",
 			__func__, __LINE__, wbm_rel_srng);
 		goto done;
 	}
@@ -316,7 +316,7 @@
 		 * Ring Type / Ring Id combo
 		 */
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			"%s %d : HAL RING Access Failed -- %lu\n",
+			"%s %d : HAL RING Access Failed -- %p\n",
 			__func__, __LINE__, hal_ring);
 		goto done;
 	}
@@ -433,7 +433,7 @@
 		 * Ring Type / Ring Id combo
 		 */
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-			"%s %d : HAL RING Access Failed -- %lu\n",
+			"%s %d : HAL RING Access Failed -- %p\n",
 			__func__, __LINE__, hal_ring);
 		goto done;
 	}
diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c
index 73aa34f..7df0183 100644
--- a/dp/wifi3.0/dp_tx.c
+++ b/dp/wifi3.0/dp_tx.c
@@ -23,7 +23,7 @@
 #include "hal_tx.h"
 #include "qdf_mem.h"
 #include "qdf_nbuf.h"
-#include "wlan_cfg.h"
+#include "../../wlan_cfg/wlan_cfg.h"
 
 #ifdef TX_CORE_ALIGNED_SEND
 #define DP_TX_GET_DESC_POOL_ID(vdev) qdf_get_cpu()
@@ -312,7 +312,7 @@
 	 * descriptor.For the direct buffer pointer case, HW requirement is that
 	 * descriptor should always point to a 8-byte aligned address.
 	 */
-	align_pad = ((uint32_t) (qdf_nbuf_data(nbuf)) & 0x7);
+	align_pad = (uint8_t)((uintptr_t) (qdf_nbuf_data(nbuf)) & 0x7);
 	tx_desc->pkt_offset = align_pad;
 
 	/*
@@ -493,8 +493,8 @@
 	hal_tx_desc_set_encap_type(hal_tx_desc_cached, tx_desc->tx_encap_type);
 
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
-			"%s length:%d , type = %d, dma_addr %p, offset %d\n",
-			__func__, length, type, dma_addr, tx_desc->pkt_offset);
+			"%s length:%d , type = %d, dma_addr %llx, offset %d\n",
+			__func__, length, type, (uint64_t)dma_addr, tx_desc->pkt_offset);
 
 	if (tx_desc->flags & DP_TX_DESC_FLAG_TO_FW)
 		hal_tx_desc_set_to_fw(hal_tx_desc_cached, 1);
@@ -585,7 +585,7 @@
 
 	if (qdf_unlikely(hal_srng_access_start(soc->hal_soc, hal_srng))) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-				"%s %d : HAL RING Access Failed -- %lu\n",
+				"%s %d : HAL RING Access Failed -- %p\n",
 				__func__, __LINE__, hal_srng);
 		goto fail_return;
 	}
@@ -635,7 +635,7 @@
 
 	if (qdf_unlikely(hal_srng_access_start(soc->hal_soc, hal_srng))) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-				"%s %d : HAL RING Access Failed -- %lu\n",
+				"%s %d : HAL RING Access Failed -- %p\n",
 				__func__, __LINE__, hal_srng);
 		return nbuf;
 	}
@@ -1113,7 +1113,7 @@
 
 	if (qdf_unlikely(hal_srng_access_start(soc->hal_soc, hal_srng))) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
-				"%s %d : HAL RING Access Failed -- %lu\n",
+				"%s %d : HAL RING Access Failed -- %p\n",
 				__func__, __LINE__, hal_srng);
 		return 0;
 	}
@@ -1330,8 +1330,8 @@
 QDF_STATUS dp_tx_soc_detach(struct dp_soc *soc)
 {
 	uint8_t num_pool;
-	uint8_t num_desc;
-	uint8_t num_ext_desc;
+	uint16_t num_desc;
+	uint16_t num_ext_desc;
 	uint8_t i;
 
 	num_pool = wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
@@ -1361,7 +1361,7 @@
 	}
 
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
-			"%s MSDU Ext Desc Pool Free descs = %d\n",
+			"%s MSDU Ext Desc Pool %d Free descs = %d\n",
 			__func__, num_pool, num_ext_desc);
 
 	return QDF_STATUS_SUCCESS;
@@ -1414,7 +1414,7 @@
 	}
 
 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
-			"%s MSDU Ext Desc Alloc , descs = %d\n",
+			"%s MSDU Ext Desc Alloc %d, descs = %d\n",
 			__func__, num_pool, num_ext_desc);
 
 	/* Initialize descriptors in TCL Rings */
diff --git a/dp/wifi3.0/dp_tx.h b/dp/wifi3.0/dp_tx.h
index 00c7176..50dd767 100644
--- a/dp/wifi3.0/dp_tx.h
+++ b/dp/wifi3.0/dp_tx.h
@@ -20,7 +20,7 @@
 
 #include <qdf_types.h>
 #include <qdf_nbuf.h>
-#include <dp_types.h>
+#include "dp_types.h"
 
 #define DP_STATS_ADD(x, y, z)
 #define DP_STATS_SUB(x, y, z)
diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h
index 957af65..f695dac 100644
--- a/dp/wifi3.0/dp_types.h
+++ b/dp/wifi3.0/dp_types.h
@@ -42,8 +42,6 @@
 #define DP_MAX_IRQ_PER_CONTEXT 12
 #define DP_MAX_INTERRUPT_CONTEXTS 8
 
-#define MAX_TCL_DATA_RINGS 3
-#define MAX_TXDESC_POOLS 3
 #define MAX_TX_HW_QUEUES 3
 
 #define DP_MAX_INTERRUPT_CONTEXTS 8
@@ -73,6 +71,9 @@
      (_a)[5] == 0xff)
 
 
+#define DP_TRACE(LVL, fmt, args ...)                             \
+	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_##LVL,       \
+		"%s:%d: "fmt, __func__, __LINE__, ## args)
 /**
  * enum dp_tx_frm_type
  * @dp_tx_frm_std: Regular frame, no added header fragments
@@ -228,19 +229,6 @@
 	uint16_t statuscode;
 };
 
-struct ol_if_ops {
-	void (*peer_set_default_routing)(void *scn_handle,
-		uint8_t *peer_macaddr, uint8_t vdev_id, bool hash_based,
-		uint8_t ring_num);
-	int (*peer_rx_reorder_queue_setup)(void *ol_soc_handle,
-		uint8_t vdev_id, uint8_t *peer_mac, qdf_dma_addr_t hw_qdesc,
-		int tid, uint16_t queue_num);
-	int (*peer_rx_reorder_queue_remove)(void *ol_soc_handle,
-		uint8_t vdev_id, uint8_t *peer_macaddr, uint32_t tid_mask);
-	/* TODO: Add any other control path calls required to OL_IF/WMA layer */
-};
-
-
 /* per interrupt context  */
 struct dp_intr {
 	uint8_t tx_ring_mask;   /* WBM Tx completion rings (0-2)
@@ -255,11 +243,7 @@
 /* SOC level structure for data path */
 struct dp_soc {
 	/* Common base structure - Should be the first member */
-#ifdef notyet /* TODO: dp_soc_cmn should be defined in cmn headers */
-	struct dp_soc_cmn soc_cmn;
-#endif
-	/* Callbacks to OL_IF layer */
-	struct ol_if_ops *ol_ops;
+	struct cdp_soc_t cdp_soc;
 
 	/* SoC/softc handle from OSIF layer */
 	void *osif_soc;
@@ -319,6 +303,9 @@
 		union dp_rx_desc_list_elem_t *freelist;
 	} rx_desc[MAX_RXDESC_POOLS];
 
+	/* DP rx desc lock */
+	DP_MUTEX_TYPE rx_desc_mutex[MAX_RXDESC_POOLS];
+
 	/* HAL SOC handle */
 	void *hal_soc;
 
@@ -512,6 +499,14 @@
 	uint32_t num_tx_outstanding;
 
 	uint32_t num_tx_exception;
+
+	/* MCL specific local peer handle */
+	struct {
+		uint8_t pool[OL_TXRX_NUM_LOCAL_PEER_IDS + 1];
+		uint8_t freelist;
+		qdf_spinlock_t lock;
+		struct dp_peer *map[OL_TXRX_NUM_LOCAL_PEER_IDS];
+	} local_peer_ids;
 	/* TBD */
 };
 
@@ -586,7 +581,7 @@
 
 	/* rx filter related */
 	uint32_t drop_unenc;
-#if notyet
+#ifdef notyet
 	privacy_exemption privacy_filters[MAX_PRIVACY_FILTERS];
 	uint32_t filters_num;
 #endif
@@ -661,7 +656,7 @@
 
 	struct {
 		enum htt_sec_type sec_type;
-#if notyet /* TODO: See if this is required for defrag support */
+#ifdef notyet /* TODO: See if this is required for defrag support */
 		u_int32_t michael_key[2]; /* relevant for TKIP */
 #endif
 	} security[2]; /* 0 -> multicast, 1 -> unicast */
@@ -685,6 +680,10 @@
 				bss_peer:1,
 				wapi:1;
 
+	/* MCL specific peer local id */
+	uint16_t local_id;
+	enum ol_txrx_peer_state state;
+	qdf_spinlock_t peer_info_lock;
 	/* TBD */
 };
 
diff --git a/dp/wifi3.0/hal_rx.h b/dp/wifi3.0/hal_rx.h
index 5e6f3db..76bf2c9 100644
--- a/dp/wifi3.0/hal_rx.h
+++ b/dp/wifi3.0/hal_rx.h
@@ -19,18 +19,7 @@
 #ifndef _HAL_RX_H_
 #define _HAL_RX_H_
 
-#include "reo_destination_ring.h"
-#include "wbm_release_ring.h"
-#include "rx_msdu_desc_info.h"
-
-#include "rx_mpdu_start.h"
-#include "rx_mpdu_end.h"
-#include "rx_msdu_start.h"
-#include "rx_msdu_end.h"
-#include "rx_attention.h"
-
-#include <qdf_mem.h>
-
+#include <hal_internal.h>
 
 /**
  * enum hal_reo_error_code: Enum which encapsulates "reo_push_reason"
diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h
index b968ab1..6f517e8 100644
--- a/hal/wifi3.0/hal_api.h
+++ b/hal/wifi3.0/hal_api.h
@@ -33,6 +33,9 @@
 #include "qdf_types.h"
 #include "hal_internal.h"
 #include "hif_io32.h"
+#include "rx_msdu_link.h"
+#include "rx_reo_queue.h"
+#include "rx_reo_queue_ext.h"
 
 /**
  * hal_attach - Initalize HAL layer
diff --git a/hal/wifi3.0/hal_internal.h b/hal/wifi3.0/hal_internal.h
index bfd2eed..b3cb5a0 100644
--- a/hal/wifi3.0/hal_internal.h
+++ b/hal/wifi3.0/hal_internal.h
@@ -32,12 +32,33 @@
 
 #include "qdf_types.h"
 #include "qdf_lock.h"
-#include "hw/reg_header/wcss/wcss_seq_hwiobase.h"
-#include "hw/reg_header/wcss/wcss_seq_hwioreg.h"
-#include "hw/data/common/sw_xml_headers.h"
-#include "hw/data/datastruct/reo_destination_ring.h"
-#include "hw/data/tlv_32/tcl_data_cmd.h"
-#include "hw/data/common/tlv_hdr.h"
+#include "qdf_mem.h"
+#include "wcss_seq_hwiobase.h"
+#include "tlv_hdr.h"
+#include "tlv_tag_def.h"
+#include "reo_destination_ring.h"
+#include "reo_reg_seq_hwioreg.h"
+#include "reo_entrance_ring.h"
+#include "reo_get_queue_stats.h"
+#include "reo_get_queue_stats_status.h"
+#include "tcl_data_cmd.h"
+#include "tcl_gse_cmd.h"
+#include "tcl_status_ring.h"
+#include "mac_tcl_reg_seq_hwioreg.h"
+#include "ce_src_desc.h"
+#include "ce_stat_desc.h"
+#include "wfss_ce_reg_seq_hwioreg.h"
+#include "wbm_link_descriptor_ring.h"
+#include "wbm_reg_seq_hwioreg.h"
+#include "wbm_buffer_ring.h"
+#include "wbm_release_ring.h"
+#include "rx_msdu_desc_info.h"
+#include "rx_mpdu_start.h"
+#include "rx_mpdu_end.h"
+#include "rx_msdu_start.h"
+#include "rx_msdu_end.h"
+#include "rx_attention.h"
+#include "tx_msdu_extension.h"
 
 /* TBD: This should be movded to shared HW header file */
 enum hal_srng_ring_id {
diff --git a/hal/wifi3.0/hal_rx.c b/hal/wifi3.0/hal_rx.c
index b57bd5f..d0416db 100644
--- a/hal/wifi3.0/hal_rx.c
+++ b/hal/wifi3.0/hal_rx.c
@@ -16,10 +16,6 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-#include "wcss_seq_hwiobase.h"
-#include "wcss_seq_hwioreg.h"
-#include "sw_xml_headers.h"
-#include "tlv_hdr.h"
 #include "hal_api.h"
 
 /* TODO: See if the following definition is available in HW headers */
diff --git a/hal/wifi3.0/hal_srng.c b/hal/wifi3.0/hal_srng.c
index 26df90d..0e38ba0 100644
--- a/hal/wifi3.0/hal_srng.c
+++ b/hal/wifi3.0/hal_srng.c
@@ -27,12 +27,6 @@
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "hw/reg_header/wcss/wcss_seq_hwiobase.h"
-#include "hw/reg_header/wcss/wcss_seq_hwioreg.h"
-#include "hw/data/common/sw_xml_headers.h"
-#include "hw/data/datastruct/reo_destination_ring.h"
-#include "hw/data/tlv_32/tcl_data_cmd.h"
-#include "hw/data/common/tlv_hdr.h"
 #include "hal_api.h"
 
 /**
diff --git a/hal/wifi3.0/hal_tx.h b/hal/wifi3.0/hal_tx.h
index 28a720f..b48251a 100644
--- a/hal/wifi3.0/hal_tx.h
+++ b/hal/wifi3.0/hal_tx.h
@@ -23,12 +23,6 @@
   Include files
   ---------------------------------------------------------------------------*/
 #include "hal_api.h"
-#include <hal_internal.h>
-#include <qdf_types.h>
-#include "qdf_mem.h"
-#include "hw/data/datastruct/wbm_release_ring.h"
-#include "hw/data/tlv_32/tcl_data_cmd.h"
-#include "hw/data/datastruct/tx_msdu_extension.h"
 
 /*---------------------------------------------------------------------------
   Preprocessor definitions and constants
diff --git a/hal/wifi3.0/hal_wbm.c b/hal/wifi3.0/hal_wbm.c
index 69ed505..8ef8098 100644
--- a/hal/wifi3.0/hal_wbm.c
+++ b/hal/wifi3.0/hal_wbm.c
@@ -16,12 +16,6 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-#include "wcss_seq_hwiobase.h"
-#include "wcss_seq_hwioreg.h"
-#include "sw_xml_headers.h"
-#include "reo_destination_ring.h"
-#include "tcl_data_cmd.h"
-#include "tlv_hdr.h"
 #include "hal_api.h"
 
 /**
diff --git a/hif/inc/regtable_pcie.h b/hif/inc/regtable_pcie.h
index 25df023..ca283b3 100644
--- a/hif/inc/regtable_pcie.h
+++ b/hif/inc/regtable_pcie.h
@@ -261,12 +261,18 @@
 	(pdev->targetdef->d_RX_MSDU_START_0_MSDU_LENGTH_MASK)
 #define RX_MSDU_START_0_MSDU_LENGTH_LSB \
 	(pdev->targetdef->d_RX_MSDU_START_0_MSDU_LENGTH_LSB)
+#ifndef RX_MSDU_START_2_DECAP_FORMAT_OFFSET
 #define RX_MSDU_START_2_DECAP_FORMAT_OFFSET \
 	(pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_OFFSET)
+#endif
+#ifndef RX_MSDU_START_2_DECAP_FORMAT_MASK
 #define RX_MSDU_START_2_DECAP_FORMAT_MASK \
 	(pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_MASK)
+#endif
+#ifndef RX_MSDU_START_2_DECAP_FORMAT_LSB
 #define RX_MSDU_START_2_DECAP_FORMAT_LSB \
 	(pdev->targetdef->d_RX_MSDU_START_2_DECAP_FORMAT_LSB)
+#endif
 #define RX_MPDU_START_0_ENCRYPTED_MASK \
 	(pdev->targetdef->d_RX_MPDU_START_0_ENCRYPTED_MASK)
 #define RX_MPDU_START_0_ENCRYPTED_LSB \
diff --git a/hif/src/ce/ce_service_srng.c b/hif/src/ce/ce_service_srng.c
index a1bd74f..aab67f4 100644
--- a/hif/src/ce/ce_service_srng.c
+++ b/hif/src/ce/ce_service_srng.c
@@ -206,7 +206,7 @@
 		DPTRACE(qdf_dp_trace((qdf_nbuf_t)per_transfer_context,
 			QDF_DP_TRACE_CE_PACKET_PTR_RECORD,
 			(uint8_t *)(((qdf_nbuf_t)per_transfer_context)->data),
-			sizeof(((qdf_nbuf_t)per_transfer_context)->data)));
+			sizeof(((qdf_nbuf_t)per_transfer_context)->data), QDF_NA));
 	} else {
 		/*
 		 * Probably not worth the additional complexity to support
diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h
index 76e0c2b..2084049 100644
--- a/hif/src/hif_main.h
+++ b/hif/src/hif_main.h
@@ -176,6 +176,12 @@
 	uint32_t hif_attribute;
 };
 
+static inline void *hif_get_hal_handle(void *hif_hdl)
+{
+	struct hif_softc *sc = (struct hif_softc *)hif_hdl;
+	return sc->hal_soc;
+}
+
 #ifdef QCA_NSS_WIFI_OFFLOAD_SUPPORT
 static inline bool hif_is_nss_wifi_enabled(struct hif_softc *sc)
 {
diff --git a/hif/src/pcie/if_pci.c b/hif/src/pcie/if_pci.c
index c5d9eb8..696416d 100644
--- a/hif/src/pcie/if_pci.c
+++ b/hif/src/pcie/if_pci.c
@@ -1451,7 +1451,7 @@
  *
  * Bmi phase uses different copy complete callbacks than mission mode.
  */
-static void hif_register_bmi_callbacks(struct hif_softc *hif_sc)
+void hif_register_bmi_callbacks(struct hif_softc *hif_sc)
 {
 	struct HIF_CE_pipe_info *pipe_info;
 	struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_sc);
diff --git a/hif/src/qca8074def.c b/hif/src/qca8074def.c
index 3a99f92..e2bfa5b 100644
--- a/hif/src/qca8074def.c
+++ b/hif/src/qca8074def.c
@@ -21,7 +21,7 @@
 #undef UMAC
 #define WLAN_HEADERS 1
 
-#include <qca8074/hw/reg_header/defines/lithium_top_reg.h>
+#include <lithium_top_reg.h>
 
 #define MISSING 0
 
diff --git a/qdf/inc/qdf_types.h b/qdf/inc/qdf_types.h
index 55c9515..c2756bf 100644
--- a/qdf/inc/qdf_types.h
+++ b/qdf/inc/qdf_types.h
@@ -269,6 +269,8 @@
 	QDF_MODULE_ID_BMI = 21,
 	QDF_MODULE_ID_EPPING = 22,
 	QDF_MODULE_ID_QVIT = 23,
+	QDF_MODULE_ID_DP = 24,
+	QDF_MODULE_ID_SOC = 25,
 	QDF_MODULE_ID_MAX
 } QDF_MODULE_ID;
 
diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c
index b253ea3..c042b7d 100644
--- a/wlan_cfg/wlan_cfg.c
+++ b/wlan_cfg/wlan_cfg.c
@@ -63,9 +63,15 @@
 #define WLAN_CFG_PER_PDEV_RX_RING 16
 #define WLAN_CFG_NUM_REO_DEST_RING 16
 
+#ifdef CONFIG_WIN
 #define WLAN_CFG_NUM_TX_DESC  8192
 #define WLAN_CFG_NUM_TX_EXT_DESC 8192
 #define WLAN_CFG_NUM_TX_DESC_POOL 16
+#else
+#define WLAN_CFG_NUM_TX_DESC  1024
+#define WLAN_CFG_NUM_TX_EXT_DESC 1024
+#define WLAN_CFG_NUM_TX_DESC_POOL 3
+#endif /* CONFIG_WIN */
 #define WLAN_CFG_NUM_TXEXT_DESC_POOL 16
 #define WLAN_CFG_HTT_PKT_TYPE 2
 #define WLAN_CFG_MAX_PEER_ID 16