Prechádzať zdrojové kódy

qcacld-3.0: wma: change legacy data path api to cdp api

Remove legacy apis call from out side of data path.
Replace legacy apis to cdp apis.
Introduce cdp apis wrappers.
wma module.

Change-Id: Ia1d89262184d68974bfb2d28af0ccba212afaf55
CRs-fixed: 1075736
Leo Chang 8 rokov pred
rodič
commit
96464904cc

+ 12 - 7
core/wma/inc/wma.h

@@ -42,15 +42,13 @@
 #include "cds_sched.h"
 #include "sir_mac_prot_def.h"
 #include "wma_types.h"
-#include "ol_txrx_types.h"
 #include <linux/workqueue.h>
 #include "utils_api.h"
 #include "lim_types.h"
 #include "wmi_unified_api.h"
 #include "cdp_txrx_cmn.h"
-#include "ol_defines.h"
 #include "dbglog.h"
-
+#include "cds_ieee80211_common.h"
 /* Platform specific configuration for max. no. of fragments */
 #define QCA_OL_11AC_TX_MAX_FRAGS            2
 
@@ -2200,7 +2198,7 @@ QDF_STATUS wma_send_snr_request(tp_wma_handle wma_handle, void *pGetRssiReq);
 
 
 QDF_STATUS wma_update_vdev_tbl(tp_wma_handle wma_handle, uint8_t vdev_id,
-			       ol_txrx_vdev_handle tx_rx_vdev_handle,
+			       void *tx_rx_vdev_handle,
 			       uint8_t *mac, uint32_t vdev_type, bool add_del);
 
 void wma_send_flush_logs_to_fw(tp_wma_handle wma_handle);
@@ -2300,15 +2298,15 @@ void wma_process_set_pdev_ht_ie_req(tp_wma_handle wma,
 void wma_process_set_pdev_vht_ie_req(tp_wma_handle wma,
 		struct set_ie_param *ie_params);
 void wma_remove_peer(tp_wma_handle wma, u_int8_t *bssid,
-			u_int8_t vdev_id, ol_txrx_peer_handle peer,
+			u_int8_t vdev_id, void *peer,
 			bool roam_synch_in_progress);
 
 QDF_STATUS wma_add_wow_wakeup_event(tp_wma_handle wma,
 					uint32_t vdev_id,
 					uint32_t bitmap,
 					bool enable);
-QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
-			   ol_txrx_vdev_handle vdev, u8 peer_addr[6],
+QDF_STATUS wma_create_peer(tp_wma_handle wma, void *pdev,
+			   void *vdev, u8 peer_addr[6],
 			   u_int32_t peer_type, u_int8_t vdev_id,
 			   bool roam_synch_in_progress);
 
@@ -2326,3 +2324,10 @@ QDF_STATUS wma_enable_disable_caevent_ind(tp_wma_handle wma_handle,
 				uint8_t val);
 void wma_update_sta_inactivity_timeout(tp_wma_handle wma,
 		struct sme_sta_inactivity_timeout  *sta_inactivity_timer);
+void wma_peer_set_default_routing(void *scn_handle, uint8_t *peer_macaddr,
+	uint8_t vdev_id, bool hash_based, uint8_t ring_num);
+int wma_peer_rx_reorder_queue_setup(void *scn_handle,
+	uint8_t vdev_id, uint8_t *peer_macaddr, qdf_dma_addr_t hw_qdesc,
+	int tid, uint16_t queue_no);
+int wma_peer_rx_reorder_queue_remove(void *scn_handle,
+	uint8_t vdev_id, uint8_t *peer_macaddr, uint32_t peer_tid_bitmap);

+ 4 - 4
core/wma/inc/wma_internal.h

@@ -549,11 +549,11 @@ QDF_STATUS wma_vdev_set_param(wmi_unified_t wmi_handle, uint32_t if_id,
 				uint32_t param_id, uint32_t param_value);
 
 void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
-			    uint8_t vdev_id, ol_txrx_peer_handle peer,
+			    uint8_t vdev_id, void *peer,
 			    bool roam_synch_in_progress);
 
-QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
-			  ol_txrx_vdev_handle vdev,
+QDF_STATUS wma_create_peer(tp_wma_handle wma, void *pdev,
+			  void *vdev,
 			  u8 peer_addr[IEEE80211_ADDR_LEN],
 			  uint32_t peer_type, uint8_t vdev_id,
 			  bool roam_synch_in_progress);
@@ -561,7 +561,7 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
 int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
 				      u32 len);
 
-ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
+void *wma_vdev_attach(tp_wma_handle wma_handle,
 				struct add_sta_self_params *self_sta_req,
 				uint8_t generateRsp);
 

+ 62 - 57
core/wma/src/wma_data.c

@@ -42,18 +42,15 @@
 #include "wmi_unified.h"
 #include "wni_cfg.h"
 #include "cfg_api.h"
-#include "ol_txrx_ctrl_api.h"
 #include <cdp_txrx_tx_throttle.h>
 #if defined(CONFIG_HL_SUPPORT)
 #include "wlan_tgt_def_config_hl.h"
 #else
 #include "wlan_tgt_def_config.h"
 #endif
-#include "ol_txrx.h"
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
 
 #include "wma_types.h"
 #include "lim_api.h"
@@ -77,7 +74,8 @@
 #include <cdp_txrx_peer_ops.h>
 #include <cdp_txrx_cfg.h>
 #include "cdp_txrx_stats.h"
-#include "ol_ctrl_txrx_api.h"
+#include <cdp_txrx_misc.h>
+#include "enet.h"
 
 typedef struct {
 	int32_t rate;
@@ -857,7 +855,7 @@ static void wma_data_tx_ack_work_handler(void *ack_work)
 void
 wma_data_tx_ack_comp_hdlr(void *wma_context, qdf_nbuf_t netbuf, int32_t status)
 {
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	tp_wma_handle wma_handle = (tp_wma_handle) wma_context;
 
 	if (NULL == wma_handle) {
@@ -906,7 +904,7 @@ wma_data_tx_ack_comp_hdlr(void *wma_context, qdf_nbuf_t netbuf, int32_t status)
 
 free_nbuf:
 	/* unmap and freeing the tx buf as txrx is not taking care */
-	qdf_nbuf_unmap_single(pdev->osdev, netbuf, QDF_DMA_TO_DEVICE);
+	qdf_nbuf_unmap_single(wma_handle->qdf_dev, netbuf, QDF_DMA_TO_DEVICE);
 	qdf_nbuf_free(netbuf);
 }
 
@@ -952,7 +950,7 @@ int wma_peer_state_change_event_handler(void *handle,
 {
 	WMI_PEER_STATE_EVENTID_param_tlvs *param_buf;
 	wmi_peer_state_event_fixed_param *event;
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 
 	if (!event_buff) {
@@ -973,8 +971,9 @@ int wma_peer_state_change_event_handler(void *handle,
 		return -EINVAL;
 	}
 
-	if (ol_txrx_get_opmode(vdev) == wlan_op_mode_sta
-	    && event->state == WMI_PEER_STATE_AUTHORIZED) {
+	if ((cdp_get_opmode(cds_get_context(QDF_MODULE_ID_SOC), vdev) ==
+			wlan_op_mode_sta) &&
+		event->state == WMI_PEER_STATE_AUTHORIZED) {
 		/*
 		 * set event so that hdd
 		 * can procced and unpause tx queue
@@ -1163,9 +1162,10 @@ QDF_STATUS wma_set_mcc_channel_time_quota
  */
 void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_vdev_handle vdev;
-	ol_txrx_peer_handle peer;
+	void *pdev;
+	void *vdev;
+	void *peer;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint8_t vdev_id, peer_id;
 	bool roam_synch_in_progress = false;
 	QDF_STATUS status;
@@ -1212,14 +1212,15 @@ void wma_set_linkstate(tp_wma_handle wma, tpLinkStateParams params)
 	} else {
 		WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP",
 			 __func__, vdev_id);
-		ol_txrx_vdev_pause(wma->interfaces[vdev_id].handle,
+		cdp_fc_vdev_pause(soc, wma->interfaces[vdev_id].handle,
 				   OL_TXQ_PAUSE_REASON_VDEV_STOP);
 		wma->interfaces[vdev_id].pause_bitmap |= (1 << PAUSE_TYPE_HOST);
 		if (wmi_unified_vdev_stop_send(wma->wmi_handle, vdev_id)) {
 			WMA_LOGP("%s: %d Failed to send vdev stop",
 				 __func__, __LINE__);
 		}
-		peer = ol_txrx_find_peer_by_addr(pdev, params->bssid, &peer_id);
+		peer = cdp_peer_find_by_addr(soc, pdev,
+					     params->bssid, &peer_id);
 		if (peer) {
 			WMA_LOGP("%s: Deleting peer %pM vdev id %d",
 				 __func__, params->bssid, vdev_id);
@@ -1251,8 +1252,8 @@ void wma_unpause_vdev(tp_wma_handle wma)
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
 		/* When host resume, by default, unpause all active vdev */
 		if (wma->interfaces[vdev_id].pause_bitmap) {
-			ol_txrx_vdev_unpause(wma->interfaces[vdev_id].handle,
-					     0xffffffff);
+			cdp_fc_vdev_unpause(cds_get_context(QDF_MODULE_ID_SOC),
+				wma->interfaces[vdev_id].handle, 0xffffffff);
 			wma->interfaces[vdev_id].pause_bitmap = 0;
 		}
 #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
@@ -1507,17 +1508,17 @@ QDF_STATUS wma_tx_attach(tp_wma_handle wma_handle)
 		(p_cds_contextType) (wma_handle->cds_context);
 
 	/* Get the txRx Pdev handle */
-	ol_txrx_pdev_handle txrx_pdev =
-		(ol_txrx_pdev_handle) (cds_handle->pdev_txrx_ctx);
+	void *txrx_pdev = cds_handle->pdev_txrx_ctx;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	/* Register for Tx Management Frames */
-	ol_txrx_mgmt_tx_cb_set(txrx_pdev, GENERIC_NODOWLOAD_ACK_COMP_INDEX,
+	cdp_mgmt_tx_cb_set(soc, txrx_pdev, GENERIC_NODOWLOAD_ACK_COMP_INDEX,
 			      NULL, wma_mgmt_tx_ack_comp_hdlr, wma_handle);
 
-	ol_txrx_mgmt_tx_cb_set(txrx_pdev, GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
+	cdp_mgmt_tx_cb_set(soc, txrx_pdev, GENERIC_DOWNLD_COMP_NOACK_COMP_INDEX,
 			      wma_mgmt_tx_dload_comp_hldr, NULL, wma_handle);
 
-	ol_txrx_mgmt_tx_cb_set(txrx_pdev, GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
+	cdp_mgmt_tx_cb_set(soc, txrx_pdev, GENERIC_DOWNLD_COMP_ACK_COMP_INDEX,
 			      wma_mgmt_tx_dload_comp_hldr,
 			      wma_mgmt_tx_ack_comp_hdlr, wma_handle);
 
@@ -1544,15 +1545,14 @@ QDF_STATUS wma_tx_detach(tp_wma_handle wma_handle)
 		(p_cds_contextType) (wma_handle->cds_context);
 
 	/* Get the txRx Pdev handle */
-	ol_txrx_pdev_handle txrx_pdev =
-		(ol_txrx_pdev_handle) (cds_handle->pdev_txrx_ctx);
+	void *txrx_pdev = cds_handle->pdev_txrx_ctx;
 
 	if (txrx_pdev) {
 		/* Deregister with TxRx for Tx Mgmt completion call back */
 		for (frame_index = 0; frame_index < FRAME_INDEX_MAX;
 							frame_index++) {
-			ol_txrx_mgmt_tx_cb_set(txrx_pdev, frame_index, NULL,
-						NULL, txrx_pdev);
+			cdp_mgmt_tx_cb_set(cds_get_context(QDF_MODULE_ID_SOC),
+				txrx_pdev, frame_index, NULL, NULL, txrx_pdev);
 		}
 	}
 
@@ -1590,6 +1590,7 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 	wmi_tx_pause_event_fixed_param *wmi_event;
 	uint8_t vdev_id;
 	A_UINT32 vdev_map;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	param_buf = (WMI_TX_PAUSE_EVENTID_param_tlvs *) event;
 	if (!param_buf) {
@@ -1626,7 +1627,7 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 				 * necessary to pause a paused queue again.
 				 */
 				if (!wma->interfaces[vdev_id].pause_bitmap)
-					ol_txrx_vdev_pause(
+					cdp_fc_vdev_pause(soc,
 						wma->interfaces[vdev_id].
 						handle,
 						OL_TXQ_PAUSE_REASON_FW);
@@ -1644,7 +1645,7 @@ int wma_mcc_vdev_tx_pause_evt_handler(void *handle, uint8_t *event,
 					    pause_bitmap) {
 						/* PAUSE BIT MAP is cleared
 						 * UNPAUSE VDEV */
-						ol_txrx_vdev_unpause(
+						cdp_fc_vdev_unpause(soc,
 							wma->interfaces[vdev_id]
 								.handle,
 							OL_TXQ_PAUSE_REASON_FW);
@@ -1730,7 +1731,8 @@ QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
 					struct t_bad_peer_txtcl_config *config)
 {
 	/* Parameter sanity check */
-	ol_txrx_pdev_handle curr_pdev;
+	void *curr_pdev;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (NULL == wma || NULL == config) {
 		WMA_LOGE("%s Invalid input\n", __func__);
@@ -1753,19 +1755,19 @@ QDF_STATUS wma_process_init_bad_peer_tx_ctl_info(tp_wma_handle wma,
 	if (config->enable) {
 		int i = 0;
 
-		ol_txrx_bad_peer_txctl_set_setting(curr_pdev,
-						   config->enable,
-						   config->period,
-						   config->txq_limit);
+		cdp_bad_peer_txctl_set_setting(soc, curr_pdev,
+					config->enable,
+					config->period,
+					config->txq_limit);
 
 		for (i = 0; i < WLAN_WMA_IEEE80211_MAX_LEVEL; i++) {
 			u_int32_t threshold, limit;
 			threshold =
 				config->threshold[i].thresh[0];
 			limit =	config->threshold[i].txlimit;
-			ol_txrx_bad_peer_txctl_update_threshold(curr_pdev, i,
-								threshold,
-								limit);
+			cdp_bad_peer_txctl_update_threshold(soc, curr_pdev, i,
+							threshold,
+							limit);
 		}
 	}
 
@@ -1789,7 +1791,7 @@ QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
 					 t_thermal_mgmt *pThermalParams)
 {
 	t_thermal_cmd_params thermal_params;
-	ol_txrx_pdev_handle curr_pdev;
+	void *curr_pdev;
 
 	if (NULL == wma || NULL == pThermalParams) {
 		WMA_LOGE("TM Invalid input");
@@ -1850,7 +1852,8 @@ QDF_STATUS wma_process_init_thermal_info(tp_wma_handle wma,
 		 wma->thermal_mgmt_info.thermalLevels[3].maxTempThreshold);
 
 	if (wma->thermal_mgmt_info.thermalMgmtEnabled) {
-		ol_tx_throttle_init_period(curr_pdev,
+		cdp_throttle_init_period(cds_get_context(QDF_MODULE_ID_SOC),
+				curr_pdev,
 				pThermalParams->throttlePeriod,
 				&pThermalParams->throttle_duty_cycle_tbl[0]);
 
@@ -1913,7 +1916,7 @@ static void wma_set_thermal_level_ind(u_int8_t level)
 QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
 					 uint8_t thermal_level)
 {
-	ol_txrx_pdev_handle curr_pdev;
+	void *curr_pdev;
 
 	if (NULL == wma) {
 		WMA_LOGE("TM Invalid input");
@@ -1947,7 +1950,8 @@ QDF_STATUS wma_process_set_thermal_level(tp_wma_handle wma,
 
 	wma->thermal_mgmt_info.thermalCurrLevel = thermal_level;
 
-	ol_tx_throttle_set_level(curr_pdev, thermal_level);
+	cdp_throttle_set_level(cds_get_context(QDF_MODULE_ID_SOC),
+			curr_pdev, thermal_level);
 
 	/* Send SME SET_THERMAL_LEVEL_IND message */
 	wma_set_thermal_level_ind(thermal_level);
@@ -2038,7 +2042,7 @@ int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
 	uint8_t thermal_level;
 	t_thermal_cmd_params thermal_params;
 	WMI_THERMAL_MGMT_EVENTID_param_tlvs *param_buf;
-	ol_txrx_pdev_handle curr_pdev;
+	void *curr_pdev;
 
 	if (NULL == event || NULL == handle) {
 		WMA_LOGE("Invalid thermal mitigation event buffer");
@@ -2084,7 +2088,8 @@ int wma_thermal_mgmt_evt_handler(void *handle, uint8_t *event,
 	wma->thermal_mgmt_info.thermalCurrLevel = thermal_level;
 
 	/* Inform txrx */
-	ol_tx_throttle_set_level(curr_pdev, thermal_level);
+	cdp_throttle_set_level(cds_get_context(QDF_MODULE_ID_SOC),
+			curr_pdev, thermal_level);
 
 	/* Send SME SET_THERMAL_LEVEL_IND message */
 	wma_set_thermal_level_ind(thermal_level);
@@ -2122,7 +2127,7 @@ int wma_ibss_peer_info_event_handler(void *handle, uint8_t *data,
 {
 	cds_msg_t cds_msg;
 	wmi_peer_info *peer_info;
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	tSirIbssPeerInfoParams *pSmeRsp;
 	uint32_t count, num_peers, status;
 	tSirIbssGetPeerInfoRspParams *pRsp;
@@ -2482,7 +2487,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 	int32_t status;
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 	int32_t is_high_latency;
-	ol_txrx_vdev_handle txrx_vdev;
+	void *txrx_vdev;
 	enum frame_index tx_frm_index = GENERIC_NODOWNLD_NOACK_COMP_INDEX;
 	tpSirMacFrameCtl pFc = (tpSirMacFrameCtl) (qdf_nbuf_data(tx_frame));
 	uint8_t use_6mbps = 0;
@@ -2498,7 +2503,8 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 	tpSirMacMgmtHdr mHdr;
 	struct wmi_mgmt_params mgmt_param = {0};
 	struct wmi_desc_t *wmi_desc = NULL;
-	ol_pdev_handle ctrl_pdev;
+	void *ctrl_pdev;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (NULL == wma_handle) {
 		WMA_LOGE("wma_handle is NULL");
@@ -2513,7 +2519,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	ol_txrx_hl_tdls_flag_reset(txrx_vdev, false);
+	cdp_hl_tdls_flag_reset(soc, txrx_vdev, false);
 
 	if (frmType >= TXRX_FRM_MAX) {
 		WMA_LOGE("Invalid Frame Type Fail to send Frame");
@@ -2636,8 +2642,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 	if (frmType == TXRX_FRM_802_11_DATA) {
 		qdf_nbuf_t ret;
 		qdf_nbuf_t skb = (qdf_nbuf_t) tx_frame;
-		ol_txrx_pdev_handle pdev =
-			cds_get_context(QDF_MODULE_ID_TXRX);
+		void *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
 		struct wma_decap_info_t decap_info;
 		struct ieee80211_frame *wh =
@@ -2703,11 +2708,11 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 		wma_handle->last_umac_data_nbuf = skb;
 
 		/* Send the Data frame to TxRx in Non Standard Path */
-		ol_txrx_hl_tdls_flag_reset(txrx_vdev, tdlsFlag);
+		cdp_hl_tdls_flag_reset(soc, txrx_vdev, tdlsFlag);
 
-		ret = ol_tx_non_std(txrx_vdev, OL_TX_SPEC_NO_FREE, skb);
+		ret = cdp_tx_non_std(soc, txrx_vdev, OL_TX_SPEC_NO_FREE, skb);
 
-		ol_txrx_hl_tdls_flag_reset(txrx_vdev, false);
+		cdp_hl_tdls_flag_reset(soc, txrx_vdev, false);
 
 		if (ret) {
 			WMA_LOGE("TxRx Rejected. Fail to do Tx");
@@ -2730,12 +2735,12 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 		return QDF_STATUS_SUCCESS;
 	}
 
-	ctrl_pdev = ol_txrx_get_ctrl_pdev_from_vdev(txrx_vdev);
+	ctrl_pdev = cdp_get_ctrl_pdev_from_vdev(soc, txrx_vdev);
 	if (ctrl_pdev == NULL) {
 		WMA_LOGE("ol_pdev_handle is NULL\n");
 		return QDF_STATUS_E_FAILURE;
 	}
-	is_high_latency = ol_cfg_is_high_latency(ctrl_pdev);
+	is_high_latency = cdp_cfg_is_high_latency(soc, ctrl_pdev);
 
 	downld_comp_required = tx_frm_download_comp_cb && is_high_latency &&
 					tx_frm_ota_comp_cb;
@@ -2843,7 +2848,7 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 		}
 	} else {
 		/* Hand over the Tx Mgmt frame to TxRx */
-		status = ol_txrx_mgmt_send_ext(txrx_vdev, tx_frame,
+		status = cdp_mgmt_send_ext(soc, txrx_vdev, tx_frame,
 				 tx_frm_index, use_6mbps, chanfreq);
 	}
 
@@ -2888,9 +2893,8 @@ QDF_STATUS wma_tx_packet(void *wma_context, void *tx_frame, uint16_t frmLen,
 			 * we didn't get Download Complete for almost
 			 * WMA_TX_FRAME_COMPLETE_TIMEOUT (1 sec)
 			 */
-
 			/* display scheduler stats */
-			ol_txrx_display_stats(WLAN_SCHEDULER_STATS);
+			cdp_display_stats(soc, WLAN_SCHEDULER_STATS);
 		}
 	}
 
@@ -2941,7 +2945,7 @@ QDF_STATUS wma_ds_peek_rx_packet_info(cds_pkt_t *pkt, void **pkt_meta,
  *
  * Return: none
  */
-void ol_rx_err(ol_pdev_handle pdev, uint8_t vdev_id,
+void ol_rx_err(void *pdev, uint8_t vdev_id,
 	       uint8_t *peer_mac_addr, int tid, uint32_t tsf32,
 	       enum ol_rx_err_type err_type, qdf_nbuf_t rx_frame,
 	       uint64_t *pn, uint8_t key_id)
@@ -3030,7 +3034,8 @@ void wma_tx_abort(uint8_t vdev_id)
 	}
 	WMA_LOGA("%s: vdevid %d bssid %pM", __func__, vdev_id, iface->bssid);
 	iface->pause_bitmap |= (1 << PAUSE_TYPE_HOST);
-	ol_txrx_vdev_pause(iface->handle, OL_TXQ_PAUSE_REASON_TX_ABORT);
+	cdp_fc_vdev_pause(cds_get_context(QDF_MODULE_ID_SOC),
+			iface->handle, OL_TXQ_PAUSE_REASON_TX_ABORT);
 
 	/* Flush all TIDs except MGMT TID for this peer in Target */
 	peer_tid_bitmap &= ~(0x1 << WMI_MGMT_TID);

+ 181 - 142
core/wma/src/wma_dev_if.c

@@ -46,7 +46,6 @@
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
 
 #include "wma_types.h"
 #include "lim_api.h"
@@ -72,11 +71,37 @@
 #include <cdp_txrx_peer_ops.h>
 #include <cdp_txrx_cfg.h>
 #include <cdp_txrx_cmn.h>
-#include "ol_txrx.h"
-
+#include <cdp_txrx_misc.h>
 
 #include "cds_concurrency.h"
 #include "wma_nan_datapath.h"
+#include "wlan_tgt_def_config.h"
+
+#ifdef QCA_WIFI_QCA8074
+#define PEER_ATTACH_WIFI3(peer, soc, vdev, peer_addr)    \
+do {                                                       \
+	peer = cdp_peer_attach(soc, vdev, peer_addr);      \
+	if (!peer) {                                       \
+		WMA_LOGE("%s : Unable to attach peer %pM", \
+			__func__, peer_addr);              \
+		goto err;                                  \
+	}                                                  \
+} while (0)
+/* Do Nothing */
+#define PEER_ATTACH_LEGACY(peer, soc, vdev, peer_addr) {}
+#else
+/* Do Nothing */
+#define PEER_ATTACH_WIFI3(peer, soc, vdev, peer_addr) {}
+#define PEER_ATTACH_LEGACY(peer, soc, vdev, peer_addr)     \
+do {                                                       \
+	peer = cdp_peer_attach(soc, vdev, peer_addr);      \
+	if (!peer) {                                       \
+		WMA_LOGE("%s : Unable to attach peer %pM", \
+			__func__, peer_addr);              \
+		goto err;                                  \
+	}                                                  \
+} while (0)
+#endif /* CONFIG_LITHIUM */
 
 /**
  * wma_find_vdev_by_addr() - find vdev_id from mac address
@@ -472,12 +497,13 @@ static QDF_STATUS wma_self_peer_remove(tp_wma_handle wma_handle,
 			struct del_sta_self_params *del_sta_self_req_param,
 			uint8_t generate_vdev_rsp)
 {
-	ol_txrx_peer_handle peer;
-	ol_txrx_pdev_handle pdev;
+	void *peer;
+	void *pdev;
 	uint8_t peer_id;
 	uint8_t vdev_id = del_sta_self_req_param->session_id;
 	struct wma_target_req *msg = NULL;
 	struct del_sta_self_rsp_params *sta_self_wmi_rsp;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGE("P2P Device: removing self peer %pM",
 		 del_sta_self_req_param->self_mac_addr);
@@ -488,7 +514,7 @@ static QDF_STATUS wma_self_peer_remove(tp_wma_handle wma_handle,
 			return QDF_STATUS_E_FAULT;
 	}
 
-	peer = ol_txrx_find_peer_by_addr(pdev,
+	peer = cdp_peer_find_by_addr(soc, pdev,
 			 del_sta_self_req_param->self_mac_addr,
 			 &peer_id);
 	if (!peer) {
@@ -535,6 +561,7 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 	struct wma_txrx_node *iface = &wma_handle->interfaces[vdev_id];
 	struct wma_target_req *msg = NULL;
 	cds_msg_t sme_msg = { 0 };
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	status = wmi_unified_vdev_delete_send(wma_handle->wmi_handle, vdev_id);
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -545,7 +572,7 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 	WMA_LOGE("vdev_id:%hu vdev_hdl:%p", vdev_id, iface->handle);
 	if (!generate_rsp) {
 		WMA_LOGE("Call txrx detach w/o callback for vdev %d", vdev_id);
-		ol_txrx_vdev_detach(iface->handle, NULL, NULL);
+		cdp_vdev_detach(soc, iface->handle, NULL, NULL);
 		iface->handle = NULL;
 		wma_handle->interfaces[vdev_id].is_vdev_valid = false;
 		goto out;
@@ -574,7 +601,7 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 					wma_handle->wmi_cmd_rsp_runtime_lock);
 	}
 	WMA_LOGD("Call txrx detach with callback for vdev %d", vdev_id);
-	ol_txrx_vdev_detach(iface->handle, NULL, NULL);
+	cdp_vdev_detach(soc, iface->handle, NULL, NULL);
 	iface->handle = NULL;
 	wma_handle->interfaces[vdev_id].is_vdev_valid = false;
 
@@ -891,10 +918,10 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
 		 * enable or disable, else the data path is paused forever
 		 * causing data packets(starting from DHCP offer) to get stuck
 		 */
-		ol_txrx_vdev_unpause(iface->handle,
+		cdp_fc_vdev_unpause(cds_get_context(QDF_MODULE_ID_SOC),
+				iface->handle,
 				OL_TXQ_PAUSE_REASON_VDEV_STOP);
 		iface->pause_bitmap &= ~(1 << PAUSE_TYPE_HOST);
-
 	}
 
 	req_msg = wma_find_vdev_req(wma, resp_event->vdev_id,
@@ -1063,7 +1090,7 @@ QDF_STATUS wma_set_peer_param(void *wma_ctx, uint8_t *peer_addr,
  * Return: none
  */
 void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
-			    uint8_t vdev_id, ol_txrx_peer_handle peer,
+			    uint8_t vdev_id, void *peer,
 			    bool roam_synch_in_progress)
 {
 #define PEER_ALL_TID_BITMASK 0xffffffff
@@ -1071,6 +1098,7 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
 	uint8_t *peer_addr = bssid;
 	struct peer_flush_params param = {0};
 	uint8_t *peer_mac_addr;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (!wma->interfaces[vdev_id].peer_count) {
 		WMA_LOGE("%s: Can't remove peer with peer_addr %pM vdevid %d peer_count %d",
@@ -1081,11 +1109,11 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
 
 	if (peer) {
 		if (roam_synch_in_progress)
-			ol_txrx_peer_detach_force_delete(peer);
+			cdp_peer_detach_force_delete(soc, peer);
 		else
-			ol_txrx_peer_detach(peer);
+			cdp_peer_detach(soc, peer);
 	}
-	peer_mac_addr = ol_txrx_peer_get_peer_mac_addr(peer);
+	peer_mac_addr = cdp_peer_get_peer_mac_addr(soc, peer);
 	if (peer_mac_addr == NULL) {
 		WMA_LOGE("%s: peer mac addr is NULL, Can't remove peer with peer_addr %pM vdevid %d peer_count %d",
 			 __func__, bssid, vdev_id,
@@ -1129,15 +1157,15 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid,
  *
  * Return: QDF status
  */
-QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
-			  ol_txrx_vdev_handle vdev,
+QDF_STATUS wma_create_peer(tp_wma_handle wma, void *pdev, void *vdev,
 			  u8 peer_addr[IEEE80211_ADDR_LEN],
 			  uint32_t peer_type, uint8_t vdev_id,
 			  bool roam_synch_in_progress)
 {
-	ol_txrx_peer_handle peer;
+	void *peer = NULL;
 	struct peer_create_params param = {0};
 	uint8_t *mac_addr_raw;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (++wma->interfaces[vdev_id].peer_count >
 	    wma->wlan_resource_config.num_peers) {
@@ -1145,12 +1173,8 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
 			 wma->interfaces[vdev_id].peer_count - 1);
 		goto err;
 	}
-	peer = ol_txrx_peer_attach(vdev, peer_addr);
-	if (!peer) {
-		WMA_LOGE("%s : Unable to attach peer %pM", __func__, peer_addr);
-		goto err;
-	}
 
+	PEER_ATTACH_LEGACY(peer, soc, vdev, peer_addr);
 	if (roam_synch_in_progress) {
 		WMA_LOGE("%s: LFR3: Created peer %p with peer_addr %pM vdev_id %d,"
 			 "peer_count - %d",
@@ -1164,15 +1188,15 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev,
 	if (wmi_unified_peer_create_send(wma->wmi_handle,
 					 &param) != QDF_STATUS_SUCCESS) {
 		WMA_LOGP("%s : Unable to create peer in Target", __func__);
-		ol_txrx_peer_detach(peer);
+		cdp_peer_detach(soc, peer);
 		goto err;
 	}
-	WMA_LOGE("%s: Created peer %p ref_cnt %d with peer_addr %pM vdev_id %d, peer_count - %d",
-		  __func__, peer, qdf_atomic_read(&peer->ref_cnt),
-		  peer_addr, vdev_id,
+	WMA_LOGE("%s: Created peer %p with peer_addr %pM vdev_id %d, peer_count - %d",
+		  __func__, peer, peer_addr, vdev_id,
 		  wma->interfaces[vdev_id].peer_count);
 
-	mac_addr_raw = ol_txrx_get_vdev_mac_addr(vdev);
+	PEER_ATTACH_WIFI3(peer, soc, vdev, peer_addr);
+	mac_addr_raw = cdp_get_vdev_mac_addr(soc, vdev);
 	if (mac_addr_raw == NULL) {
 		WMA_LOGE("%s: peer mac addr is NULL", __func__);
 		return QDF_STATUS_E_FAULT;
@@ -1216,7 +1240,7 @@ err:
  */
 static void wma_delete_all_ibss_peers(tp_wma_handle wma, A_UINT32 vdev_id)
 {
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 
 	if (!wma || vdev_id > wma->max_bssid)
 		return;
@@ -1226,7 +1250,7 @@ static void wma_delete_all_ibss_peers(tp_wma_handle wma, A_UINT32 vdev_id)
 		return;
 
 	/* remove all remote peers of IBSS */
-	ol_txrx_remove_peers_for_vdev(vdev,
+	cdp_peer_remove_for_vdev(cds_get_context(QDF_MODULE_ID_SOC), vdev,
 			(ol_txrx_vdev_peer_remove_cb)wma_remove_peer, wma,
 			true);
 }
@@ -1262,7 +1286,7 @@ static void wma_delete_all_ibss_peers(tp_wma_handle wma, A_UINT32 vdev_id)
  */
 static void wma_delete_all_ap_remote_peers(tp_wma_handle wma, A_UINT32 vdev_id)
 {
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 
 	if (!wma || vdev_id > wma->max_bssid)
 		return;
@@ -1273,7 +1297,7 @@ static void wma_delete_all_ap_remote_peers(tp_wma_handle wma, A_UINT32 vdev_id)
 
 	WMA_LOGE("%s: vdev_id - %d", __func__, vdev_id);
 	/* remove all remote peers of SAP */
-	ol_txrx_remove_peers_for_vdev(vdev,
+	cdp_peer_remove_for_vdev(cds_get_context(QDF_MODULE_ID_SOC), vdev,
 		(ol_txrx_vdev_peer_remove_cb)wma_remove_peer, wma, false);
 }
 
@@ -1338,11 +1362,12 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
 	WMI_VDEV_STOPPED_EVENTID_param_tlvs *param_buf;
 	wmi_vdev_stopped_event_fixed_param *resp_event;
 	struct wma_target_req *req_msg;
-	ol_txrx_peer_handle peer;
-	ol_txrx_pdev_handle pdev;
+	void *peer;
+	void *pdev;
 	uint8_t peer_id;
 	struct wma_txrx_node *iface;
 	int32_t status = 0;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 	tpAniSirGlobal mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
 	if (NULL == mac_ctx) {
@@ -1434,7 +1459,7 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
 				wma_delete_all_ap_remote_peers(wma,
 						resp_event->vdev_id);
 			}
-			peer = ol_txrx_find_peer_by_addr(pdev, params->bssid,
+			peer = cdp_peer_find_by_addr(soc, pdev, params->bssid,
 							 &peer_id);
 			if (!peer)
 				WMA_LOGD("%s Failed to find peer %pM",
@@ -1455,10 +1480,10 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
 			wma_find_mcc_ap(wma, resp_event->vdev_id, false);
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 		}
-		ol_txrx_vdev_flush(iface->handle);
+		cdp_fc_vdev_flush(soc, iface->handle);
 		WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for VDEV_STOP rsp",
 			 __func__, resp_event->vdev_id);
-		ol_txrx_vdev_unpause(iface->handle,
+		cdp_fc_vdev_unpause(soc, iface->handle,
 				     OL_TXQ_PAUSE_REASON_VDEV_STOP);
 		iface->pause_bitmap &= ~(1 << PAUSE_TYPE_HOST);
 		qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
@@ -1470,7 +1495,7 @@ int wma_vdev_stop_resp_handler(void *handle, uint8_t *cmd_param_info,
 			WMA_LOGD("%s: Freeing beacon struct %p, "
 				 "template memory %p", __func__, bcn, bcn->buf);
 			if (bcn->dma_mapped)
-				qdf_nbuf_unmap_single(pdev->osdev, bcn->buf,
+				qdf_nbuf_unmap_single(wma->qdf_dev, bcn->buf,
 						      QDF_DMA_TO_DEVICE);
 			qdf_nbuf_free(bcn->buf);
 			qdf_mem_free(bcn);
@@ -1518,12 +1543,12 @@ free_req_msg:
  *
  * Return: txrx vdev handle
  */
-ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
+void *wma_vdev_attach(tp_wma_handle wma_handle,
 				struct add_sta_self_params *self_sta_req,
 				uint8_t generateRsp)
 {
-	ol_txrx_vdev_handle txrx_vdev_handle = NULL;
-	ol_txrx_pdev_handle txrx_pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	void *txrx_vdev_handle = NULL;
+	void *txrx_pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 	enum wlan_op_mode txrx_vdev_type;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	struct sAniSirGlobal *mac = cds_get_context(QDF_MODULE_ID_PE);
@@ -1535,6 +1560,7 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
 	struct vdev_create_params params = { 0 };
 	u_int8_t vdev_id;
 	struct sir_set_tx_rx_aggregation_size tx_rx_aggregation_size;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (NULL == mac) {
 		WMA_LOGE("%s: Failed to get mac", __func__);
@@ -1568,17 +1594,17 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle,
 		goto end;
 	}
 
-	txrx_vdev_handle = ol_txrx_vdev_attach(txrx_pdev,
-					       self_sta_req->self_mac_addr,
-					       self_sta_req->session_id,
-					       txrx_vdev_type);
+	txrx_vdev_handle = cdp_vdev_attach(soc, txrx_pdev,
+				self_sta_req->self_mac_addr,
+				self_sta_req->session_id,
+				txrx_vdev_type);
 	wma_handle->interfaces[self_sta_req->session_id].pause_bitmap = 0;
 
 	WMA_LOGD("vdev_id %hu, txrx_vdev_handle = %p", self_sta_req->session_id,
 		 txrx_vdev_handle);
 
 	if (NULL == txrx_vdev_handle) {
-		WMA_LOGP("%s: ol_txrx_vdev_attach failed", __func__);
+		WMA_LOGP("%s: cdp_vdev_attach failed", __func__);
 		status = QDF_STATUS_E_FAILURE;
 		wmi_unified_vdev_delete_send(wma_handle->wmi_handle,
 					     self_sta_req->session_id);
@@ -2023,8 +2049,9 @@ QDF_STATUS wma_vdev_start(tp_wma_handle wma,
 	} else {
 		WMA_LOGD("%s, vdev_id: %d, unpausing tx_ll_queue at VDEV_START",
 			 __func__, params.vdev_id);
-		ol_txrx_vdev_unpause(wma->interfaces[params.vdev_id].handle,
-				     0xffffffff);
+		cdp_fc_vdev_unpause(cds_get_context(QDF_MODULE_ID_SOC),
+				wma->interfaces[params.vdev_id].handle,
+				0xffffffff);
 		wma->interfaces[params.vdev_id].pause_bitmap = 0;
 	}
 
@@ -2403,12 +2430,13 @@ void wma_vdev_resp_timer(void *data)
 {
 	tp_wma_handle wma;
 	struct wma_target_req *tgt_req = (struct wma_target_req *)data;
-	ol_txrx_peer_handle peer;
-	ol_txrx_pdev_handle pdev;
+	void *peer;
+	void *pdev;
 	uint8_t peer_id;
 	struct wma_target_req *msg;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	cds_msg_t sme_msg = { 0 };
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 	tpAniSirGlobal mac_ctx = cds_get_context(QDF_MODULE_ID_PE);
 	if (NULL == mac_ctx) {
@@ -2486,7 +2514,7 @@ void wma_vdev_resp_timer(void *data)
 							       tgt_req->
 							       vdev_id);
 			}
-			peer = ol_txrx_find_peer_by_addr(pdev, params->bssid,
+			peer = cdp_peer_find_by_addr(soc, pdev, params->bssid,
 							 &peer_id);
 			wma_remove_peer(wma, params->bssid, tgt_req->vdev_id,
 					peer, false);
@@ -2503,10 +2531,10 @@ void wma_vdev_resp_timer(void *data)
 			wma_find_mcc_ap(wma, tgt_req->vdev_id, false);
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 		}
-		ol_txrx_vdev_flush(iface->handle);
+		cdp_fc_vdev_flush(soc, iface->handle);
 		WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for WDA_DELETE_BSS_REQ timeout",
 			 __func__, tgt_req->vdev_id);
-		ol_txrx_vdev_unpause(iface->handle,
+		cdp_fc_vdev_unpause(soc, iface->handle,
 				     OL_TXQ_PAUSE_REASON_VDEV_STOP);
 		iface->pause_bitmap &= ~(1 << PAUSE_TYPE_HOST);
 		qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
@@ -2519,7 +2547,7 @@ void wma_vdev_resp_timer(void *data)
 			WMA_LOGD("%s: Freeing beacon struct %p, "
 				 "template memory %p", __func__, bcn, bcn->buf);
 			if (bcn->dma_mapped)
-				qdf_nbuf_unmap_single(pdev->osdev, bcn->buf,
+				qdf_nbuf_unmap_single(wma->qdf_dev, bcn->buf,
 						      QDF_DMA_TO_DEVICE);
 			qdf_nbuf_free(bcn->buf);
 			qdf_mem_free(bcn);
@@ -2752,10 +2780,10 @@ wma_vdev_set_bss_params(tp_wma_handle wma, int vdev_id,
  */
 static void wma_add_bss_ap_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_vdev_handle vdev;
+	void *pdev;
+	void *vdev;
 	struct wma_vdev_start_req req;
-	ol_txrx_peer_handle peer;
+	void *peer;
 	struct wma_target_req *msg;
 	uint8_t vdev_id, peer_id;
 	QDF_STATUS status;
@@ -2765,6 +2793,7 @@ static void wma_add_bss_ap_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 	QDF_STATUS ret;
 #endif /* WLAN_FEATURE_11W */
 	struct sir_hw_mode_params hw_mode = {0};
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
@@ -2791,7 +2820,7 @@ static void wma_add_bss_ap_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 		goto send_fail_resp;
 	}
 
-	peer = ol_txrx_find_peer_by_addr(pdev, add_bss->bssId, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev, add_bss->bssId, &peer_id);
 	if (!peer) {
 		WMA_LOGE("%s Failed to find peer %pM", __func__,
 			 add_bss->bssId);
@@ -2806,7 +2835,7 @@ static void wma_add_bss_ap_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 		goto peer_cleanup;
 	}
 
-	add_bss->staContext.staIdx = ol_txrx_local_peer_id(peer);
+	add_bss->staContext.staIdx = cdp_peer_get_local_peer_id(soc, peer);
 
 	qdf_mem_zero(&req, sizeof(req));
 	req.vdev_id = vdev_id;
@@ -2894,15 +2923,16 @@ send_fail_resp:
  */
 static void wma_add_bss_ibss_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_vdev_handle vdev;
+	void *pdev;
+	void *vdev;
 	struct wma_vdev_start_req req;
-	ol_txrx_peer_handle peer = NULL;
+	void *peer = NULL;
 	struct wma_target_req *msg;
 	uint8_t vdev_id, peer_id;
 	QDF_STATUS status;
 	tSetBssKeyParams key_info;
 	struct sir_hw_mode_params hw_mode = {0};
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	vdev = wma_find_vdev_by_addr(wma, add_bss->selfMacAddr, &vdev_id);
 	if (!vdev) {
@@ -2930,7 +2960,7 @@ static void wma_add_bss_ibss_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 	WMA_LOGA("IBSS BSS peer created with mac %pM",
 		 add_bss->selfMacAddr);
 
-	peer = ol_txrx_find_peer_by_addr(pdev, add_bss->selfMacAddr, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev, add_bss->selfMacAddr, &peer_id);
 	if (!peer) {
 		WMA_LOGE("%s Failed to find peer %pM", __func__,
 			 add_bss->selfMacAddr);
@@ -2959,7 +2989,7 @@ static void wma_add_bss_ibss_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 	}
 	WMA_LOGD("%s: vdev start request for IBSS enqueued", __func__);
 
-	add_bss->staContext.staIdx = ol_txrx_local_peer_id(peer);
+	add_bss->staContext.staIdx = cdp_peer_get_local_peer_id(soc, peer);
 
 	/*
 	 * If IBSS Power Save is supported by firmware
@@ -3048,11 +3078,11 @@ send_fail_resp:
  */
 static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 {
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	struct wma_vdev_start_req req;
 	struct wma_target_req *msg;
-	uint8_t peer_id;
-	ol_txrx_peer_handle peer = NULL;
+	uint8_t vdev_id = 0, peer_id;
+	void *peer;
 	QDF_STATUS status;
 	struct wma_txrx_node *iface;
 	int pps_val = 0;
@@ -3061,7 +3091,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 	struct sir_hw_mode_params hw_mode = {0};
 	bool peer_assoc_sent = false;
 	struct pdev_params param = {0};
-	uint8_t vdev_id = add_bss->staContext.smesessionId;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (NULL == pMac) {
 		WMA_LOGE("%s: Unable to get PE context", __func__);
@@ -3075,6 +3105,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 		goto send_fail_resp;
 	}
 
+	vdev_id = add_bss->staContext.smesessionId;
 	iface = &wma->interfaces[vdev_id];
 
 	wma_set_bss_rate_flags(iface, add_bss);
@@ -3114,20 +3145,20 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 		iface->shortSlotTimeSupported = add_bss->shortSlotTimeSupported;
 		iface->nwType = add_bss->nwType;
 		if (add_bss->nonRoamReassoc) {
-			peer = ol_txrx_find_peer_by_addr(pdev, add_bss->bssId,
+			peer = cdp_peer_find_by_addr(soc, pdev, add_bss->bssId,
 							  &peer_id);
 			if (peer) {
 				add_bss->staContext.staIdx =
-					ol_txrx_local_peer_id(peer);
+					cdp_peer_get_local_peer_id(soc, peer);
 				goto send_bss_resp;
 			}
 		}
 		if (add_bss->reassocReq) {
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
-			ol_txrx_vdev_handle vdev;
+			void *vdev;
 #endif
 			/* Called in preassoc state. BSSID peer is already added by set_linkstate */
-			peer = ol_txrx_find_peer_by_addr(pdev, add_bss->bssId,
+			peer = cdp_peer_find_by_addr(soc, pdev, add_bss->bssId,
 							  &peer_id);
 			if (!peer) {
 				WMA_LOGE("%s Failed to find peer %pM", __func__,
@@ -3136,7 +3167,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 			}
 			if (wma_is_roam_synch_in_progress(wma, vdev_id)) {
 				add_bss->staContext.staIdx =
-					ol_txrx_local_peer_id(peer);
+					cdp_peer_get_local_peer_id(soc, peer);
 				WMA_LOGD("LFR3:%s: bssid %pM staIdx %d",
 					__func__, add_bss->bssId,
 					add_bss->staContext.staIdx);
@@ -3153,7 +3184,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 			}
 
 			add_bss->staContext.staIdx =
-				ol_txrx_local_peer_id(peer);
+				cdp_peer_get_local_peer_id(soc, peer);
 
 			qdf_mem_zero(&req, sizeof(req));
 			req.vdev_id = vdev_id;
@@ -3201,7 +3232,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 				WMA_LOGE("%s Invalid txrx vdev", __func__);
 				goto peer_cleanup;
 			}
-			ol_txrx_vdev_pause(vdev,
+			cdp_fc_vdev_pause(soc, vdev,
 					   OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED);
 #endif
 			/* ADD_BSS_RESP will be deferred to completion of VDEV_START */
@@ -3216,18 +3247,18 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 		if (add_bss->staContext.encryptType == eSIR_ED_NONE) {
 			WMA_LOGD("%s: Update peer(%pM) state into auth",
 				 __func__, add_bss->bssId);
-			ol_txrx_peer_state_update(pdev, add_bss->bssId,
+			cdp_peer_state_update(soc, pdev, add_bss->bssId,
 						  OL_TXRX_PEER_STATE_AUTH);
 		} else {
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
-			ol_txrx_vdev_handle vdev;
+			void *vdev;
 #endif
 			WMA_LOGD("%s: Update peer(%pM) state into conn",
 				 __func__, add_bss->bssId);
-			ol_txrx_peer_state_update(pdev, add_bss->bssId,
+			cdp_peer_state_update(soc, pdev, add_bss->bssId,
 						  OL_TXRX_PEER_STATE_CONN);
 #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || defined(QCA_LL_TX_FLOW_CONTROL_V2)
-			peer = ol_txrx_find_peer_by_addr(pdev, add_bss->bssId,
+			peer = cdp_peer_find_by_addr(soc, pdev, add_bss->bssId,
 							  &peer_id);
 			if (!peer) {
 				WMA_LOGE("%s:%d Failed to find peer %pM",
@@ -3240,8 +3271,8 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 				WMA_LOGE("%s Invalid txrx vdev", __func__);
 				goto peer_cleanup;
 			}
-			ol_txrx_vdev_pause(vdev,
-					  OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED);
+			cdp_fc_vdev_pause(soc, vdev,
+					OL_TXQ_PAUSE_REASON_PEER_UNAUTHORIZED);
 #endif
 		}
 
@@ -3296,7 +3327,7 @@ static void wma_add_bss_sta_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 
 	}
 send_bss_resp:
-	ol_txrx_find_peer_by_addr(pdev, add_bss->bssId,
+	cdp_peer_find_by_addr(soc, pdev, add_bss->bssId,
 				  &add_bss->staContext.staIdx);
 	add_bss->status = (add_bss->staContext.staIdx < 0) ?
 			  QDF_STATUS_E_FAILURE : QDF_STATUS_SUCCESS;
@@ -3395,9 +3426,9 @@ void wma_add_bss(tp_wma_handle wma, tpAddBssParams params)
 static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 {
 	enum ol_txrx_peer_state state = OL_TXRX_PEER_STATE_CONN;
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_vdev_handle vdev;
-	ol_txrx_peer_handle peer;
+	void *pdev;
+	void *vdev;
+	void *peer;
 	uint8_t peer_id;
 	QDF_STATUS status;
 	int32_t ret;
@@ -3405,6 +3436,7 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	struct wma_target_req *msg;
 	bool peer_assoc_cnf = false;
 	struct pdev_params param;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
@@ -3434,9 +3466,8 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	}
 
 	iface = &wma->interfaces[add_sta->smesessionId];
-	peer = ol_txrx_find_peer_by_addr_and_vdev(pdev,
-						  vdev,
-						  add_sta->staMac, &peer_id);
+	peer = cdp_peer_find_by_addr_and_vdev(soc, pdev, vdev,
+					add_sta->staMac, &peer_id);
 	if (peer) {
 		wma_remove_peer(wma, add_sta->staMac, add_sta->smesessionId,
 				peer, false);
@@ -3449,11 +3480,11 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	 * exists on the pDev. As this peer belongs to other vDevs, just return
 	 * here.
 	 */
-	peer = ol_txrx_find_peer_by_addr(pdev, add_sta->staMac, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev, add_sta->staMac, &peer_id);
 	if (peer) {
-		WMA_LOGE("%s: My vdev:%d, but Peer exists on other vdev with "
+		WMA_LOGE("%s: My vdev:%p, but Peer exists on other vdev with "
 				"peer_addr %pM and peer_id %d",
-			__func__, vdev->vdev_id, add_sta->staMac, peer_id);
+			__func__, vdev, add_sta->staMac, peer_id);
 		add_sta->status = QDF_STATUS_E_FAILURE;
 		goto send_rsp;
 	}
@@ -3468,9 +3499,8 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 		goto send_rsp;
 	}
 
-	peer = ol_txrx_find_peer_by_addr_and_vdev(pdev,
-						  vdev,
-						  add_sta->staMac, &peer_id);
+	peer = cdp_peer_find_by_addr_and_vdev(soc, pdev, vdev,
+					add_sta->staMac, &peer_id);
 	if (!peer) {
 		WMA_LOGE("%s: Failed to find peer handle using peer mac %pM",
 			 __func__, add_sta->staMac);
@@ -3580,9 +3610,9 @@ static void wma_add_sta_req_ap_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 
 	WMA_LOGD("%s: Moving peer %pM to state %d",
 		 __func__, add_sta->staMac, state);
-	ol_txrx_peer_state_update(pdev, add_sta->staMac, state);
+	cdp_peer_state_update(soc, pdev, add_sta->staMac, state);
 
-	add_sta->staIdx = ol_txrx_local_peer_id(peer);
+	add_sta->staIdx = cdp_peer_get_local_peer_id(soc, peer);
 	add_sta->nss    = iface->nss;
 	add_sta->status = QDF_STATUS_SUCCESS;
 send_rsp:
@@ -3610,15 +3640,16 @@ send_rsp:
  */
 static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_vdev_handle vdev;
-	ol_txrx_peer_handle peer;
+	void *pdev;
+	void *vdev;
+	void *peer;
 	uint8_t peer_id;
 	QDF_STATUS status;
 	int32_t ret;
 	tTdlsPeerStateParams *peerStateParams;
 	struct wma_target_req *msg;
 	bool peer_assoc_cnf = false;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("%s: staType: %d, staIdx: %d, updateSta: %d, "
 		 "bssId: %pM, staMac: %pM",
@@ -3643,7 +3674,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 	if (0 == add_sta->updateSta) {
 		/* its a add sta request * */
 
-		ol_txrx_copy_mac_addr_raw(vdev, add_sta->bssId);
+		cdp_peer_copy_mac_addr_raw(soc, vdev, add_sta->bssId);
 
 		WMA_LOGD("%s: addSta, calling wma_create_peer for %pM, vdev_id %hu",
 			__func__, add_sta->staMac, add_sta->smesessionId);
@@ -3658,7 +3689,8 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 			goto send_rsp;
 		}
 
-		peer = ol_txrx_find_peer_by_addr(pdev, add_sta->staMac, &peer_id);
+		peer = cdp_peer_find_by_addr(soc, pdev, add_sta->staMac,
+					     &peer_id);
 		if (!peer) {
 			WMA_LOGE("%s: addSta, failed to find peer handle for mac %pM",
 				__func__, add_sta->staMac);
@@ -3666,13 +3698,12 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 			wma_remove_peer(wma, add_sta->staMac,
 					add_sta->smesessionId, peer, false);
 
-			ol_txrx_add_last_real_peer(pdev, vdev, &peer_id);
-
+			cdp_peer_add_last_real_peer(soc, pdev, vdev, &peer_id);
 			goto send_rsp;
 		}
 
-		add_sta->staIdx = ol_txrx_local_peer_id(peer);
-		WMA_LOGD("%s: addSta, after calling ol_txrx_local_peer_id, "
+		add_sta->staIdx = cdp_peer_get_local_peer_id(soc, peer);
+		WMA_LOGD("%s: addSta, after calling cdp_local_peer_id, "
 			 "staIdx: %d, staMac: %pM",
 			 __func__, add_sta->staIdx, add_sta->staMac);
 
@@ -3693,7 +3724,8 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 	} else {
 		/* its a change sta request * */
 		peer =
-			ol_txrx_find_peer_by_addr(pdev, add_sta->staMac, &peer_id);
+			cdp_peer_find_by_addr(soc, pdev, add_sta->staMac,
+					      &peer_id);
 		if (!peer) {
 			WMA_LOGE("%s: changeSta,failed to find peer handle for mac %pM",
 				__func__, add_sta->staMac);
@@ -3701,7 +3733,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 			wma_remove_peer(wma, add_sta->staMac,
 					add_sta->smesessionId, peer, false);
 
-			ol_txrx_add_last_real_peer(pdev, vdev, &peer_id);
+			cdp_peer_add_last_real_peer(soc, pdev, vdev, &peer_id);
 
 			goto send_rsp;
 		}
@@ -3737,7 +3769,7 @@ static void wma_add_tdls_sta(tp_wma_handle wma, tpAddStaParams add_sta)
 			add_sta->status = QDF_STATUS_E_FAILURE;
 			wma_remove_peer(wma, add_sta->staMac,
 					add_sta->smesessionId, peer, false);
-			ol_txrx_add_last_real_peer(pdev, vdev, &peer_id);
+			cdp_peer_add_last_real_peer(soc, pdev, vdev, &peer_id);
 
 			goto send_rsp;
 		}
@@ -3765,9 +3797,9 @@ send_rsp:
  */
 static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 {
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	ol_txrx_peer_handle peer;
+	void *peer;
 	struct wma_txrx_node *iface;
 	int8_t maxTxPower;
 	int ret = 0;
@@ -3776,6 +3808,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 	struct vdev_up_params param = {0};
 	struct pdev_params pdev_param = {0};
 	int smps_param;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 #ifdef FEATURE_WLAN_TDLS
 	if (STA_ENTRY_TDLS_PEER == params->staType) {
@@ -3797,7 +3830,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 			 __func__, params->staType);
 		goto out;
 	}
-	peer = ol_txrx_find_peer_by_addr(pdev, params->bssId, &params->staIdx);
+	peer = cdp_peer_find_by_addr(soc, pdev, params->bssId, &params->staIdx);
 	if (peer == NULL) {
 		WMA_LOGE("%s: Peer is not present vdev id %d for %pM", __func__,
 			params->smesessionId, params->bssId);
@@ -3805,7 +3838,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 		goto out;
 	}
 	if (params->nonRoamReassoc) {
-		ol_txrx_peer_state_update(pdev, params->bssId,
+		cdp_peer_state_update(soc, pdev, params->bssId,
 					  OL_TXRX_PEER_STATE_AUTH);
 		qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STARTED);
 		iface->aid = params->assocId;
@@ -3820,7 +3853,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 	}
 
 	if (peer != NULL &&
-	    (ol_txrx_get_peer_state(peer) == OL_TXRX_PEER_STATE_DISC)) {
+	    (cdp_peer_state_get(soc, peer) == OL_TXRX_PEER_STATE_DISC)) {
 		/*
 		 * This is the case for reassociation.
 		 * peer state update and peer_assoc is required since it
@@ -3831,12 +3864,12 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 		if (params->encryptType == eSIR_ED_NONE) {
 			WMA_LOGD("%s: Update peer(%pM) state into auth",
 				 __func__, params->bssId);
-			ol_txrx_peer_state_update(pdev, params->bssId,
+			cdp_peer_state_update(soc, pdev, params->bssId,
 						  OL_TXRX_PEER_STATE_AUTH);
 		} else {
 			WMA_LOGD("%s: Update peer(%pM) state into conn",
 				 __func__, params->bssId);
-			ol_txrx_peer_state_update(pdev, params->bssId,
+			cdp_peer_state_update(soc, pdev, params->bssId,
 						  OL_TXRX_PEER_STATE_CONN);
 		}
 
@@ -3846,7 +3879,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
 			 * part of wma_send_peer_assoc. As we are
 			 * skipping this operation, we are just executing the
 			 * following which are useful for LFR3.0.*/
-			ol_txrx_peer_state_update(pdev, params->bssId,
+			cdp_peer_state_update(soc, pdev, params->bssId,
 						  OL_TXRX_PEER_STATE_AUTH);
 			qdf_atomic_set(&iface->bss_status,
 				       WMA_BSS_STATUS_STARTED);
@@ -4012,10 +4045,11 @@ out:
 static void wma_delete_sta_req_ap_mode(tp_wma_handle wma,
 				       tpDeleteStaParams del_sta)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_peer_handle peer;
+	void *pdev;
+	void *peer;
 	struct wma_target_req *msg;
 	uint8_t *peer_mac_addr;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
@@ -4025,14 +4059,14 @@ static void wma_delete_sta_req_ap_mode(tp_wma_handle wma,
 		goto send_del_rsp;
 	}
 
-	peer = ol_txrx_peer_find_by_local_id(pdev, del_sta->staIdx);
+	peer = cdp_peer_find_by_local_id(soc, pdev, del_sta->staIdx);
 	if (!peer) {
 		WMA_LOGE("%s: Failed to get peer handle using peer id %d",
 			 __func__, del_sta->staIdx);
 		del_sta->status = QDF_STATUS_E_FAILURE;
 		goto send_del_rsp;
 	}
-	peer_mac_addr = ol_txrx_peer_get_peer_mac_addr(peer);
+	peer_mac_addr = cdp_peer_get_peer_mac_addr(soc, peer);
 
 	wma_remove_peer(wma, peer_mac_addr, del_sta->smesessionId, peer,
 			false);
@@ -4272,12 +4306,13 @@ void wma_delete_sta(tp_wma_handle wma, tpDeleteStaParams del_sta)
  */
 void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_peer_handle peer = NULL;
+	void *pdev;
+	void *peer = NULL;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint8_t peer_id;
-	ol_txrx_vdev_handle txrx_vdev = NULL;
+	void *txrx_vdev = NULL;
 	struct wma_txrx_node *iface;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
@@ -4285,8 +4320,8 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params)
 		WMA_LOGE("%s:Unable to get TXRX context", __func__);
 		goto fail_del_bss_ho_fail;
 	}
-	peer = ol_txrx_find_peer_by_addr(pdev, params->bssid, &peer_id);
 
+	peer = cdp_peer_find_by_addr(soc, pdev, params->bssid, &peer_id);
 	if (!peer) {
 		WMA_LOGP("%s: Failed to find peer %pM", __func__,
 			 params->bssid);
@@ -4326,14 +4361,14 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params)
 
 	WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (del_bss)",
 		 __func__, params->smesessionId);
-	ol_txrx_vdev_pause(iface->handle,
+	cdp_fc_vdev_pause(soc, iface->handle,
 			   OL_TXQ_PAUSE_REASON_VDEV_STOP);
 	iface->pause_bitmap |= (1 << PAUSE_TYPE_HOST);
 
-	ol_txrx_vdev_flush(iface->handle);
+	cdp_fc_vdev_flush(soc, iface->handle);
 	WMA_LOGD("%s, vdev_id: %d, un-pausing tx_ll_queue for VDEV_STOP rsp",
 			__func__, params->smesessionId);
-	ol_txrx_vdev_unpause(iface->handle,
+	cdp_fc_vdev_unpause(soc, iface->handle,
 			OL_TXQ_PAUSE_REASON_VDEV_STOP);
 	iface->pause_bitmap &= ~(1 << PAUSE_TYPE_HOST);
 	qdf_atomic_set(&iface->bss_status, WMA_BSS_STATUS_STOPPED);
@@ -4349,7 +4384,7 @@ void wma_delete_bss_ho_fail(tp_wma_handle wma, tpDeleteBssParams params)
 	}
 
 	if (peer)
-		ol_txrx_peer_detach(peer);
+		cdp_peer_detach(soc, peer);
 	iface->peer_count--;
 	WMA_LOGE("%s: Removed peer %p with peer_addr %pM vdevid %d peer_count %d",
 		 __func__, peer, params->bssid,  params->smesessionId,
@@ -4368,15 +4403,16 @@ fail_del_bss_ho_fail:
  */
 void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_peer_handle peer = NULL;
+	void *pdev;
+	void *peer = NULL;
 	struct wma_target_req *msg;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint8_t peer_id;
 	uint8_t max_wait_iterations = 0;
-	ol_txrx_vdev_handle txrx_vdev = NULL;
+	void *txrx_vdev = NULL;
 	bool roam_synch_in_progress = false;
 	struct wma_txrx_node *iface;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
@@ -4386,17 +4422,18 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
 	}
 	if (wma_is_vdev_in_ibss_mode(wma, params->smesessionId))
 		/* in rome ibss case, self mac is used to create the bss peer */
-		peer = ol_txrx_find_peer_by_addr(pdev,
+		peer = cdp_peer_find_by_addr(soc, pdev,
 			wma->interfaces[params->smesessionId].addr,
 			&peer_id);
 	else if (WMA_IS_VDEV_IN_NDI_MODE(wma->interfaces,
 			params->smesessionId))
 		/* In ndi case, self mac is used to create the self peer */
-		peer = ol_txrx_find_peer_by_addr(pdev,
+		peer = cdp_peer_find_by_addr(soc, pdev,
 				wma->interfaces[params->smesessionId].addr,
 				&peer_id);
 	else
-		peer = ol_txrx_find_peer_by_addr(pdev, params->bssid, &peer_id);
+		peer = cdp_peer_find_by_addr(soc, pdev, params->bssid,
+					     &peer_id);
 
 	if (!peer) {
 		WMA_LOGP("%s: Failed to find peer %pM", __func__,
@@ -4432,7 +4469,7 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
 		iface->psnr_req = NULL;
 	}
 
-	if (wlan_op_mode_ibss == ol_txrx_get_opmode(txrx_vdev))
+	if (wlan_op_mode_ibss == cdp_get_opmode(soc, txrx_vdev))
 		wma->ibss_started = 0;
 
 	if (wma_is_roam_synch_in_progress(wma, params->smesessionId)) {
@@ -4453,28 +4490,29 @@ void wma_delete_bss(tp_wma_handle wma, tpDeleteBssParams params)
 	}
 
 	WMA_LOGW(FL("Outstanding msdu packets: %d"),
-		 ol_txrx_get_tx_pending(pdev));
+		 cdp_get_tx_pending(soc, pdev));
 
 	max_wait_iterations =
 		wma->interfaces[params->smesessionId].delay_before_vdev_stop /
 		WMA_TX_Q_RECHECK_TIMER_WAIT;
 
-	while (ol_txrx_get_tx_pending(pdev) && max_wait_iterations) {
+	while (cdp_get_tx_pending(soc, pdev) && max_wait_iterations) {
 		WMA_LOGW(FL("Waiting for outstanding packet to drain."));
 		qdf_wait_single_event(&wma->tx_queue_empty_event,
 				      WMA_TX_Q_RECHECK_TIMER_MAX_WAIT);
 		max_wait_iterations--;
 	}
 
-	if (ol_txrx_get_tx_pending(pdev)) {
+	if (cdp_get_tx_pending(soc, pdev)) {
 		WMA_LOGW(FL("Outstanding msdu packets before VDEV_STOP : %d"),
-			 ol_txrx_get_tx_pending(pdev));
+			 cdp_get_tx_pending(soc, pdev));
 	}
 
 	WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP (del_bss)",
 		 __func__, params->smesessionId);
-	ol_txrx_vdev_pause(iface->handle,
-			   OL_TXQ_PAUSE_REASON_VDEV_STOP);
+	iface->pause_bitmap |= (1 << PAUSE_TYPE_HOST);
+	cdp_fc_vdev_pause(soc, wma->interfaces[params->smesessionId].handle,
+			OL_TXQ_PAUSE_REASON_VDEV_STOP);
 	iface->pause_bitmap |= (1 << PAUSE_TYPE_HOST);
 
 	if (wmi_unified_vdev_stop_send(wma->wmi_handle, params->smesessionId)) {
@@ -4530,12 +4568,13 @@ int32_t wma_find_vdev_by_type(tp_wma_handle wma, int32_t type)
 void wma_set_vdev_intrabss_fwd(tp_wma_handle wma_handle,
 				      tpDisableIntraBssFwd pdis_intra_fwd)
 {
-	ol_txrx_vdev_handle txrx_vdev;
+	void *txrx_vdev;
 	WMA_LOGD("%s:intra_fwd:vdev(%d) intrabss_dis=%s",
 		 __func__, pdis_intra_fwd->sessionId,
 		 (pdis_intra_fwd->disableintrabssfwd ? "true" : "false"));
 
 	txrx_vdev = wma_handle->interfaces[pdis_intra_fwd->sessionId].handle;
-	ol_vdev_rx_set_intrabss_fwd(txrx_vdev,
+	cdp_cfg_vdev_rx_set_intrabss_fwd(cds_get_context(QDF_MODULE_ID_SOC),
+				    txrx_vdev,
 				    pdis_intra_fwd->disableintrabssfwd);
 }

+ 27 - 24
core/wma/src/wma_features.c

@@ -44,14 +44,12 @@
 #include "wmi_unified.h"
 #include "wni_cfg.h"
 #include "cfg_api.h"
-#include "ol_txrx_ctrl_api.h"
 #include <cdp_txrx_tx_delay.h>
 #include <cdp_txrx_peer_ops.h>
 
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
 
 #include "wma_types.h"
 #include "lim_api.h"
@@ -70,7 +68,6 @@
 #include "dfs.h"
 #include "radar_filters.h"
 #include "wma_internal.h"
-#include "ol_txrx.h"
 #include "wma_nan_datapath.h"
 
 #ifndef ARRAY_LENGTH
@@ -4733,7 +4730,7 @@ static QDF_STATUS wma_set_tsm_interval(tAddTsParams *req)
 	 *
 	 */
 	uint32_t interval_milliseconds;
-	ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	void *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 	if (NULL == pdev) {
 		WMA_LOGE("%s: Failed to get pdev", __func__);
 		return QDF_STATUS_E_FAILURE;
@@ -4741,7 +4738,8 @@ static QDF_STATUS wma_set_tsm_interval(tAddTsParams *req)
 
 	interval_milliseconds = (req->tsm_interval * 1024) / 1000;
 
-	ol_tx_set_compute_interval(pdev, interval_milliseconds);
+	cdp_tx_set_compute_interval(cds_get_context(QDF_MODULE_ID_SOC),
+			pdev, interval_milliseconds);
 	return QDF_STATUS_SUCCESS;
 }
 #else
@@ -4920,8 +4918,8 @@ QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
 	 * than required by TSM, hence different (6) size array used
 	 */
 	uint16_t bin_values[QCA_TX_DELAY_HIST_REPORT_BINS] = { 0, };
-
-	ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	void *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (NULL == pdev) {
 		WMA_LOGE("%s: Failed to get pdev", __func__);
@@ -4930,9 +4928,9 @@ QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
 	}
 
 	/* get required values from data path APIs */
-	ol_tx_delay(pdev, &queue_delay_microsec, &tx_delay_microsec, tid);
-	ol_tx_delay_hist(pdev, bin_values, tid);
-	ol_tx_packet_count(pdev, &packet_count, &packet_loss_count, tid);
+	cdp_tx_delay(soc, pdev, &queue_delay_microsec, &tx_delay_microsec, tid);
+	cdp_tx_delay_hist(soc, pdev, bin_values, tid);
+	cdp_tx_packet_count(soc, pdev, &packet_count, &packet_loss_count, tid);
 
 	pTsmRspParams = qdf_mem_malloc(sizeof(*pTsmRspParams));
 	if (NULL == pTsmRspParams) {
@@ -5441,9 +5439,11 @@ QDF_STATUS wma_process_get_peer_info_req
 	uint16_t len;
 	wmi_buf_t buf;
 	int32_t vdev_id;
-	ol_txrx_pdev_handle pdev;
-	struct ol_txrx_peer_t *peer;
+	void *pdev;
+	void *peer;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint8_t peer_mac[IEEE80211_ADDR_LEN];
+	uint8_t *peer_mac_raw;
 	wmi_peer_info_req_cmd_fixed_param *p_get_peer_info_cmd;
 	uint8_t bcast_mac[IEEE80211_ADDR_LEN] = { 0xff, 0xff, 0xff,
 						  0xff, 0xff, 0xff };
@@ -5466,18 +5466,19 @@ QDF_STATUS wma_process_get_peer_info_req
 		qdf_mem_copy(peer_mac, bcast_mac, IEEE80211_ADDR_LEN);
 	} else {
 		/*get info for a single peer */
-		peer = ol_txrx_peer_find_by_local_id(pdev, pReq->staIdx);
+		peer = cdp_peer_find_by_local_id(soc, pdev, pReq->staIdx);
 		if (!peer) {
 			WMA_LOGE("%s: Failed to get peer handle using peer id %d",
 				__func__, pReq->staIdx);
 			return QDF_STATUS_E_FAILURE;
 		}
+		peer_mac_raw = cdp_peer_get_peer_mac_addr(soc, peer);
 		WMA_LOGE("%s: staIdx %d peer mac: 0x%2x:0x%2x:0x%2x:0x%2x:0x%2x:0x%2x",
-			__func__, pReq->staIdx, peer->mac_addr.raw[0],
-			peer->mac_addr.raw[1], peer->mac_addr.raw[2],
-			peer->mac_addr.raw[3], peer->mac_addr.raw[4],
-			peer->mac_addr.raw[5]);
-		qdf_mem_copy(peer_mac, peer->mac_addr.raw, IEEE80211_ADDR_LEN);
+			__func__, pReq->staIdx, peer_mac_raw[0],
+			peer_mac_raw[1], peer_mac_raw[2],
+			peer_mac_raw[3], peer_mac_raw[4],
+			peer_mac_raw[5]);
+		qdf_mem_copy(peer_mac, peer_mac_raw, IEEE80211_ADDR_LEN);
 	}
 
 	len = sizeof(wmi_peer_info_req_cmd_fixed_param);
@@ -7008,9 +7009,10 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 {
 	tp_wma_handle wma_handle = (tp_wma_handle) handle;
 	uint32_t i;
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	uint8_t peer_id;
-	ol_txrx_peer_handle peer;
+	void *peer;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	uint8_t *peer_mac_addr;
 	int ret = 0;
 	uint32_t *ch_mhz = NULL;
@@ -7062,7 +7064,7 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 			goto end_tdls_peer_state;
 		}
 
-		peer = ol_txrx_find_peer_by_addr(pdev,
+		peer = cdp_peer_find_by_addr(soc, pdev,
 						 peerStateParams->peerMacAddr,
 						 &peer_id);
 		if (!peer) {
@@ -7071,8 +7073,9 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 			ret = -EIO;
 			goto end_tdls_peer_state;
 		}
-		peer_mac_addr = ol_txrx_peer_get_peer_mac_addr(peer);
-		restore_last_peer = is_vdev_restore_last_peer(peer);
+		peer_mac_addr = cdp_peer_get_peer_mac_addr(soc, peer);
+		restore_last_peer = cdp_peer_is_vdev_restore_last_peer(
+						soc, peer);
 
 		WMA_LOGD("%s: calling wma_remove_peer for peer " MAC_ADDRESS_STR
 			 " vdevId: %d", __func__,
@@ -7080,7 +7083,7 @@ int wma_update_tdls_peer_state(WMA_HANDLE handle,
 			 peerStateParams->vdevId);
 		wma_remove_peer(wma_handle, peer_mac_addr,
 				peerStateParams->vdevId, peer, false);
-		ol_txrx_update_last_real_peer(pdev, peer, &peer_id,
+		cdp_peer_update_last_real_peer(soc, pdev, peer, &peer_id,
 					      restore_last_peer);
 	}
 

+ 79 - 74
core/wma/src/wma_main.c

@@ -52,7 +52,6 @@
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
 
 #include "wma_types.h"
 #include "lim_api.h"
@@ -78,6 +77,7 @@
 #include "cdp_txrx_flow_ctrl_legacy.h"
 #include "cdp_txrx_flow_ctrl_v2.h"
 #include "cdp_txrx_ipa.h"
+#include "cdp_txrx_misc.h"
 #include "wma_nan_datapath.h"
 
 #define WMA_LOG_COMPLETION_TIMER 10000 /* 10 seconds */
@@ -741,14 +741,14 @@ static int32_t wma_set_priv_cfg(tp_wma_handle wma_handle,
 
 	case WMA_VDEV_TXRX_GET_IPA_UC_FW_STATS_CMDID:
 	{
-		ol_txrx_pdev_handle pdev;
+		void *pdev;
 
 		pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 		if (!pdev) {
 			WMA_LOGE("pdev NULL for uc stat");
 			return -EINVAL;
 		}
-		ol_txrx_ipa_uc_get_stat(pdev);
+		cdp_ipa_get_stat(cds_get_context(QDF_MODULE_ID_SOC), pdev);
 	}
 		break;
 
@@ -854,6 +854,7 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma,
 	tpAniSirGlobal pMac = cds_get_context(QDF_MODULE_ID_PE);
 	struct qpower_params *qparams = &intr[vid].config.qpower_params;
 	struct pdev_params pdev_param;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("wmihandle %p", wma->wmi_handle);
 
@@ -912,7 +913,7 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma,
 		break;
 	case GEN_CMD:
 	{
-		ol_txrx_vdev_handle vdev = NULL;
+		void *vdev = NULL;
 		struct wma_txrx_node *intr = wma->interfaces;
 
 		vdev = wma_find_vdev_by_id(wma, privcmd->param_vdev_id);
@@ -926,18 +927,18 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma,
 
 		switch (privcmd->param_id) {
 		case GEN_VDEV_PARAM_AMPDU:
-			ret = ol_txrx_aggr_cfg(vdev, privcmd->param_value, 0);
+			ret = cdp_aggr_cfg(soc, vdev, privcmd->param_value, 0);
 			if (ret)
-				WMA_LOGE("ol_txrx_aggr_cfg set ampdu failed ret %d",
+				WMA_LOGE("cdp_aggr_cfg set ampdu failed ret %d",
 					 ret);
 			else
 				intr[privcmd->param_vdev_id].config.ampdu =
 							 privcmd->param_value;
 			break;
 		case GEN_VDEV_PARAM_AMSDU:
-			ret = ol_txrx_aggr_cfg(vdev, 0, privcmd->param_value);
+			ret = cdp_aggr_cfg(soc, vdev, 0, privcmd->param_value);
 			if (ret)
-				WMA_LOGE("ol_txrx_aggr_cfg set amsdu failed ret %d",
+				WMA_LOGE("cdp_aggr_cfg set amsdu failed ret %d",
 					 ret);
 			else
 				intr[privcmd->param_vdev_id].config.
@@ -1614,7 +1615,6 @@ int wma_process_fw_event_handler(void *ctx, void *ev, uint8_t rx_ctx)
  *
  * Return: none
  */
-static
 void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg,
 					struct cds_config_info *cds_cfg)
 {
@@ -1624,7 +1624,6 @@ void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg,
 				cds_cfg->tx_flow_stop_queue_th;
 }
 #else
-static
 void ol_cfg_set_flow_control_parameters(struct txrx_pdev_cfg_param_t *olCfg,
 					struct cds_config_info *cds_cfg)
 {
@@ -1852,7 +1851,6 @@ QDF_STATUS wma_open(void *cds_context,
 	qdf_device_t qdf_dev;
 	void *wmi_handle;
 	QDF_STATUS qdf_status;
-	struct txrx_pdev_cfg_param_t olCfg = { 0 };
 	struct wmi_rx_ops ops;
 
 	bool use_cookie = false;
@@ -1939,59 +1937,9 @@ QDF_STATUS wma_open(void *cds_context,
 	/* initialize default target config */
 	wma_set_default_tgt_config(wma_handle);
 
-	olCfg.is_uc_offload_enabled = cds_cfg->uc_offload_enabled;
-	olCfg.uc_tx_buffer_count = cds_cfg->uc_txbuf_count;
-	olCfg.uc_tx_buffer_size = cds_cfg->uc_txbuf_size;
-	olCfg.uc_rx_indication_ring_count = cds_cfg->uc_rxind_ringcount;
-	olCfg.uc_tx_partition_base = cds_cfg->uc_tx_partition_base;
-
-
 	wma_handle->tx_chain_mask_cck = cds_cfg->tx_chain_mask_cck;
 	wma_handle->self_gen_frm_pwr = cds_cfg->self_gen_frm_pwr;
 
-	/* Allocate cfg handle */
-
-	/* RX Full reorder should enable for PCIe, ROME3.X project only now
-	 * MDM should enable later, schedule TBD
-	 * HL also sdould be enabled, schedule TBD
-	 */
-#ifdef WLAN_FEATURE_RX_FULL_REORDER_OL
-	olCfg.is_full_reorder_offload = cds_cfg->reorder_offload;
-#else
-	olCfg.is_full_reorder_offload = 0;
-#endif /* WLAN_FEATURE_RX_FULL_REORDER_OL */
-	olCfg.enable_rxthread = cds_cfg->enable_rxthread;
-	olCfg.ip_tcp_udp_checksum_offload =
-			cds_cfg->ip_tcp_udp_checksum_offload;
-	olCfg.ce_classify_enabled = cds_cfg->ce_classify_enabled;
-
-	ol_cfg_set_flow_control_parameters(&olCfg, cds_cfg);
-
-	((p_cds_contextType) cds_context)->cfg_ctx =
-		ol_pdev_cfg_attach(((p_cds_contextType) cds_context)->qdf_ctx,
-				   olCfg);
-	if (!(((p_cds_contextType) cds_context)->cfg_ctx)) {
-		WMA_LOGP("%s: failed to init cfg handle", __func__);
-		qdf_status = QDF_STATUS_E_NOMEM;
-		goto err_wmi_handle;
-	}
-
-	/* adjust the cfg_ctx default value based on setting */
-	ol_set_cfg_rx_fwd_disabled((ol_pdev_handle)
-				   ((p_cds_contextType) cds_context)->cfg_ctx,
-				   (uint8_t) cds_cfg->ap_disable_intrabss_fwd);
-
-	/* Configure Receive flow steering */
-	ol_set_cfg_flow_steering((ol_pdev_handle)
-				 ((p_cds_contextType)cds_context)->cfg_ctx,
-				 cds_cfg->flow_steering_enabled);
-
-	/* adjust the packet log enable default value based on CFG INI setting */
-	ol_set_cfg_packet_log_enabled((ol_pdev_handle)
-					((p_cds_contextType) cds_context)->
-						cfg_ctx,
-				      (uint8_t)cds_is_packet_log_enabled());
-
 	/* Allocate dfs_ic and initialize DFS */
 	wma_handle->dfs_ic = wma_dfs_attach(wma_handle->dfs_ic);
 	if (wma_handle->dfs_ic == NULL) {
@@ -3195,7 +3143,9 @@ QDF_STATUS wma_stop(void *cds_ctx, uint8_t reason)
 	for (i = 0; i < wma_handle->max_bssid; i++) {
 		if (wma_handle->interfaces[i].handle &&
 				wma_handle->interfaces[i].vdev_up) {
-			ol_txrx_vdev_flush(wma_handle->interfaces[i].handle);
+			cdp_fc_vdev_flush(
+				cds_get_context(QDF_MODULE_ID_SOC),
+				wma_handle->interfaces[i].handle);
 		}
 	}
 	qdf_status = wma_tx_detach(wma_handle);
@@ -3751,14 +3701,16 @@ static inline void wma_update_target_services(tp_wma_handle wh,
 
 	if (WMI_SERVICE_IS_ENABLED(wh->wmi_service_bitmap,
 			WMI_SERVICE_TX_MSDU_ID_NEW_PARTITION_SUPPORT)) {
-		ol_cfg_set_ipa_uc_tx_partition_base((ol_pdev_handle)
-				((p_cds_contextType) wh->cds_context)->cfg_ctx,
+		cdp_ipa_set_uc_tx_partition_base(
+				cds_get_context(QDF_MODULE_ID_SOC),
+				cds_get_context(QDF_MODULE_ID_CFG),
 				HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN);
 		WMA_LOGI("%s: TX_MSDU_ID_NEW_PARTITION=%d", __func__,
 				HTT_TX_IPA_NEW_MSDU_ID_SPACE_BEGIN);
 	} else {
-		ol_cfg_set_ipa_uc_tx_partition_base((ol_pdev_handle)
-				((p_cds_contextType) wh->cds_context)->cfg_ctx,
+		cdp_ipa_set_uc_tx_partition_base(
+				cds_get_context(QDF_MODULE_ID_SOC),
+				cds_get_context(QDF_MODULE_ID_CFG),
 				HTT_TX_IPA_MSDU_ID_SPACE_BEGIN);
 		WMA_LOGI("%s: TX_MSDU_ID_OLD_PARTITION=%d", __func__,
 				HTT_TX_IPA_MSDU_ID_SPACE_BEGIN);
@@ -4463,6 +4415,7 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 	int status;
 	uint32_t *ev_wlan_dbs_hw_mode_list;
 	QDF_STATUS ret;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("%s: Enter", __func__);
 
@@ -4548,11 +4501,10 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 		     param_buf->wmi_service_bitmap,
 		     sizeof(wma_handle->wmi_service_bitmap));
 
-	ol_tx_set_is_mgmt_over_wmi_enabled(
+	cdp_cfg_tx_set_is_mgmt_over_wmi_enabled(soc,
 		WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
 				       WMI_SERVICE_MGMT_TX_WMI));
-	ol_tx_set_desc_global_pool_size(ev->num_msdu_desc);
-
+	cdp_set_desc_global_pool_size(soc, ev->num_msdu_desc);
 	/* SWBA event handler for beacon transmission */
 	status = wmi_unified_register_event_handler(wma_handle->wmi_handle,
 						    WMI_HOST_SWBA_EVENTID,
@@ -4689,7 +4641,7 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info,
 		return -EINVAL;
 	}
 
-	ol_tx_mark_first_wakeup_packet(
+	cdp_mark_first_wakeup_packet(soc,
 		WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap,
 			WMI_SERVICE_MARK_FIRST_WAKEUP_PACKET));
 
@@ -6090,7 +6042,7 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
 {
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 	tp_wma_handle wma_handle;
-	ol_txrx_vdev_handle txrx_vdev_handle = NULL;
+	void *txrx_vdev_handle = NULL;
 	extern uint8_t *mac_trace_get_wma_msg_string(uint16_t wmaMsg);
 
 	if (NULL == msg) {
@@ -6148,9 +6100,10 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
 			WMA_LOGE("Failed to attach vdev");
 		} else {
 			/* Register with TxRx Module for Data Ack Complete Cb */
-			ol_txrx_data_tx_cb_set(txrx_vdev_handle,
-					      wma_data_tx_ack_comp_hdlr,
-					      wma_handle);
+			cdp_data_tx_cb_set(cds_get_context(QDF_MODULE_ID_SOC),
+					txrx_vdev_handle,
+					wma_data_tx_ack_comp_hdlr,
+					wma_handle);
 		}
 		break;
 	case WMA_DEL_STA_SELF_REQ:
@@ -7256,3 +7209,55 @@ int wma_lro_init(struct wma_lro_config_cmd_t *lro_config)
 	return 0;
 }
 #endif
+
+void wma_peer_set_default_routing(void *scn_handle, uint8_t *peer_macaddr,
+	uint8_t vdev_id, bool hash_based, uint8_t ring_num)
+{
+	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+	struct peer_set_params param;
+
+
+	/* TODO: Need bit definitions for ring number and hash based routing
+	 * fields in common wmi header file
+	 */
+	param.param_id = WMI_HOST_PEER_SET_DEFAULT_ROUTING;
+	param.vdev_id = vdev_id;
+	param.param_value = ((hash_based) ? 1 : 0) | (ring_num << 1);
+	wmi_set_peer_param_send(wma->wmi_handle, peer_macaddr, &param);
+
+	return;
+}
+
+int wma_peer_rx_reorder_queue_setup(void *scn_handle,
+	uint8_t vdev_id, uint8_t *peer_macaddr, qdf_dma_addr_t hw_qdesc,
+	int tid, uint16_t queue_no)
+{
+	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+	struct rx_reorder_queue_setup_params param;
+
+	param.tid = tid;
+	param.vdev_id = vdev_id;
+	param.peer_macaddr = peer_macaddr;
+	param.hw_qdesc_paddr_lo = hw_qdesc & 0xffffffff;
+	param.hw_qdesc_paddr_hi = (uint64_t)hw_qdesc >> 32;
+	param.queue_no = queue_no;
+
+	return wmi_unified_peer_rx_reorder_queue_setup_send(wma->wmi_handle,
+		&param);
+}
+
+int wma_peer_rx_reorder_queue_remove(void *scn_handle,
+	uint8_t vdev_id, uint8_t *peer_macaddr, uint32_t peer_tid_bitmap)
+{
+	tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
+	struct rx_reorder_queue_remove_params param;
+
+	param.vdev_id = vdev_id;
+	param.peer_macaddr = peer_macaddr;
+	param.peer_tid_bitmap = peer_tid_bitmap;
+
+	return wmi_unified_peer_rx_reorder_queue_remove_send(wma->wmi_handle,
+		&param);
+}
+
+

+ 78 - 59
core/wma/src/wma_mgmt.c

@@ -47,7 +47,6 @@
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
 
 #include "wma_types.h"
 #include "lim_api.h"
@@ -71,6 +70,7 @@
 #include <cdp_txrx_cfg.h>
 #include <cdp_txrx_cmn.h>
 #include <cdp_txrx_misc.h>
+#include <cdp_txrx_misc.h>
 
 /**
  * wma_send_bcn_buf_ll() - prepare and send beacon buffer to fw for LL
@@ -82,7 +82,7 @@
  * Return: none
  */
 static void wma_send_bcn_buf_ll(tp_wma_handle wma,
-				ol_txrx_pdev_handle pdev,
+				void *pdev,
 				uint8_t vdev_id,
 				WMI_HOST_SWBA_EVENTID_param_tlvs *param_buf)
 {
@@ -194,10 +194,10 @@ static void wma_send_bcn_buf_ll(tp_wma_handle wma,
 	}
 
 	if (bcn->dma_mapped) {
-		qdf_nbuf_unmap_single(pdev->osdev, bcn->buf, QDF_DMA_TO_DEVICE);
+		qdf_nbuf_unmap_single(wma->qdf_dev, bcn->buf, QDF_DMA_TO_DEVICE);
 		bcn->dma_mapped = 0;
 	}
-	ret = qdf_nbuf_map_single(pdev->osdev, bcn->buf, QDF_DMA_TO_DEVICE);
+	ret = qdf_nbuf_map_single(wma->qdf_dev, bcn->buf, QDF_DMA_TO_DEVICE);
 	if (ret != QDF_STATUS_SUCCESS) {
 		WMA_LOGE("%s: failed map beacon buf to DMA region", __func__);
 		qdf_spin_unlock_bh(&bcn->lock);
@@ -241,8 +241,9 @@ int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len)
 	WMI_HOST_SWBA_EVENTID_param_tlvs *param_buf;
 	wmi_host_swba_event_fixed_param *swba_event;
 	uint32_t vdev_map;
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	uint8_t vdev_id = 0;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	param_buf = (WMI_HOST_SWBA_EVENTID_param_tlvs *) event;
 	if (!param_buf) {
@@ -261,7 +262,8 @@ int wma_beacon_swba_handler(void *handle, uint8_t *event, uint32_t len)
 	for (; vdev_map; vdev_id++, vdev_map >>= 1) {
 		if (!(vdev_map & 0x1))
 			continue;
-		if (!ol_cfg_is_high_latency(pdev->ctrl_pdev))
+		if (!cdp_cfg_is_high_latency(soc,
+				cds_get_context(QDF_MODULE_ID_CFG)))
 			wma_send_bcn_buf_ll(wma, pdev, vdev_id, param_buf);
 		break;
 	}
@@ -286,10 +288,11 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
 	WMI_PEER_STA_KICKOUT_EVENTID_param_tlvs *param_buf = NULL;
 	wmi_peer_sta_kickout_event_fixed_param *kickout_event = NULL;
 	uint8_t vdev_id, peer_id, macaddr[IEEE80211_ADDR_LEN];
-	ol_txrx_peer_handle peer;
-	ol_txrx_pdev_handle pdev;
+	void *peer;
+	void *pdev;
 	tpDeleteStaContext del_sta_ctx;
 	tpSirIbssPeerInactivityInd p_inactivity;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("%s: Enter", __func__);
 	param_buf = (WMI_PEER_STA_KICKOUT_EVENTID_param_tlvs *) event;
@@ -300,13 +303,13 @@ int wma_peer_sta_kickout_event_handler(void *handle, u8 *event, u32 len)
 		return -EINVAL;
 	}
 	WMI_MAC_ADDR_TO_CHAR_ARRAY(&kickout_event->peer_macaddr, macaddr);
-	peer = ol_txrx_find_peer_by_addr(pdev, macaddr, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev, macaddr, &peer_id);
 	if (!peer) {
 		WMA_LOGE("PEER [%pM] not found", macaddr);
 		return -EINVAL;
 	}
 
-	if (ol_txrx_get_vdevid(peer, &vdev_id) != QDF_STATUS_SUCCESS) {
+	if (cdp_peer_get_vdevid(soc, peer, &vdev_id) != QDF_STATUS_SUCCESS) {
 		WMA_LOGE("Not able to find BSSID for peer [%pM]", macaddr);
 		return -EINVAL;
 	}
@@ -769,28 +772,32 @@ static inline uint8_t wma_parse_mpdudensity(uint8_t mpdudensity)
  */
 static void
 wma_unified_peer_state_update(
-	struct ol_txrx_pdev_t *pdev,
+	void *pdev,
 	uint8_t *sta_mac,
 	uint8_t *bss_addr,
 	uint8_t sta_type)
 {
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+
 	if (STA_ENTRY_TDLS_PEER == sta_type)
-		ol_txrx_peer_state_update(pdev, sta_mac,
+		cdp_peer_state_update(soc, pdev, sta_mac,
 					  OL_TXRX_PEER_STATE_AUTH);
 	else
-		ol_txrx_peer_state_update(pdev, bss_addr,
+		cdp_peer_state_update(soc, pdev, bss_addr,
 					  OL_TXRX_PEER_STATE_AUTH);
 }
 #else
 
 static inline void
 wma_unified_peer_state_update(
-	struct ol_txrx_pdev_t *pdev,
+	void *pdev,
 	uint8_t *sta_mac,
 	uint8_t *bss_addr,
 	uint8_t sta_type)
 {
-	ol_txrx_peer_state_update(pdev, bss_addr, OL_TXRX_PEER_STATE_AUTH);
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+
+	cdp_peer_state_update(soc, pdev, bss_addr, OL_TXRX_PEER_STATE_AUTH);
 }
 #endif
 
@@ -809,7 +816,7 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma,
 				    tSirNwType nw_type,
 				    tpAddStaParams params)
 {
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	struct peer_assoc_params *cmd;
 	int32_t ret, max_rates, i;
 	uint8_t rx_stbc, tx_stbc;
@@ -1520,8 +1527,9 @@ void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info)
 	uint32_t i;
 	uint32_t def_key_idx = 0;
 	uint32_t wlan_opmode;
-	ol_txrx_vdev_handle txrx_vdev;
+	void *txrx_vdev;
 	uint8_t *mac_addr;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("BSS key setup");
 	txrx_vdev = wma_find_vdev_by_id(wma_handle, key_info->smesessionId);
@@ -1530,7 +1538,7 @@ void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info)
 		key_info->status = QDF_STATUS_E_FAILURE;
 		goto out;
 	}
-	wlan_opmode = ol_txrx_get_opmode(txrx_vdev);
+	wlan_opmode = cdp_get_opmode(soc, txrx_vdev);
 
 	/*
 	 * For IBSS, WMI expects the BSS key to be set per peer key
@@ -1556,7 +1564,7 @@ void wma_set_bsskey(tp_wma_handle wma_handle, tpSetBssKeyParams key_info)
 			wma_handle->interfaces[key_info->smesessionId].bssid,
 			IEEE80211_ADDR_LEN);
 	} else {
-		mac_addr = ol_txrx_get_vdev_mac_addr(txrx_vdev);
+		mac_addr = cdp_get_vdev_mac_addr(soc, txrx_vdev);
 		if (mac_addr == NULL) {
 			WMA_LOGE("%s: mac_addr is NULL for vdev with id %d",
 				 __func__, key_info->smesessionId);
@@ -1664,11 +1672,12 @@ void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
 				      uint8_t vdev_id,
 				      int8_t peer_num_delta)
 {
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	int16_t new_peer_num;
 	uint16_t new_timer_value_sec;
 	uint32_t new_timer_value_ms;
 	QDF_STATUS status;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (peer_num_delta != 1 && peer_num_delta != -1) {
 		WMA_LOGE("Invalid peer_num_delta value %d", peer_num_delta);
@@ -1682,8 +1691,8 @@ void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
 	}
 
 	/* adjust peer numbers */
-	new_peer_num = ol_txrx_update_ibss_add_peer_num_of_vdev(vdev,
-								peer_num_delta);
+	new_peer_num = cdp_peer_update_ibss_add_peer_num_of_vdev(soc, vdev,
+						peer_num_delta);
 	if (OL_TXRX_INVALID_NUM_PEERS == new_peer_num) {
 		WMA_LOGE("new peer num %d out of valid boundary", new_peer_num);
 		return;
@@ -1691,7 +1700,7 @@ void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
 
 	/* reset timer value if all peers departed */
 	if (new_peer_num == 0) {
-		ol_txrx_set_ibss_vdev_heart_beat_timer(vdev, 0);
+		cdp_set_ibss_vdev_heart_beat_timer(soc, vdev, 0);
 		return;
 	}
 
@@ -1703,7 +1712,7 @@ void wma_adjust_ibss_heart_beat_timer(tp_wma_handle wma,
 		return;
 	}
 	if (new_timer_value_sec ==
-	    ol_txrx_set_ibss_vdev_heart_beat_timer(vdev, new_timer_value_sec)) {
+	    cdp_set_ibss_vdev_heart_beat_timer(soc, vdev, new_timer_value_sec)) {
 		WMA_LOGD("timer value %d stays same, no need to notify target",
 			 new_timer_value_sec);
 		return;
@@ -1740,8 +1749,9 @@ static void wma_set_ibsskey_helper(tp_wma_handle wma_handle,
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint32_t i;
 	uint32_t def_key_idx = 0;
-	ol_txrx_vdev_handle txrx_vdev;
+	void *txrx_vdev;
 	int opmode;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("BSS key setup for peer");
 	txrx_vdev = wma_find_vdev_by_id(wma_handle, key_info->smesessionId);
@@ -1752,7 +1762,7 @@ static void wma_set_ibsskey_helper(tp_wma_handle wma_handle,
 	}
 
 	qdf_mem_set(&key_params, sizeof(key_params), 0);
-	opmode = ol_txrx_get_opmode(txrx_vdev);
+	opmode = cdp_get_opmode(soc, txrx_vdev);
 	qdf_mem_set(&key_params, sizeof(key_params), 0);
 	key_params.vdev_id = key_info->smesessionId;
 	key_params.key_type = key_info->encType;
@@ -1823,13 +1833,14 @@ void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info)
 {
 	int32_t i;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	ol_txrx_pdev_handle txrx_pdev;
-	ol_txrx_vdev_handle txrx_vdev;
-	ol_txrx_peer_handle peer;
+	void *txrx_pdev;
+	void *txrx_vdev;
+	void *peer;
 	uint8_t num_keys = 0, peer_id;
 	struct wma_set_key_params key_params;
 	uint32_t def_key_idx = 0;
 	int opmode;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("STA key setup");
 
@@ -1841,7 +1852,7 @@ void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info)
 		goto out;
 	}
 
-	peer = ol_txrx_find_peer_by_addr(txrx_pdev,
+	peer = cdp_peer_find_by_addr(soc, txrx_pdev,
 					 key_info->peer_macaddr.bytes,
 					 &peer_id);
 	if (!peer) {
@@ -1856,7 +1867,7 @@ void wma_set_stakey(tp_wma_handle wma_handle, tpSetStaKeyParams key_info)
 		key_info->status = QDF_STATUS_E_FAILURE;
 		goto out;
 	}
-	opmode = ol_txrx_get_opmode(txrx_vdev);
+	opmode = cdp_get_opmode(soc, txrx_vdev);
 
 	if (key_info->defWEPIdx == WMA_INVALID_KEY_IDX &&
 	    (key_info->encType == eSIR_ED_WEP40 ||
@@ -1959,11 +1970,11 @@ QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
 	wmi_wmm_vparams wmm_param[WME_NUM_AC];
 	tSirMacEdcaParamRecord *edca_record;
 	int ac;
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	struct ol_tx_wmm_param_t ol_tx_wmm_param;
 	uint8_t vdev_id;
 	QDF_STATUS status;
-
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	vdev_id = edca_params->bssIdx;
 
 	for (ac = 0; ac < WME_NUM_AC; ac++) {
@@ -2000,7 +2011,7 @@ QDF_STATUS wma_process_update_edca_param_req(WMA_HANDLE handle,
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 	if (pdev)
-		ol_txrx_set_wmm_param(pdev, ol_tx_wmm_param);
+		cdp_set_wmm_param(soc, pdev, ol_tx_wmm_param);
 	else
 		QDF_ASSERT(0);
 
@@ -2308,7 +2319,7 @@ static int wma_p2p_go_set_beacon_ie(t_wma_handle *wma_handle,
 void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
 				    tpSendProbeRespParams probe_rsp_info)
 {
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	uint8_t vdev_id;
 	tpAniProbeRspStruct probe_rsp;
 
@@ -2352,7 +2363,7 @@ void wma_send_probe_rsp_tmpl(tp_wma_handle wma,
  */
 void wma_send_beacon(tp_wma_handle wma, tpSendbeaconParams bcn_info)
 {
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	uint8_t vdev_id;
 	QDF_STATUS status;
 	uint8_t *p2p_ie;
@@ -2476,7 +2487,8 @@ static int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle,
 					  uint32_t desc_id, uint32_t status)
 {
 	struct wmi_desc_t *wmi_desc;
-	ol_txrx_pdev_handle pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+
+	void *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
 	if (pdev == NULL) {
 		WMA_LOGE("%s: NULL pdev pointer", __func__);
@@ -2494,7 +2506,7 @@ static int wma_process_mgmt_tx_completion(tp_wma_handle wma_handle,
 	}
 
 	if (wmi_desc->nbuf)
-		qdf_nbuf_unmap_single(pdev->osdev, wmi_desc->nbuf,
+		qdf_nbuf_unmap_single(wma_handle->qdf_dev, wmi_desc->nbuf,
 					  QDF_DMA_TO_DEVICE);
 	if (wmi_desc->tx_cmpl_cb)
 		wmi_desc->tx_cmpl_cb(wma_handle->mac_context,
@@ -2745,6 +2757,7 @@ void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
 {
 	struct wma_txrx_node *intr = wma_handle->interfaces;
 	struct wma_target_req *msg;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if ((pReq->sessionId !=
 	     intr[pReq->sessionId].vdev_restart_params.vdev_id)
@@ -2771,8 +2784,8 @@ void wma_hidden_ssid_vdev_restart(tp_wma_handle wma_handle,
 	/* vdev stop -> vdev restart -> vdev up */
 	WMA_LOGD("%s, vdev_id: %d, pausing tx_ll_queue for VDEV_STOP",
 		 __func__, pReq->sessionId);
-	ol_txrx_vdev_pause(wma_handle->interfaces[pReq->sessionId].handle,
-			   OL_TXQ_PAUSE_REASON_VDEV_STOP);
+	cdp_fc_vdev_pause(soc, wma_handle->interfaces[pReq->sessionId].handle,
+			OL_TXQ_PAUSE_REASON_VDEV_STOP);
 	wma_handle->interfaces[pReq->sessionId].pause_bitmap |=
 							(1 << PAUSE_TYPE_HOST);
 	if (wmi_unified_vdev_stop_send(wma_handle->wmi_handle, pReq->sessionId)) {
@@ -2839,13 +2852,14 @@ static bool
 wma_is_ccmp_pn_replay_attack(void *cds_ctx, struct ieee80211_frame *wh,
 			 uint8_t *ccmp_ptr)
 {
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_vdev_handle vdev;
-	ol_txrx_peer_handle peer;
+	void *pdev;
+	void *vdev;
+	void *peer;
 	uint8_t vdev_id, peer_id;
 	uint8_t *last_pn_valid;
 	uint64_t *last_pn, new_pn;
 	uint32_t *rmf_pn_replays;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 	if (!pdev) {
@@ -2860,7 +2874,7 @@ wma_is_ccmp_pn_replay_attack(void *cds_ctx, struct ieee80211_frame *wh,
 	}
 
 	/* Retrieve the peer based on vdev and addr */
-	peer = ol_txrx_find_peer_by_addr_and_vdev(pdev, vdev, wh->i_addr2,
+	peer = cdp_peer_find_by_addr_and_vdev(soc, pdev, vdev, wh->i_addr2,
 						  &peer_id);
 
 	if (NULL == peer) {
@@ -2870,7 +2884,7 @@ wma_is_ccmp_pn_replay_attack(void *cds_ctx, struct ieee80211_frame *wh,
 	}
 
 	new_pn = wma_extract_ccmp_pn(ccmp_ptr);
-	ol_txrx_get_pn_info(peer, &last_pn_valid, &last_pn, &rmf_pn_replays);
+	cdp_get_pn_info(soc, peer, &last_pn_valid, &last_pn, &rmf_pn_replays);
 
 	if (*last_pn_valid) {
 		if (new_pn > *last_pn) {
@@ -3037,10 +3051,11 @@ int wma_process_rmf_frame(tp_wma_handle wma_handle,
 static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle,
 				      uint8_t *peer_addr, uint8_t subtype)
 {
-	struct ol_txrx_peer_t *peer;
-	struct ol_txrx_pdev_t *pdev_ctx;
+	void *peer;
+	void *pdev_ctx;
 	uint8_t peer_id;
 	bool should_drop = false;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	/*
 	 * Currently this function handles only Disassoc,
@@ -3061,7 +3076,7 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle,
 		goto end;
 	}
 
-	peer = ol_txrx_find_peer_by_addr(pdev_ctx, peer_addr, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev_ctx, peer_addr, &peer_id);
 	if (!peer) {
 		if (SIR_MAC_MGMT_ASSOC_REQ != subtype) {
 			WMA_LOGI(
@@ -3074,36 +3089,40 @@ static bool wma_is_pkt_drop_candidate(tp_wma_handle wma_handle,
 
 	switch (subtype) {
 	case SIR_MAC_MGMT_ASSOC_REQ:
-		if (peer->last_assoc_rcvd) {
-			if (qdf_get_system_timestamp() - peer->last_assoc_rcvd <
+		if (*cdp_peer_last_assoc_received(soc, peer)) {
+			if ((qdf_get_system_timestamp() -
+				*cdp_peer_last_assoc_received(soc, peer)) <
 				WMA_MGMT_FRAME_DETECT_DOS_TIMER) {
 				    WMA_LOGI(FL("Dropping Assoc Req received"));
 				    should_drop = true;
 			}
 		}
-		peer->last_assoc_rcvd = qdf_get_system_timestamp();
+		*cdp_peer_last_assoc_received(soc, peer) =
+				qdf_get_system_timestamp();
 		break;
 	case SIR_MAC_MGMT_DISASSOC:
-		if (peer->last_disassoc_rcvd) {
-			if (qdf_get_system_timestamp() -
-				peer->last_disassoc_rcvd <
+		if (*cdp_peer_last_disassoc_received(soc, peer)) {
+			if ((qdf_get_system_timestamp() -
+				*cdp_peer_last_disassoc_received(soc, peer)) <
 				WMA_MGMT_FRAME_DETECT_DOS_TIMER) {
 				    WMA_LOGI(FL("Dropping DisAssoc received"));
 				    should_drop = true;
 			}
 		}
-		peer->last_disassoc_rcvd = qdf_get_system_timestamp();
+		*cdp_peer_last_disassoc_received(soc, peer) =
+				qdf_get_system_timestamp();
 		break;
 	case SIR_MAC_MGMT_DEAUTH:
-		if (peer->last_deauth_rcvd) {
-			if (qdf_get_system_timestamp() -
-				peer->last_deauth_rcvd <
+		if (*cdp_peer_last_deauth_received(soc, peer)) {
+			if ((qdf_get_system_timestamp() -
+				*cdp_peer_last_deauth_received(soc, peer)) <
 				WMA_MGMT_FRAME_DETECT_DOS_TIMER) {
 				    WMA_LOGI(FL("Dropping Deauth received"));
 				    should_drop = true;
 			}
 		}
-		peer->last_deauth_rcvd = qdf_get_system_timestamp();
+		*cdp_peer_last_deauth_received(soc, peer) =
+				qdf_get_system_timestamp();
 		break;
 	default:
 		break;

+ 50 - 48
core/wma/src/wma_nan_datapath.c

@@ -31,6 +31,9 @@
 #include "wma_nan_datapath.h"
 #include "wma_internal.h"
 #include "cds_utils.h"
+#include "cdp_txrx_peer_ops.h"
+#include "cdp_txrx_tx_delay.h"
+#include "cdp_txrx_misc.h"
 
 /**
  * wma_handle_ndp_initiator_req() - NDP initiator request handler
@@ -47,7 +50,7 @@ QDF_STATUS wma_handle_ndp_initiator_req(tp_wma_handle wma_handle, void *req)
 	uint32_t vdev_id, ndp_cfg_len, ndp_app_info_len;
 	struct ndp_initiator_rsp ndp_rsp = {0};
 	uint8_t *cfg_info, *app_info;
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	wmi_buf_t buf;
 	wmi_ndp_initiator_req_fixed_param *cmd;
 	cds_msg_t pe_msg = {0};
@@ -175,7 +178,7 @@ QDF_STATUS wma_handle_ndp_responder_req(tp_wma_handle wma_handle,
 					struct ndp_responder_req *req_params)
 {
 	wmi_buf_t buf;
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	uint32_t vdev_id = 0, ndp_cfg_len, ndp_app_info_len;
 	uint8_t *cfg_info, *app_info;
 	int ret;
@@ -915,13 +918,14 @@ void wma_ndp_wow_event_callback(void *handle, void *event, uint32_t len,
  */
 void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 {
-	ol_txrx_pdev_handle pdev;
+	void *pdev;
 	struct wma_vdev_start_req req;
-	ol_txrx_peer_handle peer = NULL;
+	void *peer = NULL;
 	struct wma_target_req *msg;
 	uint8_t vdev_id, peer_id;
 	QDF_STATUS status;
 	struct vdev_set_params param = {0};
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGI("%s: enter", __func__);
 	if (NULL == wma_find_vdev_by_addr(wma, add_bss->bssId, &vdev_id)) {
@@ -937,7 +941,7 @@ void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 
 	wma_set_bss_rate_flags(&wma->interfaces[vdev_id], add_bss);
 
-	peer = ol_txrx_find_peer_by_addr(pdev, add_bss->selfMacAddr, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev, add_bss->selfMacAddr, &peer_id);
 	if (!peer) {
 		WMA_LOGE("%s Failed to find peer %pM", __func__,
 			add_bss->selfMacAddr);
@@ -953,7 +957,7 @@ void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 		goto send_fail_resp;
 	}
 
-	add_bss->staContext.staIdx = ol_txrx_local_peer_id(peer);
+	add_bss->staContext.staIdx = cdp_peer_get_local_peer_id(soc, peer);
 
 	/*
 	 * beacon_intval, dtim_period, hidden_ssid, is_dfs, ssid
@@ -999,8 +1003,12 @@ send_fail_resp:
  */
 void wma_delete_all_nan_remote_peers(tp_wma_handle wma, uint32_t vdev_id)
 {
-	ol_txrx_vdev_handle vdev;
-	ol_txrx_peer_handle peer, temp;
+	void *vdev;
+	void *peer;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+	void *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
+	uint8_t *self_mac = NULL;
+	uint8_t peer_id;
 
 	if (vdev_id > wma->max_bssid) {
 		WMA_LOGE("%s: invalid vdev_id = %d", __func__, vdev_id);
@@ -1015,32 +1023,24 @@ void wma_delete_all_nan_remote_peers(tp_wma_handle wma, uint32_t vdev_id)
 	}
 
 	/* remove all remote peers of ndi */
-	qdf_spin_lock_bh(&vdev->pdev->peer_ref_mutex);
-
-	temp = NULL;
-	TAILQ_FOREACH_REVERSE(peer, &vdev->peer_list,
-		peer_list_t, peer_list_elem) {
-		if (temp) {
-			qdf_spin_unlock_bh(&vdev->pdev->peer_ref_mutex);
-			if (qdf_atomic_read(
-				&temp->delete_in_progress) == 0)
-				wma_remove_peer(wma, temp->mac_addr.raw,
-					vdev_id, temp, false);
-			qdf_spin_lock_bh(&vdev->pdev->peer_ref_mutex);
-		}
-		/* self peer is deleted last */
-		if (peer == TAILQ_FIRST(&vdev->peer_list)) {
-			WMA_LOGE("%s: self peer removed", __func__);
-			break;
-		} else
-			temp = peer;
-	}
-	qdf_spin_unlock_bh(&vdev->pdev->peer_ref_mutex);
+	cdp_peer_remove_for_vdev(soc, vdev, NULL, NULL, false);
 
 	/* remove ndi self peer last */
-	peer = TAILQ_FIRST(&vdev->peer_list);
-	wma_remove_peer(wma, peer->mac_addr.raw, vdev_id, peer,
-			false);
+	self_mac = cdp_get_vdev_mac_addr(soc, vdev);
+	if (!self_mac) {
+		WMA_LOGE("%s: self_mac address is NULL for vdev_id = %d",
+			 __func__, vdev_id);
+		return;
+	}
+
+	peer = cdp_peer_find_by_addr(soc, pdev, self_mac, &peer_id);
+	if (!peer) {
+		WMA_LOGE("%s: self peer is NULL for vdev_id = %d",
+			 __func__, vdev_id);
+		return;
+	}
+
+	wma_remove_peer(wma, self_mac, vdev_id, peer, false);
 }
 
 /**
@@ -1078,9 +1078,10 @@ QDF_STATUS wma_register_ndp_cb(QDF_STATUS (*pe_ndp_event_handler)
 void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 {
 	enum ol_txrx_peer_state state = OL_TXRX_PEER_STATE_CONN;
-	ol_txrx_pdev_handle pdev;
-	ol_txrx_vdev_handle vdev;
-	ol_txrx_peer_handle peer;
+	void *pdev;
+	void *vdev;
+	void *peer;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 	u_int8_t peer_id;
 	QDF_STATUS status;
 	struct wma_txrx_node *iface;
@@ -1100,11 +1101,11 @@ void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 		goto send_rsp;
 	}
 
-	iface = &wma->interfaces[vdev->vdev_id];
+	iface = &wma->interfaces[cdp_get_vdev_id(soc, vdev)];
 	WMA_LOGD(FL("vdev: %d, peer_mac_addr: "MAC_ADDRESS_STR),
 		add_sta->smesessionId, MAC_ADDR_ARRAY(add_sta->staMac));
 
-	peer = ol_txrx_find_peer_by_addr_and_vdev(pdev, vdev, add_sta->staMac,
+	peer = cdp_peer_find_by_addr_and_vdev(soc, pdev, vdev, add_sta->staMac,
 						  &peer_id);
 	if (peer) {
 		WMA_LOGE(FL("NDI peer already exists, peer_addr %pM"),
@@ -1120,10 +1121,10 @@ void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	 * exists on the pDev. As this peer belongs to other vDevs, just return
 	 * here.
 	 */
-	peer = ol_txrx_find_peer_by_addr(pdev, add_sta->staMac, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev, add_sta->staMac, &peer_id);
 	if (peer) {
 		WMA_LOGE(FL("vdev:%d, peer exists on other vdev with peer_addr %pM and peer_id %d"),
-			 vdev->vdev_id, add_sta->staMac, peer_id);
+			 cdp_get_vdev_id(soc, vdev), add_sta->staMac, peer_id);
 		add_sta->status = QDF_STATUS_E_EXISTS;
 		goto send_rsp;
 	}
@@ -1137,7 +1138,7 @@ void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 		goto send_rsp;
 	}
 
-	peer = ol_txrx_find_peer_by_addr_and_vdev(pdev, vdev, add_sta->staMac,
+	peer = cdp_peer_find_by_addr_and_vdev(soc, pdev, vdev, add_sta->staMac,
 						  &peer_id);
 	if (!peer) {
 		WMA_LOGE(FL("Failed to find peer handle using peer mac %pM"),
@@ -1149,9 +1150,9 @@ void wma_add_sta_ndi_mode(tp_wma_handle wma, tpAddStaParams add_sta)
 	}
 
 	WMA_LOGD(FL("Moving peer %pM to state %d"), add_sta->staMac, state);
-	ol_txrx_peer_state_update(pdev, add_sta->staMac, state);
+	cdp_peer_state_update(soc, pdev, add_sta->staMac, state);
 
-	add_sta->staIdx = ol_txrx_local_peer_id(peer);
+	add_sta->staIdx = cdp_peer_get_local_peer_id(soc, peer);
 	add_sta->nss    = iface->nss;
 	add_sta->status = QDF_STATUS_SUCCESS;
 send_rsp:
@@ -1172,18 +1173,19 @@ send_rsp:
 void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
 					tpDeleteStaParams del_sta)
 {
-	ol_txrx_pdev_handle pdev;
-	struct ol_txrx_peer_t *peer;
+	void *pdev;
+	void *peer;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
-
 	if (!pdev) {
 		WMA_LOGE(FL("Failed to get pdev"));
 		del_sta->status = QDF_STATUS_E_FAILURE;
 		goto send_del_rsp;
 	}
 
-	peer = ol_txrx_peer_find_by_local_id(pdev, del_sta->staIdx);
+	peer = cdp_peer_find_by_local_id(cds_get_context(QDF_MODULE_ID_SOC),
+			pdev, del_sta->staIdx);
 	if (!peer) {
 		WMA_LOGE(FL("Failed to get peer handle using peer id %d"),
 			 del_sta->staIdx);
@@ -1191,8 +1193,8 @@ void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
 		goto send_del_rsp;
 	}
 
-	wma_remove_peer(wma, peer->mac_addr.raw, del_sta->smesessionId, peer,
-			false);
+	wma_remove_peer(wma, cdp_peer_get_peer_mac_addr(soc, peer),
+			del_sta->smesessionId, peer, false);
 	del_sta->status = QDF_STATUS_SUCCESS;
 
 send_del_rsp:

+ 5 - 3
core/wma/src/wma_ocb.c

@@ -47,16 +47,18 @@ int wma_ocb_set_config_resp(tp_wma_handle wma_handle, uint8_t status)
 	struct sir_ocb_set_config_response *resp;
 	cds_msg_t msg = {0};
 	struct sir_ocb_config *req = wma_handle->ocb_config_req;
-	ol_txrx_vdev_handle vdev = (req ?
+	void *vdev = (req ?
 		wma_handle->interfaces[req->session_id].handle : NULL);
 	struct ol_txrx_ocb_set_chan ocb_set_chan;
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	/*
 	 * If the command was successful, save the channel information in the
 	 * vdev.
 	 */
 	if (status == QDF_STATUS_SUCCESS && vdev && req) {
-		ocb_set_chan.ocb_channel_info = ol_txrx_get_ocb_chan_info(vdev);
+		ocb_set_chan.ocb_channel_info = cdp_get_ocb_chan_info(soc,
+								      vdev);
 		if (ocb_set_chan.ocb_channel_info)
 			qdf_mem_free(ocb_set_chan.ocb_channel_info);
 		ocb_set_chan.ocb_channel_count =
@@ -82,7 +84,7 @@ int wma_ocb_set_config_resp(tp_wma_handle wma_handle, uint8_t status)
 			ocb_set_chan.ocb_channel_info = 0;
 			ocb_set_chan.ocb_channel_count = 0;
 		}
-		ol_txrx_set_ocb_chan_info(vdev, ocb_set_chan);
+		cdp_set_ocb_chan_info(soc, vdev, ocb_set_chan);
 	}
 
 	/* Free the configuration that was saved in wma_ocb_set_config. */

+ 1 - 3
core/wma/src/wma_power.c

@@ -46,8 +46,6 @@
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
-
 #include "wma_types.h"
 #include "lim_api.h"
 #include "lim_session_utils.h"
@@ -981,7 +979,7 @@ static QDF_STATUS wma_set_sta_uapsd_auto_trig_cmd(wmi_unified_t wmi_handle,
 	cmd.num_ac = num_ac;
 
 	qdf_mem_copy((uint8_t *) cmd.peer_addr, (uint8_t *) peer_addr,
-		     sizeof(peer_addr));
+		     sizeof(uint8_t) * IEEE80211_ADDR_LEN);
 	ret = wmi_unified_set_sta_uapsd_auto_trig_cmd(wmi_handle,
 				   &cmd);
 	if (QDF_IS_STATUS_ERROR(ret))

+ 12 - 7
core/wma/src/wma_scan_roam.c

@@ -49,8 +49,6 @@
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
-#include "ol_htt_api.h"
 
 #include "wma_types.h"
 #include "lim_api.h"
@@ -70,6 +68,9 @@
 
 #include "dfs.h"
 #include "wma_internal.h"
+#include "wlan_tgt_def_config.h"
+/* This is temporary, should be removed */
+#include "ol_htt_api.h"
 
 #define WMA_MCC_MIRACAST_REST_TIME 400
 #define WMA_SCAN_ID_MASK 0x0fff
@@ -2824,10 +2825,11 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 	struct wma_target_req *msg;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	uint8_t vdev_id, peer_id;
-	ol_txrx_peer_handle peer;
-	ol_txrx_pdev_handle pdev;
+	void *peer;
+	void *pdev;
 	struct wma_txrx_node *intr = wma->interfaces;
 	struct sir_hw_mode_params hw_mode = {0};
+	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("%s: Enter", __func__);
 	if (!wma_find_vdev_by_addr(wma, params->selfStaMacAddr, &vdev_id)) {
@@ -2843,7 +2845,7 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 		goto send_resp;
 	}
 
-	peer = ol_txrx_find_peer_by_addr(pdev, intr[vdev_id].bssid, &peer_id);
+	peer = cdp_peer_find_by_addr(soc, pdev, intr[vdev_id].bssid, &peer_id);
 
 	qdf_mem_zero(&req, sizeof(req));
 	req.vdev_id = vdev_id;
@@ -2900,6 +2902,7 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 			WMA_LOGE("%s: wma_switch_channel failed %d\n", __func__,
 				 status);
 
+		/* This is temporary, should be removed */
 		ol_htt_mon_note_chan(pdev, req.chan);
 	} else {
 		status = wma_vdev_start(wma, &req,
@@ -2911,6 +2914,7 @@ void wma_set_channel(tp_wma_handle wma, tpSwitchChannelParams params)
 			goto send_resp;
 		}
 
+		/* This is temporary, should be removed */
 		if (QDF_GLOBAL_MONITOR_MODE == cds_get_conparam())
 			ol_htt_mon_note_chan(pdev, req.chan);
 	}
@@ -5286,7 +5290,7 @@ QDF_STATUS wma_extscan_get_capabilities(tp_wma_handle wma,
 QDF_STATUS  wma_ipa_offload_enable_disable(tp_wma_handle wma,
 		struct sir_ipa_offload_enable_disable *ipa_offload)
 {
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	int32_t intra_bss_fwd = 0;
 	struct ipa_offload_control_params params = {0};
 	QDF_STATUS status;
@@ -5337,7 +5341,8 @@ QDF_STATUS  wma_ipa_offload_enable_disable(tp_wma_handle wma,
 		return QDF_STATUS_SUCCESS;
 
 	/* Disable Intra-BSS FWD offload when gDisableIntraBssFwd=1 in INI */
-	rx_fwd_disabled = ol_txrx_is_rx_fwd_disabled(vdev);
+	rx_fwd_disabled = cdp_cfg_is_rx_fwd_disabled(
+		cds_get_context(QDF_MODULE_ID_SOC), vdev);
 	if (!ipa_offload->enable || rx_fwd_disabled) {
 		WMA_LOGE("%s: ipa_offload->enable=%d, rx_fwd_disabled=%d",
 				__func__,

+ 6 - 5
core/wma/src/wma_utils.c

@@ -46,7 +46,6 @@
 #include "qdf_nbuf.h"
 #include "qdf_types.h"
 #include "qdf_mem.h"
-#include "ol_txrx_peer_find.h"
 
 #include "wma_types.h"
 #include "lim_api.h"
@@ -2014,7 +2013,7 @@ int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
 				uint8_t vdev_id, uint32_t value)
 {
 	struct ol_txrx_stats_req req;
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 
 	vdev = wma_find_vdev_by_id(wma_handle, vdev_id);
 	if (!vdev) {
@@ -2023,7 +2022,8 @@ int32_t wma_txrx_fw_stats_reset(tp_wma_handle wma_handle,
 	}
 	qdf_mem_zero(&req, sizeof(req));
 	req.stats_type_reset_mask = value;
-	ol_txrx_fw_stats_get(vdev, &req, false, false);
+	cdp_fw_stats_get(cds_get_context(QDF_MODULE_ID_SOC), vdev, &req,
+			false, false);
 
 	return 0;
 }
@@ -2074,7 +2074,7 @@ int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
 				    uint8_t vdev_id, uint32_t value)
 {
 	struct ol_txrx_stats_req req;
-	ol_txrx_vdev_handle vdev;
+	void *vdev;
 	uint32_t l_up_mask;
 
 	vdev = wma_find_vdev_by_id(wma_handle, vdev_id);
@@ -2093,7 +2093,8 @@ int32_t wma_set_txrx_fw_stats_level(tp_wma_handle wma_handle,
 	l_up_mask = 1 << (value - 1);
 	req.stats_type_upload_mask = l_up_mask;
 
-	ol_txrx_fw_stats_get(vdev, &req, false, true);
+	cdp_fw_stats_get(cds_get_context(QDF_MODULE_ID_SOC), vdev, &req,
+			 false, true);
 
 	return 0;
 }