qcacld-3.0: Add QDF mem API's

Replace CDF mem API's with QDF mem API's

Change-Id: Icf247b4dc5b26f4b960dcb98e323b096c1d6076c
CRs-Fixed: 981188
diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c
index e557843..1a62f21 100644
--- a/core/mac/src/cfg/cfg_api.c
+++ b/core/mac/src/cfg/cfg_api.c
@@ -150,7 +150,7 @@
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 	/* at this point pMac->cfg.gCfgSBuf starts */
-	pMac->cfg.gCfgSBuf = cdf_mem_malloc(combined_buff_size);
+	pMac->cfg.gCfgSBuf = qdf_mem_malloc(combined_buff_size);
 	if (NULL == pMac->cfg.gCfgSBuf) {
 		cfg_log(pMac, LOGE,
 			FL("Failed to allocate memory for cfg array"));
@@ -163,13 +163,13 @@
 	/* after max_i_count integers, pMac->cfg.gCfgIBufMax starts */
 	pMac->cfg.gCfgIBufMax = &pMac->cfg.gCfgIBufMin[max_i_count];
 
-	return (eSIR_SUCCESS);
+	return eSIR_SUCCESS;
 }
 
 /* ---------------------------------------------------------------------- */
 void cfg_de_init(tpAniSirGlobal pMac)
 {
-	cdf_mem_free(pMac->cfg.gCfgSBuf);
+	qdf_mem_free(pMac->cfg.gCfgSBuf);
 	pMac->cfg.gCfgIBufMin = NULL;
 	pMac->cfg.gCfgIBufMax = NULL;
 	pMac->cfg.gCfgIBuf = NULL;
@@ -599,7 +599,7 @@
 		goto error;
 	}
 
-	pCountryInfo = cdf_mem_malloc(cfgLength);
+	pCountryInfo = qdf_mem_malloc(cfgLength);
 	if (NULL == pCountryInfo) {
 		cfg_log(pMac, LOGP, FL(" failed to allocate memory"));
 		goto error;
@@ -609,7 +609,7 @@
 	 */
 	if (wlan_cfg_get_str(pMac, cfgId, pCountryInfo, &cfgLength) !=
 	    eSIR_SUCCESS) {
-		cdf_mem_free(pCountryInfo);
+		qdf_mem_free(pCountryInfo);
 		pCountryInfo = NULL;
 
 		cfg_log(pMac, LOGP,
@@ -633,7 +633,7 @@
 
 error:
 	if (NULL != pCountryInfo)
-		cdf_mem_free(pCountryInfo);
+		qdf_mem_free(pCountryInfo);
 
 	return maxTxPwr;
 }
@@ -694,7 +694,7 @@
 
 	maxTxPwr = cfg_get_dot11d_transmit_power(pMac, cfgId, cfgLength, channel);
 
-	return (maxTxPwr);
+	return maxTxPwr;
 }
 
 /* --------------------------------------------------------------------- */
diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c
index ebc8506..4c9969b 100644
--- a/core/mac/src/cfg/cfg_proc_msg.c
+++ b/core/mac/src/cfg/cfg_proc_msg.c
@@ -1822,7 +1822,7 @@
 	index = CFG_GET_FUNC_INDX(pMsg->type);
 
 	if (index >= QDF_ARRAY_SIZE(g_cfg_func)) {
-		cdf_mem_free(pMsg);
+		qdf_mem_free(pMsg);
 		return;
 	}
 	len = pMsg->msgLen - WNI_CFG_MB_HDR_LEN;
@@ -1832,7 +1832,7 @@
 	g_cfg_func[index] (pMac, len, pParam);
 
 	/* Free up buffer */
-	cdf_mem_free(pMsg);
+	qdf_mem_free(pMsg);
 
 } /*** end cfg_process_mb_msg() ***/
 
diff --git a/core/mac/src/cfg/cfg_send_msg.c b/core/mac/src/cfg/cfg_send_msg.c
index ebad7c7..a50652c 100644
--- a/core/mac/src/cfg/cfg_send_msg.c
+++ b/core/mac/src/cfg/cfg_send_msg.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -92,7 +92,7 @@
 		return;
 	}
 	/* Allocate message buffer */
-	pMsg = cdf_mem_malloc(msgLen);
+	pMsg = qdf_mem_malloc(msgLen);
 	if (NULL == pMsg) {
 		PELOGE(cfg_log(pMac, LOGE, FL("Memory allocation failure!"));)
 		return;
@@ -129,7 +129,7 @@
 
 	default:
 		PELOGE(cfg_log(pMac, LOGE, FL("Unknown msg %d!"), (int)msgType);)
-		cdf_mem_free(pMsg);
+		qdf_mem_free(pMsg);
 		return;
 	}
 
diff --git a/core/mac/src/dph/dph_hash_table.c b/core/mac/src/dph/dph_hash_table.c
index e1bbe39..0e592d1 100644
--- a/core/mac/src/dph/dph_hash_table.c
+++ b/core/mac/src/dph/dph_hash_table.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -104,7 +104,7 @@
 	for (i = 0; i < 6; i++)
 		sum += staAddr[i];
 
-	return (sum % numSta);
+	return sum % numSta;
 }
 
 /* --------------------------------------------------------------------- */
@@ -250,7 +250,7 @@
 		       (pMac, LOG1, FL("Assoc Id %d, Addr %08X"), assocId, pStaDs);
 	       )
 	/* Clear the STA node except for the next pointer (last 4 bytes) */
-	cdf_mem_set((uint8_t *) pStaDs,
+	qdf_mem_set((uint8_t *) pStaDs,
 		    sizeof(tDphHashNode) - sizeof(tpDphHashNode), 0);
 
 	/* Initialize the assocId */
@@ -261,7 +261,7 @@
 		pStaDs->staIndex = STA_INVALID_IDX;
 
 	/* Initialize STA mac address */
-	cdf_mem_copy(pStaDs->staAddr, staAddr, sizeof(tSirMacAddr));
+	qdf_mem_copy(pStaDs->staAddr, staAddr, sizeof(tSirMacAddr));
 
 	/* Initialize fragmentation threshold */
 	if (wlan_cfg_get_int(pMac, WNI_CFG_FRAGMENTATION_THRESHOLD, &val) !=
diff --git a/core/mac/src/pe/lim/lim_admit_control.c b/core/mac/src/pe/lim/lim_admit_control.c
index 7dd6fca..a0644c3 100644
--- a/core/mac/src/pe/lim/lim_admit_control.c
+++ b/core/mac/src/pe/lim/lim_admit_control.c
@@ -433,10 +433,10 @@
 	for (ctspec = 0; ctspec < LIM_NUM_TSPEC_MAX; ctspec++, pTspecList++) {
 		if ((pTspecList->inuse)
 		    &&
-		    (cdf_mem_compare
+		    (!qdf_mem_cmp
 			     (pAddr, pTspecList->staAddr, sizeof(pTspecList->staAddr)))
 		    &&
-		    (cdf_mem_compare
+		    (!qdf_mem_cmp
 			     ((uint8_t *) pTspecIE, (uint8_t *) &pTspecList->tspec,
 			     sizeof(tSirMacTspecIE)))) {
 			*ppInfo = pTspecList;
@@ -479,7 +479,7 @@
 		if ((pTspecList->inuse)
 		    && (assocId == pTspecList->assocId)
 		    &&
-		    (cdf_mem_compare
+		    (!qdf_mem_cmp
 			     ((uint8_t *) pTspecIE, (uint8_t *) &pTspecList->tspec,
 			     sizeof(tSirMacTspecIE)))) {
 			*ppInfo = pTspecList;
@@ -597,7 +597,7 @@
 	/* update the tspec info */
 	pTspecList->tspec = *pTspec;
 	pTspecList->assocId = assocId;
-	cdf_mem_copy(pTspecList->staAddr, pAddr, sizeof(pTspecList->staAddr));
+	qdf_mem_copy(pTspecList->staAddr, pAddr, sizeof(pTspecList->staAddr));
 
 	/* for edca tspec's, we are all done */
 	if (pTspec->tsinfo.traffic.accessPolicy == SIR_MAC_ACCESSPOLICY_EDCA) {
@@ -747,7 +747,7 @@
 	}
 	/* fill in a schedule if requested */
 	if (pSch != NULL) {
-		cdf_mem_set((uint8_t *) pSch, sizeof(*pSch), 0);
+		qdf_mem_set((uint8_t *) pSch, sizeof(*pSch), 0);
 		pSch->svcStartTime = pAddts->tspec.svcStartTime;
 		pSch->svcInterval = svcInterval;
 		pSch->maxSvcDuration = (uint16_t) pSch->svcInterval;    /* use SP = SI */
@@ -854,7 +854,7 @@
    -------------------------------------------------------------*/
 tSirRetStatus lim_admit_control_init(tpAniSirGlobal pMac)
 {
-	cdf_mem_set(pMac->lim.tspecInfo,
+	qdf_mem_set(pMac->lim.tspecInfo,
 		    LIM_NUM_TSPEC_MAX * sizeof(tLimTspecInfo), 0);
 	return eSIR_SUCCESS;
 }
@@ -925,16 +925,16 @@
 		return eSIR_FAILURE;
 	}
 
-	pAddTsParam = cdf_mem_malloc(sizeof(tAddTsParams));
+	pAddTsParam = qdf_mem_malloc(sizeof(tAddTsParams));
 	if (NULL == pAddTsParam) {
 		PELOGW(lim_log(pMac, LOGW, FL("AllocateMemory() failed"));)
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set((uint8_t *) pAddTsParam, sizeof(tAddTsParams), 0);
+	qdf_mem_set((uint8_t *) pAddTsParam, sizeof(tAddTsParams), 0);
 	pAddTsParam->staIdx = staIdx;
 	pAddTsParam->tspecIdx = tspecIdx;
-	cdf_mem_copy(&pAddTsParam->tspec, &tspecIE, sizeof(tSirMacTspecIE));
+	qdf_mem_copy(&pAddTsParam->tspec, &tspecIE, sizeof(tSirMacTspecIE));
 	pAddTsParam->sessionId = sessionId;
 	pAddTsParam->sme_session_id = psessionEntry->smeSessionId;
 
@@ -960,7 +960,7 @@
 	if (eSIR_SUCCESS != wma_post_ctrl_msg(pMac, &msg)) {
 		lim_log(pMac, LOGW, FL("wma_post_ctrl_msg() failed"));
 		SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
-		cdf_mem_free(pAddTsParam);
+		qdf_mem_free(pAddTsParam);
 		return eSIR_FAILURE;
 	}
 	return eSIR_SUCCESS;
@@ -986,7 +986,7 @@
 	tpDelTsParams pDelTsParam;
 	tpPESession psessionEntry = NULL;
 
-	pDelTsParam = cdf_mem_malloc(sizeof(tDelTsParams));
+	pDelTsParam = qdf_mem_malloc(sizeof(tDelTsParams));
 	if (NULL == pDelTsParam) {
 		lim_log(pMac, LOGP, FL("AllocateMemory() failed"));
 		return eSIR_MEM_ALLOC_FAILED;
@@ -995,12 +995,12 @@
 	msg.type = WMA_DEL_TS_REQ;
 	msg.bodyptr = pDelTsParam;
 	msg.bodyval = 0;
-	cdf_mem_set((uint8_t *) pDelTsParam, sizeof(tDelTsParams), 0);
+	qdf_mem_set((uint8_t *) pDelTsParam, sizeof(tDelTsParams), 0);
 
 	/* filling message parameters. */
 	pDelTsParam->staIdx = staIdx;
 	pDelTsParam->tspecIdx = tspecIdx;
-	cdf_mem_copy(&pDelTsParam->bssId, bssId, sizeof(tSirMacAddr));
+	qdf_mem_copy(&pDelTsParam->bssId, bssId, sizeof(tSirMacAddr));
 
 	psessionEntry = pe_find_session_by_session_id(pMac, sessionId);
 	if (psessionEntry == NULL) {
@@ -1019,7 +1019,7 @@
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 	if (pMac->roam.configParam.isRoamOffloadEnabled &&
 	    psessionEntry->is11Rconnection) {
-		cdf_mem_copy(&pDelTsParam->delTsInfo, &delts,
+		qdf_mem_copy(&pDelTsParam->delTsInfo, &delts,
 			     sizeof(tSirDeltsReqInfo));
 		pDelTsParam->setRICparams = 1;
 	}
@@ -1035,7 +1035,7 @@
 	return eSIR_SUCCESS;
 
 err:
-	cdf_mem_free(pDelTsParam);
+	qdf_mem_free(pDelTsParam);
 	return eSIR_FAILURE;
 }
 
@@ -1134,6 +1134,6 @@
 
 end:
 	if (pAddTsRspMsg != NULL)
-		cdf_mem_free(pAddTsRspMsg);
+		qdf_mem_free(pAddTsRspMsg);
 	return;
 }
diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c
index 4bdfe04..4281255 100644
--- a/core/mac/src/pe/lim/lim_api.c
+++ b/core/mac/src/pe/lim/lim_api.c
@@ -94,15 +94,15 @@
 	pMac->lim.gLimRestoreCBNumScanInterval =
 		LIM_RESTORE_CB_NUM_SCAN_INTERVAL_DEFAULT;
 	pMac->lim.gLimRestoreCBCount = 0;
-	cdf_mem_set(pMac->lim.gLimLegacyBssidList,
+	qdf_mem_set(pMac->lim.gLimLegacyBssidList,
 		    sizeof(pMac->lim.gLimLegacyBssidList), 0);
 
 	/* Fill in default values */
 
 	/* abort scan is used to abort an on-going scan */
 	pMac->lim.abortScan = 0;
-	cdf_mem_set(&pMac->lim.scanChnInfo, sizeof(tLimScanChnInfo), 0);
-	cdf_mem_set(&pMac->lim.dfschannelList, sizeof(tSirDFSChannelList), 0);
+	qdf_mem_set(&pMac->lim.scanChnInfo, sizeof(tLimScanChnInfo), 0);
+	qdf_mem_set(&pMac->lim.dfschannelList, sizeof(tSirDFSChannelList), 0);
 
 /* WLAN_SUSPEND_LINK Related */
 	pMac->lim.gpLimSuspendCallback = NULL;
@@ -112,7 +112,7 @@
 
 static void __lim_init_bss_vars(tpAniSirGlobal pMac)
 {
-	cdf_mem_set((void *)pMac->lim.gpSession,
+	qdf_mem_set((void *)pMac->lim.gpSession,
 		    sizeof(*pMac->lim.gpSession) * pMac->lim.maxBssId, 0);
 
 	/* This is for testing purposes only, be default should always be off */
@@ -133,14 +133,14 @@
 	/* Heart-Beat interval value */
 	pMac->lim.gLimHeartBeatCount = 0;
 
-	cdf_mem_zero(pMac->lim.gLimHeartBeatApMac[0],
+	qdf_mem_zero(pMac->lim.gLimHeartBeatApMac[0],
 			sizeof(tSirMacAddr));
-	cdf_mem_zero(pMac->lim.gLimHeartBeatApMac[1],
+	qdf_mem_zero(pMac->lim.gLimHeartBeatApMac[1],
 			sizeof(tSirMacAddr));
 	pMac->lim.gLimHeartBeatApMacIndex = 0;
 
 	/* Statistics to keep track of no. beacons rcvd in heart beat interval */
-	cdf_mem_set(pMac->lim.gLimHeartBeatBeaconStats,
+	qdf_mem_set(pMac->lim.gLimHeartBeatBeaconStats,
 		    sizeof(pMac->lim.gLimHeartBeatBeaconStats), 0);
 
 #ifdef WLAN_DEBUG
@@ -151,7 +151,7 @@
 	pMac->lim.numLearn = 0;
 	pMac->lim.numLearnIgnore = 0;
 	pMac->lim.numSme = 0;
-	cdf_mem_set(pMac->lim.numMAC, sizeof(pMac->lim.numMAC), 0);
+	qdf_mem_set(pMac->lim.numMAC, sizeof(pMac->lim.numMAC), 0);
 	pMac->lim.gLimNumAssocReqDropInvldState = 0;
 	pMac->lim.gLimNumAssocReqDropACRejectTS = 0;
 	pMac->lim.gLimNumAssocReqDropACRejectSta = 0;
@@ -195,22 +195,22 @@
 	 * when SME_START_BSS_REQ is received.
 	 */
 
-	cdf_mem_set(&pMac->lim.gLimOverlap11gParams, sizeof(tLimProtStaParams),
+	qdf_mem_set(&pMac->lim.gLimOverlap11gParams, sizeof(tLimProtStaParams),
 		    0);
-	cdf_mem_set(&pMac->lim.gLimOverlap11aParams, sizeof(tLimProtStaParams),
+	qdf_mem_set(&pMac->lim.gLimOverlap11aParams, sizeof(tLimProtStaParams),
 		    0);
-	cdf_mem_set(&pMac->lim.gLimOverlapHt20Params, sizeof(tLimProtStaParams),
+	qdf_mem_set(&pMac->lim.gLimOverlapHt20Params, sizeof(tLimProtStaParams),
 		    0);
-	cdf_mem_set(&pMac->lim.gLimOverlapNonGfParams,
+	qdf_mem_set(&pMac->lim.gLimOverlapNonGfParams,
 		    sizeof(tLimProtStaParams), 0);
-	cdf_mem_set(&pMac->lim.gLimNoShortParams, sizeof(tLimNoShortParams), 0);
-	cdf_mem_set(&pMac->lim.gLimNoShortSlotParams,
+	qdf_mem_set(&pMac->lim.gLimNoShortParams, sizeof(tLimNoShortParams), 0);
+	qdf_mem_set(&pMac->lim.gLimNoShortSlotParams,
 		    sizeof(tLimNoShortSlotParams), 0);
 
 	pMac->lim.gLimPhyMode = 0;
 	pMac->lim.scanStartTime = 0;    /* used to measure scan time */
 
-	cdf_mem_set(pMac->lim.gLimMyMacAddr, sizeof(pMac->lim.gLimMyMacAddr),
+	qdf_mem_set(pMac->lim.gLimMyMacAddr, sizeof(pMac->lim.gLimMyMacAddr),
 		    0);
 	pMac->lim.ackPolicy = 0;
 
@@ -223,15 +223,15 @@
 
 
 	/* Deferred Queue Paramters */
-	cdf_mem_set(&pMac->lim.gLimDeferredMsgQ, sizeof(tSirAddtsReq), 0);
+	qdf_mem_set(&pMac->lim.gLimDeferredMsgQ, sizeof(tSirAddtsReq), 0);
 
 	/* addts request if any - only one can be outstanding at any time */
-	cdf_mem_set(&pMac->lim.gLimAddtsReq, sizeof(tSirAddtsReq), 0);
+	qdf_mem_set(&pMac->lim.gLimAddtsReq, sizeof(tSirAddtsReq), 0);
 	pMac->lim.gLimAddtsSent = 0;
 	pMac->lim.gLimAddtsRspTimerCount = 0;
 
 	/* protection related config cache */
-	cdf_mem_set(&pMac->lim.cfgProtection, sizeof(tCfgProtection), 0);
+	qdf_mem_set(&pMac->lim.cfgProtection, sizeof(tCfgProtection), 0);
 	pMac->lim.gLimProtectionControl = 0;
 	SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
 
@@ -247,11 +247,11 @@
 	pMac->lim.pDialogueTokenHead = NULL;
 	pMac->lim.pDialogueTokenTail = NULL;
 
-	cdf_mem_set(&pMac->lim.tspecInfo,
+	qdf_mem_set(&pMac->lim.tspecInfo,
 		    sizeof(tLimTspecInfo) * LIM_NUM_TSPEC_MAX, 0);
 
 	/* admission control policy information */
-	cdf_mem_set(&pMac->lim.admitPolicyInfo, sizeof(tLimAdmitPolicyInfo), 0);
+	qdf_mem_set(&pMac->lim.admitPolicyInfo, sizeof(tLimAdmitPolicyInfo), 0);
 
 	pMac->lim.gLastBeaconDtimCount = 0;
 	pMac->lim.gLastBeaconDtimPeriod = 0;
@@ -279,9 +279,9 @@
 	/* / MAC level Pre-authentication related globals */
 	pMac->lim.gLimPreAuthChannelNumber = 0;
 	pMac->lim.gLimPreAuthType = eSIR_OPEN_SYSTEM;
-	cdf_mem_set(&pMac->lim.gLimPreAuthPeerAddr, sizeof(tSirMacAddr), 0);
+	qdf_mem_set(&pMac->lim.gLimPreAuthPeerAddr, sizeof(tSirMacAddr), 0);
 	pMac->lim.gLimNumPreAuthContexts = 0;
-	cdf_mem_set(&pMac->lim.gLimPreAuthTimerTable, sizeof(tLimPreAuthTable),
+	qdf_mem_set(&pMac->lim.gLimPreAuthTimerTable, sizeof(tLimPreAuthTable),
 		    0);
 
 	/* Placed holder to deauth reason */
@@ -296,9 +296,9 @@
 	pMac->lim.gLimDisassocFrameCredit = 0;
 
 	/* One cache for each overlap and associated case. */
-	cdf_mem_set(pMac->lim.protStaOverlapCache,
+	qdf_mem_set(pMac->lim.protStaOverlapCache,
 		    sizeof(tCacheParams) * LIM_PROT_STA_OVERLAP_CACHE_SIZE, 0);
-	cdf_mem_set(pMac->lim.protStaCache,
+	qdf_mem_set(pMac->lim.protStaCache,
 		    sizeof(tCacheParams) * LIM_PROT_STA_CACHE_SIZE, 0);
 
 	pMac->lim.pSessionEntry = NULL;
@@ -663,7 +663,7 @@
 			QDF_STATUS_SUCCESS) {
 			QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_INFO,
 			FL("Fixing leak! Deallocating pLimMgmtRegistration node"));
-			cdf_mem_free(pLimMgmtRegistration);
+			qdf_mem_free(pLimMgmtRegistration);
 		}
 		qdf_mutex_release(&pMac->lim.lim_frame_register_lock);
 		qdf_list_destroy(&pMac->lim.gLimMgmtFrameRegistratinQueue);
@@ -673,7 +673,7 @@
 
 	/* free up preAuth table */
 	if (pMac->lim.gLimPreAuthTimerTable.pTable != NULL) {
-		cdf_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
+		qdf_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
 		pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
 		pMac->lim.gLimPreAuthTimerTable.numEntry = 0;
 	}
@@ -683,27 +683,27 @@
 	}
 
 	if (NULL != pMac->lim.pDialogueTokenTail) {
-		cdf_mem_free(pMac->lim.pDialogueTokenTail);
+		qdf_mem_free(pMac->lim.pDialogueTokenTail);
 		pMac->lim.pDialogueTokenTail = NULL;
 	}
 
 	if (pMac->lim.gpLimMlmSetKeysReq != NULL) {
-		cdf_mem_free(pMac->lim.gpLimMlmSetKeysReq);
+		qdf_mem_free(pMac->lim.gpLimMlmSetKeysReq);
 		pMac->lim.gpLimMlmSetKeysReq = NULL;
 	}
 
 	if (pMac->lim.gpLimMlmAuthReq != NULL) {
-		cdf_mem_free(pMac->lim.gpLimMlmAuthReq);
+		qdf_mem_free(pMac->lim.gpLimMlmAuthReq);
 		pMac->lim.gpLimMlmAuthReq = NULL;
 	}
 
 	if (pMac->lim.gpDefdSmeMsgForNOA != NULL) {
-		cdf_mem_free(pMac->lim.gpDefdSmeMsgForNOA);
+		qdf_mem_free(pMac->lim.gpDefdSmeMsgForNOA);
 		pMac->lim.gpDefdSmeMsgForNOA = NULL;
 	}
 
 	if (pMac->lim.gpLimMlmScanReq != NULL) {
-		cdf_mem_free(pMac->lim.gpLimMlmScanReq);
+		qdf_mem_free(pMac->lim.gpLimMlmScanReq);
 		pMac->lim.gpLimMlmScanReq = NULL;
 	}
 	/* Now, finally reset the deferred message queue pointers */
@@ -744,7 +744,7 @@
 	}
 
 	pMac->lim.limTimers.gpLimCnfWaitTimer =
-		cdf_mem_malloc(sizeof(TX_TIMER) * (pMac->lim.maxStation + 1));
+		qdf_mem_malloc(sizeof(TX_TIMER) * (pMac->lim.maxStation + 1));
 	if (NULL == pMac->lim.limTimers.gpLimCnfWaitTimer) {
 		PELOGE(lim_log(pMac, LOGE,
 			FL("gpLimCnfWaitTimer memory allocate failed!"));)
@@ -752,7 +752,7 @@
 	}
 
 	pMac->lim.gpSession =
-		cdf_mem_malloc(sizeof(tPESession) * pMac->lim.maxBssId);
+		qdf_mem_malloc(sizeof(tPESession) * pMac->lim.maxBssId);
 	if (NULL == pMac->lim.gpSession) {
 		lim_log(pMac, LOGE,
 			FL("gpSession memory allocate failed!"));
@@ -760,7 +760,7 @@
 		goto pe_open_psession_fail;
 	}
 
-	cdf_mem_set(pMac->lim.gpSession,
+	qdf_mem_set(pMac->lim.gpSession,
 		    sizeof(tPESession) * pMac->lim.maxBssId, 0);
 
 	pMac->lim.mgmtFrameSessionId = 0xff;
@@ -786,10 +786,10 @@
 	return status; /* status here will be eSIR_SUCCESS */
 
 pe_open_lock_fail:
-	cdf_mem_free(pMac->lim.gpSession);
+	qdf_mem_free(pMac->lim.gpSession);
 	pMac->lim.gpSession = NULL;
 pe_open_psession_fail:
-	cdf_mem_free(pMac->lim.limTimers.gpLimCnfWaitTimer);
+	qdf_mem_free(pMac->lim.limTimers.gpLimCnfWaitTimer);
 	pMac->lim.limTimers.gpLimCnfWaitTimer = NULL;
 
 	return status;
@@ -814,20 +814,20 @@
 			pe_delete_session(pMac, &pMac->lim.gpSession[i]);
 		}
 	}
-	cdf_mem_free(pMac->lim.limTimers.gpLimCnfWaitTimer);
+	qdf_mem_free(pMac->lim.limTimers.gpLimCnfWaitTimer);
 	pMac->lim.limTimers.gpLimCnfWaitTimer = NULL;
 
 	if (pMac->lim.gpLimMlmOemDataReq) {
 		if (pMac->lim.gpLimMlmOemDataReq->data) {
-			cdf_mem_free(
+			qdf_mem_free(
 				pMac->lim.gpLimMlmOemDataReq->data);
 			pMac->lim.gpLimMlmOemDataReq->data = NULL;
 		}
-		cdf_mem_free(pMac->lim.gpLimMlmOemDataReq);
+		qdf_mem_free(pMac->lim.gpLimMlmOemDataReq);
 		pMac->lim.gpLimMlmOemDataReq = NULL;
 	}
 
-	cdf_mem_free(pMac->lim.gpSession);
+	qdf_mem_free(pMac->lim.gpSession);
 	pMac->lim.gpSession = NULL;
 	if (!QDF_IS_STATUS_SUCCESS
 		    (qdf_mutex_destroy(&pMac->lim.lkPeGlobalLock))) {
@@ -883,7 +883,7 @@
 				cds_pkt_return_packet((cds_pkt_t *) pMsg->
 						      bodyptr);
 			} else {
-				cdf_mem_free((void *)pMsg->bodyptr);
+				qdf_mem_free((void *)pMsg->bodyptr);
 			}
 		}
 		pMsg->bodyptr = 0;
@@ -1301,7 +1301,7 @@
 {
 	int i;
 	if (!pStaParams->numSta) {
-		cdf_mem_copy(pMac->lim.protStaOverlapCache[0].addr,
+		qdf_mem_copy(pMac->lim.protStaOverlapCache[0].addr,
 			     bssId, sizeof(tSirMacAddr));
 		pMac->lim.protStaOverlapCache[0].active = true;
 
@@ -1312,7 +1312,7 @@
 
 	for (i = 0; i < LIM_PROT_STA_OVERLAP_CACHE_SIZE; i++) {
 		if (pMac->lim.protStaOverlapCache[i].active) {
-			if (cdf_mem_compare
+			if (!qdf_mem_cmp
 				    (pMac->lim.protStaOverlapCache[i].addr, bssId,
 				    sizeof(tSirMacAddr))) {
 				return;
@@ -1324,7 +1324,7 @@
 	if (i == LIM_PROT_STA_OVERLAP_CACHE_SIZE) {
 		PELOG1(lim_log(pMac, LOGW, FL("Overlap cache is full"));)
 	} else {
-		cdf_mem_copy(pMac->lim.protStaOverlapCache[i].addr,
+		qdf_mem_copy(pMac->lim.protStaOverlapCache[i].addr,
 			     bssId, sizeof(tSirMacAddr));
 		pMac->lim.protStaOverlapCache[i].active = true;
 
@@ -1415,7 +1415,7 @@
 	   4. Encyption type in the beacon does not match with self station
 	 */
 	if ((!pBeacon->capabilityInfo.ibss) ||
-	    (lim_cmp_ssid(&pBeacon->ssId, psessionEntry) != true) ||
+	    (lim_cmp_ssid(&pBeacon->ssId, psessionEntry) == true) ||
 	    (psessionEntry->currentOperChannel != pBeacon->channelNumber))
 		retCode = eSIR_LIM_IGNORE_BEACON;
 	else if (lim_ibss_enc_type_matched(pBeacon, psessionEntry) != eSIR_TRUE) {
@@ -1551,7 +1551,7 @@
 						     psessionEntry);
 	if ((false == psessionEntry->limSentCapsChangeNtf) &&
 	    (((!lim_is_null_ssid(&pBeacon->ssId)) &&
-	       (false == lim_cmp_ssid(&pBeacon->ssId, psessionEntry))) ||
+	       (false != lim_cmp_ssid(&pBeacon->ssId, psessionEntry))) ||
 	     ((SIR_MAC_GET_ESS(apNewCaps.capabilityInfo) !=
 	       SIR_MAC_GET_ESS(psessionEntry->limCurrentBssCaps)) ||
 	      (SIR_MAC_GET_PRIVACY(apNewCaps.capabilityInfo) !=
@@ -1600,7 +1600,7 @@
 		len = sizeof(tSirMacCapabilityInfo) + sizeof(tSirMacAddr) + sizeof(uint8_t) + 3 * sizeof(uint8_t) + /* reserved fields */
 		      pBeacon->ssId.length + 1;
 
-		cdf_mem_copy(apNewCaps.bssId.bytes,
+		qdf_mem_copy(apNewCaps.bssId.bytes,
 			     psessionEntry->bssId, QDF_MAC_ADDR_SIZE);
 		if (newChannel != psessionEntry->currentOperChannel) {
 			PELOGE(lim_log
@@ -1632,7 +1632,7 @@
 			return;
 		} else
 			apNewCaps.channelId = psessionEntry->currentOperChannel;
-		cdf_mem_copy((uint8_t *) &apNewCaps.ssId,
+		qdf_mem_copy((uint8_t *) &apNewCaps.ssId,
 			     (uint8_t *) &pBeacon->ssId,
 			     pBeacon->ssId.length + 1);
 
@@ -1849,7 +1849,7 @@
 		roam_offload_synch_ind_ptr->beaconProbeRespOffset;
 	mac_hdr = (tpSirMacMgmtHdr)bcn_proberesp_ptr;
 	parsed_frm_ptr =
-	(tpSirProbeRespBeacon) cdf_mem_malloc(sizeof(tSirProbeRespBeacon));
+	(tpSirProbeRespBeacon) qdf_mem_malloc(sizeof(tSirProbeRespBeacon));
 	if (NULL == parsed_frm_ptr) {
 		lim_log(pMac, LOGE, "fail to allocate memory for frame");
 		return QDF_STATUS_E_NOMEM;
@@ -1860,7 +1860,7 @@
 		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR, "%s: very"
 		"few bytes in synchInd beacon / probe resp frame! length=%d",
 		__func__, roam_offload_synch_ind_ptr->beaconProbeRespLength);
-		cdf_mem_free(parsed_frm_ptr);
+		qdf_mem_free(parsed_frm_ptr);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -1878,7 +1878,7 @@
 			QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
 			"Parse error Beacon, length=%d",
 			roam_offload_synch_ind_ptr->beaconProbeRespLength);
-			cdf_mem_free(parsed_frm_ptr);
+			qdf_mem_free(parsed_frm_ptr);
 			return QDF_STATUS_E_FAILURE;
 		}
 	} else {
@@ -1890,7 +1890,7 @@
 			QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
 			"Parse error ProbeResponse, length=%d",
 			roam_offload_synch_ind_ptr->beaconProbeRespLength);
-			cdf_mem_free(parsed_frm_ptr);
+			qdf_mem_free(parsed_frm_ptr);
 			return QDF_STATUS_E_FAILURE;
 		}
 	}
@@ -1956,16 +1956,16 @@
 	bss_desc_ptr->beaconInterval = parsed_frm_ptr->beaconInterval;
 	bss_desc_ptr->timeStamp[0]   = parsed_frm_ptr->timeStamp[0];
 	bss_desc_ptr->timeStamp[1]   = parsed_frm_ptr->timeStamp[1];
-	cdf_mem_copy(&bss_desc_ptr->capabilityInfo,
+	qdf_mem_copy(&bss_desc_ptr->capabilityInfo,
 	&bcn_proberesp_ptr[SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_CAPAB_OFFSET], 2);
-	cdf_mem_copy((uint8_t *) &bss_desc_ptr->bssId,
+	qdf_mem_copy((uint8_t *) &bss_desc_ptr->bssId,
 			(uint8_t *) mac_hdr->bssId,
 			sizeof(tSirMacAddr));
 	bss_desc_ptr->nReceivedTime =
 		(uint32_t)qdf_mc_timer_get_system_ticks();
 	if (parsed_frm_ptr->mdiePresent) {
 		bss_desc_ptr->mdiePresent = parsed_frm_ptr->mdiePresent;
-		cdf_mem_copy((uint8_t *)bss_desc_ptr->mdie,
+		qdf_mem_copy((uint8_t *)bss_desc_ptr->mdie,
 				(uint8_t *)parsed_frm_ptr->mdie,
 				SIR_MDIE_SIZE);
 	}
@@ -1977,12 +1977,12 @@
 			"chan=%d, rssi=%d", bss_desc_ptr->channelId,
 			bss_desc_ptr->rssi);
 	if (ie_len) {
-		cdf_mem_copy(&bss_desc_ptr->ieFields,
+		qdf_mem_copy(&bss_desc_ptr->ieFields,
 			bcn_proberesp_ptr +
 			(SIR_MAC_HDR_LEN_3A + SIR_MAC_B_PR_SSID_OFFSET),
 			ie_len);
 	}
-	cdf_mem_free(parsed_frm_ptr);
+	qdf_mem_free(parsed_frm_ptr);
 	return QDF_STATUS_SUCCESS;
 }
 /**
@@ -2092,13 +2092,13 @@
 		add_bss_params->txMgmtPower, ft_session_ptr);
 	mac_ctx->roam.reassocRespLen = roam_sync_ind_ptr->reassocRespLength;
 	mac_ctx->roam.pReassocResp =
-		cdf_mem_malloc(mac_ctx->roam.reassocRespLen);
+		qdf_mem_malloc(mac_ctx->roam.reassocRespLen);
 	if (NULL == mac_ctx->roam.pReassocResp) {
 		lim_log(mac_ctx, LOGE, FL("LFR3:assoc resp mem alloc failed"));
 		ft_session_ptr->bRoamSynchInProgress = false;
 		return QDF_STATUS_E_NOMEM;
 	}
-	cdf_mem_copy(mac_ctx->roam.pReassocResp,
+	qdf_mem_copy(mac_ctx->roam.pReassocResp,
 			(uint8_t *)roam_sync_ind_ptr +
 			roam_sync_ind_ptr->reassocRespOffset,
 			mac_ctx->roam.reassocRespLen);
@@ -2135,7 +2135,7 @@
 	ft_session_ptr->limSmeState = eLIM_SME_LINK_EST_STATE;
 	ft_session_ptr->bRoamSynchInProgress = false;
 	if (mac_ctx->roam.pReassocResp)
-		cdf_mem_free(mac_ctx->roam.pReassocResp);
+		qdf_mem_free(mac_ctx->roam.pReassocResp);
 	mac_ctx->roam.pReassocResp = NULL;
 	return QDF_STATUS_SUCCESS;
 }
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c
index 43917d0..8d720cb 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.c
+++ b/core/mac/src/pe/lim/lim_assoc_utils.c
@@ -94,9 +94,9 @@
  *
  * Return: true if SSID matched, false otherwise.
  */
-bool lim_cmp_ssid(tSirMacSSid *rx_ssid, tpPESession session_entry)
+uint32_t lim_cmp_ssid(tSirMacSSid *rx_ssid, tpPESession session_entry)
 {
-	return cdf_mem_compare(rx_ssid, &session_entry->ssId,
+	return qdf_mem_cmp(rx_ssid, &session_entry->ssId,
 				session_entry->ssId.length);
 }
 
@@ -230,7 +230,7 @@
 	tSirMacRateSet *pRateSet, basicRate;
 	uint8_t i, j, k, match;
 
-	pRateSet = cdf_mem_malloc(sizeof(tSirMacRateSet));
+	pRateSet = qdf_mem_malloc(sizeof(tSirMacRateSet));
 	if (NULL == pRateSet) {
 		lim_log(pMac, LOGP,
 			FL("call to AllocateMemory failed for RATESET"));
@@ -239,7 +239,7 @@
 	}
 
 	/* Copy operational rate set from session Entry */
-	cdf_mem_copy(pRateSet->rate, (psessionEntry->rateSet.rate),
+	qdf_mem_copy(pRateSet->rate, (psessionEntry->rateSet.rate),
 		     psessionEntry->rateSet.numRates);
 
 	pRateSet->numRates = psessionEntry->rateSet.numRates;
@@ -268,14 +268,14 @@
 
 		if (!match) {
 			/* Free up memory allocated for rateset */
-			cdf_mem_free((uint8_t *) pRateSet);
+			qdf_mem_free((uint8_t *) pRateSet);
 
 			return false;
 		}
 	}
 
 	/* Free up memory allocated for rateset */
-	cdf_mem_free((uint8_t *) pRateSet);
+	qdf_mem_free((uint8_t *) pRateSet);
 
 	return true;
 } /****** end lim_check_rx_basic_rates() ******/
@@ -401,7 +401,7 @@
 	match = 0;
 	for (i = 0; i < rx_rsn_ie.pwise_cipher_suite_count; i++) {
 		for (j = 0; j < rsn_ie->pwise_cipher_suite_count; j++) {
-			if (cdf_mem_compare(&rx_rsn_ie.pwise_cipher_suites[i],
+			if (!qdf_mem_cmp(&rx_rsn_ie.pwise_cipher_suites[i],
 				&rsn_ie->pwise_cipher_suites[j],
 				sizeof(rsn_ie->pwise_cipher_suites[j]))) {
 				match = 1;
@@ -516,7 +516,7 @@
 	match = 0;
 	for (i = 0; i < rx_wpaie.unicast_cipher_count; i++) {
 		for (j = 0; j < wpa_ie->unicast_cipher_count; j++) {
-			if (cdf_mem_compare(rx_wpaie.unicast_ciphers[i],
+			if (!qdf_mem_cmp(rx_wpaie.unicast_ciphers[i],
 					    wpa_ie->unicast_ciphers[j], 4)) {
 				match = 1;
 				break;
@@ -705,7 +705,7 @@
 		/* Free up buffer allocated for JoinReq held by */
 		/* MLM state machine */
 		if (psessionEntry->pLimMlmJoinReq) {
-			cdf_mem_free(psessionEntry->pLimMlmJoinReq);
+			qdf_mem_free(psessionEntry->pLimMlmJoinReq);
 			psessionEntry->pLimMlmJoinReq = NULL;
 		}
 
@@ -734,7 +734,7 @@
 			FL("Lim Posting DISASSOC_CNF to Sme. Trigger: %d"),
 			mlmStaContext.cleanupTrigger);
 
-		cdf_mem_copy((uint8_t *) &mlmDisassocCnf.peerMacAddr,
+		qdf_mem_copy((uint8_t *) &mlmDisassocCnf.peerMacAddr,
 			     (uint8_t *) sta_dsaddr.bytes, QDF_MAC_ADDR_SIZE);
 		mlmDisassocCnf.resultCode = statusCode;
 		mlmDisassocCnf.disassocTrigger = mlmStaContext.cleanupTrigger;
@@ -774,7 +774,7 @@
 		lim_log(pMac, LOGW,
 			FL("Lim Posting PURGE_STA_IND to Sme. Trigger: %d"),
 			mlmStaContext.cleanupTrigger);
-		cdf_mem_copy((uint8_t *) &mlmPurgeStaInd.peerMacAddr,
+		qdf_mem_copy((uint8_t *) &mlmPurgeStaInd.peerMacAddr,
 			     (uint8_t *) sta_dsaddr.bytes, QDF_MAC_ADDR_SIZE);
 		mlmPurgeStaInd.reasonCode =
 			(uint8_t) mlmStaContext.disassocReason;
@@ -824,7 +824,7 @@
 						      psessionEntry, smesessionId,
 						      smetransactionId);
 		} else {
-			cdf_mem_free(psessionEntry->pLimJoinReq);
+			qdf_mem_free(psessionEntry->pLimJoinReq);
 			psessionEntry->pLimJoinReq = NULL;
 
 			lim_log(pMac, LOG1,
@@ -906,7 +906,7 @@
 			       &mac_ctx->lim.gLimPreAuthTimerTable);
 
 		if (auth_node) {
-			cdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
+			qdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
 				     peer_addr, sizeof(tSirMacAddr));
 			auth_node->fTimerStarted = 0;
 			auth_node->mlmState = eLIM_MLM_AUTHENTICATED_STATE;
@@ -964,11 +964,11 @@
 		 *free the copy of association request frame.
 		 */
 		if (assoc_req_frame) {
-			cdf_mem_free(assoc_req_frame);
+			qdf_mem_free(assoc_req_frame);
 			assoc_req_frame = NULL;
 		}
 
-		cdf_mem_free(session_entry->parsedAssocReq[sta_ds->assocId]);
+		qdf_mem_free(session_entry->parsedAssocReq[sta_ds->assocId]);
 		session_entry->parsedAssocReq[sta_ds->assocId] = NULL;
 	}
 }
@@ -1002,7 +1002,7 @@
 			if (!session_entry->protStaCache[i].active)
 				continue;
 
-			if (cdf_mem_compare(session_entry->protStaCache[i].addr,
+			if (!qdf_mem_cmp(session_entry->protStaCache[i].addr,
 				sta_ds->staAddr, sizeof(tSirMacAddr))) {
 				session_entry->gLimHt20Params.numSta--;
 				session_entry->protStaCache[i].active =
@@ -1067,10 +1067,10 @@
 			session_entry->gLim11aParams.numSta, sta_ds->staAddr);
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (session_entry->protStaCache[i].active &&
-				cdf_mem_compare(
+				(!qdf_mem_cmp(
 					session_entry->protStaCache[i].addr,
 					 sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 				session_entry->protStaCache[i].active = false;
 				break;
 			}
@@ -1093,10 +1093,10 @@
 			session_entry->gLim11bParams.numSta, sta_ds->staAddr);
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (session_entry->protStaCache[i].active &&
-				cdf_mem_compare(
+				(!qdf_mem_cmp(
 					session_entry->protStaCache[i].addr,
 					sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 					session_entry->gLim11bParams.numSta--;
 					session_entry->protStaCache[i].active =
 						 false;
@@ -1123,10 +1123,10 @@
 			session_entry->gLim11bParams.numSta, sta_ds->staAddr);
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (session_entry->protStaCache[i].active &&
-				cdf_mem_compare(
+				(!qdf_mem_cmp(
 					session_entry->protStaCache[i].addr,
 					sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 				 session_entry->gLim11gParams.numSta--;
 				 session_entry->protStaCache[i].active = false;
 				 break;
@@ -1155,10 +1155,10 @@
 			session_entry->gLimNonGfParams.numSta, sta_ds->staAddr);
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (session_entry->protStaCache[i].active &&
-				cdf_mem_compare(
+				(!qdf_mem_cmp(
 					session_entry->protStaCache[i].addr,
 					sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 				session_entry->protStaCache[i].active = false;
 				break;
 			}
@@ -1195,10 +1195,10 @@
 			sta_ds->staAddr);
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (session_entry->protStaCache[i].active &&
-				cdf_mem_compare(
+				(!qdf_mem_cmp(
 					session_entry->protStaCache[i].addr,
 					sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 				session_entry->protStaCache[i].active = false;
 				break;
 			}
@@ -1239,11 +1239,11 @@
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (session_entry->gLimNoShortParams.
 				staNoShortCache[i].active &&
-				cdf_mem_compare(session_entry->
+				(!qdf_mem_cmp(session_entry->
 					gLimNoShortParams.
 					staNoShortCache[i].addr,
 					sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 				session_entry->gLimNoShortParams.
 					numNonShortPreambleSta--;
 				session_entry->gLimNoShortParams.
@@ -1259,7 +1259,7 @@
 		 * enable short preamble
 		 * reset the cache
 		 */
-		cdf_mem_set((uint8_t *) &session_entry->gLimNoShortParams,
+		qdf_mem_set((uint8_t *) &session_entry->gLimNoShortParams,
 				sizeof(tLimNoShortParams), 0);
 		if (lim_enable_short_preamble(mac_ctx, true,
 			beacon_params, session_entry) != eSIR_SUCCESS) {
@@ -1304,11 +1304,11 @@
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (session_entry->gLimNoShortSlotParams.
 				staNoShortSlotCache[i].active &&
-				cdf_mem_compare(session_entry->
+				(!qdf_mem_cmp(session_entry->
 					gLimNoShortSlotParams.
 						staNoShortSlotCache[i].addr,
 					sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 				non_short_slot_sta_count--;
 				session_entry->gLimNoShortSlotParams.
 					staNoShortSlotCache[i].active = false;
@@ -1321,7 +1321,7 @@
 			 * enable short slot time
 			 * reset the cache
 			 */
-			cdf_mem_set((uint8_t *) &session_entry->
+			qdf_mem_set((uint8_t *) &session_entry->
 				gLimNoShortSlotParams,
 				sizeof(tLimNoShortSlotParams), 0);
 			beacon_params->fShortSlotTime = true;
@@ -1337,11 +1337,11 @@
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (mac_ctx->lim.gLimNoShortSlotParams.
 				staNoShortSlotCache[i].active &&
-				cdf_mem_compare(
+				(!qdf_mem_cmp(
 					mac_ctx->lim.gLimNoShortSlotParams.
 						staNoShortSlotCache[i].addr,
 					sta_ds->staAddr,
-					sizeof(tSirMacAddr))) {
+					sizeof(tSirMacAddr)))) {
 				non_short_slot_sta_count--;
 				mac_ctx->lim.gLimNoShortSlotParams.
 					staNoShortSlotCache[i].active = false;
@@ -1354,7 +1354,7 @@
 			 * enable short slot time
 			 * reset the cache
 			 */
-			cdf_mem_set(
+			qdf_mem_set(
 				(uint8_t *) &mac_ctx->lim.gLimNoShortSlotParams,
 				sizeof(tLimNoShortSlotParams), 0);
 			/*in case of AP set SHORT_SLOT_TIME to enable*/
@@ -1716,7 +1716,7 @@
 	 * put the result in pSupportedRates
 	 */
 
-	cdf_mem_set((uint8_t *) rates, sizeof(tSirSupportedRates), 0);
+	qdf_mem_set((uint8_t *) rates, sizeof(tSirSupportedRates), 0);
 	for (i = 0; i < temp_rate_set.numRates; i++) {
 		min = 0;
 		val = 0xff;
@@ -1820,7 +1820,7 @@
 
 	/* copy operational rate set from psessionEntry */
 	if (psessionEntry->rateSet.numRates <= SIR_MAC_RATESET_EID_MAX) {
-		cdf_mem_copy((uint8_t *) tempRateSet.rate,
+		qdf_mem_copy((uint8_t *) tempRateSet.rate,
 			     (uint8_t *) (psessionEntry->rateSet.rate),
 			     psessionEntry->rateSet.numRates);
 		tempRateSet.numRates = psessionEntry->rateSet.numRates;
@@ -1835,7 +1835,7 @@
 		(psessionEntry->dot11mode == WNI_CFG_DOT11_MODE_11N)) {
 		if (psessionEntry->extRateSet.numRates <=
 		    SIR_MAC_RATESET_EID_MAX) {
-			cdf_mem_copy((uint8_t *) tempRateSet2.rate,
+			qdf_mem_copy((uint8_t *) tempRateSet2.rate,
 				     (uint8_t *) (psessionEntry->extRateSet.
 						  rate),
 				     psessionEntry->extRateSet.numRates);
@@ -1868,7 +1868,7 @@
 	{
 		uint8_t aRateIndex = 0;
 		uint8_t bRateIndex = 0;
-		cdf_mem_set((uint8_t *) pRates, sizeof(tSirSupportedRates), 0);
+		qdf_mem_set((uint8_t *) pRates, sizeof(tSirSupportedRates), 0);
 		for (i = 0; i < tempRateSet.numRates; i++) {
 			min = 0;
 			val = 0xff;
@@ -2002,12 +2002,12 @@
 	lim_get_phy_mode(mac_ctx, &phy_mode, session_entry);
 
 	/* copy operational rate set from session_entry */
-	cdf_mem_copy((temp_rate_set.rate), (session_entry->rateSet.rate),
+	qdf_mem_copy((temp_rate_set.rate), (session_entry->rateSet.rate),
 		     session_entry->rateSet.numRates);
 	temp_rate_set.numRates = (uint8_t) session_entry->rateSet.numRates;
 
 	if (phy_mode == WNI_CFG_PHY_MODE_11G) {
-		cdf_mem_copy((temp_rate_set2.rate),
+		qdf_mem_copy((temp_rate_set2.rate),
 			     (session_entry->extRateSet.rate),
 			     session_entry->extRateSet.numRates);
 		temp_rate_set2.numRates =
@@ -2108,7 +2108,7 @@
 
 
 	rates = &sta_ds->supportedRates;
-	cdf_mem_set((uint8_t *) rates, sizeof(tSirSupportedRates), 0);
+	qdf_mem_set((uint8_t *) rates, sizeof(tSirSupportedRates), 0);
 	for (i = 0; (i < temp_rate_set2.numRates &&
 			 i < SIR_MAC_RATESET_EID_MAX); i++) {
 		for (j = 0; (j < temp_rate_set.numRates &&
@@ -2269,13 +2269,13 @@
 		session_entry->smeSessionId, update_entry,
 		GET_LIM_SYSTEM_ROLE(session_entry));
 
-	add_sta_params = cdf_mem_malloc(sizeof(tAddStaParams));
+	add_sta_params = qdf_mem_malloc(sizeof(tAddStaParams));
 	if (NULL == add_sta_params) {
 		lim_log(mac_ctx, LOGP,
 			FL("Unable to allocate memory during ADD_STA"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_set((uint8_t *) add_sta_params, sizeof(tAddStaParams), 0);
+	qdf_mem_set((uint8_t *) add_sta_params, sizeof(tAddStaParams), 0);
 
 	if (LIM_IS_AP_ROLE(session_entry) || LIM_IS_IBSS_ROLE(session_entry) ||
 	    LIM_IS_BT_AMP_AP_ROLE(session_entry))
@@ -2292,11 +2292,11 @@
 		FL(MAC_ADDRESS_STR ": Subtype(Assoc/Reassoc): %d"),
 		MAC_ADDR_ARRAY(*sta_Addr), sta_ds->mlmStaContext.subType);
 
-	cdf_mem_copy((uint8_t *) add_sta_params->staMac,
+	qdf_mem_copy((uint8_t *) add_sta_params->staMac,
 		     (uint8_t *) *sta_Addr, sizeof(tSirMacAddr));
-	cdf_mem_copy((uint8_t *) add_sta_params->bssId,
+	qdf_mem_copy((uint8_t *) add_sta_params->bssId,
 		     session_entry->bssId, sizeof(tSirMacAddr));
-	cdf_mem_copy(&add_sta_params->capab_info,
+	qdf_mem_copy(&add_sta_params->capab_info,
 		     &sta_ds->mlmStaContext.capabilityInfo,
 		     sizeof(add_sta_params->capab_info));
 
@@ -2304,7 +2304,7 @@
 				      session_entry);
 
 	/* Copy legacy rates */
-	cdf_mem_copy((uint8_t *) &add_sta_params->supportedRates,
+	qdf_mem_copy((uint8_t *) &add_sta_params->supportedRates,
 		     (uint8_t *) &sta_ds->supportedRates,
 		     sizeof(tSirSupportedRates));
 
@@ -2496,7 +2496,7 @@
 
 		add_sta_params->p2pCapableSta = (p2p_ie != NULL);
 		if (assoc_req && add_sta_params->htCapable) {
-			cdf_mem_copy(&add_sta_params->ht_caps,
+			qdf_mem_copy(&add_sta_params->ht_caps,
 				     ((uint8_t *) &assoc_req->HTCaps) + 1,
 				     sizeof(add_sta_params->ht_caps));
 		}
@@ -2648,7 +2648,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("ADD_STA_REQ for aId %d failed (reason %X)"),
 			sta_ds->assocId, ret_code);
-		cdf_mem_free(add_sta_params);
+		qdf_mem_free(add_sta_params);
 	}
 
 	return ret_code;
@@ -2685,14 +2685,14 @@
 	tSirMsgQ msgQ;
 	tSirRetStatus retCode = eSIR_SUCCESS;
 
-	pDelStaParams = cdf_mem_malloc(sizeof(tDeleteStaParams));
+	pDelStaParams = qdf_mem_malloc(sizeof(tDeleteStaParams));
 	if (NULL == pDelStaParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during ADD_STA"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set((uint8_t *) pDelStaParams, sizeof(tDeleteStaParams), 0);
+	qdf_mem_set((uint8_t *) pDelStaParams, sizeof(tDeleteStaParams), 0);
 
 	/* */
 	/* DPH contains the STA index only for "peer" STA entries. */
@@ -2754,7 +2754,7 @@
 	pDelStaParams->smesessionId = psessionEntry->smeSessionId;
 
 	pDelStaParams->staType = pStaDs->staType;
-	cdf_mem_copy((uint8_t *) pDelStaParams->staMac,
+	qdf_mem_copy((uint8_t *) pDelStaParams->staMac,
 		     (uint8_t *) pStaDs->staAddr, sizeof(tSirMacAddr));
 
 	pDelStaParams->status = QDF_STATUS_SUCCESS;
@@ -2777,7 +2777,7 @@
 		lim_log(pMac, LOGE,
 			FL("Posting DELETE_STA_REQ to HAL failed, reason=%X"),
 			retCode);
-		cdf_mem_free(pDelStaParams);
+		qdf_mem_free(pDelStaParams);
 	}
 
 	return retCode;
@@ -2831,7 +2831,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Posting WMA_ADD_STA_REQ to HAL failed, reason=%X"),
 			ret_code);
-		cdf_mem_free(add_sta_params);
+		qdf_mem_free(add_sta_params);
 	}
 
 	session_entry->ftPEContext.pAddStaReq = NULL;
@@ -2891,19 +2891,19 @@
 
 	sir_copy_mac_addr(staMac, psessionEntry->selfMacAddr);
 	lim_log(pMac, LOG1, FL(MAC_ADDRESS_STR ": "), MAC_ADDR_ARRAY(staMac));
-	pAddStaParams = cdf_mem_malloc(sizeof(tAddStaParams));
+	pAddStaParams = qdf_mem_malloc(sizeof(tAddStaParams));
 	if (NULL == pAddStaParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during ADD_STA"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_set((uint8_t *) pAddStaParams, sizeof(tAddStaParams), 0);
+	qdf_mem_set((uint8_t *) pAddStaParams, sizeof(tAddStaParams), 0);
 
 	/* / Add STA context at MAC HW (BMU, RHP & TFP) */
-	cdf_mem_copy((uint8_t *) pAddStaParams->staMac,
+	qdf_mem_copy((uint8_t *) pAddStaParams->staMac,
 		     (uint8_t *) staMac, sizeof(tSirMacAddr));
 
-	cdf_mem_copy((uint8_t *) pAddStaParams->bssId,
+	qdf_mem_copy((uint8_t *) pAddStaParams->bssId,
 		     psessionEntry->bssId, sizeof(tSirMacAddr));
 
 	pAddStaParams->assocId = psessionEntry->limAID;
@@ -3132,7 +3132,7 @@
 		lim_log(pMac, LOGE,
 			FL("Posting WMA_ADD_STA_REQ to HAL failed, reason=%X"),
 			retCode);
-		cdf_mem_free(pAddStaParams);
+		qdf_mem_free(pAddStaParams);
 	}
 	return retCode;
 }
@@ -3257,7 +3257,7 @@
 	tpDphHashNode sta_ds;
 	tUpdateBeaconParams beacon_params;
 
-	cdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
+	qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
 	beacon_params.paramChangeBitmap = 0;
 	lim_deactivate_and_change_per_sta_id_timer(mac_ctx, eLIM_CNF_WAIT_TIMER,
 		 sta_id);
@@ -3352,7 +3352,7 @@
 	uint32_t total_num_noa_desc = 0;
 	uint32_t selfStaDot11Mode = 0;
 
-	cdf_mem_copy(current_ssid.ssId,
+	qdf_mem_copy(current_ssid.ssId,
 		     session_entry->ssId.ssId, session_entry->ssId.length);
 
 	current_ssid.length = (uint8_t) session_entry->ssId.length;
@@ -3364,7 +3364,7 @@
 	if (((SIR_MAC_MGMT_FRAME == header->fc.type) &&
 		(SIR_MAC_MGMT_PROBE_RSP == header->fc.subType)) &&
 		current_ssid.length &&
-		(!cdf_mem_compare((uint8_t *) &beacon_probe_rsp->ssId,
+		(qdf_mem_cmp((uint8_t *) &beacon_probe_rsp->ssId,
 				  (uint8_t *) &current_ssid,
 				  (uint8_t) (1 + current_ssid.length)))) {
 		/*
@@ -3506,7 +3506,7 @@
 					  uint16_t ieLen,
 					  tpSirProbeRespBeacon beaconStruct)
 {
-	cdf_mem_set((uint8_t *) beaconStruct, sizeof(tSirProbeRespBeacon), 0);
+	qdf_mem_set((uint8_t *) beaconStruct, sizeof(tSirProbeRespBeacon), 0);
 
 	PELOG3(lim_log(pMac, LOG3,
 		       FL
@@ -3556,13 +3556,13 @@
 	tSirMsgQ msgQ;
 	tSirRetStatus retCode = eSIR_SUCCESS;
 
-	pDelBssParams = cdf_mem_malloc(sizeof(tDeleteBssParams));
+	pDelBssParams = qdf_mem_malloc(sizeof(tDeleteBssParams));
 	if (NULL == pDelBssParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during ADD_BSS"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_set((uint8_t *) pDelBssParams, sizeof(tDeleteBssParams), 0);
+	qdf_mem_set((uint8_t *) pDelBssParams, sizeof(tDeleteBssParams), 0);
 
 	pDelBssParams->sessionId = psessionEntry->peSessionId; /* update PE session Id */
 
@@ -3588,7 +3588,7 @@
 
 	pDelBssParams->status = QDF_STATUS_SUCCESS;
 	pDelBssParams->respReqd = 1;
-	cdf_mem_copy(pDelBssParams->bssid, psessionEntry->bssId,
+	qdf_mem_copy(pDelBssParams->bssid, psessionEntry->bssId,
 		     sizeof(tSirMacAddr));
 	pDelBssParams->smesessionId = psessionEntry->smeSessionId;
 	PELOGW(lim_log
@@ -3614,7 +3614,7 @@
 		lim_log(pMac, LOGE,
 			FL("Posting DELETE_BSS_REQ to HAL failed, reason=%X"),
 			retCode);
-		cdf_mem_free(pDelBssParams);
+		qdf_mem_free(pDelBssParams);
 	}
 
 	return retCode;
@@ -3756,20 +3756,20 @@
 	tAddStaParams *sta_context;
 
 	/* Package SIR_HAL_ADD_BSS_REQ message parameters */
-	pAddBssParams = cdf_mem_malloc(sizeof(tAddBssParams));
+	pAddBssParams = qdf_mem_malloc(sizeof(tAddBssParams));
 	if (NULL == pAddBssParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during ADD_BSS"));
 		retCode = eSIR_MEM_ALLOC_FAILED;
 		goto returnFailure;
 	} else
-		cdf_mem_set((uint8_t *) pAddBssParams, sizeof(tAddBssParams),
+		qdf_mem_set((uint8_t *) pAddBssParams, sizeof(tAddBssParams),
 			    0);
 
-	cdf_mem_copy(pAddBssParams->bssId, bssDescription->bssId,
+	qdf_mem_copy(pAddBssParams->bssId, bssDescription->bssId,
 		     sizeof(tSirMacAddr));
 	/* Fill in tAddBssParams selfMacAddr */
-	cdf_mem_copy(pAddBssParams->selfMacAddr,
+	qdf_mem_copy(pAddBssParams->selfMacAddr,
 		     psessionEntry->selfMacAddr, sizeof(tSirMacAddr));
 
 	lim_log(pMac, LOG1,
@@ -3805,7 +3805,7 @@
 		pBeaconStruct->cfParamSet.cfpDurRemaining;
 
 	pAddBssParams->rateSet.numRates = pAssocRsp->supportedRates.numRates;
-	cdf_mem_copy(pAddBssParams->rateSet.rate,
+	qdf_mem_copy(pAddBssParams->rateSet.rate,
 		     pAssocRsp->supportedRates.rate,
 		     pAssocRsp->supportedRates.numRates);
 
@@ -3943,7 +3943,7 @@
 	/* Identifying AP as an STA */
 	pAddBssParams->staContext.staType = STA_ENTRY_OTHER;
 
-	cdf_mem_copy(pAddBssParams->staContext.bssId,
+	qdf_mem_copy(pAddBssParams->staContext.bssId,
 			bssDescription->bssId, sizeof(tSirMacAddr));
 	pAddBssParams->staContext.listenInterval =
 		bssDescription->beaconInterval;
@@ -4178,10 +4178,10 @@
 	if ((!pAddBssParams->staContext.wpa_rsn)
 			&& (psessionEntry->isOSENConnection))
 		pAddBssParams->staContext.wpa_rsn = 1;
-	cdf_mem_copy(&pAddBssParams->staContext.capab_info,
+	qdf_mem_copy(&pAddBssParams->staContext.capab_info,
 			&pAssocRsp->capabilityInfo,
 			sizeof(pAddBssParams->staContext.capab_info));
-	cdf_mem_copy(&pAddBssParams->staContext.ht_caps,
+	qdf_mem_copy(&pAddBssParams->staContext.ht_caps,
 			(uint8_t *) &pAssocRsp->HTCaps + sizeof(uint8_t),
 			sizeof(pAddBssParams->staContext.ht_caps));
 
@@ -4199,7 +4199,7 @@
 		lim_fill_supported_rates_info(pMac, pStaDs,
 				&pStaDs->supportedRates,
 				psessionEntry);
-		cdf_mem_copy((uint8_t *) &pAddBssParams->staContext.
+		qdf_mem_copy((uint8_t *) &pAddBssParams->staContext.
 				supportedRates,
 				(uint8_t *) &pStaDs->supportedRates,
 				sizeof(tSirSupportedRates));
@@ -4285,7 +4285,7 @@
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
 		SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
-		cdf_mem_free(pAddBssParams);
+		qdf_mem_free(pAddBssParams);
 		lim_log(pMac, LOGE,
 			FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"),
 			retCode);
@@ -4315,7 +4315,7 @@
 	tpSirBssDescription bssDescription =
 		&psessionEntry->pLimJoinReq->bssDescription;
 
-	pBeaconStruct = cdf_mem_malloc(sizeof(tSchBeaconStruct));
+	pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 	if (NULL == pBeaconStruct) {
 		lim_log(pMac, LOGE,
 			FL("Unable to allocate memory during ADD_BSS"));
@@ -4323,7 +4323,7 @@
 	}
 
 	/* Package SIR_HAL_ADD_BSS_REQ message parameters */
-	pAddBssParams = cdf_mem_malloc(sizeof(tAddBssParams));
+	pAddBssParams = qdf_mem_malloc(sizeof(tAddBssParams));
 	if (NULL == pAddBssParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during ADD_BSS"));
@@ -4331,7 +4331,7 @@
 		goto returnFailure;
 	}
 
-	cdf_mem_set((uint8_t *) pAddBssParams, sizeof(tAddBssParams), 0);
+	qdf_mem_set((uint8_t *) pAddBssParams, sizeof(tAddBssParams), 0);
 
 	lim_extract_ap_capabilities(pMac, (uint8_t *) bssDescription->ieFields,
 			lim_get_ielen_from_bss_description(bssDescription),
@@ -4341,11 +4341,11 @@
 	    WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE)
 		lim_decide_sta_protection_on_assoc(pMac, pBeaconStruct,
 						   psessionEntry);
-	cdf_mem_copy(pAddBssParams->bssId, bssDescription->bssId,
+	qdf_mem_copy(pAddBssParams->bssId, bssDescription->bssId,
 		     sizeof(tSirMacAddr));
 
 	/* Fill in tAddBssParams selfMacAddr */
-	cdf_mem_copy(pAddBssParams->selfMacAddr,
+	qdf_mem_copy(pAddBssParams->selfMacAddr,
 		     psessionEntry->selfMacAddr, sizeof(tSirMacAddr));
 	lim_log(pMac, LOG1,
 		FL("sessionid: %d updateEntry = %d limsystemrole = %d "),
@@ -4377,7 +4377,7 @@
 
 	pAddBssParams->rateSet.numRates =
 		pBeaconStruct->supportedRates.numRates;
-	cdf_mem_copy(pAddBssParams->rateSet.rate,
+	qdf_mem_copy(pAddBssParams->rateSet.rate,
 		     pBeaconStruct->supportedRates.rate,
 		     pBeaconStruct->supportedRates.numRates);
 
@@ -4522,7 +4522,7 @@
 	/* Identifying AP as an STA */
 	pAddBssParams->staContext.staType = STA_ENTRY_OTHER;
 
-	cdf_mem_copy(pAddBssParams->staContext.bssId,
+	qdf_mem_copy(pAddBssParams->staContext.bssId,
 			bssDescription->bssId, sizeof(tSirMacAddr));
 	pAddBssParams->staContext.listenInterval =
 		bssDescription->beaconInterval;
@@ -4805,20 +4805,20 @@
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
 		SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
-		cdf_mem_free(pAddBssParams);
+		qdf_mem_free(pAddBssParams);
 		lim_log(pMac, LOGE,
 			FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"),
 			retCode);
 		goto returnFailure;
 
 	} else {
-		cdf_mem_free(pBeaconStruct);
+		qdf_mem_free(pBeaconStruct);
 		return retCode;
 	}
 
 returnFailure:
 	/* Clean-up will be done by the caller... */
-	cdf_mem_free(pBeaconStruct);
+	qdf_mem_free(pBeaconStruct);
 	return retCode;
 }
 
@@ -4849,7 +4849,7 @@
 		return;
 	}
 	staDsAssocId = pStaDs->assocId;
-	cdf_mem_copy((uint8_t *) sta_dsaddr.bytes,
+	qdf_mem_copy((uint8_t *) sta_dsaddr.bytes,
 		     pStaDs->staAddr, QDF_MAC_ADDR_SIZE);
 
 	mlmStaContext = pStaDs->mlmStaContext;
@@ -5088,19 +5088,19 @@
 
 	length = sizeof(tSirSmeUnprotMgmtFrameInd) + frameLen;
 
-	pSirSmeMgmtFrame = cdf_mem_malloc(length);
+	pSirSmeMgmtFrame = qdf_mem_malloc(length);
 	if (NULL == pSirSmeMgmtFrame) {
 		lim_log(pMac, LOGP,
 			FL
 				("AllocateMemory failed for tSirSmeUnprotectedMgmtFrameInd"));
 		return;
 	}
-	cdf_mem_set((void *)pSirSmeMgmtFrame, length, 0);
+	qdf_mem_set((void *)pSirSmeMgmtFrame, length, 0);
 
 	pSirSmeMgmtFrame->sessionId = sessionId;
 	pSirSmeMgmtFrame->frameType = frameType;
 
-	cdf_mem_copy(pSirSmeMgmtFrame->frameBuf, frame, frameLen);
+	qdf_mem_copy(pSirSmeMgmtFrame->frameBuf, frame, frameLen);
 	pSirSmeMgmtFrame->frameLen = frameLen;
 
 	mmhMsg.type = eWNI_SME_UNPROT_MGMT_FRM_IND;
@@ -5132,13 +5132,13 @@
 	if (!pMac || !psessionEntry)
 		return;
 
-	pSirSmeTsmIeInd = cdf_mem_malloc(sizeof(tSirSmeTsmIEInd));
+	pSirSmeTsmIeInd = qdf_mem_malloc(sizeof(tSirSmeTsmIEInd));
 	if (NULL == pSirSmeTsmIeInd) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for tSirSmeTsmIEInd"));
 		return;
 	}
-	cdf_mem_set((void *)pSirSmeTsmIeInd, sizeof(tSirSmeTsmIEInd), 0);
+	qdf_mem_set((void *)pSirSmeTsmIeInd, sizeof(tSirSmeTsmIEInd), 0);
 
 	pSirSmeTsmIeInd->sessionId = psessionEntry->smeSessionId;
 	pSirSmeTsmIeInd->tsmIe.tsid = tid;
diff --git a/core/mac/src/pe/lim/lim_assoc_utils.h b/core/mac/src/pe/lim/lim_assoc_utils.h
index 8b6df1c..941513b 100644
--- a/core/mac/src/pe/lim/lim_assoc_utils.h
+++ b/core/mac/src/pe/lim/lim_assoc_utils.h
@@ -45,7 +45,7 @@
 
 #include "lim_types.h"
 
-bool lim_cmp_ssid(tSirMacSSid *, tpPESession);
+uint32_t lim_cmp_ssid(tSirMacSSid *, tpPESession);
 uint8_t lim_compare_capabilities(tpAniSirGlobal,
 				 tSirAssocReq *,
 				 tSirMacCapabilityInfo *, tpPESession);
diff --git a/core/mac/src/pe/lim/lim_ft.c b/core/mac/src/pe/lim/lim_ft.c
index 2122371..ee01162 100644
--- a/core/mac/src/pe/lim/lim_ft.c
+++ b/core/mac/src/pe/lim/lim_ft.c
@@ -61,7 +61,7 @@
 void lim_ft_open(tpAniSirGlobal pMac, tpPESession psessionEntry)
 {
 	if (psessionEntry)
-		cdf_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext),
+		qdf_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext),
 			    0);
 }
 
@@ -95,27 +95,27 @@
 			       psessionEntry->ftPEContext.pFTPreAuthReq);
 		if (psessionEntry->ftPEContext.pFTPreAuthReq->
 		    pbssDescription) {
-			cdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq->
+			qdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq->
 				     pbssDescription);
 			psessionEntry->ftPEContext.pFTPreAuthReq->
 			pbssDescription = NULL;
 		}
-		cdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq);
+		qdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq);
 		psessionEntry->ftPEContext.pFTPreAuthReq = NULL;
 	}
 
 	if (psessionEntry->ftPEContext.pAddBssReq) {
-		cdf_mem_free(psessionEntry->ftPEContext.pAddBssReq);
+		qdf_mem_free(psessionEntry->ftPEContext.pAddBssReq);
 		psessionEntry->ftPEContext.pAddBssReq = NULL;
 	}
 
 	if (psessionEntry->ftPEContext.pAddStaReq) {
-		cdf_mem_free(psessionEntry->ftPEContext.pAddStaReq);
+		qdf_mem_free(psessionEntry->ftPEContext.pAddStaReq);
 		psessionEntry->ftPEContext.pAddStaReq = NULL;
 	}
 
 	/* The session is being deleted, cleanup the contents */
-	cdf_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0);
+	qdf_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0);
 
 	/* Delete the session created while handling pre-auth response */
 	if (pReAssocSessionEntry) {
@@ -166,27 +166,27 @@
 		if (NULL !=
 		    psessionEntry->ftPEContext.pFTPreAuthReq->
 		    pbssDescription) {
-			cdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq->
+			qdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq->
 				     pbssDescription);
 			psessionEntry->ftPEContext.pFTPreAuthReq->
 			pbssDescription = NULL;
 		}
-		cdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq);
+		qdf_mem_free(psessionEntry->ftPEContext.pFTPreAuthReq);
 		psessionEntry->ftPEContext.pFTPreAuthReq = NULL;
 	}
 
 	if (psessionEntry->ftPEContext.pAddBssReq) {
-		cdf_mem_free(psessionEntry->ftPEContext.pAddBssReq);
+		qdf_mem_free(psessionEntry->ftPEContext.pAddBssReq);
 		psessionEntry->ftPEContext.pAddBssReq = NULL;
 	}
 
 	if (psessionEntry->ftPEContext.pAddStaReq) {
-		cdf_mem_free(psessionEntry->ftPEContext.pAddStaReq);
+		qdf_mem_free(psessionEntry->ftPEContext.pAddStaReq);
 		psessionEntry->ftPEContext.pAddStaReq = NULL;
 	}
 
 	/* The session is being deleted, cleanup the contents */
-	cdf_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0);
+	qdf_mem_set(&psessionEntry->ftPEContext, sizeof(tftPEContext), 0);
 }
 
 /*
@@ -248,12 +248,12 @@
 	/* Indicate that this is the session on which preauth is being done */
 	if (session->ftPEContext.pFTPreAuthReq) {
 		if (session->ftPEContext.pFTPreAuthReq->pbssDescription) {
-			cdf_mem_free(
+			qdf_mem_free(
 			  session->ftPEContext.pFTPreAuthReq->pbssDescription);
 			session->ftPEContext.pFTPreAuthReq->pbssDescription =
 									NULL;
 		}
-		cdf_mem_free(session->ftPEContext.pFTPreAuthReq);
+		qdf_mem_free(session->ftPEContext.pFTPreAuthReq);
 		session->ftPEContext.pFTPreAuthReq = NULL;
 	}
 
@@ -392,22 +392,22 @@
 		return eSIR_FAILURE;
 	}
 
-	pBeaconStruct = cdf_mem_malloc(sizeof(tSchBeaconStruct));
+	pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 	if (NULL == pBeaconStruct) {
 		lim_log(pMac, LOGE,
 			FL("Unable to allocate memory for creating ADD_BSS"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 	/* Package SIR_HAL_ADD_BSS_REQ message parameters */
-	pAddBssParams = cdf_mem_malloc(sizeof(tAddBssParams));
+	pAddBssParams = qdf_mem_malloc(sizeof(tAddBssParams));
 	if (NULL == pAddBssParams) {
-		cdf_mem_free(pBeaconStruct);
+		qdf_mem_free(pBeaconStruct);
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory for creating ADD_BSS"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set((uint8_t *) pAddBssParams, sizeof(tAddBssParams), 0);
+	qdf_mem_set((uint8_t *) pAddBssParams, sizeof(tAddBssParams), 0);
 
 	lim_extract_ap_capabilities(pMac, (uint8_t *) bssDescription->ieFields,
 			lim_get_ielen_from_bss_description(bssDescription),
@@ -418,11 +418,11 @@
 		lim_decide_sta_protection_on_assoc(pMac, pBeaconStruct,
 						   pftSessionEntry);
 
-	cdf_mem_copy(pAddBssParams->bssId, bssDescription->bssId,
+	qdf_mem_copy(pAddBssParams->bssId, bssDescription->bssId,
 		     sizeof(tSirMacAddr));
 
 	/* Fill in tAddBssParams selfMacAddr */
-	cdf_mem_copy(pAddBssParams->selfMacAddr, pftSessionEntry->selfMacAddr,
+	qdf_mem_copy(pAddBssParams->selfMacAddr, pftSessionEntry->selfMacAddr,
 		     sizeof(tSirMacAddr));
 
 	pAddBssParams->bssType = pftSessionEntry->bssType;
@@ -445,7 +445,7 @@
 
 	pAddBssParams->rateSet.numRates =
 		pBeaconStruct->supportedRates.numRates;
-	cdf_mem_copy(pAddBssParams->rateSet.rate,
+	qdf_mem_copy(pAddBssParams->rateSet.rate,
 		     pBeaconStruct->supportedRates.rate,
 		     pBeaconStruct->supportedRates.numRates);
 
@@ -469,10 +469,10 @@
 	if (IS_DOT11_MODE_HT(pftSessionEntry->dot11mode) &&
 	    (pBeaconStruct->HTCaps.present)) {
 		pAddBssParams->htCapable = pBeaconStruct->HTCaps.present;
-		cdf_mem_copy(&pAddBssParams->staContext.capab_info,
+		qdf_mem_copy(&pAddBssParams->staContext.capab_info,
 			     &pBeaconStruct->capabilityInfo,
 			     sizeof(pAddBssParams->staContext.capab_info));
-		cdf_mem_copy(&pAddBssParams->staContext.ht_caps,
+		qdf_mem_copy(&pAddBssParams->staContext.ht_caps,
 			     (uint8_t *) &pBeaconStruct->HTCaps +
 			     sizeof(uint8_t),
 			     sizeof(pAddBssParams->staContext.ht_caps));
@@ -584,7 +584,7 @@
 	{
 		pAddBssParams->staContext.staType = STA_ENTRY_OTHER;
 
-		cdf_mem_copy(pAddBssParams->staContext.bssId,
+		qdf_mem_copy(pAddBssParams->staContext.bssId,
 			     bssDescription->bssId, sizeof(tSirMacAddr));
 		pAddBssParams->staContext.listenInterval =
 			bssDescription->beaconInterval;
@@ -748,7 +748,7 @@
 
 	lim_log(pMac, LOG1, FL("Saving SIR_HAL_ADD_BSS_REQ for pre-auth ap..."));
 
-	cdf_mem_free(pBeaconStruct);
+	qdf_mem_free(pBeaconStruct);
 	return 0;
 }
 
@@ -769,7 +769,7 @@
 	uint32_t selfDot11Mode;
 	ePhyChanBondState cbEnabledMode;
 
-	pBeaconStruct = cdf_mem_malloc(sizeof(tSchBeaconStruct));
+	pBeaconStruct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 	if (NULL == pBeaconStruct) {
 		lim_log(pMac, LOGE,
 			FL("No memory for creating lim_fill_ft_session"));
@@ -795,18 +795,18 @@
 
 	pftSessionEntry->rateSet.numRates =
 		pBeaconStruct->supportedRates.numRates;
-	cdf_mem_copy(pftSessionEntry->rateSet.rate,
+	qdf_mem_copy(pftSessionEntry->rateSet.rate,
 		     pBeaconStruct->supportedRates.rate,
 		     pBeaconStruct->supportedRates.numRates);
 
 	pftSessionEntry->extRateSet.numRates =
 		pBeaconStruct->extendedRates.numRates;
-	cdf_mem_copy(pftSessionEntry->extRateSet.rate,
+	qdf_mem_copy(pftSessionEntry->extRateSet.rate,
 		     pBeaconStruct->extendedRates.rate,
 		     pftSessionEntry->extRateSet.numRates);
 
 	pftSessionEntry->ssId.length = pBeaconStruct->ssId.length;
-	cdf_mem_copy(pftSessionEntry->ssId.ssId, pBeaconStruct->ssId.ssId,
+	qdf_mem_copy(pftSessionEntry->ssId.ssId, pBeaconStruct->ssId.ssId,
 		     pftSessionEntry->ssId.length);
 
 	wlan_cfg_get_int(pMac, WNI_CFG_DOT11_MODE, &selfDot11Mode);
@@ -962,7 +962,7 @@
 	pftSessionEntry->limRmfEnabled = psessionEntry->limRmfEnabled;
 #endif
 
-	cdf_mem_free(pBeaconStruct);
+	qdf_mem_free(pBeaconStruct);
 }
 
 /*------------------------------------------------------------------
@@ -1059,13 +1059,13 @@
 	tSirMsgQ mmh_msg;
 	uint16_t rsp_len = sizeof(tSirFTPreAuthRsp);
 
-	ft_pre_auth_rsp = (tpSirFTPreAuthRsp) cdf_mem_malloc(rsp_len);
+	ft_pre_auth_rsp = (tpSirFTPreAuthRsp) qdf_mem_malloc(rsp_len);
 	if (NULL == ft_pre_auth_rsp) {
 		lim_log(mac_ctx, LOGE, "Failed to allocate memory");
 		QDF_ASSERT(ft_pre_auth_rsp != NULL);
 		return;
 	}
-	cdf_mem_zero(ft_pre_auth_rsp, rsp_len);
+	qdf_mem_zero(ft_pre_auth_rsp, rsp_len);
 
 	lim_log(mac_ctx, LOG1, FL("Auth Rsp = %p"), ft_pre_auth_rsp);
 	if (session) {
@@ -1073,7 +1073,7 @@
 		if (!LIM_IS_STA_ROLE(session)) {
 			lim_log(mac_ctx, LOGE,
 				FL("session is not in STA mode"));
-			cdf_mem_free(ft_pre_auth_rsp);
+			qdf_mem_free(ft_pre_auth_rsp);
 			return;
 		}
 		ft_pre_auth_rsp->smeSessionId = session->smeSessionId;
@@ -1091,7 +1091,7 @@
 	ft_pre_auth_rsp->ft_ies_length = 0;
 	if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) {
 		/* Only 11r assoc has FT IEs */
-		cdf_mem_copy(ft_pre_auth_rsp->ft_ies,
+		qdf_mem_copy(ft_pre_auth_rsp->ft_ies,
 			     auth_rsp, auth_rsp_length);
 		ft_pre_auth_rsp->ft_ies_length = auth_rsp_length;
 	}
@@ -1154,7 +1154,7 @@
 	 */
 	psessionEntry->ftPEContext.saved_auth_rsp_length = 0;
 	if ((auth_rsp != NULL) && (auth_rsp_length < MAX_FTIE_SIZE)) {
-		cdf_mem_copy(psessionEntry->ftPEContext.saved_auth_rsp,
+		qdf_mem_copy(psessionEntry->ftPEContext.saved_auth_rsp,
 			     auth_rsp, auth_rsp_length);
 		psessionEntry->ftPEContext.saved_auth_rsp_length =
 			auth_rsp_length;
@@ -1199,7 +1199,7 @@
 			lim_log(pMac, LOGE, FL("Invalid bss type"));
 		}
 		pftSessionEntry->limPrevSmeState = pftSessionEntry->limSmeState;
-		cdf_mem_copy(&(pftSessionEntry->htConfig),
+		qdf_mem_copy(&(pftSessionEntry->htConfig),
 			     &(psessionEntry->htConfig),
 			     sizeof(psessionEntry->htConfig));
 		pftSessionEntry->limSmeState = eLIM_SME_WT_REASSOC_STATE;
@@ -1270,14 +1270,14 @@
 		lim_log(pMac, LOGE, FL("pAddBssReq is NULL"));
 		return;
 	}
-	pMlmReassocReq = cdf_mem_malloc(sizeof(tLimMlmReassocReq));
+	pMlmReassocReq = qdf_mem_malloc(sizeof(tLimMlmReassocReq));
 	if (NULL == pMlmReassocReq) {
 		lim_log(pMac, LOGE,
 			FL("call to AllocateMemory failed for mlmReassocReq"));
 		return;
 	}
 
-	cdf_mem_copy(pMlmReassocReq->peerMacAddr,
+	qdf_mem_copy(pMlmReassocReq->peerMacAddr,
 		     psessionEntry->bssId, sizeof(tSirMacAddr));
 
 	if (wlan_cfg_get_int(pMac, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
@@ -1289,7 +1289,7 @@
 		 */
 		lim_log(pMac, LOGE,
 			FL("could not retrieve ReassocFailureTimeout value"));
-		cdf_mem_free(pMlmReassocReq);
+		qdf_mem_free(pMlmReassocReq);
 		return;
 	}
 
@@ -1299,7 +1299,7 @@
 		 * from CFG. Log error.
 		 */
 		lim_log(pMac, LOGE, FL("could not retrieve Capabilities value"));
-		cdf_mem_free(pMlmReassocReq);
+		qdf_mem_free(pMlmReassocReq);
 		return;
 	}
 	pMlmReassocReq->capabilityInfo = caps;
@@ -1314,7 +1314,7 @@
 	    eSIR_SUCCESS) {
 		lim_log(pMac, LOGP,
 			FL("Couldn't get WNI_CFG_TELE_BCN_WAKEUP_EN"));
-		cdf_mem_free(pMlmReassocReq);
+		qdf_mem_free(pMlmReassocReq);
 		return;
 	}
 
@@ -1327,7 +1327,7 @@
 			 */
 			lim_log(pMac, LOGE,
 				FL("could not retrieve ListenInterval"));
-			cdf_mem_free(pMlmReassocReq);
+			qdf_mem_free(pMlmReassocReq);
 			return;
 		}
 	} else {
@@ -1339,14 +1339,14 @@
 			 */
 			lim_log(pMac, LOGE,
 				FL("could not retrieve ListenInterval"));
-			cdf_mem_free(pMlmReassocReq);
+			qdf_mem_free(pMlmReassocReq);
 			return;
 		}
 	}
 	if (lim_set_link_state
 		    (pMac, eSIR_LINK_PREASSOC_STATE, psessionEntry->bssId,
 		    psessionEntry->selfMacAddr, NULL, NULL) != eSIR_SUCCESS) {
-		cdf_mem_free(pMlmReassocReq);
+		qdf_mem_free(pMlmReassocReq);
 		return;
 	}
 
@@ -1365,7 +1365,7 @@
 	MTRACE(mac_trace_msg_tx(pMac, psessionEntry->peSessionId, msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(psessionEntry->ftPEContext.pAddBssReq);
+		qdf_mem_free(psessionEntry->ftPEContext.pAddBssReq);
 		lim_log(pMac, LOGE,
 			FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"),
 			retCode);
@@ -1493,14 +1493,14 @@
 			&psessionEntry->ftPEContext.PreAuthKeyInfo.
 			extSetStaKeyParam;
 
-		cdf_mem_zero(pMlmSetKeysReq, sizeof(tLimMlmSetKeysReq));
+		qdf_mem_zero(pMlmSetKeysReq, sizeof(tLimMlmSetKeysReq));
 		qdf_copy_macaddr(&pMlmSetKeysReq->peer_macaddr,
 				 &pKeyInfo->bssid);
 		pMlmSetKeysReq->sessionId = psessionEntry->peSessionId;
 		pMlmSetKeysReq->smesessionId = psessionEntry->smeSessionId;
 		pMlmSetKeysReq->edType = pKeyInfo->keyMaterial.edType;
 		pMlmSetKeysReq->numKeys = pKeyInfo->keyMaterial.numKeys;
-		cdf_mem_copy((uint8_t *) &pMlmSetKeysReq->key,
+		qdf_mem_copy((uint8_t *) &pMlmSetKeysReq->key,
 			     (uint8_t *) &pKeyInfo->keyMaterial.key,
 			     sizeof(tSirKeys));
 
@@ -1523,7 +1523,7 @@
 		pAddBssParams->extSetStaKeyParamValid = 1;
 		pAddBssParams->extSetStaKeyParam.encType =
 			pKeyInfo->keyMaterial.edType;
-		cdf_mem_copy((uint8_t *) &pAddBssParams->extSetStaKeyParam.key,
+		qdf_mem_copy((uint8_t *) &pAddBssParams->extSetStaKeyParam.key,
 			     (uint8_t *) &pKeyInfo->keyMaterial.key,
 			     sizeof(tSirKeys));
 		if (eSIR_SUCCESS !=
@@ -1602,13 +1602,13 @@
 	if (!rspReqd) {
 		return;
 	}
-	rsp = cdf_mem_malloc(sizeof(tSirAggrQosRsp));
+	rsp = qdf_mem_malloc(sizeof(tSirAggrQosRsp));
 	if (NULL == rsp) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for tSirAggrQosRsp"));
 		return;
 	}
-	cdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
+	qdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
 	rsp->messageType = eWNI_SME_FT_AGGR_QOS_RSP;
 	rsp->sessionId = smesessionId;
 	rsp->length = sizeof(*rsp);
@@ -1646,7 +1646,7 @@
 			       FL("Cant find session entry for %s"), __func__);
 		       )
 		if (pAggrQosRspMsg != NULL) {
-			cdf_mem_free(pAggrQosRspMsg);
+			qdf_mem_free(pAggrQosRspMsg);
 		}
 		return;
 	}
@@ -1681,7 +1681,7 @@
 	lim_ft_send_aggr_qos_rsp(pMac, rspReqd, pAggrQosRspMsg,
 				 psessionEntry->smeSessionId);
 	if (pAggrQosRspMsg != NULL) {
-		cdf_mem_free(pAggrQosRspMsg);
+		qdf_mem_free(pAggrQosRspMsg);
 	}
 	return;
 }
@@ -1698,7 +1698,7 @@
 	uint8_t sessionId;
 	int i;
 
-	pAggrAddTsParam = cdf_mem_malloc(sizeof(tAggrAddTsParams));
+	pAggrAddTsParam = qdf_mem_malloc(sizeof(tAggrAddTsParams));
 	if (NULL == pAggrAddTsParam) {
 		PELOGE(lim_log(pMac, LOGE, FL("AllocateMemory() failed"));)
 		return eSIR_MEM_ALLOC_FAILED;
@@ -1713,14 +1713,14 @@
 			       FL("psession Entry Null for sessionId = %d"),
 			       aggrQosReq->sessionId);
 		       )
-		cdf_mem_free(pAggrAddTsParam);
+		qdf_mem_free(pAggrAddTsParam);
 		return eSIR_FAILURE;
 	}
 
 	/* Nothing to be done if the session is not in STA mode */
 	if (!LIM_IS_STA_ROLE(psessionEntry)) {
 		lim_log(pMac, LOGE, FL("psessionEntry is not in STA mode"));
-		cdf_mem_free(pAggrAddTsParam);
+		qdf_mem_free(pAggrAddTsParam);
 		return eSIR_FAILURE;
 	}
 
@@ -1731,11 +1731,11 @@
 			       FL
 				       ("Station context not found - ignoring AddTsRsp"));
 		       )
-		cdf_mem_free(pAggrAddTsParam);
+		qdf_mem_free(pAggrAddTsParam);
 		return eSIR_FAILURE;
 	}
 
-	cdf_mem_set((uint8_t *) pAggrAddTsParam, sizeof(tAggrAddTsParams), 0);
+	qdf_mem_set((uint8_t *) pAggrAddTsParam, sizeof(tAggrAddTsParams), 0);
 	pAggrAddTsParam->staIdx = psessionEntry->staId;
 	/* Fill in the sessionId specific to PE */
 	pAggrAddTsParam->sessionId = sessionId;
@@ -1815,7 +1815,7 @@
 						       ("Adding entry in lim Tspec Table failed "));
 				       )
 				pMac->lim.gLimAddtsSent = false;
-				cdf_mem_free(pAggrAddTsParam);
+				qdf_mem_free(pAggrAddTsParam);
 				return eSIR_FAILURE;
 			}
 
@@ -1845,7 +1845,7 @@
 				       (pMac, LOGW, FL("wma_post_ctrl_msg() failed"));
 			       )
 			SET_LIM_PROCESS_DEFD_MESGS(pMac, true);
-			cdf_mem_free(pAggrAddTsParam);
+			qdf_mem_free(pAggrAddTsParam);
 			return eSIR_FAILURE;
 		}
 	}
@@ -1859,7 +1859,7 @@
 		lim_ft_send_aggr_qos_rsp(pMac, true, pAggrAddTsParam,
 					 psessionEntry->smeSessionId);
 		if (pAggrAddTsParam != NULL) {
-			cdf_mem_free(pAggrAddTsParam);
+			qdf_mem_free(pAggrAddTsParam);
 		}
 	}
 #endif
@@ -1887,24 +1887,24 @@
 	tSirRetStatus rc = eSIR_SUCCESS;
 	tSirMsgQ msg;
 
-	scan_offload_req = cdf_mem_malloc(sizeof(tSirScanOffloadReq));
+	scan_offload_req = qdf_mem_malloc(sizeof(tSirScanOffloadReq));
 	if (NULL == scan_offload_req) {
 		lim_log(mac_ctx, LOGE,
 			FL("Memory allocation failed for pScanOffloadReq"));
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	cdf_mem_zero(scan_offload_req, sizeof(tSirScanOffloadReq));
+	qdf_mem_zero(scan_offload_req, sizeof(tSirScanOffloadReq));
 
 	msg.type = WMA_START_SCAN_OFFLOAD_REQ;
 	msg.bodyptr = scan_offload_req;
 	msg.bodyval = 0;
 
-	cdf_mem_copy((uint8_t *) &scan_offload_req->selfMacAddr.bytes,
+	qdf_mem_copy((uint8_t *) &scan_offload_req->selfMacAddr.bytes,
 		     (uint8_t *) ft_preauth_req->self_mac_addr,
 		     sizeof(tSirMacAddr));
 
-	cdf_mem_copy((uint8_t *) &scan_offload_req->bssId.bytes,
+	qdf_mem_copy((uint8_t *) &scan_offload_req->bssId.bytes,
 		     (uint8_t *) ft_preauth_req->currbssId,
 		     sizeof(tSirMacAddr));
 	scan_offload_req->scanType = eSIR_PASSIVE_SCAN;
@@ -1932,7 +1932,7 @@
 	rc = wma_post_ctrl_msg(mac_ctx, &msg);
 	if (rc != eSIR_SUCCESS) {
 		lim_log(mac_ctx, LOGE, FL("START_SCAN_OFFLOAD failed %u"), rc);
-		cdf_mem_free(scan_offload_req);
+		qdf_mem_free(scan_offload_req);
 		return QDF_STATUS_E_FAILURE;
 	}
 
diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
index 697532d..a8c2680 100644
--- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
+++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
@@ -68,7 +68,7 @@
 	tLimIbssPeerNode *pTempNode = pMac->lim.gLimIbssPeerList;
 
 	while (pTempNode != NULL) {
-		if (cdf_mem_compare((uint8_t *) macAddr,
+		if (!qdf_mem_cmp((uint8_t *) macAddr,
 				    (uint8_t *) &pTempNode->peerMacAddr,
 				    sizeof(tSirMacAddr)))
 			break;
@@ -115,10 +115,10 @@
 			pTemp = pTemp->next;
 		}
 		if (pTemp->beacon) {
-			cdf_mem_free(pTemp->beacon);
+			qdf_mem_free(pTemp->beacon);
 		}
 
-		cdf_mem_free(pTemp);
+		qdf_mem_free(pTemp);
 		pPrev->next = NULL;
 	} else
 #endif
@@ -158,7 +158,7 @@
 		  tpSirMacMgmtHdr pHdr,
 		  tLimIbssPeerNode *pPeer, tpPESession psessionEntry)
 {
-	cdf_mem_copy(pPeer->peerMacAddr, pHdr->sa, sizeof(tSirMacAddr));
+	qdf_mem_copy(pPeer->peerMacAddr, pHdr->sa, sizeof(tSirMacAddr));
 
 	pPeer->capabilityInfo = pBeacon->capabilityInfo;
 	pPeer->extendedRatesPresent = pBeacon->extendedRatesPresent;
@@ -174,7 +174,7 @@
 	if (IS_DOT11_MODE_HT(psessionEntry->dot11mode) &&
 	    (pBeacon->HTCaps.present)) {
 		pPeer->htCapable = pBeacon->HTCaps.present;
-		cdf_mem_copy((uint8_t *) pPeer->supportedMCSSet,
+		qdf_mem_copy((uint8_t *) pPeer->supportedMCSSet,
 			     (uint8_t *) pBeacon->HTCaps.supportedMCSSet,
 			     sizeof(pPeer->supportedMCSSet));
 		pPeer->htGreenfield = (uint8_t) pBeacon->HTCaps.greenField;
@@ -203,18 +203,18 @@
 		pPeer->vhtCapable = pBeacon->VHTCaps.present;
 
 		/* Collect VHT capabilities from beacon */
-		cdf_mem_copy((uint8_t *) &pPeer->VHTCaps,
+		qdf_mem_copy((uint8_t *) &pPeer->VHTCaps,
 			     (uint8_t *) &pBeacon->VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 	}
 #endif
 	pPeer->erpIePresent = pBeacon->erpPresent;
 
-	cdf_mem_copy((uint8_t *) &pPeer->supportedRates,
+	qdf_mem_copy((uint8_t *) &pPeer->supportedRates,
 		     (uint8_t *) &pBeacon->supportedRates,
 		     pBeacon->supportedRates.numRates + 1);
 	if (pPeer->extendedRatesPresent)
-		cdf_mem_copy((uint8_t *) &pPeer->extendedRates,
+		qdf_mem_copy((uint8_t *) &pPeer->extendedRates,
 			     (uint8_t *) &pBeacon->extendedRates,
 			     pBeacon->extendedRates.numRates + 1);
 	else
@@ -380,9 +380,9 @@
 static void ibss_coalesce_free(tpAniSirGlobal pMac)
 {
 	if (pMac->lim.ibssInfo.pHdr != NULL)
-		cdf_mem_free(pMac->lim.ibssInfo.pHdr);
+		qdf_mem_free(pMac->lim.ibssInfo.pHdr);
 	if (pMac->lim.ibssInfo.pBeacon != NULL)
-		cdf_mem_free(pMac->lim.ibssInfo.pBeacon);
+		qdf_mem_free(pMac->lim.ibssInfo.pBeacon);
 
 	pMac->lim.ibssInfo.pHdr = NULL;
 	pMac->lim.ibssInfo.pBeacon = NULL;
@@ -398,12 +398,12 @@
 	/* get rid of any saved info */
 	ibss_coalesce_free(pMac);
 
-	pMac->lim.ibssInfo.pHdr = cdf_mem_malloc(sizeof(*pHdr));
+	pMac->lim.ibssInfo.pHdr = qdf_mem_malloc(sizeof(*pHdr));
 	if (NULL == pMac->lim.ibssInfo.pHdr) {
 		PELOGE(lim_log(pMac, LOGE, FL("ibbs-save: Failed malloc pHdr"));)
 		return;
 	}
-	pMac->lim.ibssInfo.pBeacon = cdf_mem_malloc(sizeof(*pBeacon));
+	pMac->lim.ibssInfo.pBeacon = qdf_mem_malloc(sizeof(*pBeacon));
 	if (NULL == pMac->lim.ibssInfo.pBeacon) {
 		PELOGE(lim_log
 			       (pMac, LOGE, FL("ibbs-save: Failed malloc pBeacon"));
@@ -412,8 +412,8 @@
 		return;
 	}
 
-	cdf_mem_copy(pMac->lim.ibssInfo.pHdr, pHdr, sizeof(*pHdr));
-	cdf_mem_copy(pMac->lim.ibssInfo.pBeacon, pBeacon, sizeof(*pBeacon));
+	qdf_mem_copy(pMac->lim.ibssInfo.pHdr, pHdr, sizeof(*pHdr));
+	qdf_mem_copy(pMac->lim.ibssInfo.pBeacon, pBeacon, sizeof(*pBeacon));
 }
 
 /*
@@ -502,7 +502,7 @@
 				   beacon, bcnLen, status, sessionId);
 
 	if (beacon != NULL) {
-		cdf_mem_free(beacon);
+		qdf_mem_free(beacon);
 	}
 }
 
@@ -523,7 +523,7 @@
 		return;
 	}
 
-	cdf_mem_copy(psessionEntry->bssId, pHdr->bssId, sizeof(tSirMacAddr));
+	qdf_mem_copy(psessionEntry->bssId, pHdr->bssId, sizeof(tSirMacAddr));
 
 	sir_copy_mac_addr(pHdr->bssId, psessionEntry->bssId);
 
@@ -544,7 +544,7 @@
 		psessionEntry->shortSlotTimeSupported =
 			pBeacon->capabilityInfo.shortSlotTime;
 	}
-	cdf_mem_copy((uint8_t *) &psessionEntry->pLimStartBssReq->
+	qdf_mem_copy((uint8_t *) &psessionEntry->pLimStartBssReq->
 		     operationalRateSet, (uint8_t *) &pBeacon->supportedRates,
 		     pBeacon->supportedRates.numRates);
 
@@ -575,12 +575,12 @@
 	 * even though all the nodes are capable of doing CB.
 	 * so it is decided to leave the self HT capabilties intact. This may change if some issues are found in interop.
 	 */
-	cdf_mem_set((void *)&mlmStartReq, sizeof(mlmStartReq), 0);
+	qdf_mem_set((void *)&mlmStartReq, sizeof(mlmStartReq), 0);
 
-	cdf_mem_copy(mlmStartReq.bssId, pHdr->bssId, sizeof(tSirMacAddr));
+	qdf_mem_copy(mlmStartReq.bssId, pHdr->bssId, sizeof(tSirMacAddr));
 	mlmStartReq.rateSet.numRates =
 		psessionEntry->pLimStartBssReq->operationalRateSet.numRates;
-	cdf_mem_copy(&mlmStartReq.rateSet.rate[0],
+	qdf_mem_copy(&mlmStartReq.rateSet.rate[0],
 		     &psessionEntry->pLimStartBssReq->operationalRateSet.
 		     rate[0], mlmStartReq.rateSet.numRates);
 	mlmStartReq.bssType = eSIR_IBSS_MODE;
@@ -597,7 +597,7 @@
 	mlmStartReq.cbMode = psessionEntry->pLimStartBssReq->cbMode;
 
 	/* Copy the SSID for RxP filtering based on SSID. */
-	cdf_mem_copy((uint8_t *) &mlmStartReq.ssId,
+	qdf_mem_copy((uint8_t *) &mlmStartReq.ssId,
 		     (uint8_t *) &psessionEntry->pLimStartBssReq->ssId,
 		     psessionEntry->pLimStartBssReq->ssId.length + 1);
 
@@ -663,7 +663,7 @@
 	pMac->lim.gLimNumIbssPeers = 0;
 
 	/* ibss info - params for which ibss to join while coalescing */
-	cdf_mem_set(&pMac->lim.ibssInfo, sizeof(tAniSirLimIbss), 0);
+	qdf_mem_set(&pMac->lim.ibssInfo, sizeof(tAniSirLimIbss), 0);
 } /*** end lim_ibss_init() ***/
 
 /**
@@ -729,9 +729,9 @@
 		pMac->lim.gLimIbssPeerList = pTempNode;
 
 		if (pCurrNode->beacon) {
-			cdf_mem_free(pCurrNode->beacon);
+			qdf_mem_free(pCurrNode->beacon);
 		}
-		cdf_mem_free(pCurrNode);
+		qdf_mem_free(pCurrNode);
 		if (pMac->lim.gLimNumIbssPeers > 0) /* be paranoid */
 			pMac->lim.gLimNumIbssPeers--;
 		pCurrNode = pTempNode;
@@ -838,7 +838,7 @@
 				       (pMac, pMac->lim.protStaCache[i].addr, LOG1);
 			       )
 
-			if (cdf_mem_compare(pMac->lim.protStaCache[i].addr,
+			if (!qdf_mem_cmp(pMac->lim.protStaCache[i].addr,
 					    peerMacAddr,
 					    sizeof(tSirMacAddr))) {
 				PELOG1(lim_log
@@ -862,7 +862,7 @@
 		return;
 	}
 
-	cdf_mem_copy(pMac->lim.protStaCache[i].addr,
+	qdf_mem_copy(pMac->lim.protStaCache[i].addr,
 		     peerMacAddr, sizeof(tSirMacAddr));
 
 	pMac->lim.protStaCache[i].protStaCacheType = protStaCacheType;
@@ -985,7 +985,7 @@
 	tSirMacAddr *pPeerAddr = (tSirMacAddr *) pBody;
 	tUpdateBeaconParams beaconParams;
 
-	cdf_mem_set((uint8_t *) &beaconParams, sizeof(tUpdateBeaconParams), 0);
+	qdf_mem_set((uint8_t *) &beaconParams, sizeof(tUpdateBeaconParams), 0);
 
 	if (pBody == 0) {
 		PELOGE(lim_log(pMac, LOGE, FL("Invalid IBSS AddSta"));)
@@ -1084,7 +1084,7 @@
 			       FL("IBSS: ADD_STA_RSP for unknown MAC addr "));
 		       )
 		lim_print_mac_addr(pMac, pAddStaParams->staMac, LOGE);
-		cdf_mem_free(pAddStaParams);
+		qdf_mem_free(pAddStaParams);
 		return eSIR_FAILURE;
 	}
 
@@ -1094,7 +1094,7 @@
 			       pAddStaParams->status);
 		       )
 		lim_print_mac_addr(pMac, pAddStaParams->staMac, LOGE);
-		cdf_mem_free(pAddStaParams);
+		qdf_mem_free(pAddStaParams);
 		return eSIR_FAILURE;
 	}
 
@@ -1115,7 +1115,7 @@
 			       eWNI_SME_IBSS_NEW_PEER_IND,
 			       psessionEntry->smeSessionId);
 
-	cdf_mem_free(pAddStaParams);
+	qdf_mem_free(pAddStaParams);
 
 	return eSIR_SUCCESS;
 }
@@ -1151,7 +1151,7 @@
 
 end:
 	if (pDelBss != NULL)
-		cdf_mem_free(pDelBss);
+		qdf_mem_free(pDelBss);
 }
 
 void lim_ibss_add_bss_rsp_when_coalescing(tpAniSirGlobal pMac, void *msg,
@@ -1178,10 +1178,10 @@
 	infoLen = sizeof(tSirMacAddr) + sizeof(tSirMacChanNum) +
 		  sizeof(uint8_t) + pBeacon->ssId.length + 1;
 
-	cdf_mem_set((void *)&newBssInfo, sizeof(newBssInfo), 0);
-	cdf_mem_copy(newBssInfo.bssId.bytes, pHdr->bssId, QDF_MAC_ADDR_SIZE);
+	qdf_mem_set((void *)&newBssInfo, sizeof(newBssInfo), 0);
+	qdf_mem_copy(newBssInfo.bssId.bytes, pHdr->bssId, QDF_MAC_ADDR_SIZE);
 	newBssInfo.channelNumber = (tSirMacChanNum) pAddBss->currentOperChannel;
-	cdf_mem_copy((uint8_t *) &newBssInfo.ssId,
+	qdf_mem_copy((uint8_t *) &newBssInfo.ssId,
 		     (uint8_t *) &pBeacon->ssId, pBeacon->ssId.length + 1);
 
 	PELOGW(lim_log
@@ -1274,7 +1274,7 @@
 
 end:
 	if (pDelBss != NULL)
-		cdf_mem_free(pDelBss);
+		qdf_mem_free(pDelBss);
 	/* Delete PE session once BSS is deleted */
 	if (NULL != psessionEntry) {
 		lim_send_sme_rsp(pMac, eWNI_SME_STOP_BSS_RSP, rc,
@@ -1307,7 +1307,7 @@
 		pTempNextNode = pTempNode->next;
 
 		/* Delete the STA with MAC address */
-		if (cdf_mem_compare((uint8_t *) macAddr,
+		if (!qdf_mem_cmp((uint8_t *) macAddr,
 				    (uint8_t *) &pTempNode->peerMacAddr,
 				    sizeof(tSirMacAddr))) {
 			pStaDs = dph_lookup_hash_entry(pMac, macAddr,
@@ -1339,7 +1339,7 @@
 				} else
 					pPrevNode->next = pTempNode->next;
 
-				cdf_mem_free(pTempNode);
+				qdf_mem_free(pTempNode);
 				pMac->lim.gLimNumIbssPeers--;
 
 				pTempNode = pTempNextNode;
@@ -1393,7 +1393,7 @@
 	tpDphHashNode pStaDs;
 	tUpdateBeaconParams beaconParams;
 
-	cdf_mem_set((uint8_t *) &beaconParams, sizeof(tUpdateBeaconParams), 0);
+	qdf_mem_set((uint8_t *) &beaconParams, sizeof(tUpdateBeaconParams), 0);
 
 	sir_copy_mac_addr(currentBssId, psessionEntry->bssId);
 
@@ -1403,7 +1403,7 @@
 		MAC_ADDR_ARRAY(pHdr->bssId));
 
 	/* Check for IBSS Coalescing only if Beacon is from different BSS */
-	if (!cdf_mem_compare(currentBssId, pHdr->bssId, sizeof(tSirMacAddr))
+	if (qdf_mem_cmp(currentBssId, pHdr->bssId, sizeof(tSirMacAddr))
 	    && psessionEntry->isCoalesingInIBSSAllowed) {
 		/*
 		 * If STA entry is already available in the LIM hash table, then it is
@@ -1444,7 +1444,7 @@
 		ibss_bss_delete(pMac, psessionEntry);
 		return eSIR_SUCCESS;
 	} else {
-		if (!cdf_mem_compare
+		if (qdf_mem_cmp
 			    (currentBssId, pHdr->bssId, sizeof(tSirMacAddr)))
 			return eSIR_LIM_IGNORE_BEACON;
 	}
@@ -1480,7 +1480,7 @@
 		frameLen =
 			sizeof(tLimIbssPeerNode) + ieLen - sizeof(uint32_t);
 
-		pPeerNode = cdf_mem_malloc((uint16_t) frameLen);
+		pPeerNode = qdf_mem_malloc((uint16_t) frameLen);
 		if (NULL == pPeerNode) {
 			lim_log(pMac, LOGP,
 				FL
@@ -1494,7 +1494,7 @@
 
 		ibss_peer_collect(pMac, pBeacon, pHdr, pPeerNode,
 				  psessionEntry);
-		pPeerNode->beacon = cdf_mem_malloc(ieLen);
+		pPeerNode->beacon = qdf_mem_malloc(ieLen);
 		if (NULL == pPeerNode->beacon) {
 			PELOGE(lim_log
 				       (pMac, LOGE,
@@ -1502,7 +1502,7 @@
 					       ("Unable to allocate memory to store beacon"));
 			       )
 		} else {
-			cdf_mem_copy(pPeerNode->beacon, pIEs, ieLen);
+			qdf_mem_copy(pPeerNode->beacon, pIEs, ieLen);
 			pPeerNode->beaconLen = (uint16_t) ieLen;
 		}
 		ibss_peer_add(pMac, pPeerNode);
@@ -1659,7 +1659,7 @@
 				prevnode->next = tempnode->next;
 			}
 
-			cdf_mem_free(tempnode);
+			qdf_mem_free(tempnode);
 			mac_ctx->lim.gLimNumIbssPeers--;
 
 			/* we deleted current node, so prevNode remains same. */
@@ -1753,7 +1753,7 @@
 		for (i = 0; i < LIM_PROT_STA_CACHE_SIZE; i++) {
 			if (!mac_ctx->lim.protStaCache[i].active)
 				continue;
-			if (cdf_mem_compare(mac_ctx->lim.protStaCache[i].addr,
+			if (!qdf_mem_cmp(mac_ctx->lim.protStaCache[i].addr,
 				stads->staAddr, sizeof(tSirMacAddr))) {
 				session->gLim11bParams.numSta--;
 				mac_ctx->lim.protStaCache[i].active = false;
diff --git a/core/mac/src/pe/lim/lim_link_monitoring_algo.c b/core/mac/src/pe/lim/lim_link_monitoring_algo.c
index c61e189..416edf1 100644
--- a/core/mac/src/pe/lim/lim_link_monitoring_algo.c
+++ b/core/mac/src/pe/lim/lim_link_monitoring_algo.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -78,7 +78,7 @@
 		msg->staId, msg->reasonCode);
 
 	if (LIM_IS_IBSS_ROLE(session_entry)) {
-		cdf_mem_free(msg);
+		qdf_mem_free(msg);
 		return;
 	}
 
@@ -89,7 +89,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Invalid STA limSystemRole=%d"),
 			GET_LIM_SYSTEM_ROLE(session_entry));
-		cdf_mem_free(msg);
+		qdf_mem_free(msg);
 		return;
 	}
 	stads->del_sta_ctx_rssi = msg->rssi;
@@ -100,7 +100,7 @@
 	if (stads->staIndex != msg->staId) {
 		lim_log(mac_ctx, LOGE, FL("staid mismatch: %d vs %d "),
 			stads->staIndex, msg->staId);
-		cdf_mem_free(msg);
+		qdf_mem_free(msg);
 		return;
 	}
 
@@ -125,7 +125,7 @@
 			lim_log(mac_ctx, LOGE,
 				FL("Inv Del STA staId:%d, assocId:%d"),
 				msg->staId, msg->assocId);
-			cdf_mem_free(msg);
+			qdf_mem_free(msg);
 			return;
 		} else {
 			lim_send_disassoc_mgmt_frame(mac_ctx,
@@ -172,7 +172,7 @@
 					"in some transit state, Addr = "
 					MAC_ADDRESS_STR),
 					MAC_ADDR_ARRAY(msg->bssId));
-			cdf_mem_free(msg);
+			qdf_mem_free(msg);
 			return;
 		}
 
@@ -182,7 +182,7 @@
 			eLIM_LINK_MONITORING_DEAUTH;
 
 		/* Issue Deauth Indication to SME. */
-		cdf_mem_copy((uint8_t *) &mlm_deauth_ind.peerMacAddr,
+		qdf_mem_copy((uint8_t *) &mlm_deauth_ind.peerMacAddr,
 			     stads->staAddr, sizeof(tSirMacAddr));
 		mlm_deauth_ind.reasonCode =
 			(uint8_t) stads->mlmStaContext.disassocReason;
@@ -229,7 +229,7 @@
 						 &session_id);
 	if (NULL == session_entry) {
 		lim_log(mac_ctx, LOGE, FL("session does not exist"));
-		cdf_mem_free(msg);
+		qdf_mem_free(msg);
 		return;
 	}
 
@@ -251,7 +251,7 @@
 		lim_log(mac_ctx, LOGE, FL(" Unknown reason code "));
 		break;
 	}
-	cdf_mem_free(msg);
+	qdf_mem_free(msg);
 	return;
 }
 
@@ -289,7 +289,7 @@
 	sta_ds->mlmStaContext.disassocReason =
 		eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON;
 	sta_ds->mlmStaContext.cleanupTrigger = eLIM_LINK_MONITORING_DISASSOC;
-	cdf_mem_copy(&mlm_disassoc_ind.peerMacAddr, sta_ds->staAddr,
+	qdf_mem_copy(&mlm_disassoc_ind.peerMacAddr, sta_ds->staAddr,
 		sizeof(tSirMacAddr));
 	mlm_disassoc_ind.reasonCode =
 		eSIR_MAC_DISASSOC_DUE_TO_INACTIVITY_REASON;
@@ -329,7 +329,8 @@
 	/* tear down the following sessionEntry */
 	tpPESession psessionEntry;
 
-	if ((psessionEntry = pe_find_session_by_session_id(pMac, sessionId)) == NULL) {
+	psessionEntry = pe_find_session_by_session_id(pMac, sessionId);
+	if (psessionEntry == NULL) {
 		lim_log(pMac, LOGP,
 			FL("Session Does not exist for given sessionID"));
 		return;
@@ -377,7 +378,7 @@
 					eLIM_MLM_WT_DEL_STA_RSP_STATE;
 
 		/* / Issue Deauth Indication to SME. */
-		cdf_mem_copy((uint8_t *) &mlmDeauthInd.peerMacAddr,
+		qdf_mem_copy((uint8_t *) &mlmDeauthInd.peerMacAddr,
 			     pStaDs->staAddr, sizeof(tSirMacAddr));
 
 	/*
@@ -397,7 +398,7 @@
 
 		lim_log(pMac, LOGE, FL("HB Failure on MAC "
 			MAC_ADDRESS_STR" Store it on Index %d"),
-			MAC_ADDR_ARRAY(pStaDs->staAddr),apCount);
+			MAC_ADDR_ARRAY(pStaDs->staAddr), apCount);
 
 		sir_copy_mac_addr(pMac->lim.gLimHeartBeatApMac[apCount],
 							pStaDs->staAddr);
@@ -488,8 +489,8 @@
 			if (curr_chan < SIR_MAX_24G_5G_CHANNEL_RANGE) {
 				lim_covert_channel_scan_type(mac_ctx, curr_chan,
 					false);
-				mac_ctx->lim.dfschannelList.timeStamp[curr_chan]
-					 = 0;
+				mac_ctx->lim.dfschannelList.
+					timeStamp[curr_chan] = 0;
 			}
 			/*
 			 * Connected on DFS channel so should not send the
diff --git a/core/mac/src/pe/lim/lim_p2p.c b/core/mac/src/pe/lim/lim_p2p.c
index 1c8b8c7..bf79d48 100644
--- a/core/mac/src/pe/lim/lim_p2p.c
+++ b/core/mac/src/pe/lim/lim_p2p.c
@@ -85,14 +85,14 @@
 	tSirMsgQ msg;
 	tSirRetStatus rc = eSIR_SUCCESS;
 
-	pScanOffloadReq = cdf_mem_malloc(sizeof(tSirScanOffloadReq));
+	pScanOffloadReq = qdf_mem_malloc(sizeof(tSirScanOffloadReq));
 	if (NULL == pScanOffloadReq) {
 		lim_log(pMac, LOGE,
 			FL("Memory allocation failed for pScanOffloadReq"));
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	cdf_mem_zero(pScanOffloadReq, sizeof(tSirScanOffloadReq));
+	qdf_mem_zero(pScanOffloadReq, sizeof(tSirScanOffloadReq));
 
 	msg.type = WMA_START_SCAN_OFFLOAD_REQ;
 	msg.bodyptr = pScanOffloadReq;
@@ -121,7 +121,7 @@
 	if (rc != eSIR_SUCCESS) {
 		lim_log(pMac, LOGE, FL("wma_post_ctrl_msg() return failure %u"),
 			rc);
-		cdf_mem_free(pScanOffloadReq);
+		qdf_mem_free(pScanOffloadReq);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -145,7 +145,7 @@
 		/* Post the meessage to Sme */
 		lim_send_sme_rsp(pMac, eWNI_SME_REMAIN_ON_CHN_RSP,
 				 status, msgbuff->sessionId, msgbuff->scan_id);
-		cdf_mem_free(pMac->lim.gpLimRemainOnChanReq);
+		qdf_mem_free(pMac->lim.gpLimRemainOnChanReq);
 		pMac->lim.gpLimRemainOnChanReq = NULL;
 	}
 	return false;
@@ -356,7 +356,7 @@
 			status,
 			MsgRemainonChannel->sessionId, 0);
 
-	cdf_mem_free(pMac->lim.gpLimRemainOnChanReq);
+	qdf_mem_free(pMac->lim.gpLimRemainOnChanReq);
 	pMac->lim.gpLimRemainOnChanReq = NULL;
 
 	pMac->lim.gLimMlmState = pMac->lim.gLimPrevMlmState;
@@ -386,13 +386,13 @@
 
 	length = sizeof(tSirSmeMgmtFrameInd) + frameLen;
 
-	pSirSmeMgmtFrame = cdf_mem_malloc(length);
+	pSirSmeMgmtFrame = qdf_mem_malloc(length);
 	if (NULL == pSirSmeMgmtFrame) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for eWNI_SME_LISTEN_RSP"));
 		return;
 	}
-	cdf_mem_set((void *)pSirSmeMgmtFrame, length, 0);
+	qdf_mem_set((void *)pSirSmeMgmtFrame, length, 0);
 
 	pSirSmeMgmtFrame->frame_len = frameLen;
 	pSirSmeMgmtFrame->sessionId = sessionId;
@@ -400,15 +400,15 @@
 	pSirSmeMgmtFrame->rxRssi = rxRssi;
 	pSirSmeMgmtFrame->rxChan = rxChannel;
 
-	cdf_mem_zero(pSirSmeMgmtFrame->frameBuf, frameLen);
-	cdf_mem_copy(pSirSmeMgmtFrame->frameBuf, frame, frameLen);
+	qdf_mem_zero(pSirSmeMgmtFrame->frameBuf, frameLen);
+	qdf_mem_copy(pSirSmeMgmtFrame->frameBuf, frame, frameLen);
 
 	if (pMac->mgmt_frame_ind_cb)
 		pMac->mgmt_frame_ind_cb(pSirSmeMgmtFrame);
 	else
 		lim_log(pMac, LOGW,
 			FL("Management indication callback not registered!!"));
-	cdf_mem_free(pSirSmeMgmtFrame);
+	qdf_mem_free(pSirSmeMgmtFrame);
 	return;
 }
 
@@ -577,8 +577,8 @@
 		tpSirMacP2PActionFrameHdr action_hdr =
 			(tpSirMacP2PActionFrameHdr) ((uint8_t *)
 			mb_msg->data + ACTION_OFFSET);
-		if (cdf_mem_compare(action_hdr->Oui, SIR_MAC_P2P_OUI,
-			SIR_MAC_P2P_OUI_SIZE) &&
+		if ((!qdf_mem_cmp(action_hdr->Oui, SIR_MAC_P2P_OUI,
+			SIR_MAC_P2P_OUI_SIZE)) &&
 			(SIR_MAC_ACTION_P2P_SUBTYPE_PRESENCE_RSP ==
 			action_hdr->OuiSubType)) {
 
@@ -663,7 +663,7 @@
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(frame, msg_len, 0);
+	qdf_mem_set(frame, msg_len, 0);
 
 	/*
 	 * Add sequence number to action frames
@@ -676,14 +676,14 @@
 		/* Add 2 bytes for length and Arribute field */
 		uint32_t nBytesToCopy = ((p2p_ie + orig_len + 2) -
 			 (uint8_t *) mb_msg->data);
-		cdf_mem_copy(frame, mb_msg->data, nBytesToCopy);
-		cdf_mem_copy((frame + nBytesToCopy), noa_stream, noa_len);
-		cdf_mem_copy((frame + nBytesToCopy + noa_len),
+		qdf_mem_copy(frame, mb_msg->data, nBytesToCopy);
+		qdf_mem_copy((frame + nBytesToCopy), noa_stream, noa_len);
+		qdf_mem_copy((frame + nBytesToCopy + noa_len),
 			mb_msg->data + nBytesToCopy,
 			msg_len - nBytesToCopy - noa_len);
 
 	} else {
-		cdf_mem_copy(frame, mb_msg->data, msg_len);
+		qdf_mem_copy(frame, mb_msg->data, msg_len);
 	}
 
 #ifdef WLAN_FEATURE_11W
@@ -760,14 +760,14 @@
 
 	pNoA = (tpP2pPsConfig) pMsgBuf;
 
-	pMsgNoA = cdf_mem_malloc(sizeof(tP2pPsConfig));
+	pMsgNoA = qdf_mem_malloc(sizeof(tP2pPsConfig));
 	if (NULL == pMsgNoA) {
 		lim_log(pMac, LOGE,
 			FL("Unable to allocate memory during NoA Update"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set((uint8_t *) pMsgNoA, sizeof(tP2pPsConfig), 0);
+	qdf_mem_set((uint8_t *) pMsgNoA, sizeof(tP2pPsConfig), 0);
 	pMsgNoA->opp_ps = pNoA->opp_ps;
 	pMsgNoA->ctWindow = pNoA->ctWindow;
 	pMsgNoA->duration = pNoA->duration;
diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c
index 09b8334..af50605 100644
--- a/core/mac/src/pe/lim/lim_process_action_frame.c
+++ b/core/mac/src/pe/lim/lim_process_action_frame.c
@@ -229,7 +229,7 @@
 	if (!session->lim11hEnable)
 		return;
 
-	chnl_switch_frame = cdf_mem_malloc(sizeof(*chnl_switch_frame));
+	chnl_switch_frame = qdf_mem_malloc(sizeof(*chnl_switch_frame));
 	if (NULL == chnl_switch_frame) {
 		lim_log(mac_ctx, LOGE, FL("AllocateMemory failed"));
 		return;
@@ -243,7 +243,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Failed to unpack and parse (0x%08x, %d bytes)"),
 			status, frame_len);
-		cdf_mem_free(chnl_switch_frame);
+		qdf_mem_free(chnl_switch_frame);
 		return;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(mac_ctx, LOGW,
@@ -251,11 +251,11 @@
 			status, frame_len);
 	}
 
-	if (!(cdf_mem_compare((uint8_t *) &session->bssId,
-			(uint8_t *) &mac_hdr->sa, sizeof(tSirMacAddr)))) {
+	if (qdf_mem_cmp((uint8_t *) &session->bssId,
+			(uint8_t *) &mac_hdr->sa, sizeof(tSirMacAddr))) {
 		lim_log(mac_ctx, LOG1,
 			FL("Rcvd action frame not from our BSS, dropping..."));
-		cdf_mem_free(chnl_switch_frame);
+		qdf_mem_free(chnl_switch_frame);
 		return;
 	}
 	/* copy the beacon interval from session */
@@ -334,7 +334,7 @@
 		lim_log(mac_ctx, LOG1,
 			FL("Could not start channel switch"));
 
-	cdf_mem_free(chnl_switch_frame);
+	qdf_mem_free(chnl_switch_frame);
 	return;
 }
 
@@ -368,7 +368,7 @@
 	lim_log(mac_ctx, LOG1, FL("Received EXT Channel switch action frame"));
 
 	ext_channel_switch_frame =
-		 cdf_mem_malloc(sizeof(*ext_channel_switch_frame));
+		 qdf_mem_malloc(sizeof(*ext_channel_switch_frame));
 	if (NULL == ext_channel_switch_frame) {
 		lim_log(mac_ctx, LOGE, FL("AllocateMemory failed"));
 		return;
@@ -383,7 +383,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Failed to parse CHANSW action frame (0x%08x, len %d):"),
 			status, frame_len);
-		cdf_mem_free(ext_channel_switch_frame);
+		qdf_mem_free(ext_channel_switch_frame);
 		return;
 	} else if (DOT11F_WARNED(status)) {
 
@@ -396,7 +396,7 @@
 	 ext_channel_switch_frame->ext_chan_switch_ann_action.new_channel;
 
 	/* Free ext_channel_switch_frame here as its no longer needed */
-	cdf_mem_free(ext_channel_switch_frame);
+	qdf_mem_free(ext_channel_switch_frame);
 	/*
 	 * Now, validate if channel change is required for the passed
 	 * channel and if is valid in the current regulatory domain,
@@ -417,14 +417,14 @@
 		struct sir_sme_ext_cng_chan_ind *ext_cng_chan_ind;
 		tSirMsgQ mmh_msg;
 
-		ext_cng_chan_ind = cdf_mem_malloc(sizeof(*ext_cng_chan_ind));
+		ext_cng_chan_ind = qdf_mem_malloc(sizeof(*ext_cng_chan_ind));
 		if (NULL == ext_cng_chan_ind) {
 			lim_log(mac_ctx, LOGP,
 			  FL("AllocateMemory failed for ext_cng_chan_ind"));
 			return;
 		}
 
-		cdf_mem_zero(ext_cng_chan_ind,
+		qdf_mem_zero(ext_cng_chan_ind,
 			sizeof(*ext_cng_chan_ind));
 		ext_cng_chan_ind->session_id =
 					session_entry->smeSessionId;
@@ -486,7 +486,7 @@
 		lim_log(mac_ctx, LOGW, FL("channel bonding disabled"));
 		return;
 	}
-	operating_mode_frm = cdf_mem_malloc(sizeof(*operating_mode_frm));
+	operating_mode_frm = qdf_mem_malloc(sizeof(*operating_mode_frm));
 	if (NULL == operating_mode_frm) {
 		lim_log(mac_ctx, LOGE, FL("AllocateMemory failed"));
 		return;
@@ -498,7 +498,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Failed to unpack and parse (0x%08x, %d bytes)"),
 			status, frame_len);
-		cdf_mem_free(operating_mode_frm);
+		qdf_mem_free(operating_mode_frm);
 		return;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(mac_ctx, LOGW,
@@ -577,7 +577,7 @@
 		lim_set_nss_change(mac_ctx, session, sta_ptr->vhtSupportedRxNss,
 			sta_ptr->staIndex, mac_hdr->sa);
 	}
-	cdf_mem_free(operating_mode_frm);
+	qdf_mem_free(operating_mode_frm);
 	return;
 }
 
@@ -610,7 +610,7 @@
 	frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
 
 	lim_log(mac_ctx, LOG3, FL("Received GID Management action frame"));
-	gid_mgmt_frame = cdf_mem_malloc(sizeof(*gid_mgmt_frame));
+	gid_mgmt_frame = qdf_mem_malloc(sizeof(*gid_mgmt_frame));
 	if (NULL == gid_mgmt_frame) {
 		lim_log(mac_ctx, LOGE, FL("AllocateMemory failed"));
 		return;
@@ -623,7 +623,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Fail to parse an Grp id frame (0x%08x, %d bytes):"),
 			status, frame_len);
-		cdf_mem_free(gid_mgmt_frame);
+		qdf_mem_free(gid_mgmt_frame);
 		return;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(mac_ctx, LOGW,
@@ -678,7 +678,7 @@
 	lim_check_membership_user_position(mac_ctx, session, membership,
 			usr_position, sta_ptr->staIndex);
 out:
-	cdf_mem_free(gid_mgmt_frame);
+	qdf_mem_free(gid_mgmt_frame);
 	return;
 }
 
@@ -816,7 +816,7 @@
 		lim_log(mac_ctx, LOGW, "TSM IE Present");
 		session->eseContext.tsm.tid =
 			addts.tspec.tsinfo.traffic.userPrio;
-		cdf_mem_copy(&session->eseContext.tsm.tsmInfo,
+		qdf_mem_copy(&session->eseContext.tsm.tsmInfo,
 			     &addts.tsmIE, sizeof(tSirMacESETSMIE));
 #ifdef FEATURE_WLAN_ESE_UPLOAD
 		lim_send_sme_tsm_ie_ind(mac_ctx, session, addts.tsmIE.tsid,
@@ -1188,7 +1188,7 @@
 	pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo);
 	frameLen = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
 
-	pMeasReqFrame = cdf_mem_malloc(sizeof(tSirMacMeasReqActionFrame));
+	pMeasReqFrame = qdf_mem_malloc(sizeof(tSirMacMeasReqActionFrame));
 	if (NULL == pMeasReqFrame) {
 		lim_log(pMac, LOGE,
 			FL
@@ -1239,7 +1239,7 @@
 		       (pMac, LOG1,
 		       FL("****LIM: Processing TPC Request from peer ****"));
 	       )
-	pTpcReqFrame = cdf_mem_malloc(sizeof(tSirMacTpcReqActionFrame));
+	pTpcReqFrame = qdf_mem_malloc(sizeof(tSirMacTpcReqActionFrame));
 	if (NULL == pTpcReqFrame) {
 		PELOGE(lim_log(pMac, LOGE, FL("AllocateMemory failed "));)
 		return;
@@ -1459,7 +1459,7 @@
 	pBody = WMA_GET_RX_MPDU_DATA(pRxPacketInfo);
 	frameLen = WMA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
 
-	pFrm = cdf_mem_malloc(sizeof(tDot11fNeighborReportResponse));
+	pFrm = qdf_mem_malloc(sizeof(tDot11fNeighborReportResponse));
 	if (NULL == pFrm) {
 		lim_log(pMac, LOGE,
 			FL
@@ -1468,7 +1468,7 @@
 	}
 
 	if (psessionEntry == NULL) {
-		cdf_mem_free(pFrm);
+		qdf_mem_free(pFrm);
 		return;
 	}
 
@@ -1484,7 +1484,7 @@
 		PELOG2(sir_dump_buf
 			       (pMac, SIR_DBG_MODULE_ID, LOG2, pBody, frameLen);
 		       )
-		cdf_mem_free(pFrm);
+		qdf_mem_free(pFrm);
 		return;
 	} else if (DOT11F_WARNED(nStatus)) {
 		lim_log(pMac, LOGW,
@@ -1498,7 +1498,7 @@
 	/* Call rrm function to handle the request. */
 	rrm_process_neighbor_report_response(pMac, pFrm, psessionEntry);
 
-	cdf_mem_free(pFrm);
+	qdf_mem_free(pFrm);
 }
 
 #endif
@@ -1556,7 +1556,7 @@
 	   Category       : 1 byte
 	   Action         : 1 byte
 	   Transaction ID : 2 bytes */
-	cdf_mem_copy(&transId[0], &pBody[2], 2);
+	qdf_mem_copy(&transId[0], &pBody[2], 2);
 
 	/* Send 11w SA query response action frame */
 	if (lim_send_sa_query_response_frame(pMac,
@@ -1643,7 +1643,7 @@
 	   Category       : 1 byte
 	   Action         : 1 byte
 	   Transaction ID : 2 bytes */
-	cdf_mem_copy(&transId, &pBody[2], 2);
+	qdf_mem_copy(&transId, &pBody[2], 2);
 
 	/* If SA Query is in progress with the station and the station
 	   responds then the association request that triggered the SA
@@ -1959,10 +1959,10 @@
 
 		/* Check if it is a vendor specific action frame. */
 		if (LIM_IS_STA_ROLE(session) &&
-		    (true == cdf_mem_compare(session->selfMacAddr,
+		    (true != qdf_mem_cmp(session->selfMacAddr,
 					&mac_hdr->da[0], sizeof(tSirMacAddr)))
 		    && IS_WES_MODE_ENABLED(mac_ctx)
-		    && cdf_mem_compare(vendor_specific->Oui, oui, 3)) {
+		    && !qdf_mem_cmp(vendor_specific->Oui, oui, 3)) {
 			lim_log(mac_ctx, LOGW,
 				FL("Rcvd Vendor specific frame, OUI %x %x %x"),
 				vendor_specific->Oui[0],
@@ -2006,7 +2006,7 @@
 			mac_hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 			frame_len = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
 			/* Check if it is a P2P public action frame. */
-			if (cdf_mem_compare(pub_action->Oui, p2p_oui, 4)) {
+			if (!qdf_mem_cmp(pub_action->Oui, p2p_oui, 4)) {
 				/*
 				 * Forward to the SME to HDD to wpa_supplicant
 				 * type is ACTION
@@ -2185,7 +2185,7 @@
 			frameLen = WMA_GET_RX_PAYLOAD_LEN(pBd);
 
 			/* Check if it is a P2P public action frame. */
-			if (cdf_mem_compare(pActionHdr->Oui, P2POui, 4)) {
+			if (!qdf_mem_cmp(pActionHdr->Oui, P2POui, 4)) {
 				/* Forward to the SME to HDD to wpa_supplicant */
 				/* type is ACTION */
 				lim_send_sme_mgmt_frame_ind(pMac,
diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
index aa5b4eb..2754cbb 100644
--- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
+++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c
@@ -328,7 +328,7 @@
 
 	sir_dump_buf(pMac, SIR_LIM_MODULE_ID, LOG2, (uint8_t *) pBody, framelen);
 
-	if (cdf_mem_compare((uint8_t *) pHdr->sa, (uint8_t *) pHdr->da,
+	if (!qdf_mem_cmp((uint8_t *) pHdr->sa, (uint8_t *) pHdr->da,
 			    (uint8_t) (sizeof(tSirMacAddr)))) {
 		lim_log(pMac, LOGE,
 			FL("Rejected Assoc Req frame Since same mac as"
@@ -349,12 +349,12 @@
 		return;
 	}
 	/* Allocate memory for the Assoc Request frame */
-	pAssocReq = cdf_mem_malloc(sizeof(*pAssocReq));
+	pAssocReq = qdf_mem_malloc(sizeof(*pAssocReq));
 	if (NULL == pAssocReq) {
 		lim_log(pMac, LOGP, FL("Allocate Memory failed in assoc_req"));
 		return;
 	}
-	cdf_mem_set((void *)pAssocReq, sizeof(*pAssocReq), 0);
+	qdf_mem_set((void *)pAssocReq, sizeof(*pAssocReq), 0);
 
 	/* Parse Assoc Request frame */
 	if (subType == LIM_ASSOC)
@@ -376,7 +376,7 @@
 		goto error;
 	}
 
-	pAssocReq->assocReqFrame = cdf_mem_malloc(framelen);
+	pAssocReq->assocReqFrame = qdf_mem_malloc(framelen);
 	if (NULL == pAssocReq->assocReqFrame) {
 		lim_log(pMac, LOGE,
 			FL("Unable to allocate memory for the assoc req, "
@@ -384,7 +384,7 @@
 		goto error;
 	}
 
-	cdf_mem_copy((uint8_t *) pAssocReq->assocReqFrame,
+	qdf_mem_copy((uint8_t *) pAssocReq->assocReqFrame,
 		     (uint8_t *) pBody, framelen);
 	pAssocReq->assocReqFrameLength = framelen;
 
@@ -417,7 +417,7 @@
 
 	updateContext = false;
 
-	if (lim_cmp_ssid(&pAssocReq->ssId, psessionEntry) == false) {
+	if (lim_cmp_ssid(&pAssocReq->ssId, psessionEntry) != false) {
 		lim_log(pMac, LOGE,
 			FL("Received %s Req with unmatched ssid ( Received"
 			   " SSID: %.*s current SSID: %.*s ) from "
@@ -684,8 +684,8 @@
 	} /* End if on HT caps turned on in lim. */
 
 	/* Clear the buffers so that frame parser knows that there isn't a previously decoded IE in these buffers */
-	cdf_mem_set((uint8_t *) &Dot11fIERSN, sizeof(Dot11fIERSN), 0);
-	cdf_mem_set((uint8_t *) &Dot11fIEWPA, sizeof(Dot11fIEWPA), 0);
+	qdf_mem_set((uint8_t *) &Dot11fIERSN, sizeof(Dot11fIERSN), 0);
+	qdf_mem_set((uint8_t *) &Dot11fIEWPA, sizeof(Dot11fIEWPA), 0);
 
 	/* if additional IE is present, check if it has WscIE */
 	if (pAssocReq->addIEPresent && pAssocReq->addIE.length)
@@ -1008,8 +1008,8 @@
 #endif
 
 		/* no change in the capability so drop the frame */
-		if ((true ==
-		     cdf_mem_compare(&pStaDs->mlmStaContext.capabilityInfo,
+		if ((true !=
+		     qdf_mem_cmp(&pStaDs->mlmStaContext.capabilityInfo,
 				     &pAssocReq->capabilityInfo,
 				     sizeof(tSirMacCapabilityInfo)))
 		    && (subType == LIM_ASSOC)) {
@@ -1158,11 +1158,11 @@
 		pTempAssocReq = psessionEntry->parsedAssocReq[pStaDs->assocId];
 		if (pTempAssocReq != NULL) {
 			if (pTempAssocReq->assocReqFrame) {
-				cdf_mem_free(pTempAssocReq->assocReqFrame);
+				qdf_mem_free(pTempAssocReq->assocReqFrame);
 				pTempAssocReq->assocReqFrame = NULL;
 				pTempAssocReq->assocReqFrameLength = 0;
 			}
-			cdf_mem_free(pTempAssocReq);
+			qdf_mem_free(pTempAssocReq);
 			pTempAssocReq = NULL;
 		}
 
@@ -1598,12 +1598,12 @@
 error:
 	if (pAssocReq != NULL) {
 		if (pAssocReq->assocReqFrame) {
-			cdf_mem_free(pAssocReq->assocReqFrame);
+			qdf_mem_free(pAssocReq->assocReqFrame);
 			pAssocReq->assocReqFrame = NULL;
 			pAssocReq->assocReqFrameLength = 0;
 		}
 
-		cdf_mem_free(pAssocReq);
+		qdf_mem_free(pAssocReq);
 		/* to avoid double free */
 		if (assoc_req_copied && psessionEntry->parsedAssocReq)
 			psessionEntry->parsedAssocReq[pStaDs->assocId] = NULL;
@@ -1617,12 +1617,12 @@
 				psessionEntry->parsedAssocReq[pStaDs->assocId];
 			if (pTempAssocReq != NULL) {
 				if (pTempAssocReq->assocReqFrame) {
-					cdf_mem_free(pTempAssocReq->
+					qdf_mem_free(pTempAssocReq->
 							assocReqFrame);
 					pTempAssocReq->assocReqFrame = NULL;
 					pTempAssocReq->assocReqFrameLength = 0;
 				}
-				cdf_mem_free(pTempAssocReq);
+				qdf_mem_free(pTempAssocReq);
 				psessionEntry->
 					parsedAssocReq[pStaDs->assocId] = NULL;
 			}
@@ -1656,7 +1656,7 @@
 			assoc_req->wapi.length);
 		assoc_ind->wapiIE.wapiIEdata[0] = SIR_MAC_WAPI_EID;
 		assoc_ind->wapiIE.wapiIEdata[1] = assoc_req->wapi.length;
-		cdf_mem_copy(&assoc_ind->wapiIE.wapiIEdata[2],
+		qdf_mem_copy(&assoc_ind->wapiIE.wapiIEdata[2],
 			assoc_req->wapi.info, assoc_req->wapi.length);
 		assoc_ind->wapiIE.length =
 			2 + assoc_req->wapi.length;
@@ -1780,7 +1780,7 @@
 	if (sub_type == LIM_ASSOC || sub_type == LIM_REASSOC) {
 		temp = sizeof(tLimMlmAssocInd);
 
-		assoc_ind = cdf_mem_malloc(temp);
+		assoc_ind = qdf_mem_malloc(temp);
 		if (NULL == assoc_ind) {
 			lim_release_peer_idx(mac_ctx, sta_ds->assocId,
 				session_entry);
@@ -1788,11 +1788,11 @@
 				FL("AllocateMemory failed for assoc_ind"));
 			return;
 		}
-		cdf_mem_set(assoc_ind, temp, 0);
-		cdf_mem_copy((uint8_t *) assoc_ind->peerMacAddr,
+		qdf_mem_set(assoc_ind, temp, 0);
+		qdf_mem_copy((uint8_t *) assoc_ind->peerMacAddr,
 			(uint8_t *) sta_ds->staAddr, sizeof(tSirMacAddr));
 		assoc_ind->aid = sta_ds->assocId;
-		cdf_mem_copy((uint8_t *) &assoc_ind->ssId,
+		qdf_mem_copy((uint8_t *) &assoc_ind->ssId,
 			(uint8_t *) &(assoc_req->ssId),
 			assoc_req->ssId.length + 1);
 		assoc_ind->sessionId = session_entry->peSessionId;
@@ -1814,7 +1814,7 @@
 			assoc_ind->rsnIE.rsnIEdata[0] = SIR_MAC_RSN_EID;
 			assoc_ind->rsnIE.rsnIEdata[1] =
 				assoc_req->rsn.length;
-			cdf_mem_copy(&assoc_ind->rsnIE.rsnIEdata[2],
+			qdf_mem_copy(&assoc_ind->rsnIE.rsnIEdata[2],
 				assoc_req->rsn.info,
 				assoc_req->rsn.length);
 		}
@@ -1840,14 +1840,14 @@
 				lim_log(mac_ctx, LOGE,
 					FL("rsnIEdata index out of bounds %d"),
 					rsn_len);
-				cdf_mem_free(assoc_ind);
+				qdf_mem_free(assoc_ind);
 				return;
 			}
 			assoc_ind->rsnIE.rsnIEdata[rsn_len] =
 				SIR_MAC_WPA_EID;
 			assoc_ind->rsnIE.rsnIEdata[rsn_len + 1]
 				= assoc_req->wpa.length;
-			cdf_mem_copy(
+			qdf_mem_copy(
 				&assoc_ind->rsnIE.rsnIEdata[rsn_len + 2],
 				assoc_req->wpa.info, assoc_req->wpa.length);
 			assoc_ind->rsnIE.length += 2 + assoc_req->wpa.length;
@@ -1859,7 +1859,7 @@
 
 		assoc_ind->addIE.length = 0;
 		if (assoc_req->addIEPresent) {
-			cdf_mem_copy(&assoc_ind->addIE.addIEdata,
+			qdf_mem_copy(&assoc_ind->addIE.addIEdata,
 				assoc_req->addIE.addIEdata,
 				assoc_req->addIE.length);
 			assoc_ind->addIE.length = assoc_req->addIE.length;
@@ -1876,7 +1876,7 @@
 					SIR_MAC_HT_CAPABILITIES_EID;
 				assoc_ind->addIE.addIEdata[rsn_len + 1] =
 					DOT11F_IE_HTCAPS_MIN_LEN;
-				cdf_mem_copy(
+				qdf_mem_copy(
 					&assoc_ind->addIE.addIEdata[rsn_len+2],
 					((uint8_t *)&assoc_req->HTCaps) + 1,
 					DOT11F_IE_HTCAPS_MIN_LEN);
@@ -1932,7 +1932,7 @@
 			assoc_ind);
 		lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_IND,
 			 (uint32_t *) assoc_ind);
-		cdf_mem_free(assoc_ind);
+		qdf_mem_free(assoc_ind);
 	}
 	return;
 }
diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c
index 876233f..510e3f2 100644
--- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c
+++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c
@@ -335,7 +335,7 @@
 				 tpPESession psessionEntry)
 {
 	/* Update the current Bss Information */
-	cdf_mem_copy(psessionEntry->bssId,
+	qdf_mem_copy(psessionEntry->bssId,
 		     psessionEntry->limReAssocbssId, sizeof(tSirMacAddr));
 	psessionEntry->currentOperChannel = psessionEntry->limReassocChannelId;
 	psessionEntry->htSecondaryChannelOffset =
@@ -350,7 +350,7 @@
 	psessionEntry->limCurrentBssPropCap =
 		psessionEntry->limReassocBssPropCap;
 
-	cdf_mem_copy((uint8_t *) &psessionEntry->ssId,
+	qdf_mem_copy((uint8_t *) &psessionEntry->ssId,
 		     (uint8_t *) &psessionEntry->limReassocSSID,
 		     psessionEntry->limReassocSSID.length + 1);
 
@@ -379,7 +379,7 @@
 	 tpPESession session_entry, tpSirAssocRsp assoc_rsp)
 {
 	if (session_entry->ricData != NULL) {
-		cdf_mem_free(session_entry->ricData);
+		qdf_mem_free(session_entry->ricData);
 		session_entry->ricData = NULL;
 		session_entry->RICDataLen = 0;
 	}
@@ -388,13 +388,13 @@
 			assoc_rsp->num_RICData * sizeof(tDot11fIERICDataDesc);
 		if (session_entry->RICDataLen) {
 			session_entry->ricData =
-				cdf_mem_malloc(session_entry->RICDataLen);
+				qdf_mem_malloc(session_entry->RICDataLen);
 			if (NULL == session_entry->ricData) {
 				lim_log(mac_ctx, LOGE,
 					FL("No memory for RIC data"));
 				session_entry->RICDataLen = 0;
 			} else {
-				cdf_mem_copy(session_entry->ricData,
+				qdf_mem_copy(session_entry->ricData,
 					&assoc_rsp->RICData[0],
 					session_entry->RICDataLen);
 			}
@@ -428,7 +428,7 @@
 	 tpPESession session_entry, tpSirAssocRsp assoc_rsp)
 {
 	if (session_entry->tspecIes != NULL) {
-		cdf_mem_free(session_entry->tspecIes);
+		qdf_mem_free(session_entry->tspecIes);
 		session_entry->tspecIes = NULL;
 		session_entry->tspecLen = 0;
 	}
@@ -438,13 +438,13 @@
 			assoc_rsp->num_tspecs * sizeof(tDot11fIEWMMTSPEC);
 		if (session_entry->tspecLen) {
 			session_entry->tspecIes =
-				cdf_mem_malloc(session_entry->tspecLen);
+				qdf_mem_malloc(session_entry->tspecLen);
 			if (NULL == session_entry->tspecIes) {
 				lim_log(mac_ctx, LOGE,
 					FL("Tspec IE:Fail to allocate memory"));
 				session_entry->tspecLen = 0;
 			} else {
-				cdf_mem_copy(session_entry->tspecIes,
+				qdf_mem_copy(session_entry->tspecIes,
 						&assoc_rsp->TSPECInfo[0],
 						session_entry->tspecLen);
 			}
@@ -496,7 +496,7 @@
 			EDCA_AC_VO) {
 			tsm_ctx->tid =
 				assoc_rsp->TSPECInfo[cnt].user_priority;
-			cdf_mem_copy(&tsm_ctx->tsmInfo,
+			qdf_mem_copy(&tsm_ctx->tsmInfo,
 				&assoc_rsp->tsmIE, sizeof(tSirMacESETSMIE));
 #ifdef FEATURE_WLAN_ESE_UPLOAD
 			lim_send_sme_tsm_ie_ind(mac_ctx,
@@ -614,7 +614,7 @@
 		(uint) abs((int8_t) WMA_GET_RX_RSSI_NORMALIZED(rx_pkt_info)),
 		MAC_ADDR_ARRAY(hdr->sa));
 
-	beacon = cdf_mem_malloc(sizeof(tSchBeaconStruct));
+	beacon = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 	if (NULL == beacon) {
 		lim_log(mac_ctx, LOGE, FL("Unable to allocate memory"));
 		return;
@@ -629,7 +629,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Should not recieved Re/Assoc Response in role %d "),
 			GET_LIM_SYSTEM_ROLE(session_entry));
-		cdf_mem_free(beacon);
+		qdf_mem_free(beacon);
 		return;
 	}
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
@@ -667,12 +667,12 @@
 				mac_ctx->lim.retry_packet_cnt++;
 			}
 		}
-		cdf_mem_free(beacon);
+		qdf_mem_free(beacon);
 		return;
 	}
 	sir_copy_mac_addr(current_bssid, session_entry->bssId);
 	if (subtype == LIM_ASSOC) {
-		if (!cdf_mem_compare
+		if (qdf_mem_cmp
 			(hdr->sa, current_bssid, sizeof(tSirMacAddr))) {
 			/*
 			 * Received Association Response frame from an entity
@@ -683,11 +683,11 @@
 				 FL("received AssocRsp from unexpected peer "
 				MAC_ADDRESS_STR),
 				MAC_ADDR_ARRAY(hdr->sa));
-			cdf_mem_free(beacon);
+			qdf_mem_free(beacon);
 			return;
 		}
 	} else {
-		if (!cdf_mem_compare
+		if (qdf_mem_cmp
 			(hdr->sa, session_entry->limReAssocbssId,
 			sizeof(tSirMacAddr))) {
 			/*
@@ -699,16 +699,16 @@
 				FL("received ReassocRsp from unexpected peer "
 				MAC_ADDRESS_STR),
 				MAC_ADDR_ARRAY(hdr->sa));
-			cdf_mem_free(beacon);
+			qdf_mem_free(beacon);
 			return;
 		}
 	}
 
-	assoc_rsp = cdf_mem_malloc(sizeof(*assoc_rsp));
+	assoc_rsp = qdf_mem_malloc(sizeof(*assoc_rsp));
 	if (NULL == assoc_rsp) {
 		lim_log(mac_ctx, LOGP,
 			FL("Allocate Memory failed in AssocRsp"));
-		cdf_mem_free(beacon);
+		qdf_mem_free(beacon);
 		return;
 	}
 	/* Get pointer to Re/Association Response frame body */
@@ -721,18 +721,18 @@
 	/* parse Re/Association Response frame. */
 	if (sir_convert_assoc_resp_frame2_struct(mac_ctx, body,
 		frame_len, assoc_rsp) == eSIR_FAILURE) {
-		cdf_mem_free(assoc_rsp);
+		qdf_mem_free(assoc_rsp);
 		lim_log(mac_ctx, LOGE,
 			FL("Parse error Assoc resp subtype %d," "length=%d"),
 			frame_len, subtype);
-		cdf_mem_free(beacon);
+		qdf_mem_free(beacon);
 		return;
 	}
 
 	if (!assoc_rsp->suppRatesPresent) {
 		lim_log(mac_ctx, LOGE,
 		FL("assoc response does not have supported rate set"));
-		cdf_mem_copy(&assoc_rsp->supportedRates,
+		qdf_mem_copy(&assoc_rsp->supportedRates,
 			&session_entry->rateSet,
 			sizeof(tSirMacRateSet));
 	}
@@ -742,12 +742,12 @@
 		lim_log(mac_ctx, LOGW,
 			FL("session_entry->assocRsp is not NULL freeing it "
 			 "and setting NULL"));
-		cdf_mem_free(session_entry->assocRsp);
+		qdf_mem_free(session_entry->assocRsp);
 		session_entry->assocRsp = NULL;
 		session_entry->assocRspLen = 0;
 	}
 
-	session_entry->assocRsp = cdf_mem_malloc(frame_len);
+	session_entry->assocRsp = qdf_mem_malloc(frame_len);
 	if (NULL == session_entry->assocRsp) {
 		lim_log(mac_ctx, LOGE,
 			FL("Unable to allocate memory for assoc res,len=%d"),
@@ -757,7 +757,7 @@
 		 * Store the Assoc response. This is sent
 		 * to csr/hdd in join cnf response.
 		 */
-		cdf_mem_copy(session_entry->assocRsp, body, frame_len);
+		qdf_mem_copy(session_entry->assocRsp, body, frame_len);
 		session_entry->assocRspLen = frame_len;
 	}
 
@@ -771,12 +771,12 @@
 	if (assoc_rsp->FTInfo.R0KH_ID.present) {
 		roam_session->ftSmeContext.r0kh_id_len =
 			assoc_rsp->FTInfo.R0KH_ID.num_PMK_R0_ID;
-		cdf_mem_copy(roam_session->ftSmeContext.r0kh_id,
+		qdf_mem_copy(roam_session->ftSmeContext.r0kh_id,
 			assoc_rsp->FTInfo.R0KH_ID.PMK_R0_ID,
 			roam_session->ftSmeContext.r0kh_id_len);
 	} else {
 		roam_session->ftSmeContext.r0kh_id_len = 0;
-		cdf_mem_zero(roam_session->ftSmeContext.r0kh_id,
+		qdf_mem_zero(roam_session->ftSmeContext.r0kh_id,
 			SIR_ROAM_R0KH_ID_MAX_LEN);
 	}
 #endif
@@ -794,15 +794,15 @@
 		 */
 		lim_log(mac_ctx, LOGE,
 			FL("received Re/AssocRsp frame with IBSS capability"));
-		cdf_mem_free(assoc_rsp);
-		cdf_mem_free(beacon);
+		qdf_mem_free(assoc_rsp);
+		qdf_mem_free(beacon);
 		return;
 	}
 
 	if (cfg_get_capability_info(mac_ctx, &caps, session_entry)
 		!= eSIR_SUCCESS) {
-		cdf_mem_free(assoc_rsp);
-		cdf_mem_free(beacon);
+		qdf_mem_free(assoc_rsp);
+		qdf_mem_free(beacon);
 		lim_log(mac_ctx, LOGP, FL("could not retrieve Capabilities "));
 		return;
 	}
@@ -817,7 +817,7 @@
 		if ((NULL != mac_ctx->lim.pSessionEntry)
 		    && (NULL !=
 			mac_ctx->lim.pSessionEntry->pLimMlmReassocRetryReq)) {
-			cdf_mem_free(
+			qdf_mem_free(
 			mac_ctx->lim.pSessionEntry->pLimMlmReassocRetryReq);
 			mac_ctx->lim.pSessionEntry->pLimMlmReassocRetryReq =
 				NULL;
@@ -904,8 +904,8 @@
 				FL("ASSOC resp with try again event recvd. "
 				"But try again time interval IE is wrong."));
 		}
-		cdf_mem_free(beacon);
-		cdf_mem_free(assoc_rsp);
+		qdf_mem_free(beacon);
+		qdf_mem_free(assoc_rsp);
 		return;
 	}
 #endif
@@ -920,8 +920,8 @@
 			NULL) != eSIR_SUCCESS) {
 			lim_log(mac_ctx, LOGE,
 				FL("Set link state to POSTASSOC failed"));
-			cdf_mem_free(beacon);
-			cdf_mem_free(assoc_rsp);
+			qdf_mem_free(beacon);
+			qdf_mem_free(assoc_rsp);
 			return;
 		}
 	}
@@ -937,7 +937,7 @@
 		lim_update_ese_tsm(mac_ctx, session_entry, assoc_rsp);
 #endif
 		if (session_entry->pLimMlmJoinReq) {
-			cdf_mem_free(session_entry->pLimMlmJoinReq);
+			qdf_mem_free(session_entry->pLimMlmJoinReq);
 			session_entry->pLimMlmJoinReq = NULL;
 		}
 
@@ -990,7 +990,7 @@
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 		}
 #endif
-			cdf_mem_free(beacon);
+			qdf_mem_free(beacon);
 			return;
 		}
 
@@ -1023,7 +1023,7 @@
 				goto assocReject;
 			}
 		}
-		cdf_mem_free(beacon);
+		qdf_mem_free(beacon);
 		return;
 	}
 	lim_log(mac_ctx, LOG1,
@@ -1047,8 +1047,8 @@
 		assoc_cnf.protStatusCode = eSIR_SME_SUCCESS;
 		lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF,
 			(uint32_t *) &assoc_cnf);
-		cdf_mem_free(assoc_rsp);
-		cdf_mem_free(beacon);
+		qdf_mem_free(assoc_rsp);
+		qdf_mem_free(beacon);
 		return;
 	}
 	/* Delete Pre-auth context for the associated BSS */
@@ -1084,10 +1084,10 @@
 			      eSIR_SUCCESS, eSIR_SUCCESS);
 #endif
 	if (assoc_rsp->QosMapSet.present)
-		cdf_mem_copy(&session_entry->QosMapSet,
+		qdf_mem_copy(&session_entry->QosMapSet,
 			&assoc_rsp->QosMapSet, sizeof(tSirQosMapSet));
 	 else
-		cdf_mem_zero(&session_entry->QosMapSet, sizeof(tSirQosMapSet));
+		qdf_mem_zero(&session_entry->QosMapSet, sizeof(tSirQosMapSet));
 
 	lim_update_stads_ext_cap(mac_ctx, session_entry, assoc_rsp, sta_ds);
 	/* Update the BSS Entry, this entry was added during preassoc. */
@@ -1095,8 +1095,8 @@
 			beacon,
 			&session_entry->pLimJoinReq->bssDescription, true,
 			 session_entry)) {
-		cdf_mem_free(assoc_rsp);
-		cdf_mem_free(beacon);
+		qdf_mem_free(assoc_rsp);
+		qdf_mem_free(beacon);
 		return;
 	} else {
 		lim_log(mac_ctx, LOGE, FL("could not update the bss entry"));
@@ -1123,7 +1123,7 @@
 			session_entry->peSessionId,
 			session_entry->limMlmState));
 		if (session_entry->pLimMlmJoinReq) {
-			cdf_mem_free(session_entry->pLimMlmJoinReq);
+			qdf_mem_free(session_entry->pLimMlmJoinReq);
 			session_entry->pLimMlmJoinReq = NULL;
 		}
 		if (subtype == LIM_ASSOC) {
@@ -1144,7 +1144,7 @@
 			session_entry);
 	}
 
-	cdf_mem_free(beacon);
-	cdf_mem_free(assoc_rsp);
+	qdf_mem_free(beacon);
+	qdf_mem_free(assoc_rsp);
 	return;
 }
diff --git a/core/mac/src/pe/lim/lim_process_auth_frame.c b/core/mac/src/pe/lim/lim_process_auth_frame.c
index 803d0e6..41b4c9c 100644
--- a/core/mac/src/pe/lim/lim_process_auth_frame.c
+++ b/core/mac/src/pe/lim/lim_process_auth_frame.c
@@ -155,7 +155,7 @@
 			return;
 		}
 
-		cdf_mem_copy((uint8_t *) auth_node->peerMacAddr, mac_hdr->sa,
+		qdf_mem_copy((uint8_t *) auth_node->peerMacAddr, mac_hdr->sa,
 				sizeof(tSirMacAddr));
 		auth_node->mlmState = eLIM_MLM_WT_AUTH_FRAME3_STATE;
 		auth_node->authType =
@@ -206,7 +206,7 @@
 			lim_log(mac_ctx, LOGE,
 				FL("Challenge text preparation failed"));
 		challenge = auth_node->challengeText;
-		cdf_mem_copy(challenge, (uint8_t *)challenge_txt_arr,
+		qdf_mem_copy(challenge, (uint8_t *)challenge_txt_arr,
 				sizeof(challenge_txt_arr));
 		/*
 		 * Sending Authenticaton frame with challenge.
@@ -217,7 +217,7 @@
 		auth_frame->authStatusCode = eSIR_MAC_SUCCESS_STATUS;
 		auth_frame->type = SIR_MAC_CHALLENGE_TEXT_EID;
 		auth_frame->length = SIR_MAC_AUTH_CHALLENGE_LENGTH;
-		cdf_mem_copy(auth_frame->challengeText,
+		qdf_mem_copy(auth_frame->challengeText,
 				auth_node->challengeText,
 				SIR_MAC_AUTH_CHALLENGE_LENGTH);
 		lim_send_auth_mgmt_frame(mac_ctx, auth_frame,
@@ -245,7 +245,7 @@
 	}
 	lim_log(mac_ctx, LOG1, FL("Alloc new data: %p peer "), auth_node);
 	lim_print_mac_addr(mac_ctx, mac_hdr->sa, LOG1);
-	cdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
+	qdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
 			mac_hdr->sa, sizeof(tSirMacAddr));
 	auth_node->mlmState = eLIM_MLM_AUTHENTICATED_STATE;
 	auth_node->authType = (tAniAuthType) rx_auth_frm_body->authAlgoNumber;
@@ -290,9 +290,9 @@
 		pMlmDisassocReq =
 			mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDisassocReq;
 		if (pMlmDisassocReq &&
-			cdf_mem_compare((uint8_t *) mac_hdr->sa, (uint8_t *)
+			(!qdf_mem_cmp((uint8_t *) mac_hdr->sa, (uint8_t *)
 				&pMlmDisassocReq->peer_macaddr.bytes,
-				QDF_MAC_ADDR_SIZE)) {
+				QDF_MAC_ADDR_SIZE))) {
 			lim_log(mac_ctx, LOGE,
 				FL("TODO:Ack for disassoc frame is pending Issue delsta for "
 				MAC_ADDRESS_STR),
@@ -304,9 +304,9 @@
 		pMlmDeauthReq =
 			mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq;
 		if (pMlmDeauthReq &&
-			cdf_mem_compare((uint8_t *) mac_hdr->sa, (uint8_t *)
+			(!qdf_mem_cmp((uint8_t *) mac_hdr->sa, (uint8_t *)
 				&pMlmDeauthReq->peer_macaddr.bytes,
-				QDF_MAC_ADDR_SIZE)) {
+				QDF_MAC_ADDR_SIZE))) {
 			lim_log(mac_ctx, LOGE,
 				FL("TODO:Ack for deauth frame is pending Issue delsta for "
 				MAC_ADDRESS_STR),
@@ -386,10 +386,10 @@
 						&pe_session->dph.dphHashTable);
 			if (NULL == sta_ds_ptr)
 				continue;
-			if (sta_ds_ptr->valid && cdf_mem_compare(
+			if (sta_ds_ptr->valid && (!qdf_mem_cmp(
 					(uint8_t *)&sta_ds_ptr->staAddr,
 					(uint8_t *) &(mac_hdr->sa),
-					(uint8_t) sizeof(tSirMacAddr)))
+					(uint8_t) sizeof(tSirMacAddr))))
 				break;
 			sta_ds_ptr = NULL;
 		}
@@ -523,7 +523,7 @@
 		    (rx_auth_frm_body->authStatusCode ==
 				eSIR_MAC_SUCCESS_STATUS) &&
 		    (pe_session->ftPEContext.pFTPreAuthReq != NULL) &&
-		    (cdf_mem_compare(
+		    (!qdf_mem_cmp(
 			pe_session->ftPEContext.pFTPreAuthReq->preAuthbssId,
 			mac_hdr->sa, sizeof(tSirMacAddr)))) {
 
@@ -534,7 +534,7 @@
 			pe_session->ftPEContext.saved_auth_rsp_length = 0;
 
 			if ((body_ptr != NULL) && (frame_len < MAX_FTIE_SIZE)) {
-				cdf_mem_copy(
+				qdf_mem_copy(
 					pe_session->ftPEContext.saved_auth_rsp,
 					body_ptr, frame_len);
 				pe_session->ftPEContext.saved_auth_rsp_length =
@@ -555,7 +555,7 @@
 		return;
 	}
 
-	if (!cdf_mem_compare((uint8_t *) mac_hdr->sa,
+	if (qdf_mem_cmp((uint8_t *) mac_hdr->sa,
 			(uint8_t *) &mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr,
 			sizeof(tSirMacAddr))) {
 		/*
@@ -632,7 +632,7 @@
 		lim_log(mac_ctx, LOG1,
 			FL("Alloc new data: %p peer"), auth_node);
 		lim_print_mac_addr(mac_ctx, mac_hdr->sa, LOG1);
-		cdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
+		qdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
 				mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr,
 				sizeof(tSirMacAddr));
 		auth_node->fTimerStarted = 0;
@@ -693,7 +693,7 @@
 		if (LIM_IS_AP_ROLE(pe_session)) {
 			tpSirKeys key_ptr =
 				&pe_session->WEPKeyMaterial[key_id].key[0];
-			cdf_mem_copy(defaultkey, key_ptr->key,
+			qdf_mem_copy(defaultkey, key_ptr->key,
 					key_ptr->keyLength);
 		} else if (wlan_cfg_get_str(mac_ctx,
 				(uint16_t)(WNI_CFG_WEP_DEFAULT_KEY_1 + key_id),
@@ -729,7 +729,7 @@
 			SIR_MAC_CHALLENGE_TEXT_EID;
 		((tpSirMacAuthFrameBody)plainbody)->length =
 			SIR_MAC_AUTH_CHALLENGE_LENGTH;
-		cdf_mem_copy((uint8_t *) (
+		qdf_mem_copy((uint8_t *) (
 			(tpSirMacAuthFrameBody)plainbody)->challengeText,
 			rx_auth_frm_body->challengeText,
 			SIR_MAC_AUTH_CHALLENGE_LENGTH);
@@ -864,7 +864,7 @@
 		 * Check if received challenge text is same as one sent in
 		 * Authentication frame3
 		 */
-		if (cdf_mem_compare(rx_auth_frm_body->challengeText,
+		if (!qdf_mem_cmp(rx_auth_frm_body->challengeText,
 					auth_node->challengeText,
 					SIR_MAC_AUTH_CHALLENGE_LENGTH)) {
 			/*
@@ -948,7 +948,7 @@
 		return;
 	}
 
-	if (!cdf_mem_compare((uint8_t *) mac_hdr->sa,
+	if (qdf_mem_cmp((uint8_t *) mac_hdr->sa,
 			(uint8_t *) &mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr,
 			sizeof(tSirMacAddr))) {
 		/*
@@ -996,7 +996,7 @@
 		lim_log(mac_ctx, LOG1, FL("Alloc new data: %p peer "),
 			auth_node);
 		lim_print_mac_addr(mac_ctx, mac_hdr->sa, LOG1);
-		cdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
+		qdf_mem_copy((uint8_t *) auth_node->peerMacAddr,
 				mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr,
 				sizeof(tSirMacAddr));
 		auth_node->fTimerStarted = 0;
@@ -1262,7 +1262,7 @@
 		if (LIM_IS_AP_ROLE(pe_session)) {
 			tpSirKeys key_ptr;
 			key_ptr = &pe_session->WEPKeyMaterial[key_id].key[0];
-			cdf_mem_copy(defaultkey, key_ptr->key,
+			qdf_mem_copy(defaultkey, key_ptr->key,
 					key_ptr->keyLength);
 			val = key_ptr->keyLength;
 		} else if (wlan_cfg_get_str(mac_ctx,
@@ -1438,7 +1438,7 @@
 		 (pHdr->seqControl.fragNum)));
 
 	/* Check that its the same bssId we have for preAuth */
-	if (!cdf_mem_compare
+	if (qdf_mem_cmp
 		    (psessionEntry->ftPEContext.pFTPreAuthReq->preAuthbssId,
 		    pHdr->bssId, sizeof(tSirMacAddr))) {
 		lim_log(pMac, LOGE, FL("Error: Same bssid as preauth BSSID"));
diff --git a/core/mac/src/pe/lim/lim_process_beacon_frame.c b/core/mac/src/pe/lim/lim_process_beacon_frame.c
index 6d80751..114e563 100644
--- a/core/mac/src/pe/lim/lim_process_beacon_frame.c
+++ b/core/mac/src/pe/lim/lim_process_beacon_frame.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -83,7 +83,7 @@
 		lim_print_mac_addr(mac_ctx, mac_hdr->sa, LOG2);
 
 	/* Expect Beacon in any state as Scan is independent of LIM state */
-	bcn_ptr = cdf_mem_malloc(sizeof(*bcn_ptr));
+	bcn_ptr = qdf_mem_malloc(sizeof(*bcn_ptr));
 	if (NULL == bcn_ptr) {
 		lim_log(mac_ctx, LOGE,
 			FL("Unable to allocate memory"));
@@ -102,7 +102,7 @@
 			session->limMlmState);
 		lim_print_mlm_state(mac_ctx, LOGW,
 			session->limMlmState);
-		cdf_mem_free(bcn_ptr);
+		qdf_mem_free(bcn_ptr);
 		return;
 	}
 	/*
@@ -113,7 +113,7 @@
 	if ((!session->lastBeaconDtimPeriod) &&
 	    (sir_compare_mac_addr(session->bssId,
 				bcn_ptr->bssid))) {
-		cdf_mem_copy((uint8_t *)&session->lastBeaconTimeStamp,
+		qdf_mem_copy((uint8_t *)&session->lastBeaconTimeStamp,
 			(uint8_t *) bcn_ptr->timeStamp,
 			sizeof(uint64_t));
 		session->lastBeaconDtimCount =
@@ -148,12 +148,12 @@
 	} else if (session->limMlmState ==
 			eLIM_MLM_WT_JOIN_BEACON_STATE) {
 		if (session->beacon != NULL) {
-			cdf_mem_free(session->beacon);
+			qdf_mem_free(session->beacon);
 			session->beacon = NULL;
 			session->bcnLen = 0;
 		}
 		session->bcnLen = WMA_GET_RX_PAYLOAD_LEN(rx_pkt_info);
-		session->beacon = cdf_mem_malloc(session->bcnLen);
+		session->beacon = qdf_mem_malloc(session->bcnLen);
 		if (NULL == session->beacon) {
 			lim_log(mac_ctx, LOGE,
 				FL("fail to alloc mem to store bcn"));
@@ -162,14 +162,14 @@
 			 * Store the Beacon/ProbeRsp. This is sent to
 			 * csr/hdd in join cnf response.
 			 */
-			cdf_mem_copy(session->beacon,
+			qdf_mem_copy(session->beacon,
 				WMA_GET_RX_MPDU_DATA(rx_pkt_info),
 				session->bcnLen);
 		}
 		lim_check_and_announce_join_success(mac_ctx, bcn_ptr,
 				mac_hdr, session);
 	}
-	cdf_mem_free(bcn_ptr);
+	qdf_mem_free(bcn_ptr);
 	return;
 }
 
@@ -204,7 +204,7 @@
 	if ((pMac->lim.gLimMlmState == eLIM_MLM_WT_PROBE_RESP_STATE) ||
 	    (pMac->lim.gLimMlmState == eLIM_MLM_PASSIVE_SCAN_STATE) ||
 	    (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE)) {
-		pBeacon = cdf_mem_malloc(sizeof(tSchBeaconStruct));
+		pBeacon = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 		if (NULL == pBeacon) {
 			lim_log(pMac, LOGE,
 				FL
@@ -221,7 +221,7 @@
 					("Received invalid Beacon in global MLM state %X"),
 				pMac->lim.gLimMlmState);
 			lim_print_mlm_state(pMac, LOGW, pMac->lim.gLimMlmState);
-			cdf_mem_free(pBeacon);
+			qdf_mem_free(pBeacon);
 			return;
 		}
 
@@ -236,7 +236,7 @@
 						 &pMac->lim.dfschannelList);
 		} else if (pMac->lim.gLimMlmState == eLIM_MLM_LEARN_STATE) {
 		} /* end of eLIM_MLM_LEARN_STATE) */
-		cdf_mem_free(pBeacon);
+		qdf_mem_free(pBeacon);
 	} /* end of (eLIM_MLM_WT_PROBE_RESP_STATE) || (eLIM_MLM_PASSIVE_SCAN_STATE) */
 	else {
 		lim_log(pMac, LOG1, FL("Rcvd Beacon in unexpected MLM state %s (%d)"),
diff --git a/core/mac/src/pe/lim/lim_process_cfg_updates.c b/core/mac/src/pe/lim/lim_process_cfg_updates.c
index ae1cf2a..ece95d4 100644
--- a/core/mac/src/pe/lim/lim_process_cfg_updates.c
+++ b/core/mac/src/pe/lim/lim_process_cfg_updates.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -78,7 +78,7 @@
 	if (pesessionEntry != NULL && LIM_IS_AP_ROLE(pesessionEntry)) {
 		if (pesessionEntry->gLimProtectionControl ==
 		    WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE)
-			cdf_mem_set((void *)&pesessionEntry->cfgProtection,
+			qdf_mem_set((void *)&pesessionEntry->cfgProtection,
 				    sizeof(tCfgProtection), 0);
 		else {
 			lim_log(pMac, LOG1,
@@ -112,7 +112,7 @@
 
 		if (pMac->lim.gLimProtectionControl ==
 		    WNI_CFG_FORCE_POLICY_PROTECTION_DISABLE)
-			cdf_mem_set((void *)&pMac->lim.cfgProtection,
+			qdf_mem_set((void *)&pMac->lim.cfgProtection,
 				    sizeof(tCfgProtection), 0);
 		else {
 			pMac->lim.cfgProtection.fromlla =
diff --git a/core/mac/src/pe/lim/lim_process_deauth_frame.c b/core/mac/src/pe/lim/lim_process_deauth_frame.c
index 2cca55d..ba26a69 100644
--- a/core/mac/src/pe/lim/lim_process_deauth_frame.c
+++ b/core/mac/src/pe/lim/lim_process_deauth_frame.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -373,7 +373,7 @@
 				psessionEntry->limMlmState, reasonCode,
 				MAC_ADDR_ARRAY(pHdr->sa));
 			/* / Issue Deauth Indication to SME. */
-			cdf_mem_copy((uint8_t *) &mlmDeauthInd.peerMacAddr,
+			qdf_mem_copy((uint8_t *) &mlmDeauthInd.peerMacAddr,
 				     pHdr->sa, sizeof(tSirMacAddr));
 			mlmDeauthInd.reasonCode = reasonCode;
 
@@ -403,7 +403,7 @@
 				lim_delete_pre_auth_node(pMac, pHdr->sa);
 
 			if (psessionEntry->pLimMlmJoinReq) {
-				cdf_mem_free(psessionEntry->pLimMlmJoinReq);
+				qdf_mem_free(psessionEntry->pLimMlmJoinReq);
 				psessionEntry->pLimMlmJoinReq = NULL;
 			}
 
@@ -548,7 +548,7 @@
 	pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DEAUTH;
 
 	/* / Issue Deauth Indication to SME. */
-	cdf_mem_copy((uint8_t *) &mlmDeauthInd.peerMacAddr,
+	qdf_mem_copy((uint8_t *) &mlmDeauthInd.peerMacAddr,
 		     pStaDs->staAddr, sizeof(tSirMacAddr));
 	mlmDeauthInd.reasonCode =
 		(uint8_t) pStaDs->mlmStaContext.disassocReason;
@@ -570,7 +570,7 @@
 			lim_delete_pre_auth_node(pMac, pHdr->sa);
 
 		if (psessionEntry->limAssocResponseData) {
-			cdf_mem_free(psessionEntry->limAssocResponseData);
+			qdf_mem_free(psessionEntry->limAssocResponseData);
 			psessionEntry->limAssocResponseData = NULL;
 		}
 
diff --git a/core/mac/src/pe/lim/lim_process_disassoc_frame.c b/core/mac/src/pe/lim/lim_process_disassoc_frame.c
index 70a9a8d..699b02c 100644
--- a/core/mac/src/pe/lim/lim_process_disassoc_frame.c
+++ b/core/mac/src/pe/lim/lim_process_disassoc_frame.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -360,7 +360,7 @@
 	pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes) reasonCode;
 
 	/* Issue Disassoc Indication to SME. */
-	cdf_mem_copy((uint8_t *) &mlmDisassocInd.peerMacAddr,
+	qdf_mem_copy((uint8_t *) &mlmDisassocInd.peerMacAddr,
 		     (uint8_t *) pStaDs->staAddr, sizeof(tSirMacAddr));
 	mlmDisassocInd.reasonCode =
 		(uint8_t) pStaDs->mlmStaContext.disassocReason;
@@ -383,7 +383,7 @@
 		       )
 
 		if (psessionEntry->limAssocResponseData) {
-			cdf_mem_free(psessionEntry->limAssocResponseData);
+			qdf_mem_free(psessionEntry->limAssocResponseData);
 			psessionEntry->limAssocResponseData = NULL;
 		}
 
diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c
index 7cd2a9d..0e71547 100644
--- a/core/mac/src/pe/lim/lim_process_message_queue.c
+++ b/core/mac/src/pe/lim/lim_process_message_queue.c
@@ -67,7 +67,7 @@
 
 #include "qdf_types.h"
 #include "cds_packet.h"
-#include "cdf_memory.h"
+#include "qdf_mem.h"
 
 void lim_log_session_states(tpAniSirGlobal pMac);
 static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx,
@@ -101,7 +101,7 @@
 
 	len = sizeof(*param);
 
-	param = cdf_mem_malloc(len);
+	param = qdf_mem_malloc(len);
 	if (!param) {
 		lim_log(mac, LOGE, FL("Fail to allocate memory"));
 		/* Memory allocation for param failed.
@@ -155,7 +155,7 @@
 
 	len = sizeof(*param);
 
-	param = cdf_mem_malloc(len);
+	param = qdf_mem_malloc(len);
 	if (!param) {
 		lim_log(mac, LOGE, FL("Fail to allocate memory"));
 		/* Memory allocation for param failed.
@@ -218,7 +218,7 @@
 
 	len = sizeof(*param);
 
-	param = cdf_mem_malloc(len);
+	param = qdf_mem_malloc(len);
 	if (!param) {
 		lim_log(mac, LOGE, FL("Fail to allocate memory"));
 		return;
@@ -345,14 +345,14 @@
 	len = sizeof(*result) + (num_results * sizeof(tSirWifiScanResult)) +
 		ie_len;
 
-	result = cdf_mem_malloc(len);
+	result = qdf_mem_malloc(len);
 	if (NULL == result) {
 		lim_log(pmac, LOGE, FL("Memory allocation failed"));
 		return;
 	}
 	hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 	body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
-	cdf_mem_zero(result, sizeof(*result) + ie_len);
+	qdf_mem_zero(result, sizeof(*result) + ie_len);
 
 	/* Received frame does not have request id, hence set 0 */
 	result->request_id = 0;
@@ -369,14 +369,14 @@
 		result->ap[i].rtt = 0;
 		result->ap[i].rtt_sd = 0;
 		result->ap[i].ieLength = ie_len;
-		cdf_mem_copy((uint8_t *) &result->ap[i].ssid[0],
+		qdf_mem_copy((uint8_t *) &result->ap[i].ssid[0],
 			(uint8_t *) frame->ssId.ssId, frame->ssId.length);
 		result->ap[i].ssid[frame->ssId.length] = '\0';
-		cdf_mem_copy((uint8_t *) &result->ap[i].bssid,
+		qdf_mem_copy((uint8_t *) &result->ap[i].bssid,
 				(uint8_t *) hdr->bssId,
 				sizeof(tSirMacAddr));
 		/* Copy IE fields */
-		cdf_mem_copy((uint8_t *) &result->ap[i].ieData,
+		qdf_mem_copy((uint8_t *) &result->ap[i].ieData,
 				body + SIR_MAC_B_PR_SSID_OFFSET, ie_len);
 	}
 
@@ -398,14 +398,14 @@
 	tSirMsgQ                     mmh_msg;
 	tpSirMacMgmtHdr              hdr;
 
-	result = cdf_mem_malloc(sizeof(*result) + ie_len);
+	result = qdf_mem_malloc(sizeof(*result) + ie_len);
 	if (NULL == result) {
 		lim_log(pmac, LOGE, FL("Memory allocation failed"));
 		return;
 	}
 	hdr = WMA_GET_RX_MAC_HEADER(rx_pkt_info);
 	body = WMA_GET_RX_MPDU_DATA(rx_pkt_info);
-	cdf_mem_zero(result, sizeof(*result) + ie_len);
+	qdf_mem_zero(result, sizeof(*result) + ie_len);
 
 	/* Received frame does not have request id, hence set 0 */
 	result->requestId = 0;
@@ -421,14 +421,14 @@
 	result->ap.rtt_sd = 0;
 	result->ap.ieLength = ie_len;
 
-	cdf_mem_copy((uint8_t *) &result->ap.ssid[0],
+	qdf_mem_copy((uint8_t *) &result->ap.ssid[0],
 			(uint8_t *) frame->ssId.ssId, frame->ssId.length);
 	result->ap.ssid[frame->ssId.length] = '\0';
-	cdf_mem_copy((uint8_t *) &result->ap.bssid.bytes,
+	qdf_mem_copy((uint8_t *) &result->ap.bssid.bytes,
 			(uint8_t *) hdr->bssId,
 			QDF_MAC_ADDR_SIZE);
 	/* Copy IE fields */
-	cdf_mem_copy((uint8_t *) &result->ap.ieData,
+	qdf_mem_copy((uint8_t *) &result->ap.ieData,
 			body + SIR_MAC_B_PR_SSID_OFFSET, ie_len);
 
 	mmh_msg.type = msg_type;
@@ -454,7 +454,7 @@
 		return;
 	}
 
-	frame = cdf_mem_malloc(sizeof(*frame));
+	frame = qdf_mem_malloc(sizeof(*frame));
 	if (NULL == frame) {
 		lim_log(pmac, LOGE, FL("Memory allocation failed"));
 		return;
@@ -471,13 +471,13 @@
 		status = sir_convert_probe_frame2_struct(pmac, body,
 							frm_len, frame);
 	} else {
-		cdf_mem_free(frame);
+		qdf_mem_free(frame);
 		return;
 	}
 
 	if (status != eSIR_SUCCESS) {
 		lim_log(pmac, LOGE, FL("Frame parsing failed"));
-		cdf_mem_free(frame);
+		qdf_mem_free(frame);
 		return;
 	}
 
@@ -491,7 +491,7 @@
 					(frm_len - SIR_MAC_B_PR_SSID_OFFSET),
 					eWNI_SME_EPNO_NETWORK_FOUND_IND);
 
-	cdf_mem_free(frame);
+	qdf_mem_free(frame);
 }
 #endif
 
@@ -675,8 +675,8 @@
 				break;
 			}
 			if (mgmt_frame->matchLen <= frm_len &&
-				cdf_mem_compare(mgmt_frame->matchData, body,
-				mgmt_frame->matchLen)) {
+				(!qdf_mem_cmp(mgmt_frame->matchData, body,
+				mgmt_frame->matchLen))) {
 				/* found match! */
 				match = true;
 				break;
@@ -1027,7 +1027,7 @@
 	tSirRetStatus rc = eSIR_SUCCESS;
 	tAbortScanParams *pAbortScanParams;
 
-	pAbortScanParams = cdf_mem_malloc(sizeof(tAbortScanParams));
+	pAbortScanParams = qdf_mem_malloc(sizeof(tAbortScanParams));
 	if (NULL == pAbortScanParams) {
 		lim_log(pMac, LOGP,
 			FL("Memory allocation failed for AbortScanParams"));
@@ -1044,7 +1044,7 @@
 	rc = wma_post_ctrl_msg(pMac, &msg);
 	if (rc != eSIR_SUCCESS) {
 		lim_log(pMac, LOGE, FL("wma_post_ctrl_msg() return failure"));
-		cdf_mem_free(pAbortScanParams);
+		qdf_mem_free(pAbortScanParams);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -1120,7 +1120,7 @@
 	}
 
 	if (NULL != pMac->lim.gpLimMlmOemDataReq) {
-		cdf_mem_free(pMac->lim.gpLimMlmOemDataReq);
+		qdf_mem_free(pMac->lim.gpLimMlmOemDataReq);
 		pMac->lim.gpLimMlmOemDataReq = NULL;
 	}
 	/* "Failure" status doesn't mean that Oem Data Rsp did not happen */
@@ -1188,7 +1188,7 @@
 #endif
 	tSirMbMsgP2p *p2p_msg = NULL;
 	if (ANI_DRIVER_TYPE(mac_ctx) == eDRIVER_TYPE_MFG) {
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		return;
 	}
@@ -1256,7 +1256,7 @@
 			QDF_ASSERT(0);
 			break;
 		}
-		cdf_mem_copy((uint8_t *) &new_msg,
+		qdf_mem_copy((uint8_t *) &new_msg,
 			(uint8_t *) msg, sizeof(tSirMsgQ));
 		body_ptr = (cds_pkt_t *) new_msg.bodyptr;
 		cds_pkt_get_packet_length(body_ptr, &pkt_len);
@@ -1323,7 +1323,7 @@
 			scan_id = req_msg->scan_id;
 			lim_process_abort_scan_ind(mac_ctx, session_id,
 				scan_id, USER_SCAN_REQUESTOR_ID);
-			cdf_mem_free((void *)msg->bodyptr);
+			qdf_mem_free((void *)msg->bodyptr);
 			msg->bodyptr = NULL;
 		}
 		break;
@@ -1373,20 +1373,20 @@
 
 	case eWNI_PMC_SMPS_STATE_IND:
 		if (msg->bodyptr) {
-			cdf_mem_free(msg->bodyptr);
+			qdf_mem_free(msg->bodyptr);
 			msg->bodyptr = NULL;
 		}
 		break;
 	case eWNI_SME_SEND_ACTION_FRAME_IND:
 		lim_send_p2p_action_frame(mac_ctx, msg);
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case eWNI_SME_ABORT_REMAIN_ON_CHAN_IND:
 		p2p_msg = (tSirMbMsgP2p *) msg->bodyptr;
 		lim_process_abort_scan_ind(mac_ctx, p2p_msg->sessionId,
 			p2p_msg->scan_id, ROC_SCAN_REQUESTOR_ID);
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case SIR_HAL_P2P_NOA_START_IND:
@@ -1405,7 +1405,7 @@
 				(session_entry->pePersona == QDF_P2P_GO_MODE)) {
 				/* Save P2P NOA start attribute for Go persona*/
 				p2p_go_exists = 1;
-				cdf_mem_copy(&session_entry->p2pGoPsNoaStartInd,
+				qdf_mem_copy(&session_entry->p2pGoPsNoaStartInd,
 					msg->bodyptr, sizeof(tSirP2PNoaStart));
 				qdf_status =
 					session_entry->p2pGoPsNoaStartInd.status;
@@ -1426,7 +1426,7 @@
 		/* We received the NOA start indication. Now we can send down
 		 * the SME request which requires off-channel operation */
 		lim_process_regd_defd_sme_req_after_noa_start(mac_ctx);
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 #ifdef FEATURE_WLAN_TDLS
@@ -1437,7 +1437,7 @@
 		if (session_entry == NULL) {
 				lim_log(mac_ctx, LOG1,
 					FL("No session exist for given bssId"));
-				cdf_mem_free(msg->bodyptr);
+				qdf_mem_free(msg->bodyptr);
 				msg->bodyptr = NULL;
 				return;
 			}
@@ -1446,7 +1446,7 @@
 			if (sta_ds == NULL) {
 				lim_log(mac_ctx, LOG1,
 					FL("No sta_ds exist for given staId"));
-				cdf_mem_free(msg->bodyptr);
+				qdf_mem_free(msg->bodyptr);
 				msg->bodyptr = NULL;
 				return;
 			}
@@ -1458,7 +1458,7 @@
 				lim_send_sme_tdls_del_sta_ind(mac_ctx, sta_ds,
 					session_entry, tdls_ind->reasonCode);
 			}
-			cdf_mem_free(msg->bodyptr);
+			qdf_mem_free(msg->bodyptr);
 			msg->bodyptr = NULL;
 		break;
 #endif
@@ -1471,7 +1471,7 @@
 			if ((session_entry != NULL) && (session_entry->valid)
 				&& (session_entry->pePersona ==
 				QDF_P2P_GO_MODE)) { /* Save P2P attr for Go */
-					cdf_mem_copy(
+					qdf_mem_copy(
 						&session_entry->p2pGoPsUpdate,
 						msg->bodyptr,
 						sizeof(tSirP2PNoaAttr));
@@ -1493,12 +1493,12 @@
 					break;
 			}
 		}
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case WMA_MISSED_BEACON_IND:
 		lim_ps_offload_handle_missed_beacon_ind(mac_ctx, msg);
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case SIR_LIM_ADDTS_RSP_TIMEOUT:
@@ -1634,7 +1634,7 @@
 		break;
 	case WMA_SET_MIMOPS_RSP:
 	case WMA_SET_TX_POWER_RSP:
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case WMA_SET_MAX_TX_POWER_RSP:
@@ -1642,7 +1642,7 @@
 		rrm_set_max_tx_power_rsp(mac_ctx, msg);
 #endif
 		if (msg->bodyptr != NULL) {
-			cdf_mem_free((void *)msg->bodyptr);
+			qdf_mem_free((void *)msg->bodyptr);
 			msg->bodyptr = NULL;
 		}
 		break;
@@ -1652,7 +1652,7 @@
 		/* message from HAL indicating addr2 mismatch interrupt occurred
 		 * msg->bodyptr contains only pointer to 48-bit addr2 field
 		 */
-		cdf_mem_free((void *)(msg->bodyptr));
+		qdf_mem_free((void *)(msg->bodyptr));
 		msg->bodyptr = NULL;
 		break;
 #ifdef WLAN_FEATURE_VOWIFI_11R
@@ -1677,7 +1677,7 @@
 			link_state_param->callback(mac_ctx,
 				link_state_param->callbackArg,
 				link_state_param->status);
-		cdf_mem_free((void *)(msg->bodyptr));
+		qdf_mem_free((void *)(msg->bodyptr));
 		msg->bodyptr = NULL;
 		break;
 	case eWNI_SME_SET_BCN_FILTER_REQ:
@@ -1688,7 +1688,7 @@
 			 eSIR_SUCCESS))
 			lim_log(mac_ctx, LOGE,
 				FL("Failied to send Beacon Filter Info "));
-		cdf_mem_free((void *)(msg->bodyptr));
+		qdf_mem_free((void *)(msg->bodyptr));
 		msg->bodyptr = NULL;
 		break;
 #ifdef FEATURE_WLAN_TDLS
@@ -1711,7 +1711,7 @@
 				session_entry->smeSessionId, NULL, NULL,
 				tdls_link_params->status);
 		}
-		cdf_mem_free((void *)(msg->bodyptr));
+		qdf_mem_free((void *)(msg->bodyptr));
 		msg->bodyptr = NULL;
 		break;
 #endif
@@ -1720,7 +1720,7 @@
 		break;
 	case WMA_IBSS_PEER_INACTIVITY_IND:
 		lim_process_ibss_peer_inactivity(mac_ctx, msg->bodyptr);
-		cdf_mem_free((void *)(msg->bodyptr));
+		qdf_mem_free((void *)(msg->bodyptr));
 		msg->bodyptr = NULL;
 		break;
 	case WMA_DFS_RADAR_IND:
@@ -1731,7 +1731,7 @@
 	case WMA_DFS_BEACON_TX_SUCCESS_IND:
 		lim_process_beacon_tx_success_ind(mac_ctx, msg->type,
 				(void *)msg->bodyptr);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case WMA_DISASSOC_TX_COMP:
@@ -1742,7 +1742,7 @@
 		break;
 #ifdef FEATURE_AP_MCC_CH_AVOIDANCE
 	case WMA_UPDATE_Q2Q_IE_IND:
-		cdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
+		qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
 		beacon_params.paramChangeBitmap = 0;
 		for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
 			vdev_id = ((uint8_t *)msg->bodyptr)[i];
@@ -1778,65 +1778,65 @@
 					session_entry);
 			}
 		}
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 	case eWNI_SME_NSS_UPDATE_REQ:
 	case eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ:
 		lim_process_sme_req_messages(mac_ctx, msg);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case eWNI_SME_CHANNEL_CHANGE_REQ:
 		lim_process_sme_req_messages(mac_ctx, msg);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case eWNI_SME_START_BEACON_REQ:
 		lim_process_sme_req_messages(mac_ctx, msg);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case eWNI_SME_UPDATE_ADDITIONAL_IES:
 		lim_process_sme_req_messages(mac_ctx, msg);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case eWNI_SME_MODIFY_ADDITIONAL_IES:
 		lim_process_sme_req_messages(mac_ctx, msg);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 #ifdef QCA_HT_2040_COEX
 	case eWNI_SME_SET_HT_2040_MODE:
 		lim_process_sme_req_messages(mac_ctx, msg);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 #endif
 	case SIR_HAL_SOC_SET_HW_MODE_RESP:
 		lim_process_set_hw_mode_resp(mac_ctx, msg->bodyptr);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case SIR_HAL_SOC_HW_MODE_TRANS_IND:
 		lim_process_hw_mode_trans_ind(mac_ctx, msg->bodyptr);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case SIR_HAL_SOC_DUAL_MAC_CFG_RESP:
 		lim_process_dual_mac_cfg_resp(mac_ctx, msg->bodyptr);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	case eWNI_SME_SET_IE_REQ:
 		lim_process_sme_req_messages(mac_ctx, msg);
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		break;
 	default:
-		cdf_mem_free((void *)msg->bodyptr);
+		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;
 		/* Unwanted messages */
 		/* Log error */
@@ -1882,7 +1882,7 @@
 	size = pMac->lim.gLimDeferredMsgQ.size;
 	if (size > 0) {
 		while ((readMsg = lim_read_deferred_msg_q(pMac)) != NULL) {
-			cdf_mem_copy((uint8_t *) &limMsg,
+			qdf_mem_copy((uint8_t *) &limMsg,
 				     (uint8_t *) readMsg, sizeof(tSirMsgQ));
 			size--;
 			lim_process_messages(pMac, &limMsg);
@@ -1949,7 +1949,7 @@
 #endif
 			lim_log_session_states(mac_ctx);
 			/* Release body */
-			cdf_mem_free(msg->bodyptr);
+			qdf_mem_free(msg->bodyptr);
 			msg->bodyptr = NULL;
 		}
 	} else {
@@ -1968,7 +1968,7 @@
 			 * Release body. limProcessSmeReqMessage consumed the
 			 * buffer. We can free it.
 			 */
-			cdf_mem_free(msg->bodyptr);
+			qdf_mem_free(msg->bodyptr);
 			msg->bodyptr = NULL;
 		}
 	}
diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
index 8b1e0d2..32b862b 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c
@@ -373,7 +373,7 @@
 		goto error;
 	}
 
-	start_oem_data_req = cdf_mem_malloc(sizeof(*start_oem_data_req));
+	start_oem_data_req = qdf_mem_malloc(sizeof(*start_oem_data_req));
 	if (NULL == start_oem_data_req) {
 		lim_log(mac_ctx, LOGE, FL
 			("Could not allocate memory for start_oem_data_req"));
@@ -381,10 +381,10 @@
 	}
 
 	start_oem_data_req->data =
-		cdf_mem_malloc(mac_ctx->lim.gpLimMlmOemDataReq->data_len);
+		qdf_mem_malloc(mac_ctx->lim.gpLimMlmOemDataReq->data_len);
 	if (!start_oem_data_req->data) {
 		lim_log(mac_ctx, LOGE, FL("memory allocation failed"));
-		cdf_mem_free(start_oem_data_req);
+		qdf_mem_free(start_oem_data_req);
 		goto error;
 	}
 
@@ -394,7 +394,7 @@
 
 	start_oem_data_req->data_len =
 			mac_ctx->lim.gpLimMlmOemDataReq->data_len;
-	cdf_mem_copy(start_oem_data_req->data,
+	qdf_mem_copy(start_oem_data_req->data,
 		     mac_ctx->lim.gpLimMlmOemDataReq->data,
 		     mac_ctx->lim.gpLimMlmOemDataReq->data_len);
 
@@ -411,8 +411,8 @@
 		return;
 
 	SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true);
-	cdf_mem_free(start_oem_data_req->data);
-	cdf_mem_free(start_oem_data_req);
+	qdf_mem_free(start_oem_data_req->data);
+	qdf_mem_free(start_oem_data_req);
 	lim_log(mac_ctx, LOGE,
 		FL("OEM_DATA: posting WMA_START_OEM_DATA_REQ to HAL failed"));
 
@@ -421,7 +421,7 @@
 	MTRACE(mac_trace(mac_ctx, TRACE_CODE_MLM_STATE, NO_SESSION,
 		       mac_ctx->lim.gLimMlmState));
 
-	mlm_oem_data_rsp = cdf_mem_malloc(sizeof(tLimMlmOemDataRsp));
+	mlm_oem_data_rsp = qdf_mem_malloc(sizeof(tLimMlmOemDataRsp));
 	if (NULL == mlm_oem_data_rsp) {
 		lim_log(mac_ctx->hHdd, LOGP, FL
 			("memory allocation for mlm_oem_data_rsp"));
@@ -431,11 +431,11 @@
 
 	if (NULL != mac_ctx->lim.gpLimMlmOemDataReq) {
 		if (NULL != mac_ctx->lim.gpLimMlmOemDataReq->data) {
-			cdf_mem_free(
+			qdf_mem_free(
 				mac_ctx->lim.gpLimMlmOemDataReq->data);
 			mac_ctx->lim.gpLimMlmOemDataReq->data = NULL;
 		}
-		cdf_mem_free(mac_ctx->lim.gpLimMlmOemDataReq);
+		qdf_mem_free(mac_ctx->lim.gpLimMlmOemDataReq);
 		mac_ctx->lim.gpLimMlmOemDataReq = NULL;
 	}
 
@@ -467,8 +467,8 @@
 	wlan_cfg_get_int(mac_ctx, WNI_CFG_DOT11_MODE, &self_dot11mode);
 	sta_param->staType = STA_ENTRY_SELF; /* Identifying self */
 
-	cdf_mem_copy(sta_param->bssId, bssid, sizeof(tSirMacAddr));
-	cdf_mem_copy(sta_param->staMac, session_entry->selfMacAddr,
+	qdf_mem_copy(sta_param->bssId, bssid, sizeof(tSirMacAddr));
+	qdf_mem_copy(sta_param->staMac, session_entry->selfMacAddr,
 		     sizeof(tSirMacAddr));
 
 	/* Configuration related parameters to be changed to support BT-AMP */
@@ -594,7 +594,7 @@
 	uint32_t retcode;
 
 	/* Package WMA_ADD_BSS_REQ message parameters */
-	addbss_param = cdf_mem_malloc(sizeof(tAddBssParams));
+	addbss_param = qdf_mem_malloc(sizeof(tAddBssParams));
 	if (NULL == addbss_param) {
 		lim_log(mac_ctx, LOGE,
 			FL("Unable to allocate memory during ADD_BSS"));
@@ -602,13 +602,13 @@
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set(addbss_param, sizeof(tAddBssParams), 0);
+	qdf_mem_set(addbss_param, sizeof(tAddBssParams), 0);
 	/* Fill in tAddBssParams members */
-	cdf_mem_copy(addbss_param->bssId, mlm_start_req->bssId,
+	qdf_mem_copy(addbss_param->bssId, mlm_start_req->bssId,
 		     sizeof(tSirMacAddr));
 
 	/* Fill in tAddBssParams selfMacAddr */
-	cdf_mem_copy(addbss_param->selfMacAddr,
+	qdf_mem_copy(addbss_param->selfMacAddr,
 		     session->selfMacAddr, sizeof(tSirMacAddr));
 
 	addbss_param->bssType = mlm_start_req->bssType;
@@ -633,7 +633,7 @@
 		mlm_start_req->cfParamSet.cfpDurRemaining;
 
 	addbss_param->rateSet.numRates = mlm_start_req->rateSet.numRates;
-	cdf_mem_copy(addbss_param->rateSet.rate, mlm_start_req->rateSet.rate,
+	qdf_mem_copy(addbss_param->rateSet.rate, mlm_start_req->rateSet.rate,
 		     mlm_start_req->rateSet.numRates);
 
 	addbss_param->nwType = mlm_start_req->nwType;
@@ -657,7 +657,7 @@
 	addbss_param->sessionId = mlm_start_req->sessionId;
 
 	/* Send the SSID to HAL to enable SSID matching for IBSS */
-	cdf_mem_copy(&(addbss_param->ssId.ssId),
+	qdf_mem_copy(&(addbss_param->ssId.ssId),
 		     mlm_start_req->ssId.ssId, mlm_start_req->ssId.length);
 	addbss_param->ssId.length = mlm_start_req->ssId.length;
 	addbss_param->bHiddenSSIDEn = mlm_start_req->ssidHidden;
@@ -708,7 +708,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Posting ADD_BSS_REQ to HAL failed, reason=%X"),
 			retcode);
-		cdf_mem_free(addbss_param);
+		qdf_mem_free(addbss_param);
 		return eSIR_SME_HAL_SEND_MESSAGE_FAIL;
 	}
 
@@ -773,7 +773,7 @@
 	mlm_start_cnf.sessionId = mlm_start_req->sessionId;
 
 	/* Free up buffer allocated for LimMlmScanReq */
-	cdf_mem_free(msg_buf);
+	qdf_mem_free(msg_buf);
 
 	/*
 	 * Respond immediately to LIM, only if MLME has not been
@@ -814,12 +814,12 @@
 		 */
 		if (mac_ctx->lim.gpLimMlmOemDataReq) {
 			if (mac_ctx->lim.gpLimMlmOemDataReq->data) {
-				cdf_mem_free(
+				qdf_mem_free(
 				 mac_ctx->lim.gpLimMlmOemDataReq->data);
 				mac_ctx->lim.gpLimMlmOemDataReq->data =
 				 NULL;
 			}
-			cdf_mem_free(mac_ctx->lim.gpLimMlmOemDataReq);
+			qdf_mem_free(mac_ctx->lim.gpLimMlmOemDataReq);
 			mac_ctx->lim.gpLimMlmOemDataReq = NULL;
 		}
 
@@ -838,15 +838,15 @@
 		lim_print_mlm_state(mac_ctx, LOGW, mac_ctx->lim.gLimMlmState);
 
 		/* Free up buffer allocated */
-		cdf_mem_free(msg_buf);
+		qdf_mem_free(msg_buf);
 
 		/* Return Meas confirm with INVALID_PARAMETERS */
-		mlm_oem_data_rsp = cdf_mem_malloc(sizeof(tLimMlmOemDataRsp));
+		mlm_oem_data_rsp = qdf_mem_malloc(sizeof(tLimMlmOemDataRsp));
 		if (mlm_oem_data_rsp != NULL) {
 			mlm_oem_data_rsp->target_rsp = false;
 			lim_post_sme_message(mac_ctx, LIM_MLM_OEM_DATA_CNF,
 					     (uint32_t *) mlm_oem_data_rsp);
-			cdf_mem_free(mlm_oem_data_rsp);
+			qdf_mem_free(mlm_oem_data_rsp);
 		} else {
 			lim_log(mac_ctx, LOGP, FL
 			    ("Could not allocate memory for mlm_oem_data_rsp"));
@@ -1087,7 +1087,7 @@
 	}
 
 error:
-	cdf_mem_free(msg);
+	qdf_mem_free(msg);
 	if (session != NULL)
 		session->pLimMlmJoinReq = NULL;
 	mlmjoin_cnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE;
@@ -1171,7 +1171,7 @@
 	      ((stads != NULL) &&
 	       (mac_ctx->lim.gpLimMlmAuthReq->authType ==
 			stads->mlmStaContext.authType)) &&
-	       (cdf_mem_compare(mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr,
+	       (!qdf_mem_cmp(mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr,
 			curr_bssid, sizeof(tSirMacAddr)))) ||
 	      ((preauth_node != NULL) &&
 	       (preauth_node->authType ==
@@ -1303,14 +1303,14 @@
 	}
 	return;
 end:
-	cdf_mem_copy((uint8_t *) &mlm_auth_cnf.peerMacAddr,
+	qdf_mem_copy((uint8_t *) &mlm_auth_cnf.peerMacAddr,
 		     (uint8_t *) &mac_ctx->lim.gpLimMlmAuthReq->peerMacAddr,
 		     sizeof(tSirMacAddr));
 
 	mlm_auth_cnf.authType = mac_ctx->lim.gpLimMlmAuthReq->authType;
 	mlm_auth_cnf.sessionId = session_id;
 
-	cdf_mem_free(mac_ctx->lim.gpLimMlmAuthReq);
+	qdf_mem_free(mac_ctx->lim.gpLimMlmAuthReq);
 	mac_ctx->lim.gpLimMlmAuthReq = NULL;
 	lim_log(mac_ctx, LOG1, "SessionId:%d LimPostSme LIM_MLM_AUTH_CNF ",
 		session_id);
@@ -1349,7 +1349,7 @@
 		lim_log(mac_ctx, LOGP,
 			FL("SessionId:%d Session Does not exist"),
 			mlm_assoc_req->sessionId);
-		cdf_mem_free(mlm_assoc_req);
+		qdf_mem_free(mlm_assoc_req);
 		return;
 	}
 
@@ -1359,7 +1359,7 @@
 	    !LIM_IS_BT_AMP_AP_ROLE(session_entry)) &&
 		(session_entry->limMlmState == eLIM_MLM_AUTHENTICATED_STATE ||
 		 session_entry->limMlmState == eLIM_MLM_JOINED_STATE) &&
-		(cdf_mem_compare(mlm_assoc_req->peerMacAddr,
+		(!qdf_mem_cmp(mlm_assoc_req->peerMacAddr,
 		 curr_bssId, sizeof(tSirMacAddr))))) {
 		/*
 		 * Received Association request either in invalid state
@@ -1435,7 +1435,7 @@
 	/* Update PE session Id */
 	mlm_assoc_cnf.sessionId = mlm_assoc_req->sessionId;
 	/* Free up buffer allocated for assocReq */
-	cdf_mem_free(mlm_assoc_req);
+	qdf_mem_free(mlm_assoc_req);
 	lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF,
 			     (uint32_t *) &mlm_assoc_cnf);
 }
@@ -1471,7 +1471,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Session Does not exist for given sessionId %d"),
 			reassoc_req->sessionId);
-		cdf_mem_free(reassoc_req);
+		qdf_mem_free(reassoc_req);
 		return;
 	}
 
@@ -1501,7 +1501,7 @@
 	}
 
 	if (session->pLimMlmReassocReq)
-		cdf_mem_free(session->pLimMlmReassocReq);
+		qdf_mem_free(session->pLimMlmReassocReq);
 
 	/*
 	 * Hold Re-Assoc request as part of Session, knock-out mac_ctx
@@ -1512,9 +1512,9 @@
 	/* See if we have pre-auth context with new AP */
 	auth_node = lim_search_pre_auth_list(mac_ctx, session->limReAssocbssId);
 
-	if (!auth_node && (!cdf_mem_compare(reassoc_req->peerMacAddr,
+	if (!auth_node && qdf_mem_cmp(reassoc_req->peerMacAddr,
 					    session->bssId,
-					    sizeof(tSirMacAddr)))) {
+					    sizeof(tSirMacAddr))) {
 		/*
 		 * Either pre-auth context does not exist AND
 		 * we are not reassociating with currently
@@ -1559,7 +1559,7 @@
 	/* Update PE sessio Id */
 	reassoc_cnf.sessionId = reassoc_req->sessionId;
 	/* Free up buffer allocated for reassocReq */
-	cdf_mem_free(reassoc_req);
+	qdf_mem_free(reassoc_req);
 	session->pLimReAssocReq = NULL;
 	lim_post_sme_message(mac_ctx, LIM_MLM_REASSOC_CNF,
 			     (uint32_t *) &reassoc_cnf);
@@ -1613,7 +1613,7 @@
 		session->limMlmState,
 		MAC_ADDR_ARRAY(mlm_disassocreq->peer_macaddr.bytes));
 
-	cdf_mem_copy(curr_bssid.bytes, session->bssId, QDF_MAC_ADDR_SIZE);
+	qdf_mem_copy(curr_bssid.bytes, session->bssId, QDF_MAC_ADDR_SIZE);
 
 	switch (GET_LIM_SYSTEM_ROLE(session)) {
 	case eLIM_STA_ROLE:
@@ -1630,7 +1630,7 @@
 			 * disassociation
 			 */
 			sme_disassoc_rsp =
-				cdf_mem_malloc(sizeof(tSirSmeDisassocRsp));
+				qdf_mem_malloc(sizeof(tSirSmeDisassocRsp));
 			if (NULL == sme_disassoc_rsp) {
 				lim_log(mac_ctx, LOGP,
 					FL("memory allocation failed for disassoc rsp"));
@@ -1751,13 +1751,13 @@
 			goto end;
 		}
 		/* Free up buffer allocated for mlmDisassocReq */
-		cdf_mem_free(mlm_disassocreq);
+		qdf_mem_free(mlm_disassocreq);
 	}
 
 	return;
 
 end:
-	cdf_mem_copy((uint8_t *) &mlm_disassoccnf.peerMacAddr,
+	qdf_mem_copy((uint8_t *) &mlm_disassoccnf.peerMacAddr,
 		     (uint8_t *) mlm_disassocreq->peer_macaddr.bytes,
 		     QDF_MAC_ADDR_SIZE);
 	mlm_disassoccnf.aid = mlm_disassocreq->aid;
@@ -1767,7 +1767,7 @@
 	mlm_disassoccnf.sessionId = mlm_disassocreq->sessionId;
 
 	/* Free up buffer allocated for mlmDisassocReq */
-	cdf_mem_free(mlm_disassocreq);
+	qdf_mem_free(mlm_disassocreq);
 
 	lim_post_sme_message(mac_ctx, LIM_MLM_DISASSOC_CNF,
 			     (uint32_t *) &mlm_disassoccnf);
@@ -1792,10 +1792,10 @@
 
 	disassoc_req = mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDisassocReq;
 	deauth_req = mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq;
-	if ((disassoc_req && (cdf_mem_compare((uint8_t *) sta_mac,
+	if ((disassoc_req && (!qdf_mem_cmp((uint8_t *) sta_mac,
 			      (uint8_t *) &disassoc_req->peer_macaddr.bytes,
 			       QDF_MAC_ADDR_SIZE))) ||
-	    (deauth_req && (cdf_mem_compare((uint8_t *) sta_mac,
+	    (deauth_req && (!qdf_mem_cmp((uint8_t *) sta_mac,
 			      (uint8_t *) &deauth_req->peer_macaddr.bytes,
 			       QDF_MAC_ADDR_SIZE)))) {
 		PELOG1(lim_log(mac_ctx, LOG1,
@@ -1826,7 +1826,7 @@
 	tLimMlmDeauthReq *mlm_deauth_req;
 	mlm_disassoc_req = mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDisassocReq;
 	if (mlm_disassoc_req &&
-	    (cdf_mem_compare((uint8_t *) sta_mac,
+	    (!qdf_mem_cmp((uint8_t *) sta_mac,
 			     (uint8_t *) &mlm_disassoc_req->peer_macaddr.bytes,
 			     QDF_MAC_ADDR_SIZE))) {
 		if (clean_rx_path) {
@@ -1837,7 +1837,7 @@
 				lim_deactivate_and_change_timer(mac_ctx,
 						eLIM_DISASSOC_ACK_TIMER);
 			}
-			cdf_mem_free(mlm_disassoc_req);
+			qdf_mem_free(mlm_disassoc_req);
 			mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDisassocReq =
 				NULL;
 		}
@@ -1845,7 +1845,7 @@
 
 	mlm_deauth_req = mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq;
 	if (mlm_deauth_req &&
-	    (cdf_mem_compare((uint8_t *) sta_mac,
+	    (!qdf_mem_cmp((uint8_t *) sta_mac,
 			     (uint8_t *) &mlm_deauth_req->peer_macaddr.bytes,
 			     QDF_MAC_ADDR_SIZE))) {
 		if (clean_rx_path) {
@@ -1856,7 +1856,7 @@
 				lim_deactivate_and_change_timer(mac_ctx,
 						eLIM_DEAUTH_ACK_TIMER);
 			}
-			cdf_mem_free(mlm_deauth_req);
+			qdf_mem_free(mlm_deauth_req);
 			mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDeauthReq =
 				NULL;
 		}
@@ -1947,7 +1947,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("session does not exist for given sessionId %d"),
 			mlm_deauth_req->sessionId);
-		cdf_mem_free(mlm_deauth_req);
+		qdf_mem_free(mlm_deauth_req);
 		return;
 	}
 	lim_log(mac_ctx, LOG1, FL("Process Deauth Req on sessionID %d Systemrole %d"
@@ -1972,7 +1972,7 @@
 		case eLIM_MLM_AUTHENTICATED_STATE:
 		case eLIM_MLM_WT_ASSOC_RSP_STATE:
 		case eLIM_MLM_LINK_ESTABLISHED_STATE:
-			if (!cdf_mem_compare(mlm_deauth_req->peer_macaddr.bytes,
+			if (qdf_mem_cmp(mlm_deauth_req->peer_macaddr.bytes,
 					curr_bssId, QDF_MAC_ADDR_SIZE)) {
 				lim_log(mac_ctx, LOGE,
 					FL("received MLM_DEAUTH_REQ with invalid BSS id "
@@ -1986,7 +1986,7 @@
 				 * deauthentication
 				 */
 				sme_deauth_rsp =
-				    cdf_mem_malloc(sizeof(tSirSmeDeauthRsp));
+				    qdf_mem_malloc(sizeof(tSirSmeDeauthRsp));
 				if (NULL == sme_deauth_rsp) {
 					lim_log(mac_ctx, LOGP,
 						FL("memory allocation failed for deauth rsp"));
@@ -2009,7 +2009,7 @@
 						mlm_deauth_req->sessionId;
 				sme_deauth_rsp->transactionId = 0;
 
-				cdf_mem_copy(sme_deauth_rsp->peer_macaddr.bytes,
+				qdf_mem_copy(sme_deauth_rsp->peer_macaddr.bytes,
 					     mlm_deauth_req->peer_macaddr.bytes,
 					     QDF_MAC_ADDR_SIZE);
 
@@ -2154,7 +2154,7 @@
 	mlm_deauth_cnf.sessionId = mlm_deauth_req->sessionId;
 
 	/* Free up buffer allocated for mlmDeauthReq */
-	cdf_mem_free(mlm_deauth_req);
+	qdf_mem_free(mlm_deauth_req);
 	lim_post_sme_message(mac_ctx,
 			     LIM_MLM_DEAUTH_CNF, (uint32_t *) &mlm_deauth_cnf);
 }
@@ -2261,7 +2261,7 @@
 		mlm_set_keys_req->aid, mlm_set_keys_req->edType,
 		mlm_set_keys_req->numKeys);
 	lim_print_mac_addr(mac_ctx, mlm_set_keys_req->peer_macaddr.bytes, LOGW);
-	cdf_mem_copy(curr_bssid.bytes, session->bssId, QDF_MAC_ADDR_SIZE);
+	qdf_mem_copy(curr_bssid.bytes, session->bssId, QDF_MAC_ADDR_SIZE);
 
 	switch (GET_LIM_SYSTEM_ROLE(session)) {
 	case eLIM_STA_ROLE:
@@ -2535,7 +2535,7 @@
 		mlm_join_cnf.sessionId = session->peSessionId;
 		/* Freeup buffer allocated to join request */
 		if (session->pLimMlmJoinReq) {
-			cdf_mem_free(session->pLimMlmJoinReq);
+			qdf_mem_free(session->pLimMlmJoinReq);
 			session->pLimMlmJoinReq = NULL;
 		}
 		lim_post_sme_message(mac_ctx, LIM_MLM_JOIN_CNF,
@@ -2578,7 +2578,7 @@
 	if ((true ==
 	    tx_timer_running(&mac_ctx->lim.limTimers.gLimJoinFailureTimer))
 		&& (session->limMlmState == eLIM_MLM_WT_JOIN_BEACON_STATE)) {
-		cdf_mem_copy(ssid.ssId, session->ssId.ssId,
+		qdf_mem_copy(ssid.ssId, session->ssId.ssId,
 			     session->ssId.length);
 		ssid.length = session->ssId.length;
 		lim_send_probe_req_mgmt_frame(mac_ctx, &ssid,
@@ -2803,7 +2803,7 @@
 		 * MLM state machine
 		 */
 		if (session->pLimMlmJoinReq) {
-			cdf_mem_free(session->pLimMlmJoinReq);
+			qdf_mem_free(session->pLimMlmJoinReq);
 			session->pLimMlmJoinReq = NULL;
 		}
 		/* To remove the preauth node in case of fail to associate */
@@ -2870,7 +2870,7 @@
 	lim_restore_pre_scan_state(mac_ctx);
 	/* Free up mac_ctx->lim.gLimMlmScanReq */
 	if (NULL != mac_ctx->lim.gpLimMlmScanReq) {
-		cdf_mem_free(mac_ctx->lim.gpLimMlmScanReq);
+		qdf_mem_free(mac_ctx->lim.gpLimMlmScanReq);
 		mac_ctx->lim.gpLimMlmScanReq = NULL;
 	}
 
diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
index 9ec47dc..ed6875c 100644
--- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c
@@ -405,7 +405,7 @@
 		return;
 	}
 
-	assoc_req = cdf_mem_malloc(sizeof(tLimMlmAssocReq));
+	assoc_req = qdf_mem_malloc(sizeof(tLimMlmAssocReq));
 	if (NULL == assoc_req) {
 		lim_log(mac_ctx, LOGP,
 			FL("call to AllocateMemory failed for mlmAssocReq"));
@@ -626,21 +626,21 @@
 		 */
 		auth_mode = eSIR_SHARED_KEY;
 		/* Trigger MAC based Authentication */
-		auth_req = cdf_mem_malloc(sizeof(tLimMlmAuthReq));
+		auth_req = qdf_mem_malloc(sizeof(tLimMlmAuthReq));
 		if (NULL == auth_req) {
 			/* Log error */
 			lim_log(mac_ctx, LOGP,
 				FL("mlmAuthReq :Memory alloc failed "));
 			return;
 		}
-		cdf_mem_set((uint8_t *) auth_req,
+		qdf_mem_set((uint8_t *) auth_req,
 			sizeof(tLimMlmAuthReq), 0);
 		if (session_entry->limSmeState ==
 			eLIM_SME_WT_AUTH_STATE) {
 			sir_copy_mac_addr(auth_req->peerMacAddr,
 				session_entry->bssId);
 		} else {
-			cdf_mem_copy((uint8_t *)&auth_req->peerMacAddr,
+			qdf_mem_copy((uint8_t *)&auth_req->peerMacAddr,
 			(uint8_t *)&mac_ctx->lim.gLimPreAuthPeerAddr,
 			sizeof(tSirMacAddr));
 		}
@@ -815,7 +815,7 @@
 		return;
 	}
 	if (session->pLimReAssocReq) {
-		cdf_mem_free(session->pLimReAssocReq);
+		qdf_mem_free(session->pLimReAssocReq);
 		session->pLimReAssocReq = NULL;
 	}
 
@@ -828,12 +828,12 @@
 		lim_log(mac_ctx, LOG1, FL("Freeing pFTPreAuthReq= %p"),
 			session->ftPEContext.pFTPreAuthReq);
 		if (session->ftPEContext.pFTPreAuthReq->pbssDescription) {
-			cdf_mem_free(
+			qdf_mem_free(
 			  session->ftPEContext.pFTPreAuthReq->pbssDescription);
 			session->ftPEContext.pFTPreAuthReq->pbssDescription =
 									NULL;
 		}
-		cdf_mem_free(session->ftPEContext.pFTPreAuthReq);
+		qdf_mem_free(session->ftPEContext.pFTPreAuthReq);
 		session->ftPEContext.pFTPreAuthReq = NULL;
 		session->ftPEContext.ftPreAuthSession = false;
 	}
@@ -921,32 +921,32 @@
 	sme_assoc_ind->beaconLength = session_entry->bcnLen;
 
 	/* Fill in peerMacAddr */
-	cdf_mem_copy(sme_assoc_ind->peerMacAddr, assoc_ind->peerMacAddr,
+	qdf_mem_copy(sme_assoc_ind->peerMacAddr, assoc_ind->peerMacAddr,
 		sizeof(tSirMacAddr));
 
 	/* Fill in aid */
 	sme_assoc_ind->aid = assoc_ind->aid;
 	/* Fill in bssId */
-	cdf_mem_copy(sme_assoc_ind->bssId, session_entry->bssId,
+	qdf_mem_copy(sme_assoc_ind->bssId, session_entry->bssId,
 		sizeof(tSirMacAddr));
 	/* Fill in authType */
 	sme_assoc_ind->authType = assoc_ind->authType;
 	/* Fill in ssId */
-	cdf_mem_copy((uint8_t *) &sme_assoc_ind->ssId,
+	qdf_mem_copy((uint8_t *) &sme_assoc_ind->ssId,
 		(uint8_t *) &(assoc_ind->ssId), assoc_ind->ssId.length + 1);
 	sme_assoc_ind->rsnIE.length = assoc_ind->rsnIE.length;
-	cdf_mem_copy((uint8_t *) &sme_assoc_ind->rsnIE.rsnIEdata,
+	qdf_mem_copy((uint8_t *) &sme_assoc_ind->rsnIE.rsnIEdata,
 		(uint8_t *) &(assoc_ind->rsnIE.rsnIEdata),
 		assoc_ind->rsnIE.length);
 
 #ifdef FEATURE_WLAN_WAPI
 	sme_assoc_ind->wapiIE.length = assoc_ind->wapiIE.length;
-	cdf_mem_copy((uint8_t *) &sme_assoc_ind->wapiIE.wapiIEdata,
+	qdf_mem_copy((uint8_t *) &sme_assoc_ind->wapiIE.wapiIEdata,
 		(uint8_t *) &(assoc_ind->wapiIE.wapiIEdata),
 		assoc_ind->wapiIE.length);
 #endif
 	sme_assoc_ind->addIE.length = assoc_ind->addIE.length;
-	cdf_mem_copy((uint8_t *) &sme_assoc_ind->addIE.addIEdata,
+	qdf_mem_copy((uint8_t *) &sme_assoc_ind->addIE.addIEdata,
 		(uint8_t *) &(assoc_ind->addIE.addIEdata),
 		assoc_ind->addIE.length);
 
@@ -959,12 +959,12 @@
 			assoc_ind->powerCap.maxTxPower;
 		sme_assoc_ind->supportedChannels.numChnl =
 			assoc_ind->supportedChannels.numChnl;
-		cdf_mem_copy((uint8_t *) &sme_assoc_ind->supportedChannels.
+		qdf_mem_copy((uint8_t *) &sme_assoc_ind->supportedChannels.
 			channelList,
 			(uint8_t *) &(assoc_ind->supportedChannels.channelList),
 			assoc_ind->supportedChannels.numChnl);
 	}
-	cdf_mem_copy(&sme_assoc_ind->chan_info, &assoc_ind->chan_info,
+	qdf_mem_copy(&sme_assoc_ind->chan_info, &assoc_ind->chan_info,
 		sizeof(tSirSmeChanInfo));
 	/* Fill in WmmInfo */
 	sme_assoc_ind->wmmEnabledSta = assoc_ind->WmmStaInfoPresent;
@@ -1009,7 +1009,7 @@
 	}
 	/* / Inform Host of STA association */
 	len = sizeof(tSirSmeAssocInd);
-	pSirSmeAssocInd = cdf_mem_malloc(len);
+	pSirSmeAssocInd = qdf_mem_malloc(len);
 	if (NULL == pSirSmeAssocInd) {
 		/* Log error */
 		lim_log(pMac, LOGP,
@@ -1032,7 +1032,7 @@
 			FL
 				("MLM AssocInd: Station context no longer valid (aid %d)"),
 			((tpLimMlmAssocInd) pMsgBuf)->aid);
-		cdf_mem_free(pSirSmeAssocInd);
+		qdf_mem_free(pSirSmeAssocInd);
 
 		return;
 	}
@@ -1553,13 +1553,13 @@
 					 &session_entry->dph.dphHashTable);
 				goto error;
 			}
-			cdf_mem_free(session_entry->pLimJoinReq);
+			qdf_mem_free(session_entry->pLimJoinReq);
 			session_entry->pLimJoinReq = NULL;
 			return;
 		}
 	}
 error:
-	cdf_mem_free(session_entry->pLimJoinReq);
+	qdf_mem_free(session_entry->pLimJoinReq);
 	session_entry->pLimJoinReq = NULL;
 	/* Delete teh session if JOIN failure occurred. */
 	if (result_code != eSIR_SME_SUCCESS) {
@@ -1825,7 +1825,7 @@
 	}
 end:
 	if (NULL != msg->bodyptr) {
-		cdf_mem_free(add_sta_params);
+		qdf_mem_free(add_sta_params);
 		msg->bodyptr = NULL;
 	}
 	/* Updating PE session Id */
@@ -1921,7 +1921,7 @@
 	}
 end:
 	if (0 != limMsgQ->bodyptr) {
-		cdf_mem_free(pDelBssParams);
+		qdf_mem_free(pDelBssParams);
 		limMsgQ->bodyptr = NULL;
 	}
 	if (pStaDs == NULL)
@@ -1956,7 +1956,7 @@
 	if (psessionEntry == NULL) {
 		lim_log(pMac, LOGE, FL("Session entry passed is NULL"));
 		if (pDelBss != NULL) {
-			cdf_mem_free(pDelBss);
+			qdf_mem_free(pDelBss);
 			limMsgQ->bodyptr = NULL;
 		}
 		return;
@@ -2006,7 +2006,7 @@
 	pe_delete_session(pMac, psessionEntry);
 
 	if (pDelBss != NULL) {
-		cdf_mem_free(pDelBss);
+		qdf_mem_free(pDelBss);
 		limMsgQ->bodyptr = NULL;
 	}
 }
@@ -2046,7 +2046,7 @@
 	if (NULL == session_entry) {
 		lim_log(mac_ctx, LOGP,
 			FL("Session Doesn't exist"));
-		cdf_mem_free(del_sta_params);
+		qdf_mem_free(del_sta_params);
 		msg->bodyptr = NULL;
 		return;
 	}
@@ -2079,7 +2079,7 @@
 			FL("DPH Entry for STA %X missing."),
 			pDelStaParams->assocId);
 		statusCode = eSIR_SME_REFUSED;
-		cdf_mem_free(pDelStaParams);
+		qdf_mem_free(pDelStaParams);
 		limMsgQ->bodyptr = NULL;
 
 		return;
@@ -2110,7 +2110,7 @@
 		lim_print_mac_addr(pMac, pStaDs->staAddr, LOG1);
 		if (eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE ==
 		    pStaDs->mlmStaContext.mlmState) {
-			cdf_mem_free(pDelStaParams);
+			qdf_mem_free(pDelStaParams);
 			limMsgQ->bodyptr = NULL;
 			if (lim_add_sta(pMac, pStaDs, false, psessionEntry) !=
 			    eSIR_SUCCESS) {
@@ -2160,7 +2160,7 @@
 		statusCode = eSIR_SME_REFUSED;
 	}
 end:
-	cdf_mem_free(pDelStaParams);
+	qdf_mem_free(pDelStaParams);
 	limMsgQ->bodyptr = NULL;
 	if (eLIM_MLM_WT_ASSOC_DEL_STA_RSP_STATE !=
 	    pStaDs->mlmStaContext.mlmState) {
@@ -2210,7 +2210,7 @@
 	 * calling limDelBSS.
 	 */
 	if (0 != limMsgQ->bodyptr) {
-		cdf_mem_free(pDelStaParams);
+		qdf_mem_free(pDelStaParams);
 		limMsgQ->bodyptr = NULL;
 	}
 	/* Proceed to do DelBSS even if DelSta resulted in failure */
@@ -2219,7 +2219,7 @@
 	return;
 end:
 	if (0 != limMsgQ->bodyptr) {
-		cdf_mem_free(pDelStaParams);
+		qdf_mem_free(pDelStaParams);
 		limMsgQ->bodyptr = NULL;
 	}
 	return;
@@ -2292,7 +2292,7 @@
 	/* fall though to reclaim the original Add STA Response message */
 end:
 	if (0 != limMsgQ->bodyptr) {
-		cdf_mem_free(pAddStaParams);
+		qdf_mem_free(pAddStaParams);
 		limMsgQ->bodyptr = NULL;
 	}
 	return;
@@ -2350,7 +2350,7 @@
 			       FL("session does not exist for given sessionId"));
 		       )
 		if (NULL != pAddBssParams) {
-			cdf_mem_free(pAddBssParams);
+			qdf_mem_free(pAddBssParams);
 			limMsgQ->bodyptr = NULL;
 		}
 		return;
@@ -2440,7 +2440,7 @@
 	lim_post_sme_message(pMac, LIM_MLM_START_CNF, (uint32_t *) &mlmStartCnf);
 end:
 	if (0 != limMsgQ->bodyptr) {
-		cdf_mem_free(pAddBssParams);
+		qdf_mem_free(pAddBssParams);
 		limMsgQ->bodyptr = NULL;
 	}
 }
@@ -2539,7 +2539,7 @@
 	lim_post_sme_message(pMac, LIM_MLM_START_CNF, (uint32_t *) &mlmStartCnf);
 end:
 	if (0 != limMsgQ->bodyptr) {
-		cdf_mem_free(pAddBssParams);
+		qdf_mem_free(pAddBssParams);
 		limMsgQ->bodyptr = NULL;
 	}
 }
@@ -2603,7 +2603,7 @@
 			authMode = cfgAuthType;
 
 		/* Trigger MAC based Authentication */
-		pMlmAuthReq = cdf_mem_malloc(sizeof(tLimMlmAuthReq));
+		pMlmAuthReq = qdf_mem_malloc(sizeof(tLimMlmAuthReq));
 		if (NULL == pMlmAuthReq) {
 			lim_log(mac_ctx, LOGP,
 				FL("Allocate Memory failed for mlmAuthReq"));
@@ -2733,14 +2733,14 @@
 	if (NULL == pMac->lim.pSessionEntry->pLimMlmReassocRetryReq) {
 		/* Take a copy of reassoc request for retrying */
 		pMac->lim.pSessionEntry->pLimMlmReassocRetryReq =
-			cdf_mem_malloc(sizeof(tLimMlmReassocReq));
+			qdf_mem_malloc(sizeof(tLimMlmReassocReq));
 		if (NULL ==
 		    pMac->lim.pSessionEntry->pLimMlmReassocRetryReq)
 			goto end;
-		cdf_mem_set(pMac->lim.pSessionEntry->
+		qdf_mem_set(pMac->lim.pSessionEntry->
 			    pLimMlmReassocRetryReq,
 			    sizeof(tLimMlmReassocReq), 0);
-		cdf_mem_copy(pMac->lim.pSessionEntry->
+		qdf_mem_copy(pMac->lim.pSessionEntry->
 			     pLimMlmReassocRetryReq,
 			     psessionEntry->pLimMlmReassocReq,
 			     sizeof(tLimMlmReassocReq));
@@ -2779,20 +2779,20 @@
 	rrm_cache_mgmt_tx_power(pMac, pAddBssParams->txMgmtPower, psessionEntry);
 #endif
 
-	pAddStaParams = cdf_mem_malloc(sizeof(tAddStaParams));
+	pAddStaParams = qdf_mem_malloc(sizeof(tAddStaParams));
 	if (NULL == pAddStaParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during ADD_STA"));
 		goto end;
 	}
-	cdf_mem_set((uint8_t *) pAddStaParams, sizeof(tAddStaParams), 0);
+	qdf_mem_set((uint8_t *) pAddStaParams, sizeof(tAddStaParams), 0);
 
 	/* / Add STA context at MAC HW (BMU, RHP & TFP) */
-	cdf_mem_copy((uint8_t *) pAddStaParams->staMac,
+	qdf_mem_copy((uint8_t *) pAddStaParams->staMac,
 		     (uint8_t *) psessionEntry->selfMacAddr,
 		     sizeof(tSirMacAddr));
 
-	cdf_mem_copy((uint8_t *) pAddStaParams->bssId,
+	qdf_mem_copy((uint8_t *) pAddStaParams->bssId,
 		     psessionEntry->bssId, sizeof(tSirMacAddr));
 
 	pAddStaParams->staType = STA_ENTRY_SELF;
@@ -2870,7 +2870,7 @@
 	psessionEntry->ftPEContext.pAddStaReq = pAddStaParams;
 
 	if (pAddBssParams != NULL) {
-		cdf_mem_free(pAddBssParams);
+		qdf_mem_free(pAddBssParams);
 		pAddBssParams = NULL;
 		limMsgQ->bodyptr = NULL;
 	}
@@ -2888,12 +2888,12 @@
 	/* Free up buffer allocated for reassocReq */
 	if (psessionEntry != NULL)
 		if (psessionEntry->pLimMlmReassocReq != NULL) {
-			cdf_mem_free(psessionEntry->pLimMlmReassocReq);
+			qdf_mem_free(psessionEntry->pLimMlmReassocReq);
 			psessionEntry->pLimMlmReassocReq = NULL;
 		}
 
 	if (pAddBssParams != NULL) {
-		cdf_mem_free(pAddBssParams);
+		qdf_mem_free(pAddBssParams);
 		pAddBssParams = NULL;
 		limMsgQ->bodyptr = NULL;
 	}
@@ -3075,7 +3075,7 @@
 	}
 end:
 	if (0 != msg->bodyptr) {
-		cdf_mem_free(add_bss_params);
+		qdf_mem_free(add_bss_params);
 		msg->bodyptr = NULL;
 	}
 }
@@ -3129,7 +3129,7 @@
 		lim_log(mac_ctx, LOGE, FL("SessionId:%d Session Doesn't exist"),
 			add_bss_param->sessionId);
 		if (NULL != add_bss_param) {
-			cdf_mem_free(add_bss_param);
+			qdf_mem_free(add_bss_param);
 			msg->bodyptr = NULL;
 		}
 		return;
@@ -3154,7 +3154,7 @@
 				mlm_start_cnf.resultCode =
 					eSIR_SME_BSS_ALREADY_STARTED_OR_JOINED;
 				if (0 != msg->bodyptr) {
-					cdf_mem_free(add_bss_param);
+					qdf_mem_free(add_bss_param);
 					msg->bodyptr = NULL;
 				}
 				lim_post_sme_message(mac_ctx, LIM_MLM_START_CNF,
@@ -3223,7 +3223,7 @@
 	tpPESession session_entry;
 
 	SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true);
-	cdf_mem_set((void *)&mlm_set_key_cnf, sizeof(tLimMlmSetKeysCnf), 0);
+	qdf_mem_set((void *)&mlm_set_key_cnf, sizeof(tLimMlmSetKeysCnf), 0);
 	if (NULL == msg->bodyptr) {
 		PELOGE(lim_log(mac_ctx, LOGE, FL("msg bodyptr is NULL"));)
 		return;
@@ -3233,7 +3233,7 @@
 	if (session_entry == NULL) {
 		PELOGE(lim_log(mac_ctx, LOGE,
 			FL("session does not exist for given session_id"));)
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		return;
 	}
@@ -3249,7 +3249,7 @@
 			(uint16_t)(((tpSetStaKeyParams) msg->bodyptr)->status);
 	}
 
-	cdf_mem_free(msg->bodyptr);
+	qdf_mem_free(msg->bodyptr);
 	msg->bodyptr = NULL;
 	/* Restore MLME state */
 	session_entry->limMlmState = session_entry->limPrevMlmState;
@@ -3266,7 +3266,7 @@
 			 * Free the buffer cached for the global
 			 * mac_ctx->lim.gpLimMlmSetKeysReq
 			 */
-			cdf_mem_free(mac_ctx->lim.gpLimMlmSetKeysReq);
+			qdf_mem_free(mac_ctx->lim.gpLimMlmSetKeysReq);
 			mac_ctx->lim.gpLimMlmSetKeysReq = NULL;
 		}
 		mlm_set_key_cnf.sessionId = session_id;
@@ -3296,7 +3296,7 @@
 	tpLimMlmSetKeysReq set_key_req;
 
 	SET_LIM_PROCESS_DEFD_MESGS(mac_ctx, true);
-	cdf_mem_set((void *)&set_key_cnf, sizeof(tLimMlmSetKeysCnf), 0);
+	qdf_mem_set((void *)&set_key_cnf, sizeof(tLimMlmSetKeysCnf), 0);
 	if (NULL == msg->bodyptr) {
 		PELOGE(lim_log(mac_ctx, LOGE, FL("msg bodyptr is null"));)
 		return;
@@ -3307,7 +3307,7 @@
 		PELOGE(lim_log(mac_ctx, LOGE,
 			FL("session does not exist for given sessionId [%d]"),
 			session_id);)
-		cdf_mem_free(msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		msg->bodyptr = NULL;
 		return;
 	}
@@ -3334,7 +3334,7 @@
 		set_key_cnf.resultCode = result_status;
 	}
 
-	cdf_mem_free(msg->bodyptr);
+	qdf_mem_free(msg->bodyptr);
 	msg->bodyptr = NULL;
 	/* Restore MLME state */
 	session_entry->limMlmState = session_entry->limPrevMlmState;
@@ -3354,7 +3354,7 @@
 		 * Free the buffer cached for the
 		 * global mac_ctx->lim.gpLimMlmSetKeysReq
 		 */
-		cdf_mem_free(mac_ctx->lim.gpLimMlmSetKeysReq);
+		qdf_mem_free(mac_ctx->lim.gpLimMlmSetKeysReq);
 		mac_ctx->lim.gpLimMlmSetKeysReq = NULL;
 	}
 	lim_post_sme_message(mac_ctx, LIM_MLM_SETKEYS_CNF,
@@ -3426,7 +3426,7 @@
 	if (pMlmReassocReq != NULL) {
 		/* Update PE session Id */
 		mlmReassocCnf.sessionId = pMlmReassocReq->sessionId;
-		cdf_mem_free(pMlmReassocReq);
+		qdf_mem_free(pMlmReassocReq);
 		psessionEntry->pLimMlmReassocReq = NULL;
 	} else {
 		mlmReassocCnf.sessionId = 0;
@@ -3509,7 +3509,7 @@
 
 		for (apCount = 0; apCount < 2; apCount++) {
 
-			if (cdf_mem_compare(session_entry->pLimMlmJoinReq->bssDescription.bssId,
+			if (!qdf_mem_cmp(session_entry->pLimMlmJoinReq->bssDescription.bssId,
 				mac_ctx->lim.gLimHeartBeatApMac[apCount], sizeof(tSirMacAddr))) {
 
 				lim_log(mac_ctx, LOGE, FL("Index %d Sessionid: %d Send deauth on "
@@ -3522,7 +3522,7 @@
 					session_entry->pLimMlmJoinReq->bssDescription.bssId,
 					session_entry, false);
 
-				cdf_mem_zero(mac_ctx->lim.gLimHeartBeatApMac[apCount],
+				qdf_mem_zero(mac_ctx->lim.gLimHeartBeatApMac[apCount],
 					sizeof(tSirMacAddr));
 				break;
 			}
@@ -3530,7 +3530,7 @@
 	}
 
 	/* Wait for Beacon to announce join success */
-	cdf_mem_copy(ssId.ssId,
+	qdf_mem_copy(ssId.ssId,
 		session_entry->ssId.ssId, session_entry->ssId.length);
 	ssId.length = session_entry->ssId.length;
 
@@ -3586,11 +3586,11 @@
 error:
 	if (NULL != session_entry) {
 		if (session_entry->pLimMlmJoinReq) {
-			cdf_mem_free(session_entry->pLimMlmJoinReq);
+			qdf_mem_free(session_entry->pLimMlmJoinReq);
 			session_entry->pLimMlmJoinReq = NULL;
 		}
 		if (session_entry->pLimJoinReq) {
-			cdf_mem_free(session_entry->pLimJoinReq);
+			qdf_mem_free(session_entry->pLimJoinReq);
 			session_entry->pLimJoinReq = NULL;
 		}
 		join_cnf.sessionId = session_entry->peSessionId;
@@ -3698,7 +3698,7 @@
 	default:
 		break;
 	}
-	cdf_mem_free(body);
+	qdf_mem_free(body);
 }
 
 /**
@@ -3736,7 +3736,7 @@
 		tpDphHashNode pStaDs;
 		tSirRetStatus retStatus = eSIR_SUCCESS;
 		tpSchBeaconStruct beacon_struct;
-		beacon_struct = cdf_mem_malloc(sizeof(tSchBeaconStruct));
+		beacon_struct = qdf_mem_malloc(sizeof(tSchBeaconStruct));
 		if (NULL == beacon_struct) {
 			lim_log(pMac, LOGE, FL("beaconStruct alloc failed"));
 			mlmReassocCnf.resultCode =
@@ -3767,7 +3767,7 @@
 			mlmReassocCnf.resultCode =
 				eSIR_SME_RESOURCES_UNAVAILABLE;
 			mlmReassocCnf.protStatusCode = eSIR_SME_SUCCESS;
-			cdf_mem_free(beacon_struct);
+			qdf_mem_free(beacon_struct);
 			goto error;
 		}
 		/*
@@ -3812,13 +3812,13 @@
 				eSIR_SME_RESOURCES_UNAVAILABLE;
 			mlmReassocCnf.protStatusCode =
 				eSIR_MAC_UNSPEC_FAILURE_STATUS;
-			cdf_mem_free(assocRsp);
+			qdf_mem_free(assocRsp);
 			pMac->lim.gLimAssocResponseData = NULL;
-			cdf_mem_free(beacon_struct);
+			qdf_mem_free(beacon_struct);
 			goto error;
 		}
-		cdf_mem_free(assocRsp);
-		cdf_mem_free(beacon_struct);
+		qdf_mem_free(assocRsp);
+		qdf_mem_free(beacon_struct);
 		psessionEntry->limAssocResponseData = NULL;
 	}
 	break;
@@ -3907,7 +3907,7 @@
 	lim_post_sme_message(pMac, LIM_MLM_START_CNF, (uint32_t *) &mlmStartCnf);
 end:
 	if (0 != limMsgQ->bodyptr) {
-		cdf_mem_free(pAddBssParams);
+		qdf_mem_free(pAddBssParams);
 		limMsgQ->bodyptr = NULL;
 	}
 }
@@ -3946,7 +3946,7 @@
 		tSirRetStatus retStatus = eSIR_SUCCESS;
 		tSchBeaconStruct *pBeaconStruct;
 		pBeaconStruct =
-			cdf_mem_malloc(sizeof(tSchBeaconStruct));
+			qdf_mem_malloc(sizeof(tSchBeaconStruct));
 		if (NULL == pBeaconStruct) {
 			lim_log(pMac, LOGE,
 				FL
@@ -3970,7 +3970,7 @@
 			mlmReassocCnf.resultCode =
 				eSIR_SME_RESOURCES_UNAVAILABLE;
 			mlmReassocCnf.protStatusCode = eSIR_SME_SUCCESS;
-			cdf_mem_free(pBeaconStruct);
+			qdf_mem_free(pBeaconStruct);
 			goto Error;
 		}
 		/** While Processing the ReAssoc Response Frame the ReAssocRsp Frame
@@ -4021,14 +4021,14 @@
 				eSIR_SME_RESOURCES_UNAVAILABLE;
 			mlmReassocCnf.protStatusCode =
 				eSIR_MAC_UNSPEC_FAILURE_STATUS;
-			cdf_mem_free(assocRsp);
+			qdf_mem_free(assocRsp);
 			pMac->lim.gLimAssocResponseData = NULL;
-			cdf_mem_free(pBeaconStruct);
+			qdf_mem_free(pBeaconStruct);
 			goto Error;
 		}
-		cdf_mem_free(assocRsp);
+		qdf_mem_free(assocRsp);
 		psessionEntry->limAssocResponseData = NULL;
-		cdf_mem_free(pBeaconStruct);
+		qdf_mem_free(pBeaconStruct);
 	}
 	break;
 	case eLIM_SME_WT_REASSOC_LINK_FAIL_STATE: {
@@ -4086,7 +4086,7 @@
 		       )
 		return;
 	}
-	pBeaconGenParams = cdf_mem_malloc(sizeof(*pBeaconGenParams));
+	pBeaconGenParams = qdf_mem_malloc(sizeof(*pBeaconGenParams));
 	if (NULL == pBeaconGenParams) {
 		PELOGE(lim_log(pMac, LOGP,
 			       FL
@@ -4094,8 +4094,8 @@
 		       )
 		return;
 	}
-	cdf_mem_set(pBeaconGenParams, sizeof(*pBeaconGenParams), 0);
-	cdf_mem_copy((void *)pBeaconGenParams->bssId,
+	qdf_mem_set(pBeaconGenParams, sizeof(*pBeaconGenParams), 0);
+	qdf_mem_copy((void *)pBeaconGenParams->bssId,
 		     (void *)psessionEntry->bssId, QDF_MAC_ADDR_SIZE);
 	limMsg.bodyptr = pBeaconGenParams;
 	sch_process_pre_beacon_ind(pMac, &limMsg);
@@ -4167,7 +4167,7 @@
 					 QDF_STATUS_SUCCESS,
 					 pScanEvent->sessionId,
 					 pScanEvent->scanId);
-			cdf_mem_free(pMac->lim.gpLimRemainOnChanReq);
+			qdf_mem_free(pMac->lim.gpLimRemainOnChanReq);
 			pMac->lim.gpLimRemainOnChanReq = NULL;
 			/*
 			 * If remain on channel timer expired and action frame
@@ -4216,5 +4216,5 @@
 			  "Received unhandled scan event %u",
 			  pScanEvent->event);
 	}
-	cdf_mem_free(buf);
+	qdf_mem_free(buf);
 }
diff --git a/core/mac/src/pe/lim/lim_process_probe_req_frame.c b/core/mac/src/pe/lim/lim_process_probe_req_frame.c
index 0a75bd4..91b887d 100644
--- a/core/mac/src/pe/lim/lim_process_probe_req_frame.c
+++ b/core/mac/src/pe/lim/lim_process_probe_req_frame.c
@@ -82,7 +82,7 @@
 	cur_time = (uint32_t) (qdf_mc_timer_get_system_ticks() /
 						QDF_TICKS_PER_SECOND);
 	qdf_zero_macaddr(&addr);
-	cdf_mem_set((uint8_t *) uuid_e, SIR_WPS_UUID_LEN, 0);
+	qdf_mem_set((uint8_t *) uuid_e, SIR_WPS_UUID_LEN, 0);
 	for (pbc = session->pAPWPSPBCSession; pbc; pbc = pbc->next) {
 		if (cur_time > pbc->timestamp + SIR_WPS_PBC_WALK_TIME)
 			break;
@@ -90,7 +90,7 @@
 		if (count > 1)
 			break;
 		qdf_copy_macaddr(&addr, &pbc->addr);
-		cdf_mem_copy((uint8_t *) uuid_e, (uint8_t *) pbc->uuid_e,
+		qdf_mem_copy((uint8_t *) uuid_e, (uint8_t *) pbc->uuid_e,
 				SIR_WPS_UUID_LEN);
 	}
 	if (count > 1)
@@ -140,7 +140,7 @@
 			       SIR_WPS_UUID_LEN);
 		       )
 
-		cdf_mem_free(prev);
+		qdf_mem_free(prev);
 	}
 }
 
@@ -163,7 +163,7 @@
 			prev->next = pbc->next;
 			if (pbc == session_entry->pAPWPSPBCSession)
 				session_entry->pAPWPSPBCSession = pbc->next;
-			cdf_mem_free(pbc);
+			qdf_mem_free(pbc);
 			return;
 		}
 		prev = pbc;
@@ -220,11 +220,11 @@
 	pbc = psessionEntry->pAPWPSPBCSession;
 
 	while (pbc) {
-		if (cdf_mem_compare
+		if ((!qdf_mem_cmp
 			    ((uint8_t *) pbc->addr.bytes, (uint8_t *) addr,
-			    QDF_MAC_ADDR_SIZE)
-		    && cdf_mem_compare((uint8_t *) pbc->uuid_e,
-				       (uint8_t *) uuid_e, SIR_WPS_UUID_LEN)) {
+			    QDF_MAC_ADDR_SIZE))
+		    && (!qdf_mem_cmp((uint8_t *) pbc->uuid_e,
+				       (uint8_t *) uuid_e, SIR_WPS_UUID_LEN))) {
 			if (prev)
 				prev->next = pbc->next;
 			else
@@ -236,18 +236,18 @@
 	}
 
 	if (!pbc) {
-		pbc = cdf_mem_malloc(sizeof(tSirWPSPBCSession));
+		pbc = qdf_mem_malloc(sizeof(tSirWPSPBCSession));
 		if (NULL == pbc) {
 			PELOGE(lim_log
 				       (pMac, LOGE, FL("memory allocate failed!"));
 			       )
 			return;
 		}
-		cdf_mem_copy((uint8_t *) pbc->addr.bytes, (uint8_t *) addr,
+		qdf_mem_copy((uint8_t *) pbc->addr.bytes, (uint8_t *) addr,
 			     QDF_MAC_ADDR_SIZE);
 
 		if (uuid_e)
-			cdf_mem_copy((uint8_t *) pbc->uuid_e,
+			qdf_mem_copy((uint8_t *) pbc->uuid_e,
 				     (uint8_t *) uuid_e, SIR_WPS_UUID_LEN);
 	}
 
@@ -451,7 +451,7 @@
 		}
 		ssid.length = session->ssId.length;
 		/* Copy the SSID from sessio entry to local variable */
-		cdf_mem_copy(ssid.ssId, session->ssId.ssId,
+		qdf_mem_copy(ssid.ssId, session->ssId.ssId,
 				session->ssId.length);
 
 		/*
@@ -462,7 +462,7 @@
 			if (!ssid.length)
 				goto multipleSSIDcheck;
 
-			if (cdf_mem_compare((uint8_t *) &ssid,
+			if (!qdf_mem_cmp((uint8_t *) &ssid,
 						(uint8_t *) &(probe_req.ssId),
 						(uint8_t) (ssid.length + 1))) {
 				lim_send_probe_rsp_mgmt_frame(mac_ctx,
@@ -476,7 +476,7 @@
 					QDF_P2P_GO_MODE) {
 				uint8_t direct_ssid[7] = "DIRECT-";
 				uint8_t direct_ssid_len = 7;
-				if (cdf_mem_compare((uint8_t *) &direct_ssid,
+				if (!qdf_mem_cmp((uint8_t *) &direct_ssid,
 					(uint8_t *) &(probe_req.ssId.ssId),
 					(uint8_t) (direct_ssid_len))) {
 					lim_send_probe_rsp_mgmt_frame(mac_ctx,
@@ -651,7 +651,7 @@
 	tSirSmeProbeReqInd *pSirSmeProbeReqInd;
 	tSirMsgQ msgQ;
 
-	pSirSmeProbeReqInd = cdf_mem_malloc(sizeof(tSirSmeProbeReqInd));
+	pSirSmeProbeReqInd = qdf_mem_malloc(sizeof(tSirSmeProbeReqInd));
 	if (NULL == pSirSmeProbeReqInd) {
 		/* Log error */
 		lim_log(pMac, LOGP,
@@ -668,15 +668,15 @@
 	pSirSmeProbeReqInd->length = sizeof(tSirSmeProbeReq);
 	pSirSmeProbeReqInd->sessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_copy(pSirSmeProbeReqInd->bssid.bytes, psessionEntry->bssId,
+	qdf_mem_copy(pSirSmeProbeReqInd->bssid.bytes, psessionEntry->bssId,
 		     QDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.peer_macaddr.bytes,
+	qdf_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.peer_macaddr.bytes,
 		     peerMacAddr, QDF_MAC_ADDR_SIZE);
 
 	MTRACE(mac_trace_msg_tx(pMac, psessionEntry->peSessionId, msgQ.type));
 	pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIELen =
 		(uint16_t) ProbeReqIELen;
-	cdf_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE, pProbeReqIE,
+	qdf_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE, pProbeReqIE,
 		     ProbeReqIELen);
 
 	if (lim_sys_process_mmh_msg_api(pMac, &msgQ, ePROT) != eSIR_SUCCESS) {
diff --git a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c
index 195e223..87783a0 100644
--- a/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c
+++ b/core/mac/src/pe/lim/lim_process_probe_rsp_frame.c
@@ -97,7 +97,7 @@
 	lim_log(mac_ctx, LOG1, "SessionId:%d ProbeRsp Frame is received",
 		session_entry->peSessionId);
 
-	probe_rsp = cdf_mem_malloc(sizeof(tSirProbeRespBeacon));
+	probe_rsp = qdf_mem_malloc(sizeof(tSirProbeRespBeacon));
 	if (NULL == probe_rsp) {
 		lim_log(mac_ctx, LOGE,
 			FL
@@ -120,7 +120,7 @@
 		eSIR_SUCCESS) {
 		lim_log(mac_ctx, LOG1,
 			FL("Parse error ProbeResponse, length=%d"), frame_len);
-		cdf_mem_free(probe_rsp);
+		qdf_mem_free(probe_rsp);
 		return;
 	}
 
@@ -138,7 +138,7 @@
 		!probe_rsp->ssidPresent) {
 		lim_log(mac_ctx, LOG1,
 			FL("Parse error ProbeResponse, length=%d"), frame_len);
-		cdf_mem_free(probe_rsp);
+		qdf_mem_free(probe_rsp);
 		return;
 	}
 	lim_check_and_add_bss_description(mac_ctx, probe_rsp,
@@ -159,14 +159,14 @@
 		 * Hence store it in same buffer.
 		 */
 		if (session_entry->beacon != NULL) {
-			cdf_mem_free(session_entry->beacon);
+			qdf_mem_free(session_entry->beacon);
 			session_entry->beacon = NULL;
 			session_entry->bcnLen = 0;
 		}
 		session_entry->bcnLen =
 			WMA_GET_RX_PAYLOAD_LEN(rx_Packet_info);
 			session_entry->beacon =
-			cdf_mem_malloc(session_entry->bcnLen);
+			qdf_mem_malloc(session_entry->bcnLen);
 		if (NULL == session_entry->beacon) {
 			lim_log(mac_ctx, LOGE,
 				FL("No Memory to store beacon"));
@@ -175,7 +175,7 @@
 			 * Store the Beacon/ProbeRsp.
 			 * This is sent to csr/hdd in join cnf response.
 			 */
-			cdf_mem_copy(session_entry->beacon,
+			qdf_mem_copy(session_entry->beacon,
 				     WMA_GET_RX_MPDU_DATA
 					     (rx_Packet_info),
 				     session_entry->bcnLen);
@@ -193,9 +193,9 @@
 		 * heart beat threshold
 		 */
 		sir_copy_mac_addr(current_bssid, session_entry->bssId);
-		if (!cdf_mem_compare(current_bssid, header->bssId,
+		if (qdf_mem_cmp(current_bssid, header->bssId,
 				sizeof(tSirMacAddr))) {
-			cdf_mem_free(probe_rsp);
+			qdf_mem_free(probe_rsp);
 			return;
 		}
 		if (!LIM_IS_CONNECTION_ACTIVE(session_entry)) {
@@ -294,7 +294,7 @@
 			lim_handle_ibss_coalescing(mac_ctx, probe_rsp,
 					rx_Packet_info, session_entry);
 	}
-	cdf_mem_free(probe_rsp);
+	qdf_mem_free(probe_rsp);
 
 	/* Ignore Probe Response frame in all other states */
 	return;
@@ -318,7 +318,7 @@
 	tpSirMacMgmtHdr header;
 	tSirProbeRespBeacon *probe_rsp;
 
-	probe_rsp = cdf_mem_malloc(sizeof(tSirProbeRespBeacon));
+	probe_rsp = qdf_mem_malloc(sizeof(tSirProbeRespBeacon));
 	if (NULL == probe_rsp) {
 		lim_log(mac_ctx, LOGE,
 			FL("Unable to allocate memory"));
@@ -340,7 +340,7 @@
 								eSIR_SUCCESS) {
 		lim_log(mac_ctx, LOG1,
 			FL("Parse error ProbeResponse, length=%d"), frame_len);
-		cdf_mem_free(probe_rsp);
+		qdf_mem_free(probe_rsp);
 		return;
 	}
 
@@ -360,12 +360,12 @@
 		lim_log(mac_ctx, LOG1,
 			FL("Parse error ProbeResponse, length=%d\n"),
 			frame_len);
-		cdf_mem_free(probe_rsp);
+		qdf_mem_free(probe_rsp);
 		return;
 	}
 	lim_log(mac_ctx, LOG2, FL("Save this probe rsp in LFR cache"));
 	lim_check_and_add_bss_description(mac_ctx, probe_rsp,
 		  rx_packet_info, false, true);
-	cdf_mem_free(probe_rsp);
+	qdf_mem_free(probe_rsp);
 	return;
 }
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 99b5795..d71fa97 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -148,16 +148,16 @@
 
 	len = sizeof(*req_msg);
 
-	req_msg = cdf_mem_malloc(len);
+	req_msg = qdf_mem_malloc(len);
 	if (!req_msg) {
-		lim_log(mac, LOGE, FL("cdf_mem_malloc failed"));
+		lim_log(mac, LOGE, FL("qdf_mem_malloc failed"));
 		/* Free the active command list
 		 * Probably the malloc is going to fail there as well?!
 		 */
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	cdf_mem_zero(req_msg, len);
+	qdf_mem_zero(req_msg, len);
 
 	req_msg->hw_mode_index = buf->set_hw.hw_mode_index;
 	req_msg->reason = buf->set_hw.reason;
@@ -172,12 +172,12 @@
 		lim_log(mac, LOGE,
 			FL("vos_mq_post_message failed!(err=%d)"),
 			status);
-		cdf_mem_free(req_msg);
+		qdf_mem_free(req_msg);
 		goto fail;
 	}
 	return status;
 fail:
-	param = cdf_mem_malloc(sizeof(*param));
+	param = qdf_mem_malloc(sizeof(*param));
 	if (!param) {
 		lim_log(mac, LOGE, FL("HW mode resp failed"));
 		return QDF_STATUS_E_FAILURE;
@@ -221,7 +221,7 @@
 
 	len = sizeof(*req_msg);
 
-	req_msg = cdf_mem_malloc(len);
+	req_msg = qdf_mem_malloc(len);
 	if (!req_msg) {
 		lim_log(mac, LOGE, FL("vos_mem_malloc failed"));
 		/* Free the active command list
@@ -230,7 +230,7 @@
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	cdf_mem_zero(req_msg, len);
+	qdf_mem_zero(req_msg, len);
 
 	req_msg->scan_config = buf->set_dual_mac.scan_config;
 	req_msg->fw_mode_config = buf->set_dual_mac.fw_mode_config;
@@ -247,12 +247,12 @@
 		lim_log(mac, LOGE,
 				FL("vos_mq_post_message failed!(err=%d)"),
 				status);
-		cdf_mem_free(req_msg);
+		qdf_mem_free(req_msg);
 		goto fail;
 	}
 	return status;
 fail:
-	param = cdf_mem_malloc(sizeof(*param));
+	param = qdf_mem_malloc(sizeof(*param));
 	if (!param) {
 		lim_log(mac, LOGE, FL("Dual mac config resp failed"));
 		return QDF_STATUS_E_FAILURE;
@@ -592,7 +592,7 @@
 	    (mac_ctx->lim.gLimSmeState == eLIM_SME_IDLE_STATE)) {
 		size = sizeof(tSirSmeStartBssReq);
 
-		sme_start_bss_req = cdf_mem_malloc(size);
+		sme_start_bss_req = qdf_mem_malloc(size);
 		if (NULL == sme_start_bss_req) {
 			lim_log(mac_ctx, LOGE,
 				FL("Allocate Memory fail for LimStartBssReq"));
@@ -601,8 +601,8 @@
 			goto end;
 		}
 
-		cdf_mem_set((void *)sme_start_bss_req, size, 0);
-		cdf_mem_copy(sme_start_bss_req, msg_buf,
+		qdf_mem_set((void *)sme_start_bss_req, size, 0);
+		qdf_mem_copy(sme_start_bss_req, msg_buf,
 			sizeof(tSirSmeStartBssReq));
 		if (!lim_is_sme_start_bss_req_valid(mac_ctx,
 					sme_start_bss_req)) {
@@ -669,7 +669,7 @@
 
 		session->transactionId = sme_start_bss_req->transactionId;
 
-		cdf_mem_copy(&(session->htConfig),
+		qdf_mem_copy(&(session->htConfig),
 			     &(sme_start_bss_req->htConfig),
 			     sizeof(session->htConfig));
 
@@ -677,7 +677,7 @@
 				  sme_start_bss_req->self_macaddr.bytes);
 
 		/* Copy SSID to session table */
-		cdf_mem_copy((uint8_t *) &session->ssId,
+		qdf_mem_copy((uint8_t *) &session->ssId,
 			     (uint8_t *) &sme_start_bss_req->ssId,
 			     (sme_start_bss_req->ssId.length + 1));
 
@@ -729,10 +729,10 @@
 			session->limRmfEnabled);
 #endif
 
-		cdf_mem_copy((void *)&session->rateSet,
+		qdf_mem_copy((void *)&session->rateSet,
 			     (void *)&sme_start_bss_req->operationalRateSet,
 			     sizeof(tSirMacRateSet));
-		cdf_mem_copy((void *)&session->extRateSet,
+		qdf_mem_copy((void *)&session->extRateSet,
 			     (void *)&sme_start_bss_req->extendedRateSet,
 			     sizeof(tSirMacRateSet));
 
@@ -788,7 +788,7 @@
 		if ((sme_start_bss_req->bssType == eSIR_BTAMP_AP_MODE) ||
 		    (sme_start_bss_req->bssType == eSIR_INFRA_AP_MODE)) {
 			session->parsedAssocReq =
-				cdf_mem_malloc(session->dph.dphHashTable.
+				qdf_mem_malloc(session->dph.dphHashTable.
 					       size * sizeof(tpSirAssocReq));
 			if (NULL == session->parsedAssocReq) {
 				lim_log(mac_ctx, LOGW,
@@ -796,7 +796,7 @@
 				ret_code = eSIR_SME_RESOURCES_UNAVAILABLE;
 				goto free;
 			}
-			cdf_mem_set(session->parsedAssocReq,
+			qdf_mem_set(session->parsedAssocReq,
 				(session->dph.dphHashTable.size *
 				sizeof(tpSirAssocReq)), 0);
 		}
@@ -878,14 +878,14 @@
 			 * bit7       bit6    bit5   bit4 bit3   bit2  bit1 bit0
 			 * reserved reserved   RIFS   Lsig n-GF   ht20  11g  11b
 			 */
-			cdf_mem_copy((void *)&session->cfgProtection,
+			qdf_mem_copy((void *)&session->cfgProtection,
 				     (void *)&sme_start_bss_req->ht_capab,
 				     sizeof(uint16_t));
 			/* Initialize WPS PBC session link list */
 			session->pAPWPSPBCSession = NULL;
 		}
 		/* Prepare and Issue LIM_MLM_START_REQ to MLM */
-		mlm_start_req = cdf_mem_malloc(sizeof(tLimMlmStartReq));
+		mlm_start_req = qdf_mem_malloc(sizeof(tLimMlmStartReq));
 		if (NULL == mlm_start_req) {
 			lim_log(mac_ctx, LOGP,
 				FL("Allocate Memory failed for mlmStartReq"));
@@ -893,10 +893,10 @@
 			goto free;
 		}
 
-		cdf_mem_set((void *)mlm_start_req, sizeof(tLimMlmStartReq), 0);
+		qdf_mem_set((void *)mlm_start_req, sizeof(tLimMlmStartReq), 0);
 
 		/* Copy SSID to the MLM start structure */
-		cdf_mem_copy((uint8_t *) &mlm_start_req->ssId,
+		qdf_mem_copy((uint8_t *) &mlm_start_req->ssId,
 			     (uint8_t *) &sme_start_bss_req->ssId,
 			     sme_start_bss_req->ssId.length + 1);
 		mlm_start_req->ssidHidden = sme_start_bss_req->ssidHidden;
@@ -999,7 +999,7 @@
 		 * as rateSet is now included in the
 		 * session entry and MLM has session context.
 		 */
-		cdf_mem_copy((void *)&mlm_start_req->rateSet,
+		qdf_mem_copy((void *)&mlm_start_req->rateSet,
 			     (void *)&session->rateSet,
 			     sizeof(tSirMacRateSet));
 
@@ -1078,8 +1078,8 @@
 		(session->pLimStartBssReq == sme_start_bss_req)) {
 		session->pLimStartBssReq = NULL;
 	}
-	cdf_mem_free(sme_start_bss_req);
-	cdf_mem_free(mlm_start_req);
+	qdf_mem_free(sme_start_bss_req);
+	qdf_mem_free(mlm_start_req);
 
 end:
 	if (sme_start_bss_req != NULL) {
@@ -1147,7 +1147,7 @@
 	random[0] = tx_time_get();
 	random[0] |= (random[0] << 15);
 	random[1] = random[0] >> 1;
-	cdf_mem_copy(data, (uint8_t *) random, sizeof(tSirMacAddr));
+	qdf_mem_copy(data, (uint8_t *) random, sizeof(tSirMacAddr));
 }
 
 static QDF_STATUS lim_send_hal_start_scan_offload_req(tpAniSirGlobal pMac,
@@ -1219,14 +1219,14 @@
 	}
 #endif /* WLAN_FEATURE_11AC */
 
-	pScanOffloadReq = cdf_mem_malloc(len);
+	pScanOffloadReq = qdf_mem_malloc(len);
 	if (NULL == pScanOffloadReq) {
 		lim_log(pMac, LOGE,
 			FL("AllocateMemory failed for pScanOffloadReq"));
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	cdf_mem_set((uint8_t *) pScanOffloadReq, len, 0);
+	qdf_mem_set((uint8_t *) pScanOffloadReq, len, 0);
 
 	msg.type = WMA_START_SCAN_OFFLOAD_REQ;
 	msg.bodyptr = pScanOffloadReq;
@@ -1238,14 +1238,14 @@
 		lim_log(pMac, LOGE,
 			FL("Invalid value (%d) for numSsid"),
 			SIR_SCAN_MAX_NUM_SSID);
-		cdf_mem_free(pScanOffloadReq);
+		qdf_mem_free(pScanOffloadReq);
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	pScanOffloadReq->numSsid = pScanReq->numSsid;
 	for (i = 0; i < pScanOffloadReq->numSsid; i++) {
 		pScanOffloadReq->ssId[i].length = pScanReq->ssId[i].length;
-		cdf_mem_copy((uint8_t *) pScanOffloadReq->ssId[i].ssId,
+		qdf_mem_copy((uint8_t *) pScanOffloadReq->ssId[i].ssId,
 			     (uint8_t *) pScanReq->ssId[i].ssId,
 			     pScanOffloadReq->ssId[i].length);
 	}
@@ -1281,7 +1281,7 @@
 	pScanOffloadReq->uIEFieldLen = pScanReq->uIEFieldLen;
 	pScanOffloadReq->uIEFieldOffset = len - addn_ie_len -
 						pScanOffloadReq->uIEFieldLen;
-	cdf_mem_copy((uint8_t *) pScanOffloadReq +
+	qdf_mem_copy((uint8_t *) pScanOffloadReq +
 		     pScanOffloadReq->uIEFieldOffset,
 		     (uint8_t *) pScanReq + pScanReq->uIEFieldOffset,
 		     pScanReq->uIEFieldLen);
@@ -1292,7 +1292,7 @@
 		ht_cap_ie = (uint8_t *) pScanOffloadReq +
 					pScanOffloadReq->uIEFieldOffset +
 					pScanOffloadReq->uIEFieldLen;
-		cdf_mem_set(ht_cap_ie, ht_cap_len, 0);
+		qdf_mem_set(ht_cap_ie, ht_cap_len, 0);
 		*ht_cap_ie = SIR_MAC_HT_CAPABILITIES_EID;
 		*(ht_cap_ie + 1) =  ht_cap_len - 2;
 		lim_set_ht_caps(pMac, NULL, ht_cap_ie, ht_cap_len);
@@ -1306,7 +1306,7 @@
 		vht_cap_ie = (uint8_t *) pScanOffloadReq +
 					 pScanOffloadReq->uIEFieldOffset +
 					 pScanOffloadReq->uIEFieldLen;
-		cdf_mem_set(vht_cap_ie, vht_cap_len, 0);
+		qdf_mem_set(vht_cap_ie, vht_cap_len, 0);
 		*vht_cap_ie = SIR_MAC_VHT_CAPABILITIES_EID;
 		*(vht_cap_ie + 1) =  vht_cap_len - 2;
 		lim_set_vht_caps(pMac, NULL, vht_cap_ie, vht_cap_len);
@@ -1317,7 +1317,7 @@
 	rc = wma_post_ctrl_msg(pMac, &msg);
 	if (rc != eSIR_SUCCESS) {
 		lim_log(pMac, LOGE, FL("wma_post_ctrl_msg() return failure"));
-		cdf_mem_free(pScanOffloadReq);
+		qdf_mem_free(pScanOffloadReq);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -1448,26 +1448,26 @@
 	pOemDataReq = (tpSirOemDataReq) pMsgBuf;
 
 	/* post the lim mlm message now */
-	pMlmOemDataReq = cdf_mem_malloc(sizeof(*pMlmOemDataReq));
+	pMlmOemDataReq = qdf_mem_malloc(sizeof(*pMlmOemDataReq));
 	if (NULL == pMlmOemDataReq) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for mlmOemDataReq"));
 		return;
 	}
-	pMlmOemDataReq->data = cdf_mem_malloc(pOemDataReq->data_len);
+	pMlmOemDataReq->data = qdf_mem_malloc(pOemDataReq->data_len);
 	if (!pMlmOemDataReq->data) {
 		lim_log(pMac, LOGP, FL("memory allocation failed"));
-		cdf_mem_free(pMlmOemDataReq);
+		qdf_mem_free(pMlmOemDataReq);
 		return;
 	}
 
 	qdf_copy_macaddr(&pMlmOemDataReq->selfMacAddr,
 			 &pOemDataReq->selfMacAddr);
 	pMlmOemDataReq->data_len = pOemDataReq->data_len;
-	cdf_mem_copy(pMlmOemDataReq->data, pOemDataReq->data,
+	qdf_mem_copy(pMlmOemDataReq->data, pOemDataReq->data,
 		     pOemDataReq->data_len);
 	/* buffer from SME copied, free it now */
-	cdf_mem_free(pOemDataReq->data);
+	qdf_mem_free(pOemDataReq->data);
 	/* Issue LIM_MLM_OEM_DATA_REQ to MLM */
 	lim_post_mlm_message(pMac, LIM_MLM_OEM_DATA_REQ,
 			     (uint32_t *) pMlmOemDataReq);
@@ -1497,7 +1497,7 @@
  */
 static void __lim_process_clear_dfs_channel_list(tpAniSirGlobal pMac, tpSirMsgQ pMsg)
 {
-	cdf_mem_set(&pMac->lim.dfschannelList, sizeof(tSirDFSChannelList), 0);
+	qdf_mem_set(&pMac->lim.dfschannelList, sizeof(tSirDFSChannelList), 0);
 }
 
 /**
@@ -1548,15 +1548,15 @@
 		n_size = __lim_get_sme_join_req_size_for_alloc((uint8_t *)
 				msg_buf);
 
-		sme_join_req = cdf_mem_malloc(n_size);
+		sme_join_req = qdf_mem_malloc(n_size);
 		if (NULL == sme_join_req) {
 			lim_log(mac_ctx, LOGP,
 				FL("AllocateMemory failed for sme_join_req"));
 			ret_code = eSIR_SME_RESOURCES_UNAVAILABLE;
 			return;
 		}
-		(void)cdf_mem_set((void *)sme_join_req, n_size, 0);
-		(void)cdf_mem_copy((void *)sme_join_req, (void *)msg_buf,
+		(void)qdf_mem_set((void *)sme_join_req, n_size, 0);
+		(void)qdf_mem_copy((void *)sme_join_req, (void *)msg_buf,
 			n_size);
 
 		if (!lim_is_sme_join_req_valid(mac_ctx, sme_join_req)) {
@@ -1652,7 +1652,7 @@
 		session->beaconParams.beaconInterval =
 			bss_desc.beaconInterval;
 
-		cdf_mem_copy(&(session->htConfig), &(sme_join_req->htConfig),
+		qdf_mem_copy(&(session->htConfig), &(sme_join_req->htConfig),
 			sizeof(session->htConfig));
 
 		/* Copying of bssId is already done, while creating session */
@@ -1791,7 +1791,7 @@
 
 		/* Copy the SSID from smejoinreq to session entry  */
 		session->ssId.length = sme_join_req->ssId.length;
-		cdf_mem_copy(session->ssId.ssId, sme_join_req->ssId.ssId,
+		qdf_mem_copy(session->ssId.ssId, sme_join_req->ssId.ssId,
 			session->ssId.length);
 
 		/*
@@ -1830,22 +1830,22 @@
 		}
 
 		if (sme_join_req->addIEScan.length)
-			cdf_mem_copy(&session->pLimJoinReq->addIEScan,
+			qdf_mem_copy(&session->pLimJoinReq->addIEScan,
 				&sme_join_req->addIEScan, sizeof(tSirAddie));
 
 		if (sme_join_req->addIEAssoc.length)
-			cdf_mem_copy(&session->pLimJoinReq->addIEAssoc,
+			qdf_mem_copy(&session->pLimJoinReq->addIEAssoc,
 				&sme_join_req->addIEAssoc, sizeof(tSirAddie));
 
 		val = sizeof(tLimMlmJoinReq) +
 			session->pLimJoinReq->bssDescription.length + 2;
-		mlm_join_req = cdf_mem_malloc(val);
+		mlm_join_req = qdf_mem_malloc(val);
 		if (NULL == mlm_join_req) {
 			lim_log(mac_ctx, LOGP,
 				FL("AllocateMemory failed for mlmJoinReq"));
 			return;
 		}
-		(void)cdf_mem_set((void *)mlm_join_req, val, 0);
+		(void)qdf_mem_set((void *)mlm_join_req, val, 0);
 
 		/* PE SessionId is stored as a part of JoinReq */
 		mlm_join_req->sessionId = session->peSessionId;
@@ -1861,17 +1861,17 @@
 		}
 
 		/* copy operational rate from session */
-		cdf_mem_copy((void *)&session->rateSet,
+		qdf_mem_copy((void *)&session->rateSet,
 			(void *)&sme_join_req->operationalRateSet,
 			sizeof(tSirMacRateSet));
-		cdf_mem_copy((void *)&session->extRateSet,
+		qdf_mem_copy((void *)&session->extRateSet,
 			(void *)&sme_join_req->extendedRateSet,
 			sizeof(tSirMacRateSet));
 		/*
 		 * this may not be needed anymore now, as rateSet is now
 		 * included in the session entry and MLM has session context.
 		 */
-		cdf_mem_copy((void *)&mlm_join_req->operationalRateSet,
+		qdf_mem_copy((void *)&mlm_join_req->operationalRateSet,
 			(void *)&session->rateSet,
 			sizeof(tSirMacRateSet));
 
@@ -1880,7 +1880,7 @@
 		mlm_join_req->bssDescription.length =
 			session->pLimJoinReq->bssDescription.length;
 
-		cdf_mem_copy((uint8_t *) &mlm_join_req->bssDescription.bssId,
+		qdf_mem_copy((uint8_t *) &mlm_join_req->bssDescription.bssId,
 			(uint8_t *)
 			&session->pLimJoinReq->bssDescription.bssId,
 			session->pLimJoinReq->bssDescription.length + 2);
@@ -2002,7 +2002,7 @@
 	sme_transaction_id = sme_join_req->transactionId;
 
 	if (sme_join_req) {
-		cdf_mem_free(sme_join_req);
+		qdf_mem_free(sme_join_req);
 		sme_join_req = NULL;
 		if (NULL != session)
 			session->pLimJoinReq = NULL;
@@ -2070,7 +2070,7 @@
 	lim_log(mac_ctx, LOG3, FL("Received REASSOC_REQ"));
 
 	size = __lim_get_sme_join_req_size_for_alloc((uint8_t *)msg_buf);
-	reassoc_req = cdf_mem_malloc(size);
+	reassoc_req = qdf_mem_malloc(size);
 	if (NULL == reassoc_req) {
 		lim_log(mac_ctx, LOGP,
 			FL("call to AllocateMemory failed for reassoc_req"));
@@ -2078,8 +2078,8 @@
 		ret_code = eSIR_SME_RESOURCES_UNAVAILABLE;
 		goto end;
 	}
-	(void)cdf_mem_set((void *)reassoc_req, size, 0);
-	(void)cdf_mem_copy((void *)reassoc_req, (void *)msg_buf, size);
+	(void)qdf_mem_set((void *)reassoc_req, size, 0);
+	(void)qdf_mem_copy((void *)reassoc_req, (void *)msg_buf, size);
 
 	if (!lim_is_sme_join_req_valid(mac_ctx,
 				(tpSirSmeJoinReq)reassoc_req)) {
@@ -2132,7 +2132,7 @@
 					session_entry->peSessionId);
 
 			/* Make sure its our preauth bssid */
-			if (!cdf_mem_compare(reassoc_req->bssDescription.bssId,
+			if (qdf_mem_cmp(reassoc_req->bssDescription.bssId,
 					     session_entry->limReAssocbssId,
 					     6)) {
 				lim_print_mac_addr(mac_ctx,
@@ -2160,7 +2160,7 @@
 		goto end;
 	}
 
-	cdf_mem_copy(session_entry->limReAssocbssId,
+	qdf_mem_copy(session_entry->limReAssocbssId,
 		     session_entry->pLimReAssocReq->bssDescription.bssId,
 		     sizeof(tSirMacAddr));
 
@@ -2197,7 +2197,7 @@
 #endif
 	/* Copy the SSID from session entry to local variable */
 	session_entry->limReassocSSID.length = reassoc_req->ssId.length;
-	cdf_mem_copy(session_entry->limReassocSSID.ssId,
+	qdf_mem_copy(session_entry->limReassocSSID.ssId,
 		     reassoc_req->ssId.ssId,
 		     session_entry->limReassocSSID.length);
 	if (session_entry->gLimCurrentBssUapsd) {
@@ -2208,7 +2208,7 @@
 			session_entry->gUapsdPerAcBitmask);
 	}
 
-	mlm_reassoc_req = cdf_mem_malloc(sizeof(tLimMlmReassocReq));
+	mlm_reassoc_req = qdf_mem_malloc(sizeof(tLimMlmReassocReq));
 	if (NULL == mlm_reassoc_req) {
 		lim_log(mac_ctx, LOGP,
 			FL("call to AllocateMemory failed for mlmReassocReq"));
@@ -2217,7 +2217,7 @@
 		goto end;
 	}
 
-	cdf_mem_copy(mlm_reassoc_req->peerMacAddr,
+	qdf_mem_copy(mlm_reassoc_req->peerMacAddr,
 		     session_entry->limReAssocbssId, sizeof(tSirMacAddr));
 
 	if (wlan_cfg_get_int(mac_ctx, WNI_CFG_REASSOCIATION_FAILURE_TIMEOUT,
@@ -2299,7 +2299,7 @@
 	return;
 end:
 	if (reassoc_req) {
-		cdf_mem_free(reassoc_req);
+		qdf_mem_free(reassoc_req);
 		if (session_entry)
 			session_entry->pLimReAssocReq = NULL;
 	}
@@ -2365,7 +2365,7 @@
 		return;
 	}
 
-	cdf_mem_copy(&smeDisassocReq, pMsgBuf, sizeof(tSirSmeDisassocReq));
+	qdf_mem_copy(&smeDisassocReq, pMsgBuf, sizeof(tSirSmeDisassocReq));
 	smesessionId = smeDisassocReq.sessionId;
 	smetransactionId = smeDisassocReq.transactionId;
 	if (!lim_is_sme_disassoc_req_valid(pMac,
@@ -2529,7 +2529,7 @@
 				" : %d, reasonCode : %d"),
 			disassocTrigger, reasonCode);
 
-	pMlmDisassocReq = cdf_mem_malloc(sizeof(tLimMlmDisassocReq));
+	pMlmDisassocReq = qdf_mem_malloc(sizeof(tLimMlmDisassocReq));
 	if (NULL == pMlmDisassocReq) {
 		/* Log error */
 		lim_log(pMac, LOGP,
@@ -2588,7 +2588,7 @@
 
 	PELOG1(lim_log(pMac, LOG1, FL("received DISASSOC_CNF message"));)
 
-	cdf_mem_copy(&smeDisassocCnf, pMsgBuf,
+	qdf_mem_copy(&smeDisassocCnf, pMsgBuf,
 			sizeof(struct sSirSmeDisassocCnf));
 
 	psessionEntry = pe_find_session_by_bssid(pMac,
@@ -2709,7 +2709,7 @@
 
 	lim_log(mac_ctx, LOG1, FL("received DEAUTH_REQ message"));
 
-	cdf_mem_copy(&sme_deauth_req, msg_buf, sizeof(tSirSmeDeauthReq));
+	qdf_mem_copy(&sme_deauth_req, msg_buf, sizeof(tSirSmeDeauthReq));
 	sme_session_id = sme_deauth_req.sessionId;
 	sme_transaction_id = sme_deauth_req.transactionId;
 
@@ -2861,7 +2861,7 @@
 	}
 
 	/* Trigger Deauthentication frame to peer MAC entity */
-	mlm_deauth_req = cdf_mem_malloc(sizeof(tLimMlmDeauthReq));
+	mlm_deauth_req = qdf_mem_malloc(sizeof(tLimMlmDeauthReq));
 	if (NULL == mlm_deauth_req) {
 		lim_log(mac_ctx, LOGP,
 			FL("call to AllocateMemory failed for mlmDeauthReq"));
@@ -2922,13 +2922,13 @@
 		return;
 	}
 
-	set_context_req = cdf_mem_malloc(sizeof(struct sSirSmeSetContextReq));
+	set_context_req = qdf_mem_malloc(sizeof(struct sSirSmeSetContextReq));
 	if (NULL == set_context_req) {
 		lim_log(mac_ctx, LOGP, FL(
 			"call to AllocateMemory failed for set_context_req"));
 		return;
 	}
-	cdf_mem_copy(set_context_req, msg_buf,
+	qdf_mem_copy(set_context_req, msg_buf,
 			sizeof(struct sSirSmeSetContextReq));
 	sme_session_id = set_context_req->sessionId;
 	sme_transaction_id = set_context_req->transactionId;
@@ -2975,7 +2975,7 @@
 	    LIM_IS_BT_AMP_AP_ROLE(session_entry)) &&
 	    (session_entry->limSmeState == eLIM_SME_NORMAL_STATE))) {
 		/* Trigger MLM_SETKEYS_REQ */
-		mlm_set_key_req = cdf_mem_malloc(sizeof(tLimMlmSetKeysReq));
+		mlm_set_key_req = qdf_mem_malloc(sizeof(tLimMlmSetKeysReq));
 		if (NULL == mlm_set_key_req) {
 			lim_log(mac_ctx, LOGP, FL(
 					"mem alloc failed for mlmSetKeysReq"));
@@ -2993,7 +2993,7 @@
 		qdf_copy_macaddr(&mlm_set_key_req->peer_macaddr,
 				 &set_context_req->peer_macaddr);
 
-		cdf_mem_copy((uint8_t *) &mlm_set_key_req->key,
+		qdf_mem_copy((uint8_t *) &mlm_set_key_req->key,
 			     (uint8_t *) &set_context_req->keyMaterial.key,
 			     sizeof(tSirKeys) *
 			     (mlm_set_key_req->numKeys ? mlm_set_key_req->
@@ -3012,7 +3012,7 @@
 				uint8_t key_id;
 				key_id =
 					set_context_req->keyMaterial.key[0].keyId;
-				cdf_mem_copy((uint8_t *)
+				qdf_mem_copy((uint8_t *)
 					&session_entry->WEPKeyMaterial[key_id],
 					(uint8_t *) &set_context_req->keyMaterial,
 					sizeof(tSirKeyMaterial));
@@ -3020,7 +3020,7 @@
 				uint32_t i;
 				for (i = 0; i < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS;
 				     i++) {
-					cdf_mem_copy((uint8_t *)
+					qdf_mem_copy((uint8_t *)
 						&mlm_set_key_req->key[i],
 						(uint8_t *)session_entry->WEPKeyMaterial[i].key,
 						sizeof(tSirKeys));
@@ -3043,7 +3043,7 @@
 				sme_transaction_id);
 	}
 end:
-	cdf_mem_free(set_context_req);
+	qdf_mem_free(set_context_req);
 	return;
 }
 
@@ -3077,7 +3077,7 @@
 		return;
 	}
 
-	cdf_mem_copy(&get_assoc_stas_req, msg_buf,
+	qdf_mem_copy(&get_assoc_stas_req, msg_buf,
 				sizeof(struct sSirSmeGetAssocSTAsReq));
 	/*
 	 * Get Associated stations from PE.
@@ -3112,13 +3112,13 @@
 		if (NULL == sta_ds)
 			continue;
 		if (sta_ds->valid) {
-			cdf_mem_copy((uint8_t *) &assoc_sta_tmp->staMac,
+			qdf_mem_copy((uint8_t *) &assoc_sta_tmp->staMac,
 					(uint8_t *) &sta_ds->staAddr,
 					 QDF_MAC_ADDR_SIZE);
 			assoc_sta_tmp->assocId = (uint8_t) sta_ds->assocId;
 			assoc_sta_tmp->staId = (uint8_t) sta_ds->staIndex;
 
-			cdf_mem_copy((uint8_t *)&assoc_sta_tmp->supportedRates,
+			qdf_mem_copy((uint8_t *)&assoc_sta_tmp->supportedRates,
 				     (uint8_t *)&sta_ds->supportedRates,
 				     sizeof(tSirSupportedRates));
 			assoc_sta_tmp->ShortGI40Mhz = sta_ds->htShortGI40Mhz;
@@ -3184,7 +3184,7 @@
 	sap_get_wpspbc_event = &sap_event.sapevt.sapGetWPSPBCSessionEvent;
 	sap_get_wpspbc_event->status = QDF_STATUS_E_FAULT;
 
-	cdf_mem_copy(&get_wps_pbc_sessions_req, msg_buf,
+	qdf_mem_copy(&get_wps_pbc_sessions_req, msg_buf,
 			sizeof(struct sSirSmeGetWPSPBCSessionsReq));
 	/*
 	 * Get Associated stations from PE
@@ -3274,7 +3274,7 @@
 	tpPESession psessionEntry;
 	uint8_t sessionId;      /* PE sessionId */
 
-	cdf_mem_copy(&tkipCntrMeasReq, pMsgBuf,
+	qdf_mem_copy(&tkipCntrMeasReq, pMsgBuf,
 			sizeof(struct sSirSmeTkipCntrMeasReq));
 
 	psessionEntry = pe_find_session_by_bssid(pMac,
@@ -3304,7 +3304,7 @@
 	uint8_t i = 0;
 	tpDphHashNode pStaDs = NULL;
 
-	cdf_mem_copy(&stopBssReq, pMsgBuf, sizeof(tSirSmeStopBssReq));
+	qdf_mem_copy(&stopBssReq, pMsgBuf, sizeof(tSirSmeStopBssReq));
 	smesessionId = stopBssReq.sessionId;
 	smetransactionId = stopBssReq.transactionId;
 
@@ -3386,15 +3386,15 @@
 	}
 
 	/* Free the buffer allocated in START_BSS_REQ */
-	cdf_mem_free(psessionEntry->addIeParams.probeRespData_buff);
+	qdf_mem_free(psessionEntry->addIeParams.probeRespData_buff);
 	psessionEntry->addIeParams.probeRespDataLen = 0;
 	psessionEntry->addIeParams.probeRespData_buff = NULL;
 
-	cdf_mem_free(psessionEntry->addIeParams.assocRespData_buff);
+	qdf_mem_free(psessionEntry->addIeParams.assocRespData_buff);
 	psessionEntry->addIeParams.assocRespDataLen = 0;
 	psessionEntry->addIeParams.assocRespData_buff = NULL;
 
-	cdf_mem_free(psessionEntry->addIeParams.probeRespBCNData_buff);
+	qdf_mem_free(psessionEntry->addIeParams.probeRespBCNData_buff);
 	psessionEntry->addIeParams.probeRespBCNDataLen = 0;
 	psessionEntry->addIeParams.probeRespBCNData_buff = NULL;
 
@@ -3506,7 +3506,7 @@
 		goto end;
 	}
 
-	cdf_mem_copy(&assoc_cnf, msg_buf, sizeof(struct sSirSmeAssocCnf));
+	qdf_mem_copy(&assoc_cnf, msg_buf, sizeof(struct sSirSmeAssocCnf));
 	if (!__lim_is_sme_assoc_cnf_valid(&assoc_cnf)) {
 		lim_log(mac_ctx, LOGE,
 			FL("Received invalid SME_RE(ASSOC)_CNF message "));
@@ -3552,7 +3552,7 @@
 				session_entry);
 		goto end;
 	}
-	if (!cdf_mem_compare((uint8_t *)sta_ds->staAddr,
+	if (qdf_mem_cmp((uint8_t *)sta_ds->staAddr,
 				(uint8_t *) assoc_cnf.peer_macaddr.bytes,
 				QDF_MAC_ADDR_SIZE)) {
 		lim_log(mac_ctx, LOG1, FL(
@@ -3623,10 +3623,10 @@
 		assoc_req = (tpSirAssocReq)
 			session_entry->parsedAssocReq[sta_ds->assocId];
 		if (assoc_req->assocReqFrame) {
-			cdf_mem_free(assoc_req->assocReqFrame);
+			qdf_mem_free(assoc_req->assocReqFrame);
 			assoc_req->assocReqFrame = NULL;
 		}
-		cdf_mem_free(session_entry->parsedAssocReq[sta_ds->assocId]);
+		qdf_mem_free(session_entry->parsedAssocReq[sta_ds->assocId]);
 		session_entry->parsedAssocReq[sta_ds->assocId] = NULL;
 	}
 }
@@ -3757,7 +3757,7 @@
 
 	/* save the addts request */
 	pMac->lim.gLimAddtsSent = true;
-	cdf_mem_copy((uint8_t *) &pMac->lim.gLimAddtsReq,
+	qdf_mem_copy((uint8_t *) &pMac->lim.gLimAddtsReq,
 		     (uint8_t *) pSirAddts, sizeof(tSirAddtsReq));
 
 	/* ship out the message now */
@@ -3980,7 +3980,7 @@
 	MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msgQ.type));
 
 	if (eSIR_SUCCESS != (wma_post_ctrl_msg(pMac, &msgQ))) {
-		cdf_mem_free(pMsgBuf);
+		qdf_mem_free(pMsgBuf);
 		pMsgBuf = NULL;
 		lim_log(pMac, LOGP, "Unable to forward request");
 		return;
@@ -4011,7 +4011,7 @@
 	MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msgQ.type));
 
 	if (eSIR_SUCCESS != (wma_post_ctrl_msg(pMac, &msgQ))) {
-		cdf_mem_free(pMsgBuf);
+		qdf_mem_free(pMsgBuf);
 		pMsgBuf = NULL;
 		lim_log(pMac, LOGP, "Unable to forward request");
 		return;
@@ -4033,14 +4033,14 @@
 		return;
 	}
 
-	pUpdateAPWPSIEsReq = cdf_mem_malloc(sizeof(tSirUpdateAPWPSIEsReq));
+	pUpdateAPWPSIEsReq = qdf_mem_malloc(sizeof(tSirUpdateAPWPSIEsReq));
 	if (NULL == pUpdateAPWPSIEsReq) {
 		lim_log(pMac, LOGP,
 			FL
 				("call to AllocateMemory failed for pUpdateAPWPSIEsReq"));
 		return;
 	}
-	cdf_mem_copy(pUpdateAPWPSIEsReq, pMsgBuf,
+	qdf_mem_copy(pUpdateAPWPSIEsReq, pMsgBuf,
 			sizeof(struct sSirUpdateAPWPSIEsReq));
 
 	psessionEntry = pe_find_session_by_bssid(pMac,
@@ -4052,14 +4052,14 @@
 		goto end;
 	}
 
-	cdf_mem_copy(&psessionEntry->APWPSIEs, &pUpdateAPWPSIEsReq->APWPSIEs,
+	qdf_mem_copy(&psessionEntry->APWPSIEs, &pUpdateAPWPSIEsReq->APWPSIEs,
 		     sizeof(tSirAPWPSIEs));
 
 	sch_set_fixed_beacon_fields(pMac, psessionEntry);
 	lim_send_beacon_ind(pMac, psessionEntry);
 
 end:
-	cdf_mem_free(pUpdateAPWPSIEsReq);
+	qdf_mem_free(pUpdateAPWPSIEsReq);
 	return;
 }
 
@@ -4080,7 +4080,7 @@
 	}
 
 	pHalHiddenSsidVdevRestart =
-		cdf_mem_malloc(sizeof(tHalHiddenSsidVdevRestart));
+		qdf_mem_malloc(sizeof(tHalHiddenSsidVdevRestart));
 	if (NULL == pHalHiddenSsidVdevRestart) {
 		PELOGE(lim_log
 			       (pMac, LOGE, "%s:%d: Unable to allocate memory",
@@ -4102,7 +4102,7 @@
 			       (pMac, LOGE, "%s:%d: wma_post_ctrl_msg() failed", __func__,
 			       __LINE__);
 		       )
-		cdf_mem_free(pHalHiddenSsidVdevRestart);
+		qdf_mem_free(pHalHiddenSsidVdevRestart);
 	}
 }
 
@@ -4153,14 +4153,14 @@
 		return;
 	}
 
-	pUpdateAPWPARSNIEsReq = cdf_mem_malloc(sizeof(tSirUpdateAPWPSIEsReq));
+	pUpdateAPWPARSNIEsReq = qdf_mem_malloc(sizeof(tSirUpdateAPWPSIEsReq));
 	if (NULL == pUpdateAPWPARSNIEsReq) {
 		lim_log(pMac, LOGP,
 			FL
 				("call to AllocateMemory failed for pUpdateAPWPARSNIEsReq"));
 		return;
 	}
-	cdf_mem_copy(pUpdateAPWPARSNIEsReq, pMsgBuf,
+	qdf_mem_copy(pUpdateAPWPARSNIEsReq, pMsgBuf,
 			sizeof(struct sSirUpdateAPWPARSNIEsReq));
 
 	psessionEntry = pe_find_session_by_bssid(pMac,
@@ -4172,7 +4172,7 @@
 		goto end;
 	}
 
-	cdf_mem_copy(&psessionEntry->pLimStartBssReq->rsnIE,
+	qdf_mem_copy(&psessionEntry->pLimStartBssReq->rsnIE,
 		     &pUpdateAPWPARSNIEsReq->APWPARSNIEs, sizeof(tSirRSNie));
 
 	lim_set_rs_nie_wp_aiefrom_sme_start_bss_req_message(pMac,
@@ -4187,7 +4187,7 @@
 	lim_send_beacon_ind(pMac, psessionEntry);
 
 end:
-	cdf_mem_free(pUpdateAPWPARSNIEsReq);
+	qdf_mem_free(pUpdateAPWPARSNIEsReq);
 	return;
 } /*** end __lim_process_sme_set_wparsni_es(tpAniSirGlobal pMac, uint32_t *pMsgBuf) ***/
 
@@ -4210,7 +4210,7 @@
 		return;
 	}
 
-	cdf_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams));
+	qdf_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams));
 	pChangeBIParams = (tpSirChangeBIParams) pMsgBuf;
 
 	psessionEntry = pe_find_session_by_bssid(pMac,
@@ -4330,7 +4330,7 @@
 			continue;
 
 		if (pStaDs->valid && pStaDs->htSupportedChannelWidthSet) {
-			pHtOpMode = cdf_mem_malloc(sizeof(tUpdateVHTOpMode));
+			pHtOpMode = qdf_mem_malloc(sizeof(tUpdateVHTOpMode));
 			if (NULL == pHtOpMode) {
 				lim_log(pMac, LOGE,
 					FL
@@ -4343,7 +4343,7 @@
 				 PHY_SINGLE_CHANNEL_CENTERED) ?
 				eHT_CHANNEL_WIDTH_20MHZ : eHT_CHANNEL_WIDTH_40MHZ;
 			pHtOpMode->staId = staId;
-			cdf_mem_copy(pHtOpMode->peer_mac, &pStaDs->staAddr,
+			qdf_mem_copy(pHtOpMode->peer_mac, &pStaDs->staAddr,
 				     sizeof(tSirMacAddr));
 			pHtOpMode->smesessionId = sessionId;
 
@@ -4356,7 +4356,7 @@
 					FL
 						("%s: Not able to post WMA_UPDATE_OP_MODE message to WMA"),
 					__func__);
-				cdf_mem_free(pHtOpMode);
+				qdf_mem_free(pHtOpMode);
 				return;
 			}
 			lim_log(pMac, LOG1,
@@ -4439,7 +4439,7 @@
 		return eSIR_FAILURE;
 	}
 
-	pMaxTxParams = cdf_mem_malloc(sizeof(tMaxTxPowerParams));
+	pMaxTxParams = qdf_mem_malloc(sizeof(tMaxTxPowerParams));
 	if (NULL == pMaxTxParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory for pMaxTxParams "));
@@ -4455,9 +4455,9 @@
 		return eSIR_FAILURE;
 	}
 	pMaxTxParams->power = txPower;
-	cdf_mem_copy(pMaxTxParams->bssId.bytes, pSessionEntry->bssId,
+	qdf_mem_copy(pMaxTxParams->bssId.bytes, pSessionEntry->bssId,
 		     QDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(pMaxTxParams->selfStaMacAddr.bytes,
+	qdf_mem_copy(pMaxTxParams->selfStaMacAddr.bytes,
 			pSessionEntry->selfMacAddr,
 			QDF_MAC_ADDR_SIZE);
 
@@ -4471,7 +4471,7 @@
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
 		lim_log(pMac, LOGE, FL("wma_post_ctrl_msg() failed"));
-		cdf_mem_free(pMaxTxParams);
+		qdf_mem_free(pMaxTxParams);
 	}
 	return retCode;
 }
@@ -4512,7 +4512,7 @@
 			goto skip_match;
 		if (sme_req->matchLen) {
 			if ((lim_mgmt_regn->matchLen == sme_req->matchLen) &&
-				(cdf_mem_compare(lim_mgmt_regn->matchData,
+				(!qdf_mem_cmp(lim_mgmt_regn->matchData,
 					sme_req->matchData,
 					lim_mgmt_regn->matchLen))) {
 					/* found match! */
@@ -4540,22 +4540,22 @@
 				&mac_ctx->lim.gLimMgmtFrameRegistratinQueue,
 				(qdf_list_node_t *)lim_mgmt_regn);
 		qdf_mutex_release(&mac_ctx->lim.lim_frame_register_lock);
-		cdf_mem_free(lim_mgmt_regn);
+		qdf_mem_free(lim_mgmt_regn);
 	}
 
 	if (sme_req->registerFrame) {
 		lim_mgmt_regn =
-			cdf_mem_malloc(sizeof(struct mgmt_frm_reg_info) +
+			qdf_mem_malloc(sizeof(struct mgmt_frm_reg_info) +
 					sme_req->matchLen);
 		if (lim_mgmt_regn != NULL) {
-			cdf_mem_set((void *)lim_mgmt_regn,
+			qdf_mem_set((void *)lim_mgmt_regn,
 				    sizeof(struct mgmt_frm_reg_info) +
 				    sme_req->matchLen, 0);
 			lim_mgmt_regn->frameType = sme_req->frameType;
 			lim_mgmt_regn->matchLen = sme_req->matchLen;
 			lim_mgmt_regn->sessionId = sme_req->sessionId;
 			if (sme_req->matchLen) {
-				cdf_mem_copy(lim_mgmt_regn->matchData,
+				qdf_mem_copy(lim_mgmt_regn->matchData,
 					     sme_req->matchData,
 					     sme_req->matchLen);
 			}
@@ -4578,7 +4578,7 @@
 	pMac->lim.gDeferMsgTypeForNOA = 0;
 	if (pMac->lim.gpDefdSmeMsgForNOA != NULL) {
 		/* __lim_process_sme_scan_req consumed the buffer. We can free it. */
-		cdf_mem_free(pMac->lim.gpDefdSmeMsgForNOA);
+		qdf_mem_free(pMac->lim.gpDefdSmeMsgForNOA);
 		pMac->lim.gpDefdSmeMsgForNOA = NULL;
 	}
 }
@@ -4938,7 +4938,7 @@
 		lim_process_ext_change_channel(pMac, pMsgBuf);
 		break;
 	default:
-		cdf_mem_free((void *)pMsg->bodyptr);
+		qdf_mem_free((void *)pMsg->bodyptr);
 		pMsg->bodyptr = NULL;
 		break;
 	} /* switch (msgType) */
@@ -5096,10 +5096,10 @@
 
 	session_entry->lim11hEnable = val;
 	session_entry->dot11mode = ch_change_req->dot11mode;
-	cdf_mem_copy(&session_entry->rateSet,
+	qdf_mem_copy(&session_entry->rateSet,
 			&ch_change_req->operational_rateset,
 			sizeof(session_entry->rateSet));
-	cdf_mem_copy(&session_entry->extRateSet,
+	qdf_mem_copy(&session_entry->extRateSet,
 			&ch_change_req->extended_rateset,
 			sizeof(session_entry->extRateSet));
 	lim_set_channel(mac_ctx, ch_change_req->targetChannel,
@@ -5139,14 +5139,14 @@
 	if (srcDataLen > 0 && pSrcData_buff != NULL) {
 		*pDstDataLen = srcDataLen;
 
-		*pDstData_buff = cdf_mem_malloc(*pDstDataLen);
+		*pDstData_buff = qdf_mem_malloc(*pDstDataLen);
 
 		if (NULL == *pDstData_buff) {
 			lim_log(pMac, LOGE,
 				FL("AllocateMemory failed for pDstData_buff"));
 			return;
 		}
-		cdf_mem_copy(*pDstData_buff, pSrcData_buff, *pDstDataLen);
+		qdf_mem_copy(*pDstData_buff, pSrcData_buff, *pDstDataLen);
 	} else {
 		*pDstData_buff = NULL;
 		*pDstDataLen = 0;
@@ -5190,9 +5190,9 @@
 	if (srcDataLen > *pDstDataLen) {
 		*pDstDataLen = srcDataLen;
 		/* free old buffer */
-		cdf_mem_free(*pDstData_buff);
+		qdf_mem_free(*pDstData_buff);
 		/* allocate a new */
-		*pDstData_buff = cdf_mem_malloc(*pDstDataLen);
+		*pDstData_buff = qdf_mem_malloc(*pDstDataLen);
 
 		if (NULL == *pDstData_buff) {
 			lim_log(pMac, LOGE, FL("Memory allocation failed."));
@@ -5204,7 +5204,7 @@
 	/* copy the content of buffer into dst buffer
 	 */
 	*pDstDataLen = srcDataLen;
-	cdf_mem_copy(*pDstData_buff, pSrcData_buff, *pDstDataLen);
+	qdf_mem_copy(*pDstData_buff, pSrcData_buff, *pDstDataLen);
 
 }
 
@@ -5283,7 +5283,7 @@
 		break;
 	}
 end:
-	cdf_mem_free(modify_add_ies->modifyIE.pIEBuffer);
+	qdf_mem_free(modify_add_ies->modifyIE.pIEBuffer);
 	modify_add_ies->modifyIE.pIEBuffer = NULL;
 }
 
@@ -5328,17 +5328,17 @@
 	if (0 == update_ie->ieBufferlength) {
 		switch (update_add_ies->updateType) {
 		case eUPDATE_IE_PROBE_RESP:
-			cdf_mem_free(addn_ie->probeRespData_buff);
+			qdf_mem_free(addn_ie->probeRespData_buff);
 			addn_ie->probeRespData_buff = NULL;
 			addn_ie->probeRespDataLen = 0;
 			break;
 		case eUPDATE_IE_ASSOC_RESP:
-			cdf_mem_free(addn_ie->assocRespData_buff);
+			qdf_mem_free(addn_ie->assocRespData_buff);
 			addn_ie->assocRespData_buff = NULL;
 			addn_ie->assocRespDataLen = 0;
 			break;
 		case eUPDATE_IE_PROBE_BCN:
-			cdf_mem_free(addn_ie->probeRespBCNData_buff);
+			qdf_mem_free(addn_ie->probeRespBCNData_buff);
 			addn_ie->probeRespBCNData_buff = NULL;
 			addn_ie->probeRespBCNDataLen = 0;
 
@@ -5360,20 +5360,20 @@
 			 */
 			new_length = update_ie->ieBufferlength +
 				addn_ie->probeRespDataLen;
-			new_ptr = cdf_mem_malloc(new_length);
+			new_ptr = qdf_mem_malloc(new_length);
 			if (NULL == new_ptr) {
 				lim_log(mac_ctx, LOGE, FL(
 						"Memory allocation failed."));
 				goto end;
 			}
 			/* append buffer to end of local buffers */
-			cdf_mem_copy(new_ptr, addn_ie->probeRespData_buff,
+			qdf_mem_copy(new_ptr, addn_ie->probeRespData_buff,
 					addn_ie->probeRespDataLen);
-			cdf_mem_copy(&new_ptr[addn_ie->probeRespDataLen],
+			qdf_mem_copy(&new_ptr[addn_ie->probeRespDataLen],
 				     update_ie->pAdditionIEBuffer,
 				     update_ie->ieBufferlength);
 			/* free old memory */
-			cdf_mem_free(addn_ie->probeRespData_buff);
+			qdf_mem_free(addn_ie->probeRespData_buff);
 			/* adjust length accordingly */
 			addn_ie->probeRespDataLen = new_length;
 			/* save refernece of local buffer in PE session */
@@ -5409,7 +5409,7 @@
 		break;
 	}
 end:
-	cdf_mem_free(update_ie->pAdditionIEBuffer);
+	qdf_mem_free(update_ie->pAdditionIEBuffer);
 	update_ie->pAdditionIEBuffer = NULL;
 }
 
diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c
index c4653be..26abe4d 100644
--- a/core/mac/src/pe/lim/lim_process_tdls.c
+++ b/core/mac/src/pe/lim/lim_process_tdls.c
@@ -277,12 +277,12 @@
 	pMacHdr->fc.powerMgmt = 0;
 	pMacHdr->fc.wep = (psessionEntry->encryptType == eSIR_ED_NONE) ? 0 : 1;
 
-	cdf_mem_copy((uint8_t *) pMacHdr->addr1,
+	qdf_mem_copy((uint8_t *) pMacHdr->addr1,
 		     (uint8_t *) addr1, sizeof(tSirMacAddr));
-	cdf_mem_copy((uint8_t *) pMacHdr->addr2,
+	qdf_mem_copy((uint8_t *) pMacHdr->addr2,
 		     (uint8_t *) staMac, sizeof(tSirMacAddr));
 
-	cdf_mem_copy((uint8_t *) pMacHdr->addr3,
+	qdf_mem_copy((uint8_t *) pMacHdr->addr3,
 		     (uint8_t *) (addr3), sizeof(tSirMacAddr));
 
 	lim_log(pMac, LOG1,
@@ -305,7 +305,7 @@
 	/*
 	 * Now form RFC1042 header
 	 */
-	cdf_mem_copy((uint8_t *) (pFrame + header_offset),
+	qdf_mem_copy((uint8_t *) (pFrame + header_offset),
 		     (uint8_t *) eth_890d_header, sizeof(eth_890d_header));
 
 	header_offset += sizeof(eth_890d_header);
@@ -372,7 +372,7 @@
 	 * and then hand it off to 'dot11f_pack_probe_request' (for
 	 * serialization).  We start by zero-initializing the structure:
 	 */
-	cdf_mem_set((uint8_t *) &tdlsDisReq, sizeof(tDot11fTDLSDisReq), 0);
+	qdf_mem_set((uint8_t *) &tdlsDisReq, sizeof(tDot11fTDLSDisReq), 0);
 
 	/*
 	 * setup Fixed fields,
@@ -449,7 +449,7 @@
 	}
 
 	/* zero out the memory */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/*
 	 * IE formation, memory allocation is completed, Now form TDLS discovery
@@ -496,7 +496,7 @@
 
 		/* padding zero if more than 5 bytes are required */
 		if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE)
-			cdf_mem_set(pFrame + header_offset + nPayload +
+			qdf_mem_set(pFrame + header_offset + nPayload +
 				    MIN_VENDOR_SPECIFIC_IE_SIZE,
 				    padLen - MIN_VENDOR_SPECIFIC_IE_SIZE, 0);
 	}
@@ -626,7 +626,7 @@
 	 * and then hand it off to 'dot11f_pack_probe_request' (for
 	 * serialization).  We start by zero-initializing the structure:
 	 */
-	cdf_mem_set((uint8_t *) &tdlsDisRsp, sizeof(tDot11fTDLSDisRsp), 0);
+	qdf_mem_set((uint8_t *) &tdlsDisRsp, sizeof(tDot11fTDLSDisRsp), 0);
 
 	/*
 	 * setup Fixed fields,
@@ -729,7 +729,7 @@
 	}
 
 	/* zero out the memory */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/*
 	 * IE formation, memory allocation is completed, Now form TDLS discovery
@@ -772,7 +772,7 @@
 	if (0 != addIeLen) {
 		lim_log(pMac, LOG1,
 			FL("Copy Additional Ie Len = %d"), addIeLen);
-		cdf_mem_copy(pFrame + sizeof(tSirMacMgmtHdr) + nPayload, addIe,
+		qdf_mem_copy(pFrame + sizeof(tSirMacMgmtHdr) + nPayload, addIe,
 			     addIeLen);
 	}
 	lim_log(pMac, LOG1,
@@ -883,7 +883,7 @@
 	 */
 	smeSessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &tdlsSetupReq, sizeof(tDot11fTDLSSetupReq), 0);
+	qdf_mem_set((uint8_t *) &tdlsSetupReq, sizeof(tDot11fTDLSSetupReq), 0);
 	tdlsSetupReq.Category.category = SIR_MAC_ACTION_TDLS;
 	tdlsSetupReq.Action.action = SIR_MAC_TDLS_SETUP_REQ;
 	tdlsSetupReq.DialogToken.token = dialog;
@@ -1051,7 +1051,7 @@
 	}
 
 	/* zero out the memory */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/*
 	 * IE formation, memory allocation is completed, Now form TDLS discovery
@@ -1098,7 +1098,7 @@
 	if (addIeLen != 0) {
 		lim_log(pMac, LOG1, FL("Copy Additional Ie Len = %d"),
 		       addIeLen);
-		cdf_mem_copy(pFrame + header_offset + nPayload, addIe,
+		qdf_mem_copy(pFrame + header_offset + nPayload, addIe,
 			     addIeLen);
 	}
 
@@ -1164,7 +1164,7 @@
 	 * and then hand it off to 'dot11f_pack_probe_request' (for
 	 * serialization).  We start by zero-initializing the structure:
 	 */
-	cdf_mem_set((uint8_t *) &teardown, sizeof(tDot11fTDLSTeardown), 0);
+	qdf_mem_set((uint8_t *) &teardown, sizeof(tDot11fTDLSTeardown), 0);
 	teardown.Category.category = SIR_MAC_ACTION_TDLS;
 	teardown.Action.action = SIR_MAC_TDLS_TEARDOWN;
 	teardown.Reason.code = reason;
@@ -1236,7 +1236,7 @@
 	}
 
 	/* zero out the memory */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/*
 	 * IE formation, memory allocation is completed, Now form TDLS discovery
@@ -1277,7 +1277,7 @@
 	if (addIeLen != 0) {
 		lim_log(pMac, LOGW,
 			FL("Copy Additional Ie Len = %d"), addIeLen);
-		cdf_mem_copy(pFrame + header_offset + nPayload, addIe,
+		qdf_mem_copy(pFrame + header_offset + nPayload, addIe,
 			     addIeLen);
 	}
 #ifndef NO_PAD_TDLS_MIN_8023_SIZE
@@ -1297,7 +1297,7 @@
 
 		/* padding zero if more than 5 bytes are required */
 		if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE)
-			cdf_mem_set(pFrame + header_offset + nPayload +
+			qdf_mem_set(pFrame + header_offset + nPayload +
 				    addIeLen + MIN_VENDOR_SPECIFIC_IE_SIZE,
 				    padLen - MIN_VENDOR_SPECIFIC_IE_SIZE, 0);
 	}
@@ -1370,7 +1370,7 @@
 	 * and then hand it off to 'dot11f_pack_probe_request' (for
 	 * serialization).  We start by zero-initializing the structure:
 	 */
-	cdf_mem_set((uint8_t *) &tdlsSetupRsp, sizeof(tDot11fTDLSSetupRsp), 0);
+	qdf_mem_set((uint8_t *) &tdlsSetupRsp, sizeof(tDot11fTDLSSetupRsp), 0);
 
 	/*
 	 * setup Fixed fields,
@@ -1533,7 +1533,7 @@
 	}
 
 	/* zero out the memory */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/*
 	 * IE formation, memory allocation is completed, Now form TDLS discovery
@@ -1578,7 +1578,7 @@
 	/* follow the order. This should be ok, but we should consider changing this */
 	/* if there is any IOT issue. */
 	if (addIeLen != 0) {
-		cdf_mem_copy(pFrame + header_offset + nPayload, addIe,
+		qdf_mem_copy(pFrame + header_offset + nPayload, addIe,
 			     addIeLen);
 	}
 
@@ -1640,7 +1640,7 @@
 	 */
 	smeSessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &tdlsSetupCnf, sizeof(tDot11fTDLSSetupCnf), 0);
+	qdf_mem_set((uint8_t *) &tdlsSetupCnf, sizeof(tDot11fTDLSSetupCnf), 0);
 
 	/*
 	 * setup Fixed fields,
@@ -1740,7 +1740,7 @@
 	}
 
 	/* zero out the memory */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/*
 	 * IE formation, memory allocation is completed, Now form TDLS discovery
@@ -1776,7 +1776,7 @@
 	/* follow the order. This should be ok, but we should consider changing this */
 	/* if there is any IOT issue. */
 	if (addIeLen != 0) {
-		cdf_mem_copy(pFrame + header_offset + nPayload, addIe,
+		qdf_mem_copy(pFrame + header_offset + nPayload, addIe,
 			     addIeLen);
 	}
 #ifndef NO_PAD_TDLS_MIN_8023_SIZE
@@ -1796,7 +1796,7 @@
 
 		/* padding zero if more than 5 bytes are required */
 		if (padLen > MIN_VENDOR_SPECIFIC_IE_SIZE)
-			cdf_mem_set(pFrame + header_offset + nPayload +
+			qdf_mem_set(pFrame + header_offset + nPayload +
 				    addIeLen + MIN_VENDOR_SPECIFIC_IE_SIZE,
 				    padLen - MIN_VENDOR_SPECIFIC_IE_SIZE, 0);
 	}
@@ -1913,7 +1913,7 @@
 
 	lim_log(pMac, LOG1, FL("AMPDU Param: %x"), nCfgValue);
 
-	cdf_mem_copy(pDot11f->supportedMCSSet, pTdlsAddStaReq->htCap.suppMcsSet,
+	qdf_mem_copy(pDot11f->supportedMCSSet, pTdlsAddStaReq->htCap.suppMcsSet,
 		     SIZE_OF_SUPPORTED_MCS_SET);
 
 	nCfgValue = pTdlsAddStaReq->htCap.extendedHtCapInfo;
@@ -2157,7 +2157,7 @@
 	temp_rate_set.numRates = supp_rates_len;
 
 	rates = &stads->supportedRates;
-	cdf_mem_set((uint8_t *) rates, sizeof(tSirSupportedRates), 0);
+	qdf_mem_set((uint8_t *) rates, sizeof(tSirSupportedRates), 0);
 
 	for (i = 0; i < temp_rate_set2.numRates; i++) {
 		for (j = 0; j < temp_rate_set.numRates; j++) {
@@ -2480,7 +2480,7 @@
 	tSirTdlsAddStaRsp *addStaRsp = NULL;
 	mmhMsg.type = eWNI_SME_TDLS_ADD_STA_RSP;
 
-	addStaRsp = cdf_mem_malloc(sizeof(tSirTdlsAddStaRsp));
+	addStaRsp = qdf_mem_malloc(sizeof(tSirTdlsAddStaRsp));
 	if (NULL == addStaRsp) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory"));
 		return QDF_STATUS_E_NOMEM;
@@ -2494,7 +2494,7 @@
 		addStaRsp->bcastSig = pStaDs->ucBcastSig;
 	}
 	if (peerMac) {
-		cdf_mem_copy(addStaRsp->peermac.bytes,
+		qdf_mem_copy(addStaRsp->peermac.bytes,
 			     (uint8_t *) peerMac, QDF_MAC_ADDR_SIZE);
 	}
 	if (updateSta)
@@ -2554,7 +2554,7 @@
 					       pAddStaParams->staMac,
 					       pAddStaParams->updateSta, pStaDs,
 					       status);
-	cdf_mem_free(pAddStaParams);
+	qdf_mem_free(pAddStaParams);
 	return status;
 }
 
@@ -2677,13 +2677,13 @@
 				       (respStaAddr = linkIden->RespStaAddr))
 	: ((respStaAddr = linkIden->InitStaAddr),
 	   (initStaAddr = linkIden->RespStaAddr));
-	cdf_mem_copy((uint8_t *) linkIden->bssid,
+	qdf_mem_copy((uint8_t *) linkIden->bssid,
 		     (uint8_t *) psessionEntry->bssId, QDF_MAC_ADDR_SIZE);
 
-	cdf_mem_copy((uint8_t *) initStaAddr,
+	qdf_mem_copy((uint8_t *) initStaAddr,
 		     psessionEntry->selfMacAddr, QDF_MAC_ADDR_SIZE);
 
-	cdf_mem_copy((uint8_t *) respStaAddr, (uint8_t *) peer_mac.bytes,
+	qdf_mem_copy((uint8_t *) respStaAddr, (uint8_t *) peer_mac.bytes,
 		     QDF_MAC_ADDR_SIZE);
 
 	linkIden->present = 1;
@@ -2855,7 +2855,7 @@
 	tSirTdlsLinkEstablishReqRsp *pTdlsLinkEstablishReqRsp = NULL;
 
 	pTdlsLinkEstablishReqRsp =
-		cdf_mem_malloc(sizeof(tSirTdlsLinkEstablishReqRsp));
+		qdf_mem_malloc(sizeof(tSirTdlsLinkEstablishReqRsp));
 	if (NULL == pTdlsLinkEstablishReqRsp) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory"));
 		return;
@@ -2885,7 +2885,7 @@
 	tSirTdlsDelStaRsp *pDelSta = NULL;
 	mmhMsg.type = eWNI_SME_TDLS_DEL_STA_RSP;
 
-	pDelSta = cdf_mem_malloc(sizeof(tSirTdlsDelStaRsp));
+	pDelSta = qdf_mem_malloc(sizeof(tSirTdlsDelStaRsp));
 	if (NULL == pDelSta) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory"));
 		return QDF_STATUS_E_NOMEM;
@@ -3145,14 +3145,14 @@
 		lim_log(mac_ctx, LOGE, FL("stads is NULL"));
 		goto lim_tdls_link_establish_error;
 	}
-	tdls_req_params = cdf_mem_malloc(sizeof(tTdlsLinkEstablishParams));
+	tdls_req_params = qdf_mem_malloc(sizeof(tTdlsLinkEstablishParams));
 	if (NULL == tdls_req_params) {
 		lim_log(mac_ctx, LOGE,
 			FL("Unable to allocate memory TDLS Link Establish Request"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set((uint8_t *) tdls_req_params,
+	qdf_mem_set((uint8_t *) tdls_req_params,
 		    sizeof(tTdlsLinkEstablishParams), 0);
 
 	tdls_req_params->staIdx = stads->staIndex;
@@ -3195,7 +3195,7 @@
 		&tdls_req_params->validChannelsLen);
 
 send_tdls_establish_request:
-	cdf_mem_copy(tdls_req_params->validOperClasses,
+	qdf_mem_copy(tdls_req_params->validOperClasses,
 		     tdls_req->supportedOperClasses,
 		     tdls_req->supportedOperClassesLen);
 	tdls_req_params->validOperClassesLen =
diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c
index ac882ae..7f96633 100644
--- a/core/mac/src/pe/lim/lim_prop_exts_utils.c
+++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c
@@ -87,13 +87,13 @@
 	tSirRetStatus cfg_set_status = eSIR_FAILURE;
 	tSirRetStatus cfg_get_status = eSIR_FAILURE;
 
-	beacon_struct = cdf_mem_malloc(sizeof(tSirProbeRespBeacon));
+	beacon_struct = qdf_mem_malloc(sizeof(tSirProbeRespBeacon));
 	if (NULL == beacon_struct) {
 		lim_log(mac_ctx, LOGE, FL("Unable to allocate memory"));
 		return;
 	}
 
-	cdf_mem_set((uint8_t *) beacon_struct, sizeof(tSirProbeRespBeacon), 0);
+	qdf_mem_set((uint8_t *) beacon_struct, sizeof(tSirProbeRespBeacon), 0);
 	*qos_cap = 0;
 	*prop_cap = 0;
 	*uapsd = 0;
@@ -239,7 +239,7 @@
 		if (beacon_struct->countryInfoPresent)
 			session->country_info_present = true;
 	}
-	cdf_mem_free(beacon_struct);
+	qdf_mem_free(beacon_struct);
 	return;
 } /****** end lim_extract_ap_capability() ******/
 
diff --git a/core/mac/src/pe/lim/lim_scan_result_utils.c b/core/mac/src/pe/lim/lim_scan_result_utils.c
index 2bc0f20..e8a6813 100644
--- a/core/mac/src/pe/lim/lim_scan_result_utils.c
+++ b/core/mac/src/pe/lim/lim_scan_result_utils.c
@@ -123,7 +123,7 @@
 					- sizeof(pBssDescr->length) + ieLen);
 
 	/* Copy BSS Id */
-	cdf_mem_copy((uint8_t *) &pBssDescr->bssId,
+	qdf_mem_copy((uint8_t *) &pBssDescr->bssId,
 		     (uint8_t *) pHdr->bssId, sizeof(tSirMacAddr));
 
 	/* Copy Timestamp, Beacon Interval and Capability Info */
@@ -227,7 +227,7 @@
 	}
 #endif
 	/* Copy IE fields */
-	cdf_mem_copy((uint8_t *) &pBssDescr->ieFields,
+	qdf_mem_copy((uint8_t *) &pBssDescr->ieFields,
 		     pBody + SIR_MAC_B_PR_SSID_OFFSET, ieLen);
 
 	/*set channel number in beacon in case it is not present */
@@ -269,7 +269,7 @@
 	uint8_t i = 0;
 
 	for (i = 0; i < pMac->lim.gpLimMlmScanReq->numSsid; i++) {
-		if (true == cdf_mem_compare((uint8_t *) ssId,
+		if (true != qdf_mem_cmp((uint8_t *) ssId,
 					    (uint8_t *) &pMac->lim.
 					    gpLimMlmScanReq->ssId[i],
 					    (uint8_t) (pMac->lim.
@@ -317,7 +317,7 @@
 	hdr = WMA_GET_RX_MPDUHEADER3A((uint8_t *) rx_packet_info);
 
 	/*  Check For Null BSSID and Skip in case of P2P */
-	if (cdf_mem_compare(bssid_zero, &hdr->addr3, 6))
+	if (!qdf_mem_cmp(bssid_zero, &hdr->addr3, 6))
 		return;
 
 	/*
@@ -388,12 +388,12 @@
 
 	/* IEs will be overlap ieFields field. Adjust the length accordingly */
 	frame_len = sizeof(*bssdescr) + ie_len - sizeof(bssdescr->ieFields[1]);
-	bssdescr = (tSirBssDescription *) cdf_mem_malloc(frame_len);
+	bssdescr = (tSirBssDescription *) qdf_mem_malloc(frame_len);
 
 	if (NULL == bssdescr) {
 		/* Log error */
 		lim_log(mac_ctx, LOGE,
-			FL("cdf_mem_malloc(length=%d) failed"), frame_len);
+			FL("qdf_mem_malloc(length=%d) failed"), frame_len);
 		return;
 	}
 	/* In scan state, store scan result. */
@@ -422,7 +422,7 @@
 		status = QDF_STATUS_E_INVAL;
 	}
 last:
-	cdf_mem_free(bssdescr);
+	qdf_mem_free(bssdescr);
 	return;
 }
 
diff --git a/core/mac/src/pe/lim/lim_security_utils.c b/core/mac/src/pe/lim/lim_security_utils.c
index 1da7814..2283bf7 100644
--- a/core/mac/src/pe/lim/lim_security_utils.c
+++ b/core/mac/src/pe/lim/lim_security_utils.c
@@ -238,7 +238,7 @@
 	struct tLimPreAuthNode *pTempNode = pMac->lim.pLimPreAuthList;
 
 	while (pTempNode != NULL) {
-		if (cdf_mem_compare((uint8_t *) macAddr,
+		if (!qdf_mem_cmp((uint8_t *) macAddr,
 				    (uint8_t *) &pTempNode->peerMacAddr,
 				    sizeof(tSirMacAddr)))
 			break;
@@ -388,7 +388,7 @@
 	if (pTempNode == NULL)
 		return;
 
-	if (cdf_mem_compare((uint8_t *) macAddr,
+	if (!qdf_mem_cmp((uint8_t *) macAddr,
 			    (uint8_t *) &pTempNode->peerMacAddr,
 			    sizeof(tSirMacAddr))) {
 		/* First node to be deleted */
@@ -414,7 +414,7 @@
 	pTempNode = pTempNode->next;
 
 	while (pTempNode != NULL) {
-		if (cdf_mem_compare((uint8_t *) macAddr,
+		if (!qdf_mem_cmp((uint8_t *) macAddr,
 				    (uint8_t *) &pTempNode->peerMacAddr,
 				    sizeof(tSirMacAddr))) {
 			/* Found node to be deleted */
@@ -481,7 +481,7 @@
 			      resultCode, protStatusCode);
 #endif
 
-	cdf_mem_copy((uint8_t *) &mlmAuthCnf.peerMacAddr,
+	qdf_mem_copy((uint8_t *) &mlmAuthCnf.peerMacAddr,
 		     (uint8_t *) &pMac->lim.gpLimMlmAuthReq->peerMacAddr,
 		     sizeof(tSirMacAddr));
 	mlmAuthCnf.authType = pMac->lim.gpLimMlmAuthReq->authType;
@@ -493,7 +493,7 @@
 
 	/* / Free up buffer allocated */
 	/* / for pMac->lim.gLimMlmAuthReq */
-	cdf_mem_free(pMac->lim.gpLimMlmAuthReq);
+	qdf_mem_free(pMac->lim.gpLimMlmAuthReq);
 	pMac->lim.gpLimMlmAuthReq = NULL;
 
 	sessionEntry->limMlmState = sessionEntry->limPrevMlmState;
@@ -548,12 +548,12 @@
 	keyLength += 3;
 
 	/* Bytes 3-7 of seed is key */
-	cdf_mem_copy((uint8_t *) &seed[3], pKey, keyLength - 3);
+	qdf_mem_copy((uint8_t *) &seed[3], pKey, keyLength - 3);
 
 	/* Compute CRC-32 and place them in last 4 bytes of plain text */
 	lim_compute_crc32(icv, pPlainText, sizeof(tSirMacAuthFrameBody));
 
-	cdf_mem_copy(pPlainText + sizeof(tSirMacAuthFrameBody),
+	qdf_mem_copy(pPlainText + sizeof(tSirMacAuthFrameBody),
 		     icv, SIR_MAC_WEP_ICV_LENGTH);
 
 	/* Run RC4 on plain text with the seed */
@@ -732,10 +732,10 @@
 	keyLength += 3;
 
 	/* Bytes 0-2 of seed is received IV */
-	cdf_mem_copy((uint8_t *) seed, pEncrBody, SIR_MAC_WEP_IV_LENGTH - 1);
+	qdf_mem_copy((uint8_t *) seed, pEncrBody, SIR_MAC_WEP_IV_LENGTH - 1);
 
 	/* Bytes 3-7 of seed is key */
-	cdf_mem_copy((uint8_t *) &seed[3], pKey, keyLength - 3);
+	qdf_mem_copy((uint8_t *) &seed[3], pKey, keyLength - 3);
 
 	/* Run RC4 on encrypted text with the seed */
 	lim_rc4(pPlainBody,
@@ -778,7 +778,7 @@
 			 &pMlmSetKeysReq->peer_macaddr);
 
 	/* Free up buffer allocated for mlmSetKeysReq */
-	cdf_mem_free(pMlmSetKeysReq);
+	qdf_mem_free(pMlmSetKeysReq);
 	pMac->lim.gpLimMlmSetKeysReq = NULL;
 
 	lim_post_sme_message(pMac,
@@ -827,7 +827,7 @@
 	}
 	/* Package WMA_SET_BSSKEY_REQ message parameters */
 
-	pSetBssKeyParams = cdf_mem_malloc(sizeof(tSetBssKeyParams));
+	pSetBssKeyParams = qdf_mem_malloc(sizeof(tSetBssKeyParams));
 	if (NULL == pSetBssKeyParams) {
 		lim_log(pMac, LOGE,
 			FL("Unable to allocate memory during SET_BSSKEY"));
@@ -836,7 +836,7 @@
 		mlmSetKeysCnf.resultCode = eSIR_SME_RESOURCES_UNAVAILABLE;
 		goto end;
 	} else
-		cdf_mem_set((void *)pSetBssKeyParams,
+		qdf_mem_set((void *)pSetBssKeyParams,
 			    sizeof(tSetBssKeyParams), 0);
 
 	/* Update the WMA_SET_BSSKEY_REQ parameters */
@@ -861,14 +861,14 @@
 		/* IF the key id is non-zero and encryption type is WEP, Send all the 4
 		 * keys to HAL with filling the key at right index in pSetBssKeyParams->key. */
 		pSetBssKeyParams->numKeys = SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS;
-		cdf_mem_copy((uint8_t *) &pSetBssKeyParams->
+		qdf_mem_copy((uint8_t *) &pSetBssKeyParams->
 			     key[pMlmSetKeysReq->key[0].keyId],
 			     (uint8_t *) &pMlmSetKeysReq->key[0],
 			     sizeof(pMlmSetKeysReq->key[0]));
 
 	} else {
 		pSetBssKeyParams->numKeys = pMlmSetKeysReq->numKeys;
-		cdf_mem_copy((uint8_t *) &pSetBssKeyParams->key,
+		qdf_mem_copy((uint8_t *) &pSetBssKeyParams->key,
 			     (uint8_t *) &pMlmSetKeysReq->key,
 			     sizeof(tSirKeys) * pMlmSetKeysReq->numKeys);
 	}
@@ -931,13 +931,13 @@
 	uint32_t val = 0;
 
 	/* Package WMA_SET_STAKEY_REQ message parameters */
-	pSetStaKeyParams = cdf_mem_malloc(sizeof(tSetStaKeyParams));
+	pSetStaKeyParams = qdf_mem_malloc(sizeof(tSetStaKeyParams));
 	if (NULL == pSetStaKeyParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during SET_BSSKEY"));
 		return;
 	} else
-		cdf_mem_set((void *)pSetStaKeyParams, sizeof(tSetStaKeyParams),
+		qdf_mem_set((void *)pSetStaKeyParams, sizeof(tSetStaKeyParams),
 			    0);
 
 	/* Update the WMA_SET_STAKEY_REQ parameters */
@@ -1002,7 +1002,7 @@
 			uint32_t i;
 
 			for (i = 0; i < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS; i++) {
-				cdf_mem_copy((uint8_t *) &pSetStaKeyParams->
+				qdf_mem_copy((uint8_t *) &pSetStaKeyParams->
 					     key[i],
 					     (uint8_t *) &pMlmSetKeysReq->
 					     key[i], sizeof(tSirKeys));
@@ -1018,7 +1018,7 @@
 			/*This case the keys are coming from upper layer so need to fill the
 			 * key at the default wep key index and send to the HAL */
 			if (defWEPIdx < SIR_MAC_MAX_NUM_OF_DEFAULT_KEYS) {
-				cdf_mem_copy((uint8_t *) &pSetStaKeyParams->
+				qdf_mem_copy((uint8_t *) &pSetStaKeyParams->
 					     key[defWEPIdx],
 					     (uint8_t *) &pMlmSetKeysReq->
 					     key[0],
@@ -1028,7 +1028,7 @@
 			} else {
 				lim_log(pMac, LOGE, FL("Wrong Key Index %d"),
 					defWEPIdx);
-				cdf_mem_free(pSetStaKeyParams);
+				qdf_mem_free(pSetStaKeyParams);
 				return;
 			}
 		}
@@ -1039,7 +1039,7 @@
 	case eSIR_ED_WPI:
 #endif
 		{
-			cdf_mem_copy((uint8_t *) &pSetStaKeyParams->key,
+			qdf_mem_copy((uint8_t *) &pSetStaKeyParams->key,
 				     (uint8_t *) &pMlmSetKeysReq->key[0],
 				     sizeof(tSirKeys));
 		}
diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c
index bc12d9a..5222050 100644
--- a/core/mac/src/pe/lim/lim_send_management_frames.c
+++ b/core/mac/src/pe/lim/lim_send_management_frames.c
@@ -163,14 +163,14 @@
 	mac_hdr->fc.subType = sub_type;
 
 	/* Prepare Address 1 */
-	cdf_mem_copy((uint8_t *) mac_hdr->da,
+	qdf_mem_copy((uint8_t *) mac_hdr->da,
 		     (uint8_t *) peer_addr, sizeof(tSirMacAddr));
 
 	/* Prepare Address 2 */
 	sir_copy_mac_addr(mac_hdr->sa, self_mac_addr);
 
 	/* Prepare Address 3 */
-	cdf_mem_copy((uint8_t *) mac_hdr->bssId,
+	qdf_mem_copy((uint8_t *) mac_hdr->bssId,
 		     (uint8_t *) peer_addr, sizeof(tSirMacAddr));
 
 	/* Prepare sequence number */
@@ -255,7 +255,7 @@
 	/* The scheme here is to fill out a 'tDot11fProbeRequest' structure */
 	/* and then hand it off to 'dot11f_pack_probe_request' (for */
 	/* serialization).  We start by zero-initializing the structure: */
-	cdf_mem_set((uint8_t *) &pr, sizeof(pr), 0);
+	qdf_mem_set((uint8_t *) &pr, sizeof(pr), 0);
 
 	/* & delegating to assorted helpers: */
 	populate_dot11f_ssid(mac_ctx, ssid, &pr.SSID);
@@ -380,7 +380,7 @@
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 	/* Paranoia: */
-	cdf_mem_set(frame, bytes, 0);
+	qdf_mem_set(frame, bytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
@@ -400,7 +400,7 @@
 	}
 	/* Append any AddIE if present. */
 	if (addn_ielen) {
-		cdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
+		qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
 			     additional_ie, addn_ielen);
 		payload += addn_ielen;
 	}
@@ -456,7 +456,7 @@
 			return eSIR_FAILURE;
 		}
 
-		tempbuf = cdf_mem_malloc(left);
+		tempbuf = qdf_mem_malloc(left);
 		if (NULL == tempbuf) {
 			PELOGE(lim_log(pMac, LOGE,
 				       FL
@@ -474,23 +474,23 @@
 					FL
 						("****Invalid IEs eid = %d elem_len=%d left=%d*****"),
 					elem_id, elem_len, left);
-				cdf_mem_free(tempbuf);
+				qdf_mem_free(tempbuf);
 				return eSIR_FAILURE;
 			}
 			if (!((SIR_MAC_EID_VENDOR == elem_id) &&
 			      (memcmp
 				       (&ptr[2], SIR_MAC_P2P_OUI,
 				       SIR_MAC_P2P_OUI_SIZE) == 0))) {
-				cdf_mem_copy(tempbuf + tempLen, &ptr[0],
+				qdf_mem_copy(tempbuf + tempLen, &ptr[0],
 					     elem_len + 2);
 				tempLen += (elem_len + 2);
 			}
 			left -= elem_len;
 			ptr += (elem_len + 2);
 		}
-		cdf_mem_copy(addIE, tempbuf, tempLen);
+		qdf_mem_copy(addIE, tempbuf, tempLen);
 		*addnIELen = tempLen;
-		cdf_mem_free(tempbuf);
+		qdf_mem_free(tempbuf);
 	}
 	return eSIR_SUCCESS;
 }
@@ -561,20 +561,20 @@
 		return;
 	}
 	sme_sessionid = pe_session->smeSessionId;
-	frm = cdf_mem_malloc(sizeof(tDot11fProbeResponse));
+	frm = qdf_mem_malloc(sizeof(tDot11fProbeResponse));
 	if (NULL == frm) {
 		lim_log(mac_ctx, LOGE,
 			FL("Unable to allocate memory"));
 		return;
 	}
 
-	cdf_mem_zero(&extracted_ext_cap, sizeof(extracted_ext_cap));
+	qdf_mem_zero(&extracted_ext_cap, sizeof(extracted_ext_cap));
 
 	/*
 	 * Fill out 'frm', after which we'll just hand the struct off to
 	 * 'dot11f_pack_probe_response'.
 	 */
-	cdf_mem_set((uint8_t *) frm, sizeof(tDot11fProbeResponse), 0);
+	qdf_mem_set((uint8_t *) frm, sizeof(tDot11fProbeResponse), 0);
 
 	/*
 	 * Timestamp to be updated by TFP, below.
@@ -720,7 +720,7 @@
 
 	if (addn_ie_present) {
 
-		add_ie = cdf_mem_malloc(
+		add_ie = qdf_mem_malloc(
 				pe_session->addIeParams.probeRespDataLen);
 		if (NULL == add_ie) {
 			lim_log(mac_ctx, LOGE,
@@ -728,7 +728,7 @@
 			goto err_ret;
 		}
 
-		cdf_mem_copy(add_ie,
+		qdf_mem_copy(add_ie,
 			     pe_session->addIeParams.probeRespData_buff,
 			     pe_session->addIeParams.probeRespDataLen);
 		addn_ie_len = pe_session->addIeParams.probeRespDataLen;
@@ -775,7 +775,7 @@
 		goto err_ret;
 	}
 	/* Paranoia: */
-	cdf_mem_set(frame, bytes, 0);
+	qdf_mem_set(frame, bytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
@@ -812,13 +812,13 @@
 	mac_ctx->sys.probeRespond++;
 
 	if (mac_ctx->lim.gpLimRemainOnChanReq)
-		cdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
+		qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
 			     mac_ctx->lim.gpLimRemainOnChanReq->probeRspIe,
 			     (mac_ctx->lim.gpLimRemainOnChanReq->length -
 			      sizeof(tSirRemainOnChnReq)));
 
 	if (addn_ie_present)
-		cdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
+		qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
 			     &add_ie[0], addn_ie_len);
 
 	if (noalen != 0) {
@@ -829,7 +829,7 @@
 				total_noalen);
 			goto err_ret;
 		} else {
-			cdf_mem_copy(&frame[bytes - (total_noalen)],
+			qdf_mem_copy(&frame[bytes - (total_noalen)],
 				     &noa_ie[0], total_noalen);
 		}
 	}
@@ -853,16 +853,16 @@
 		lim_log(mac_ctx, LOGE, FL("Could not send Probe Response."));
 
 	if (add_ie != NULL)
-		cdf_mem_free(add_ie);
+		qdf_mem_free(add_ie);
 
-	cdf_mem_free(frm);
+	qdf_mem_free(frm);
 	return;
 
 err_ret:
 	if (add_ie != NULL)
-		cdf_mem_free(add_ie);
+		qdf_mem_free(add_ie);
 	if (frm != NULL)
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 	if (packet != NULL)
 		cds_packet_free((void *)packet);
 	return;
@@ -895,7 +895,7 @@
 	smeSessionId = psessionEntry->smeSessionId;
 
 	if (!pAddTS->wmeTspecPresent) {
-		cdf_mem_set((uint8_t *) &AddTSReq, sizeof(AddTSReq), 0);
+		qdf_mem_set((uint8_t *) &AddTSReq, sizeof(AddTSReq), 0);
 
 		AddTSReq.Action.action = SIR_MAC_QOS_ADD_TS_REQ;
 		AddTSReq.DialogToken.token = pAddTS->dialogToken;
@@ -952,7 +952,7 @@
 				   " (0x%08x)."), nStatus);
 		}
 	} else {
-		cdf_mem_set((uint8_t *) &WMMAddTSReq, sizeof(WMMAddTSReq), 0);
+		qdf_mem_set((uint8_t *) &WMMAddTSReq, sizeof(WMMAddTSReq), 0);
 
 		WMMAddTSReq.Action.action = SIR_MAC_QOS_ADD_TS_REQ;
 		WMMAddTSReq.DialogToken.token = pAddTS->dialogToken;
@@ -1005,7 +1005,7 @@
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -1136,7 +1136,7 @@
 
 	sme_session = pe_session->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	limGetQosMode(pe_session, &qos_mode);
 	limGetWmeMode(pe_session, &wme_mode);
@@ -1257,7 +1257,7 @@
 #endif
 	}
 
-	cdf_mem_set((uint8_t *) &beacon_params, sizeof(beacon_params), 0);
+	qdf_mem_set((uint8_t *) &beacon_params, sizeof(beacon_params), 0);
 
 	if (LIM_IS_AP_ROLE(pe_session) &&
 		(pe_session->gLimProtectionControl !=
@@ -1305,11 +1305,11 @@
 		/* Nonzero length indicates Assoc rsp IE available */
 		if (addn_ie_len <= WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN
 		    && (bytes + addn_ie_len) <= SIR_MAX_PACKET_SIZE) {
-			cdf_mem_copy(add_ie,
+			qdf_mem_copy(add_ie,
 				pe_session->addIeParams.assocRespData_buff,
 				pe_session->addIeParams.assocRespDataLen);
 
-			cdf_mem_set((uint8_t *) &extracted_ext_cap,
+			qdf_mem_set((uint8_t *) &extracted_ext_cap,
 				    sizeof(extracted_ext_cap), 0);
 
 			stripoff_len = addn_ie_len;
@@ -1337,7 +1337,7 @@
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(frame, bytes, 0);
+	qdf_mem_set(frame, bytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
@@ -1379,7 +1379,7 @@
 	lim_print_mac_addr(mac_ctx, mac_hdr->da, LOG1);
 
 	if (addn_ie_len && addn_ie_len <= WNI_CFG_ASSOC_RSP_ADDNIE_DATA_LEN)
-		cdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
+		qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
 			     &add_ie[0], addn_ie_len);
 
 	if ((SIR_BAND_5_GHZ ==
@@ -1438,7 +1438,7 @@
 	smeSessionId = psessionEntry->smeSessionId;
 
 	if (!wmmTspecPresent) {
-		cdf_mem_set((uint8_t *) &DelTS, sizeof(DelTS), 0);
+		qdf_mem_set((uint8_t *) &DelTS, sizeof(DelTS), 0);
 
 		DelTS.Category.category = SIR_MAC_ACTION_QOS_MGMT;
 		DelTS.Action.action = SIR_MAC_QOS_DEL_TS_REQ;
@@ -1458,7 +1458,7 @@
 				   " (0x%08x)."), nStatus);
 		}
 	} else {
-		cdf_mem_set((uint8_t *) &WMMDelTS, sizeof(WMMDelTS), 0);
+		qdf_mem_set((uint8_t *) &WMMDelTS, sizeof(WMMDelTS), 0);
 
 		WMMDelTS.Category.category = SIR_MAC_ACTION_WME;
 		WMMDelTS.Action.action = SIR_MAC_QOS_DEL_TS_REQ;
@@ -1492,7 +1492,7 @@
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -1621,16 +1621,16 @@
 	add_ie_len = pe_session->pLimJoinReq->addIEAssoc.length;
 	add_ie = pe_session->pLimJoinReq->addIEAssoc.addIEdata;
 
-	frm = cdf_mem_malloc(sizeof(tDot11fAssocRequest));
+	frm = qdf_mem_malloc(sizeof(tDot11fAssocRequest));
 	if (NULL == frm) {
 		lim_log(mac_ctx, LOGE, FL("Unable to allocate memory"));
 		return;
 	}
 
-	cdf_mem_set((uint8_t *) frm, sizeof(tDot11fAssocRequest), 0);
+	qdf_mem_set((uint8_t *) frm, sizeof(tDot11fAssocRequest), 0);
 
 	if (add_ie_len) {
-		cdf_mem_set((uint8_t *) &extr_ext_cap, sizeof(tDot11fIEExtCap),
+		qdf_mem_set((uint8_t *) &extr_ext_cap, sizeof(tDot11fIEExtCap),
 			    0);
 		sir_status = lim_strip_extcap_update_struct(mac_ctx,
 					add_ie, &add_ie_len, &extr_ext_cap);
@@ -1881,11 +1881,11 @@
 		lim_post_sme_message(mac_ctx, LIM_MLM_ASSOC_CNF,
 			(uint32_t *) &assoc_cnf);
 
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(frame, bytes, 0);
+	qdf_mem_set(frame, bytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
@@ -1901,7 +1901,7 @@
 		lim_log(mac_ctx, LOGE,
 			FL("Assoc request pack failure (0x%08x)"), status);
 		cds_packet_free((void *)packet);
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(mac_ctx, LOGW,
@@ -1911,18 +1911,18 @@
 	lim_log(mac_ctx, LOG1,
 		FL("*** Sending Association Request length %d to "), bytes);
 	if (pe_session->assocReq != NULL) {
-		cdf_mem_free(pe_session->assocReq);
+		qdf_mem_free(pe_session->assocReq);
 		pe_session->assocReq = NULL;
 		pe_session->assocReqLen = 0;
 	}
 
 	if (add_ie_len) {
-		cdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
+		qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
 			     add_ie, add_ie_len);
 		payload += add_ie_len;
 	}
 
-	pe_session->assocReq = cdf_mem_malloc(payload);
+	pe_session->assocReq = qdf_mem_malloc(payload);
 	if (NULL == pe_session->assocReq) {
 		lim_log(mac_ctx, LOGE, FL("Unable to allocate memory"));
 	} else {
@@ -1930,7 +1930,7 @@
 		 * Store the Assoc request. This is sent to csr/hdd in
 		 * join cnf response.
 		 */
-		cdf_mem_copy(pe_session->assocReq,
+		qdf_mem_copy(pe_session->assocReq,
 			     frame + sizeof(tSirMacMgmtHdr), payload);
 		pe_session->assocReqLen = payload;
 	}
@@ -1965,13 +1965,13 @@
 			FL("Failed to send Association Request (%X)!"),
 			qdf_status);
 		/* Pkt will be freed up by the callback */
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return;
 	}
 	/* Free up buffer allocated for mlm_assoc_req */
-	cdf_mem_free(mlm_assoc_req);
+	qdf_mem_free(mlm_assoc_req);
 	mlm_assoc_req = NULL;
-	cdf_mem_free(frm);
+	qdf_mem_free(frm);
 	return;
 }
 
@@ -2029,7 +2029,7 @@
 	lim_log(mac_ctx, LOG1,
 		FL("called in state (%d)."), pe_session->limMlmState);
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	caps = mlm_reassoc_req->capabilityInfo;
 #if defined(FEATURE_WLAN_WAPI)
@@ -2053,7 +2053,7 @@
 	 * The previous ap bssid is stored in the FT Session
 	 * while creating the PE FT Session for reassociation.
 	 */
-	cdf_mem_copy((uint8_t *)frm.CurrentAPAddress.mac,
+	qdf_mem_copy((uint8_t *)frm.CurrentAPAddress.mac,
 			pe_session->prev_ap_bssid, sizeof(tSirMacAddr));
 
 	populate_dot11f_ssid2(mac_ctx, &frm.SSID);
@@ -2286,7 +2286,7 @@
 		goto end;
 	}
 	/* Paranoia: */
-	cdf_mem_set(frame, bytes + ft_ies_length, 0);
+	qdf_mem_set(frame, bytes + ft_ies_length, 0);
 
 	lim_print_mac_addr(mac_ctx, pe_session->limReAssocbssId, LOG1);
 	/* Next, we fill out the buffer descriptor: */
@@ -2312,18 +2312,18 @@
 		       bytes, payload);
 
 	if (pe_session->assocReq != NULL) {
-		cdf_mem_free(pe_session->assocReq);
+		qdf_mem_free(pe_session->assocReq);
 		pe_session->assocReq = NULL;
 		pe_session->assocReqLen = 0;
 	}
 
 	if (add_ie_len) {
-		cdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
+		qdf_mem_copy(frame + sizeof(tSirMacMgmtHdr) + payload,
 			     add_ie, add_ie_len);
 		payload += add_ie_len;
 	}
 
-	pe_session->assocReq = cdf_mem_malloc(payload);
+	pe_session->assocReq = qdf_mem_malloc(payload);
 	if (NULL == pe_session->assocReq) {
 		lim_log(mac_ctx, LOGE, FL("Failed to alloc memory"));
 	} else {
@@ -2331,7 +2331,7 @@
 		 * Store the Assoc request. This is sent to csr/hdd in
 		 * join cnf response.
 		 */
-		cdf_mem_copy(pe_session->assocReq,
+		qdf_mem_copy(pe_session->assocReq,
 			     frame + sizeof(tSirMacMgmtHdr), payload);
 		pe_session->assocReqLen = payload;
 	}
@@ -2356,12 +2356,12 @@
 	}
 
 	if (NULL != pe_session->assocReq) {
-		cdf_mem_free(pe_session->assocReq);
+		qdf_mem_free(pe_session->assocReq);
 		pe_session->assocReq = NULL;
 		pe_session->assocReqLen = 0;
 	}
 	if (ft_ies_length) {
-		pe_session->assocReq = cdf_mem_malloc(ft_ies_length);
+		pe_session->assocReq = qdf_mem_malloc(ft_ies_length);
 		if (NULL == pe_session->assocReq) {
 			lim_log(mac_ctx,
 				LOGE, FL("Failed to alloc memory for FT IEs"));
@@ -2371,7 +2371,7 @@
 			 * Store the FT IEs. This is sent to csr/hdd in
 			 * join cnf response.
 			 */
-			cdf_mem_copy(pe_session->assocReq,
+			qdf_mem_copy(pe_session->assocReq,
 				ft_sme_context->reassoc_ft_ies, ft_ies_length);
 			pe_session->assocReqLen = ft_ies_length;
 		}
@@ -2401,7 +2401,7 @@
 
 end:
 	/* Free up buffer allocated for mlmAssocReq */
-	cdf_mem_free(mlm_reassoc_req);
+	qdf_mem_free(mlm_reassoc_req);
 	pe_session->pLimMlmReassocReq = NULL;
 
 }
@@ -2413,11 +2413,11 @@
 	tLimMlmReassocCnf mlmReassocCnf;        /* keep sme */
 	tLimMlmReassocReq *pTmpMlmReassocReq = NULL;
 	if (NULL == pTmpMlmReassocReq) {
-		pTmpMlmReassocReq = cdf_mem_malloc(sizeof(tLimMlmReassocReq));
+		pTmpMlmReassocReq = qdf_mem_malloc(sizeof(tLimMlmReassocReq));
 		if (NULL == pTmpMlmReassocReq)
 			goto end;
-		cdf_mem_set(pTmpMlmReassocReq, sizeof(tLimMlmReassocReq), 0);
-		cdf_mem_copy(pTmpMlmReassocReq, pMlmReassocReq,
+		qdf_mem_set(pTmpMlmReassocReq, sizeof(tLimMlmReassocReq), 0);
+		qdf_mem_copy(pTmpMlmReassocReq, pMlmReassocReq,
 			     sizeof(tLimMlmReassocReq));
 	}
 	/* Prepare and send Reassociation request frame */
@@ -2447,11 +2447,11 @@
 end:
 	/* Free up buffer allocated for reassocReq */
 	if (pMlmReassocReq != NULL) {
-		cdf_mem_free(pMlmReassocReq);
+		qdf_mem_free(pMlmReassocReq);
 		pMlmReassocReq = NULL;
 	}
 	if (pTmpMlmReassocReq != NULL) {
-		cdf_mem_free(pTmpMlmReassocReq);
+		qdf_mem_free(pTmpMlmReassocReq);
 		pTmpMlmReassocReq = NULL;
 	}
 	mlmReassocCnf.resultCode = eSIR_SME_FT_REASSOC_FAILURE;
@@ -2500,7 +2500,7 @@
 	nAddIELen = psessionEntry->pLimReAssocReq->addIEAssoc.length;
 	pAddIE = psessionEntry->pLimReAssocReq->addIEAssoc.addIEdata;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	caps = pMlmReassocReq->capabilityInfo;
 #if defined(FEATURE_WLAN_WAPI)
@@ -2517,7 +2517,7 @@
 
 	frm.ListenInterval.interval = pMlmReassocReq->listenInterval;
 
-	cdf_mem_copy((uint8_t *) frm.CurrentAPAddress.mac,
+	qdf_mem_copy((uint8_t *) frm.CurrentAPAddress.mac,
 		     (uint8_t *) psessionEntry->bssId, 6);
 
 	populate_dot11f_ssid2(pMac, &frm.SSID);
@@ -2654,7 +2654,7 @@
 		goto end;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -2684,23 +2684,23 @@
 	       )
 
 	if (psessionEntry->assocReq != NULL) {
-		cdf_mem_free(psessionEntry->assocReq);
+		qdf_mem_free(psessionEntry->assocReq);
 		psessionEntry->assocReq = NULL;
 		psessionEntry->assocReqLen = 0;
 	}
 
 	if (nAddIELen) {
-		cdf_mem_copy(pFrame + sizeof(tSirMacMgmtHdr) + nPayload,
+		qdf_mem_copy(pFrame + sizeof(tSirMacMgmtHdr) + nPayload,
 			     pAddIE, nAddIELen);
 		nPayload += nAddIELen;
 	}
 
-	psessionEntry->assocReq = cdf_mem_malloc(nPayload);
+	psessionEntry->assocReq = qdf_mem_malloc(nPayload);
 	if (NULL == psessionEntry->assocReq) {
 		lim_log(pMac, LOGE, FL("Unable to allocate mem for assoc req"));
 	} else {
 		/* Store the Assoc request. This is sent to csr/hdd in join cnf response. */
-		cdf_mem_copy(psessionEntry->assocReq,
+		qdf_mem_copy(psessionEntry->assocReq,
 			     pFrame + sizeof(tSirMacMgmtHdr), nPayload);
 		psessionEntry->assocReqLen = nPayload;
 	}
@@ -2739,7 +2739,7 @@
 
 end:
 	/* Free up buffer allocated for mlmAssocReq */
-	cdf_mem_free(pMlmReassocReq);
+	qdf_mem_free(pMlmReassocReq);
 	psessionEntry->pLimMlmReassocReq = NULL;
 
 } /* lim_send_reassoc_req_mgmt_frame */
@@ -2910,7 +2910,7 @@
 		return;
 	}
 
-	cdf_mem_zero(frame, frame_len);
+	qdf_mem_zero(frame, frame_len);
 
 	/* Prepare BD */
 	lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
@@ -2921,7 +2921,7 @@
 	/* Prepare BSSId */
 	if (LIM_IS_AP_ROLE(session) ||
 	    LIM_IS_BT_AMP_AP_ROLE(session))
-		cdf_mem_copy((uint8_t *) mac_hdr->bssId,
+		qdf_mem_copy((uint8_t *) mac_hdr->bssId,
 			     (uint8_t *) session->bssId,
 			     sizeof(tSirMacAddr));
 
@@ -2929,7 +2929,7 @@
 	body = frame + sizeof(tSirMacMgmtHdr);
 
 	if (wep_bit == LIM_WEP_IN_FC) {
-		cdf_mem_copy(body, (uint8_t *) auth_frame, body_len);
+		qdf_mem_copy(body, (uint8_t *) auth_frame, body_len);
 
 		lim_log(mac_ctx, LOG1,
 			FL("*** Sending Auth seq# 3 status %d (%d) to"
@@ -2957,7 +2957,7 @@
 		if (body_len <= (sizeof(auth_frame->type) +
 				sizeof(auth_frame->length) +
 				sizeof(auth_frame->challengeText)))
-			cdf_mem_copy(body, (uint8_t *) &auth_frame->type,
+			qdf_mem_copy(body, (uint8_t *) &auth_frame->type,
 				     body_len);
 
 #if defined WLAN_FEATURE_VOWIFI_11R
@@ -2967,7 +2967,7 @@
 		     (session->ftPEContext.pFTPreAuthReq != NULL)) {
 
 			if (ft_ies_length > 0) {
-				cdf_mem_copy(body,
+				qdf_mem_copy(body,
 					session->ftPEContext.
 						pFTPreAuthReq->ft_ies,
 					ft_ies_length);
@@ -2983,7 +2983,7 @@
 				body++;
 				*body = SIR_MDIE_SIZE;
 				body++;
-				cdf_mem_copy(body,
+				qdf_mem_copy(body,
 					&session->ftPEContext.pFTPreAuthReq->
 						pbssDescription->mdie[0],
 					SIR_MDIE_SIZE);
@@ -3106,7 +3106,7 @@
 	}
 #endif
 		/* / Free up buffer allocated for mlmDeauthReq */
-		cdf_mem_free(pMlmDeauthReq);
+		qdf_mem_free(pMlmDeauthReq);
 		pMac->lim.limDisassocDeauthCnfReq.pMlmDeauthReq = NULL;
 	}
 	return QDF_STATUS_SUCCESS;
@@ -3119,7 +3119,7 @@
 
 	/* Free up buffer allocated */
 	/* for mlmDeauthReq */
-	cdf_mem_free(pMlmDeauthReq);
+	qdf_mem_free(pMlmDeauthReq);
 
 	lim_post_sme_message(pMac,
 			     LIM_MLM_DEAUTH_CNF, (uint32_t *) &mlmDeauthCnf);
@@ -3213,14 +3213,14 @@
 		}
 #endif
 		/* Free up buffer allocated for mlmDisassocReq */
-		cdf_mem_free(disassoc_req);
+		qdf_mem_free(disassoc_req);
 		mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL;
 		return QDF_STATUS_SUCCESS;
 	} else {
 		return QDF_STATUS_SUCCESS;
 	}
 end:
-	cdf_mem_copy((uint8_t *) &disassoc_cnf.peerMacAddr,
+	qdf_mem_copy((uint8_t *) &disassoc_cnf.peerMacAddr,
 		     (uint8_t *) disassoc_req->peer_macaddr.bytes,
 		     QDF_MAC_ADDR_SIZE);
 	disassoc_cnf.aid = disassoc_req->aid;
@@ -3231,7 +3231,7 @@
 
 	if (disassoc_req != NULL) {
 		/* / Free up buffer allocated for mlmDisassocReq */
-		cdf_mem_free(disassoc_req);
+		qdf_mem_free(disassoc_req);
 		mac_ctx->lim.limDisassocDeauthCnfReq.pMlmDisassocReq = NULL;
 	}
 
@@ -3300,7 +3300,7 @@
 	}
 	smeSessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Reason.code = nReason;
 
@@ -3327,7 +3327,7 @@
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -3479,7 +3479,7 @@
 	}
 	smeSessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Reason.code = nReason;
 
@@ -3506,7 +3506,7 @@
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -3660,7 +3660,7 @@
 	void *pPacket;
 	QDF_STATUS qdf_status;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT;
 	frm.Action.action = SIR_MAC_ACTION_MEASURE_REPORT_ID;
@@ -3717,14 +3717,14 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
 		SIR_MAC_MGMT_ACTION, peer);
 	pMacHdr = (tpSirMacMgmtHdr) pFrame;
 
-	cdf_mem_copy(pMacHdr->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
+	qdf_mem_copy(pMacHdr->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
 
 #ifdef WLAN_FEATURE_11W
 	lim_set_protected_bit(pMac, psessionEntry, peer, pMacHdr);
@@ -3790,7 +3790,7 @@
 	void *pPacket;
 	QDF_STATUS qdf_status;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT;
 	frm.Action.action = SIR_MAC_ACTION_TPC_REQUEST_ID;
@@ -3821,14 +3821,14 @@
 		return;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
 		SIR_MAC_MGMT_ACTION, peer);
 	pMacHdr = (tpSirMacMgmtHdr) pFrame;
 
-	cdf_mem_copy(pMacHdr->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
+	qdf_mem_copy(pMacHdr->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
 
 #ifdef WLAN_FEATURE_11W
 	lim_set_protected_bit(pMac, psessionEntry, peer, pMacHdr);
@@ -3893,7 +3893,7 @@
 	void *pPacket;
 	QDF_STATUS qdf_status;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT;
 	frm.Action.action = SIR_MAC_ACTION_TPC_REPORT_ID;
@@ -3927,7 +3927,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -3935,7 +3935,7 @@
 
 	pMacHdr = (tpSirMacMgmtHdr) pFrame;
 
-	cdf_mem_copy(pMacHdr->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
+	qdf_mem_copy(pMacHdr->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
 
 #ifdef WLAN_FEATURE_11W
 	lim_set_protected_bit(pMac, psessionEntry, peer, pMacHdr);
@@ -4021,7 +4021,7 @@
 	}
 	smeSessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Category.category = SIR_MAC_ACTION_SPECTRUM_MGMT;
 	frm.Action.action = SIR_MAC_ACTION_CHANNEL_SWITCH_ID;
@@ -4054,14 +4054,14 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
 		SIR_MAC_MGMT_ACTION, peer,
 		psessionEntry->selfMacAddr);
 	pMacHdr = (tpSirMacMgmtHdr) pFrame;
-	cdf_mem_copy((uint8_t *) pMacHdr->bssId,
+	qdf_mem_copy((uint8_t *) pMacHdr->bssId,
 		     (uint8_t *) psessionEntry->bssId, sizeof(tSirMacAddr));
 
 #ifdef WLAN_FEATURE_11W
@@ -4146,7 +4146,7 @@
 
 	sme_session_id = session_entry->smeSessionId;
 
-	cdf_mem_set(&frm, sizeof(frm), 0);
+	qdf_mem_set(&frm, sizeof(frm), 0);
 
 	frm.Category.category     = SIR_MAC_ACTION_PUBLIC_USAGE;
 	frm.Action.action         = SIR_MAC_ACTION_EXT_CHANNEL_SWITCH_ID;
@@ -4184,13 +4184,13 @@
 	}
 
 	/* Paranoia*/
-	cdf_mem_set(frame, num_bytes, 0);
+	qdf_mem_set(frame, num_bytes, 0);
 
 	/* Next, we fill out the buffer descriptor */
 	lim_populate_mac_header(mac_ctx, frame, SIR_MAC_MGMT_FRAME,
 		SIR_MAC_MGMT_ACTION, peer, session_entry->selfMacAddr);
 	mac_hdr = (tpSirMacMgmtHdr) frame;
-	cdf_mem_copy((uint8_t *) mac_hdr->bssId,
+	qdf_mem_copy((uint8_t *) mac_hdr->bssId,
 				   (uint8_t *) session_entry->bssId,
 				   sizeof(tSirMacAddr));
 
@@ -4264,7 +4264,7 @@
 	}
 	smeSessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Category.category = SIR_MAC_ACTION_VHT;
 	frm.Action.action = SIR_MAC_VHT_OPMODE_NOTIFICATION;
@@ -4297,7 +4297,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	if (psessionEntry->pePersona == QDF_SAP_MODE)
@@ -4309,7 +4309,7 @@
 			SIR_MAC_MGMT_ACTION, psessionEntry->bssId,
 			psessionEntry->selfMacAddr);
 	pMacHdr = (tpSirMacMgmtHdr) pFrame;
-	cdf_mem_copy((uint8_t *) pMacHdr->bssId,
+	qdf_mem_copy((uint8_t *) pMacHdr->bssId,
 		     (uint8_t *) psessionEntry->bssId, sizeof(tSirMacAddr));
 	nStatus = dot11f_pack_operating_mode(pMac, &frm, pFrame +
 					     sizeof(tSirMacMgmtHdr),
@@ -4393,7 +4393,7 @@
 		return eSIR_FAILURE;
 	}
 	smeSessionId = psessionEntry->smeSessionId;
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Category.category = SIR_MAC_ACTION_RRM;
 	frm.Action.action = SIR_MAC_RRM_NEIGHBOR_REQ;
@@ -4429,7 +4429,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Copy necessary info to BD */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -4543,7 +4543,7 @@
 		return eSIR_FAILURE;
 	}
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 
 	frm.Category.category = SIR_MAC_ACTION_RRM;
 	frm.Action.action = SIR_MAC_RRM_LINK_MEASUREMENT_RPT;
@@ -4588,7 +4588,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Copy necessary info to BD */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -4701,7 +4701,7 @@
 	uint8_t smeSessionId = 0;
 
 	tDot11fRadioMeasurementReport *frm =
-		cdf_mem_malloc(sizeof(tDot11fRadioMeasurementReport));
+		qdf_mem_malloc(sizeof(tDot11fRadioMeasurementReport));
 	if (!frm) {
 		lim_log(pMac, LOGE,
 			FL
@@ -4713,10 +4713,10 @@
 		lim_log(pMac, LOGE,
 			FL
 				("(psession == NULL) in Request to send Beacon Report action frame"));
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return eSIR_FAILURE;
 	}
-	cdf_mem_set((uint8_t *) frm, sizeof(*frm), 0);
+	qdf_mem_set((uint8_t *) frm, sizeof(*frm), 0);
 
 	frm->Category.category = SIR_MAC_ACTION_RRM;
 	frm->Action.action = SIR_MAC_RRM_RADIO_MEASURE_RPT;
@@ -4761,7 +4761,7 @@
 			nStatus);
 		/* We'll fall back on the worst case scenario: */
 		nPayload = sizeof(tDot11fLinkMeasurementReport);
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(nStatus)) {
 		lim_log(pMac, LOGW, FL("There were warnings while calculating "
@@ -4778,11 +4778,11 @@
 		lim_log(pMac, LOGP,
 			FL("Failed to allocate %d bytes for a Radio Measure "
 			   "Report."), nBytes);
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Copy necessary info to BD */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -4846,15 +4846,15 @@
 		       )
 		statusCode = eSIR_FAILURE;
 		/* Pkt will be freed up by the callback */
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return statusCode;
 	} else {
-		cdf_mem_free(frm);
+		qdf_mem_free(frm);
 		return eSIR_SUCCESS;
 	}
 
 returnAfterError:
-	cdf_mem_free(frm);
+	qdf_mem_free(frm);
 	cds_packet_free((void *)pPacket);
 	return statusCode;
 }
@@ -4895,14 +4895,14 @@
 	uint8_t txFlag = 0;
 	uint8_t smeSessionId = 0;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 	frm.Category.category = SIR_MAC_ACTION_SA_QUERY;
 	/* 11w action  field is :
 	   action: 0 --> SA Query Request action frame
 	   action: 1 --> SA Query Response action frame */
 	frm.Action.action = SIR_MAC_SA_QUERY_REQ;
 	/* 11w SA Query Request transId */
-	cdf_mem_copy(&frm.TransactionId.transId[0], &transId[0], 2);
+	qdf_mem_copy(&frm.TransactionId.transId[0], &transId[0], 2);
 
 	nStatus = dot11f_get_packed_sa_query_req_size(pMac, &frm, &nPayload);
 	if (DOT11F_FAILED(nStatus)) {
@@ -4927,7 +4927,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Copy necessary info to BD */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
@@ -5036,7 +5036,7 @@
 
 	smeSessionId = psessionEntry->smeSessionId;
 
-	cdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
+	qdf_mem_set((uint8_t *) &frm, sizeof(frm), 0);
 	frm.Category.category = SIR_MAC_ACTION_SA_QUERY;
 	/*11w action  field is :
 	   action: 0 --> SA query request action frame
@@ -5044,7 +5044,7 @@
 	frm.Action.action = SIR_MAC_SA_QUERY_RSP;
 	/*11w SA query response transId is same as
 	   SA query request transId */
-	cdf_mem_copy(&frm.TransactionId.transId[0], &transId[0], 2);
+	qdf_mem_copy(&frm.TransactionId.transId[0], &transId[0], 2);
 
 	nStatus = dot11f_get_packed_sa_query_rsp_size(pMac, &frm, &nPayload);
 	if (DOT11F_FAILED(nStatus)) {
@@ -5069,7 +5069,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame, nBytes, 0);
+	qdf_mem_set(pFrame, nBytes, 0);
 
 	/* Copy necessary info to BD */
 	lim_populate_mac_header(pMac, pFrame, SIR_MAC_MGMT_FRAME,
diff --git a/core/mac/src/pe/lim/lim_send_messages.c b/core/mac/src/pe/lim/lim_send_messages.c
index 05ad92f..ad53515 100644
--- a/core/mac/src/pe/lim/lim_send_messages.c
+++ b/core/mac/src/pe/lim/lim_send_messages.c
@@ -99,14 +99,14 @@
 	tSirRetStatus retCode = eSIR_SUCCESS;
 	tSirMsgQ msgQ;
 
-	pCFParams = cdf_mem_malloc(sizeof(tUpdateCFParams));
+	pCFParams = qdf_mem_malloc(sizeof(tUpdateCFParams));
 	if (NULL == pCFParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during Update CF Params"));
 		retCode = eSIR_MEM_ALLOC_FAILED;
 		goto returnFailure;
 	}
-	cdf_mem_set((uint8_t *) pCFParams, sizeof(tUpdateCFParams), 0);
+	qdf_mem_set((uint8_t *) pCFParams, sizeof(tUpdateCFParams), 0);
 	pCFParams->cfpCount = cfpCount;
 	pCFParams->cfpPeriod = cfpPeriod;
 	pCFParams->bssIdx = bssIdx;
@@ -119,7 +119,7 @@
 	MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pCFParams);
+		qdf_mem_free(pCFParams);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_UPDATE_CF_IND failed, reason=%X"),
 			retCode);
@@ -148,13 +148,13 @@
 	tSirRetStatus retCode = eSIR_SUCCESS;
 	tSirMsgQ msgQ;
 
-	pBcnParams = cdf_mem_malloc(sizeof(*pBcnParams));
+	pBcnParams = qdf_mem_malloc(sizeof(*pBcnParams));
 	if (NULL == pBcnParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during Update Beacon Params"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_copy((uint8_t *) pBcnParams, pUpdatedBcnParams,
+	qdf_mem_copy((uint8_t *) pBcnParams, pUpdatedBcnParams,
 		     sizeof(*pBcnParams));
 	msgQ.type = WMA_UPDATE_BEACON_IND;
 	msgQ.reserved = 0;
@@ -164,7 +164,7 @@
 	       FL("Sending WMA_UPDATE_BEACON_IND, paramChangeBitmap in hex = %x"),
 	       pUpdatedBcnParams->paramChangeBitmap);)
 	if (NULL == psessionEntry) {
-		cdf_mem_free(pBcnParams);
+		qdf_mem_free(pBcnParams);
 		MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msgQ.type));
 		return eSIR_FAILURE;
 	} else {
@@ -175,7 +175,7 @@
 	pBcnParams->smeSessionId = psessionEntry->smeSessionId;
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pBcnParams);
+		qdf_mem_free(pBcnParams);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_UPDATE_BEACON_IND, reason=%X"),
 			retCode);
@@ -235,25 +235,25 @@
 				peSessionId);
 		return eSIR_FAILURE;
 	}
-	pChnlParams = cdf_mem_malloc(sizeof(tSwitchChannelParams));
+	pChnlParams = qdf_mem_malloc(sizeof(tSwitchChannelParams));
 	if (NULL == pChnlParams) {
 		lim_log(pMac, LOGP, FL(
 			"Unable to allocate memory for Switch Ch Params"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_set((uint8_t *) pChnlParams, sizeof(tSwitchChannelParams), 0);
+	qdf_mem_set((uint8_t *) pChnlParams, sizeof(tSwitchChannelParams), 0);
 	pChnlParams->channelNumber = chnlNumber;
 	pChnlParams->ch_center_freq_seg0 = ch_center_freq_seg0;
 	pChnlParams->ch_center_freq_seg1 = ch_center_freq_seg1;
 	pChnlParams->ch_width = ch_width;
-	cdf_mem_copy(pChnlParams->selfStaMacAddr, pSessionEntry->selfMacAddr,
+	qdf_mem_copy(pChnlParams->selfStaMacAddr, pSessionEntry->selfMacAddr,
 		     sizeof(tSirMacAddr));
 #if defined WLAN_FEATURE_VOWIFI
 	pChnlParams->maxTxPower = maxTxPower;
 #else
 	pChnlParams->localPowerConstraint = localPwrConstraint;
 #endif
-	cdf_mem_copy(pChnlParams->bssId, pSessionEntry->bssId,
+	qdf_mem_copy(pChnlParams->bssId, pSessionEntry->bssId,
 		     sizeof(tSirMacAddr));
 	pChnlParams->peSessionId = peSessionId;
 	pChnlParams->vhtCapable = pSessionEntry->vhtCapability;
@@ -291,7 +291,7 @@
 #endif
 	MTRACE(mac_trace_msg_tx(pMac, peSessionId, msgQ.type));
 	if (eSIR_SUCCESS != wma_post_ctrl_msg(pMac, &msgQ)) {
-		cdf_mem_free(pChnlParams);
+		qdf_mem_free(pChnlParams);
 		lim_log(pMac, LOGP, FL(
 			"Posting  CH_SWITCH_REQ to WMA failed"));
 		return eSIR_FAILURE;
@@ -329,7 +329,7 @@
 	tSirMsgQ msgQ;
 	uint8_t i;
 
-	pEdcaParams = cdf_mem_malloc(sizeof(tEdcaParams));
+	pEdcaParams = qdf_mem_malloc(sizeof(tEdcaParams));
 	if (NULL == pEdcaParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during Update EDCA Params"));
@@ -359,7 +359,7 @@
 	MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pEdcaParams);
+		qdf_mem_free(pEdcaParams);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_UPDATE_EDCA_PROFILE_IND failed, reason=%X"),
 			retCode);
@@ -493,7 +493,7 @@
 	tSirRetStatus retCode;
 	tpLinkStateParams pLinkStateParams = NULL;
 	/* Allocate memory. */
-	pLinkStateParams = cdf_mem_malloc(sizeof(tLinkStateParams));
+	pLinkStateParams = qdf_mem_malloc(sizeof(tLinkStateParams));
 	if (NULL == pLinkStateParams) {
 		lim_log(pMac, LOGP,
 			FL
@@ -501,7 +501,7 @@
 		retCode = eSIR_MEM_ALLOC_FAILED;
 		return retCode;
 	}
-	cdf_mem_set((uint8_t *) pLinkStateParams, sizeof(tLinkStateParams), 0);
+	qdf_mem_set((uint8_t *) pLinkStateParams, sizeof(tLinkStateParams), 0);
 	pLinkStateParams->state = state;
 	pLinkStateParams->callback = callback;
 	pLinkStateParams->callbackArg = callbackArg;
@@ -519,7 +519,7 @@
 
 	retCode = (uint32_t) wma_post_ctrl_msg(pMac, &msgQ);
 	if (retCode != eSIR_SUCCESS) {
-		cdf_mem_free(pLinkStateParams);
+		qdf_mem_free(pLinkStateParams);
 		lim_log(pMac, LOGP,
 			FL("Posting link state %d failed, reason = %x "), state,
 			retCode);
@@ -537,7 +537,7 @@
 	tSirRetStatus retCode;
 	tpLinkStateParams pLinkStateParams = NULL;
 	/* Allocate memory. */
-	pLinkStateParams = cdf_mem_malloc(sizeof(tLinkStateParams));
+	pLinkStateParams = qdf_mem_malloc(sizeof(tLinkStateParams));
 	if (NULL == pLinkStateParams) {
 		lim_log(pMac, LOGP,
 			FL
@@ -545,7 +545,7 @@
 		retCode = eSIR_MEM_ALLOC_FAILED;
 		return retCode;
 	}
-	cdf_mem_set((uint8_t *) pLinkStateParams, sizeof(tLinkStateParams), 0);
+	qdf_mem_set((uint8_t *) pLinkStateParams, sizeof(tLinkStateParams), 0);
 	pLinkStateParams->state = state;
 	/* Copy Mac address */
 	sir_copy_mac_addr(pLinkStateParams->bssid, bssId);
@@ -566,7 +566,7 @@
 
 	retCode = (uint32_t) wma_post_ctrl_msg(pMac, &msgQ);
 	if (retCode != eSIR_SUCCESS) {
-		cdf_mem_free(pLinkStateParams);
+		qdf_mem_free(pLinkStateParams);
 		lim_log(pMac, LOGP,
 			FL("Posting link state %d failed, reason = %x "), state,
 			retCode);
@@ -598,14 +598,14 @@
 		return retCode;
 	}
 	msgSize = sizeof(tBeaconFilterMsg) + sizeof(beacon_filter_table);
-	pBeaconFilterMsg = cdf_mem_malloc(msgSize);
+	pBeaconFilterMsg = qdf_mem_malloc(msgSize);
 	if (NULL == pBeaconFilterMsg) {
 		lim_log(pMac, LOGP,
 			FL("Fail to allocate memory for beaconFiilterMsg "));
 		retCode = eSIR_MEM_ALLOC_FAILED;
 		return retCode;
 	}
-	cdf_mem_set((uint8_t *) pBeaconFilterMsg, msgSize, 0);
+	qdf_mem_set((uint8_t *) pBeaconFilterMsg, msgSize, 0);
 	/* Fill in capability Info and mask */
 	/* Don't send this message if no active Infra session is found. */
 	pBeaconFilterMsg->capabilityInfo = psessionEntry->limCurrentBssCaps;
@@ -638,7 +638,7 @@
 	MTRACE(mac_trace_msg_tx(pMac, psessionEntry->peSessionId, msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pBeaconFilterMsg);
+		qdf_mem_free(pBeaconFilterMsg);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_BEACON_FILTER_IND failed, reason=%X"),
 			retCode);
@@ -656,13 +656,13 @@
 	tSirRetStatus retCode = eSIR_SUCCESS;
 	tSirMsgQ msgQ;
 
-	pVhtOpMode = cdf_mem_malloc(sizeof(tUpdateVHTOpMode));
+	pVhtOpMode = qdf_mem_malloc(sizeof(tUpdateVHTOpMode));
 	if (NULL == pVhtOpMode) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during Update Op Mode"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_copy((uint8_t *) pVhtOpMode, pTempParam,
+	qdf_mem_copy((uint8_t *) pVhtOpMode, pTempParam,
 		     sizeof(tUpdateVHTOpMode));
 	msgQ.type = WMA_UPDATE_OP_MODE;
 	msgQ.reserved = 0;
@@ -679,7 +679,7 @@
 					msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pVhtOpMode);
+		qdf_mem_free(pVhtOpMode);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_UPDATE_OP_MODE failed, reason=%X"),
 			retCode);
@@ -696,13 +696,13 @@
 	tSirRetStatus retCode = eSIR_SUCCESS;
 	tSirMsgQ msgQ;
 
-	pRxNss = cdf_mem_malloc(sizeof(tUpdateRxNss));
+	pRxNss = qdf_mem_malloc(sizeof(tUpdateRxNss));
 	if (NULL == pRxNss) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during Update Rx Nss"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_copy((uint8_t *) pRxNss, pTempParam, sizeof(tUpdateRxNss));
+	qdf_mem_copy((uint8_t *) pRxNss, pTempParam, sizeof(tUpdateRxNss));
 	msgQ.type = WMA_UPDATE_RX_NSS;
 	msgQ.reserved = 0;
 	msgQ.bodyptr = pRxNss;
@@ -716,7 +716,7 @@
 					msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pRxNss);
+		qdf_mem_free(pRxNss);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_UPDATE_RX_NSS failed, reason=%X"),
 			retCode);
@@ -733,13 +733,13 @@
 	tSirRetStatus retCode = eSIR_SUCCESS;
 	tSirMsgQ msgQ;
 
-	pMembership = cdf_mem_malloc(sizeof(tUpdateMembership));
+	pMembership = qdf_mem_malloc(sizeof(tUpdateMembership));
 	if (NULL == pMembership) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during Update Membership Mode"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_copy((uint8_t *) pMembership, pTempParam,
+	qdf_mem_copy((uint8_t *) pMembership, pTempParam,
 		     sizeof(tUpdateMembership));
 
 	msgQ.type = WMA_UPDATE_MEMBERSHIP;
@@ -755,7 +755,7 @@
 					msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pMembership);
+		qdf_mem_free(pMembership);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_UPDATE_MEMBERSHIP failed, reason=%X"),
 			retCode);
@@ -772,13 +772,13 @@
 	tSirRetStatus retCode = eSIR_SUCCESS;
 	tSirMsgQ msgQ;
 
-	pUserPos = cdf_mem_malloc(sizeof(tUpdateUserPos));
+	pUserPos = qdf_mem_malloc(sizeof(tUpdateUserPos));
 	if (NULL == pUserPos) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during Update User Position"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
-	cdf_mem_copy((uint8_t *) pUserPos, pTempParam, sizeof(tUpdateUserPos));
+	qdf_mem_copy((uint8_t *) pUserPos, pTempParam, sizeof(tUpdateUserPos));
 
 	msgQ.type = WMA_UPDATE_USERPOS;
 	msgQ.reserved = 0;
@@ -793,7 +793,7 @@
 					msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pUserPos);
+		qdf_mem_free(pUserPos);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_UPDATE_USERPOS failed, reason=%X"),
 			retCode);
@@ -825,7 +825,7 @@
 	tSirWlanExcludeUnencryptParam *pExcludeUnencryptParam;
 
 	pExcludeUnencryptParam =
-		cdf_mem_malloc(sizeof(tSirWlanExcludeUnencryptParam));
+		qdf_mem_malloc(sizeof(tSirWlanExcludeUnencryptParam));
 	if (NULL == pExcludeUnencryptParam) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory during lim_send_exclude_unencrypt_ind"));
@@ -833,7 +833,7 @@
 	}
 
 	pExcludeUnencryptParam->excludeUnencrypt = excludeUnenc;
-	cdf_mem_copy(pExcludeUnencryptParam->bssid.bytes, psessionEntry->bssId,
+	qdf_mem_copy(pExcludeUnencryptParam->bssid.bytes, psessionEntry->bssId,
 			QDF_MAC_ADDR_SIZE);
 
 	msgQ.type = WMA_EXCLUDE_UNENCRYPTED_IND;
@@ -844,7 +844,7 @@
 	MTRACE(mac_trace_msg_tx(pMac, psessionEntry->peSessionId, msgQ.type));
 	retCode = wma_post_ctrl_msg(pMac, &msgQ);
 	if (eSIR_SUCCESS != retCode) {
-		cdf_mem_free(pExcludeUnencryptParam);
+		qdf_mem_free(pExcludeUnencryptParam);
 		lim_log(pMac, LOGP,
 			FL("Posting WMA_EXCLUDE_UNENCRYPTED_IND failed, reason=%X"),
 			retCode);
diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
index 4924801..358016a 100644
--- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
+++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c
@@ -88,7 +88,7 @@
 	lim_log(mac_ctx, LOG1, FL("Sending message %s with reasonCode %s"),
 		lim_msg_str(msg_type), lim_result_code_str(result_code));
 
-	sme_rsp = cdf_mem_malloc(sizeof(tSirSmeRsp));
+	sme_rsp = qdf_mem_malloc(sizeof(tSirSmeRsp));
 	if (NULL == sme_rsp) {
 		/* Buffer not available. Log error */
 		QDF_TRACE(QDF_MODULE_ID_PE, LOGP,
@@ -147,7 +147,7 @@
 		lim_msg_str(msg_type), lim_result_code_str(result_code),
 		scan_id);
 
-	sme_rsp = cdf_mem_malloc(sizeof(struct sir_roc_rsp));
+	sme_rsp = qdf_mem_malloc(sizeof(struct sir_roc_rsp));
 	if (NULL == sme_rsp) {
 		QDF_TRACE(QDF_MODULE_ID_PE, LOGP,
 			FL("call to AllocateMemory failed for eWNI_SME_*_RSP"));
@@ -266,10 +266,10 @@
 	if (result_code == eSIR_SME_SUCCESS) {
 		if (session_entry->beacon != NULL) {
 			sme_join_rsp->beaconLength = session_entry->bcnLen;
-			cdf_mem_copy(sme_join_rsp->frames,
+			qdf_mem_copy(sme_join_rsp->frames,
 				session_entry->beacon,
 				sme_join_rsp->beaconLength);
-			cdf_mem_free(session_entry->beacon);
+			qdf_mem_free(session_entry->beacon);
 			session_entry->beacon = NULL;
 			session_entry->bcnLen = 0;
 			lim_log(mac_ctx, LOG1, FL("Beacon=%d"),
@@ -278,11 +278,11 @@
 		if (session_entry->assocReq != NULL) {
 			sme_join_rsp->assocReqLength =
 				session_entry->assocReqLen;
-			cdf_mem_copy(sme_join_rsp->frames +
+			qdf_mem_copy(sme_join_rsp->frames +
 				sme_join_rsp->beaconLength,
 				session_entry->assocReq,
 				sme_join_rsp->assocReqLength);
-			cdf_mem_free(session_entry->assocReq);
+			qdf_mem_free(session_entry->assocReq);
 			session_entry->assocReq = NULL;
 			session_entry->assocReqLen = 0;
 			lim_log(mac_ctx,
@@ -292,12 +292,12 @@
 		if (session_entry->assocRsp != NULL) {
 			sme_join_rsp->assocRspLength =
 				session_entry->assocRspLen;
-			cdf_mem_copy(sme_join_rsp->frames +
+			qdf_mem_copy(sme_join_rsp->frames +
 				sme_join_rsp->beaconLength +
 				sme_join_rsp->assocReqLength,
 				session_entry->assocRsp,
 				sme_join_rsp->assocRspLength);
-			cdf_mem_free(session_entry->assocRsp);
+			qdf_mem_free(session_entry->assocRsp);
 			session_entry->assocRsp = NULL;
 			session_entry->assocRspLen = 0;
 		}
@@ -305,13 +305,13 @@
 		if (session_entry->ricData != NULL) {
 			sme_join_rsp->parsedRicRspLen =
 				session_entry->RICDataLen;
-			cdf_mem_copy(sme_join_rsp->frames +
+			qdf_mem_copy(sme_join_rsp->frames +
 				sme_join_rsp->beaconLength +
 				sme_join_rsp->assocReqLength +
 				sme_join_rsp->assocRspLength,
 				session_entry->ricData,
 				sme_join_rsp->parsedRicRspLen);
-			cdf_mem_free(session_entry->ricData);
+			qdf_mem_free(session_entry->ricData);
 			session_entry->ricData = NULL;
 			session_entry->RICDataLen = 0;
 			lim_log(mac_ctx, LOG1, FL("RicLength=%d"),
@@ -322,14 +322,14 @@
 		if (session_entry->tspecIes != NULL) {
 			sme_join_rsp->tspecIeLen =
 				session_entry->tspecLen;
-			cdf_mem_copy(sme_join_rsp->frames +
+			qdf_mem_copy(sme_join_rsp->frames +
 				sme_join_rsp->beaconLength +
 				sme_join_rsp->assocReqLength +
 				sme_join_rsp->assocRspLength +
 				sme_join_rsp->parsedRicRspLen,
 				session_entry->tspecIes,
 				sme_join_rsp->tspecIeLen);
-			cdf_mem_free(session_entry->tspecIes);
+			qdf_mem_free(session_entry->tspecIes);
 			session_entry->tspecIes = NULL;
 			session_entry->tspecLen = 0;
 			lim_log(mac_ctx, LOG1, FL("ESE-TspecLen=%d"),
@@ -365,30 +365,30 @@
 #endif
 	} else {
 		if (session_entry->beacon != NULL) {
-			cdf_mem_free(session_entry->beacon);
+			qdf_mem_free(session_entry->beacon);
 			session_entry->beacon = NULL;
 			session_entry->bcnLen = 0;
 		}
 		if (session_entry->assocReq != NULL) {
-			cdf_mem_free(session_entry->assocReq);
+			qdf_mem_free(session_entry->assocReq);
 			session_entry->assocReq = NULL;
 			session_entry->assocReqLen = 0;
 		}
 		if (session_entry->assocRsp != NULL) {
-			cdf_mem_free(session_entry->assocRsp);
+			qdf_mem_free(session_entry->assocRsp);
 			session_entry->assocRsp = NULL;
 			session_entry->assocRspLen = 0;
 		}
 #ifdef WLAN_FEATURE_VOWIFI_11R
 		if (session_entry->ricData != NULL) {
-			cdf_mem_free(session_entry->ricData);
+			qdf_mem_free(session_entry->ricData);
 			session_entry->ricData = NULL;
 			session_entry->RICDataLen = 0;
 		}
 #endif
 #ifdef FEATURE_WLAN_ESE
 		if (session_entry->tspecIes != NULL) {
-			cdf_mem_free(session_entry->tspecIes);
+			qdf_mem_free(session_entry->tspecIes);
 			session_entry->tspecIes = NULL;
 			session_entry->tspecLen = 0;
 		}
@@ -436,14 +436,14 @@
 
 	if (session_entry == NULL) {
 		rsp_len = sizeof(tSirSmeJoinRsp);
-		sme_join_rsp = cdf_mem_malloc(rsp_len);
+		sme_join_rsp = qdf_mem_malloc(rsp_len);
 		if (NULL == sme_join_rsp) {
 			lim_log(mac_ctx, LOGP,
 				FL("Mem Alloc fail - JOIN/REASSOC_RSP"));
 			return;
 		}
 
-		cdf_mem_set((uint8_t *) sme_join_rsp, rsp_len, 0);
+		qdf_mem_set((uint8_t *) sme_join_rsp, rsp_len, 0);
 		sme_join_rsp->beaconLength = 0;
 		sme_join_rsp->assocReqLength = 0;
 		sme_join_rsp->assocRspLength = 0;
@@ -457,13 +457,13 @@
 			session_entry->tspecLen +
 #endif
 			sizeof(tSirSmeJoinRsp) - sizeof(uint8_t);
-		sme_join_rsp = cdf_mem_malloc(rsp_len);
+		sme_join_rsp = qdf_mem_malloc(rsp_len);
 		if (NULL == sme_join_rsp) {
 			lim_log(mac_ctx, LOGP,
 				FL("MemAlloc fail - JOIN/REASSOC_RSP"));
 			return;
 		}
-		cdf_mem_set((uint8_t *) sme_join_rsp, rsp_len, 0);
+		qdf_mem_set((uint8_t *) sme_join_rsp, rsp_len, 0);
 		if (result_code == eSIR_SME_SUCCESS) {
 			sta_ds = dph_get_hash_entry(mac_ctx,
 				DPH_STA_HASH_INDEX_PEER,
@@ -562,7 +562,7 @@
 	size = sizeof(tSirSmeStartBssRsp);
 
 	if (psessionEntry == NULL) {
-		pSirSmeRsp = cdf_mem_malloc(size);
+		pSirSmeRsp = qdf_mem_malloc(size);
 		if (NULL == pSirSmeRsp) {
 			/* / Buffer not available. Log error */
 			lim_log(pMac, LOGP,
@@ -570,7 +570,7 @@
 					("call to AllocateMemory failed for eWNI_SME_START_BSS_RSP"));
 			return;
 		}
-		cdf_mem_set((uint8_t *) pSirSmeRsp, size, 0);
+		qdf_mem_set((uint8_t *) pSirSmeRsp, size, 0);
 
 	} else {
 		/* subtract size of beaconLength + Mac Hdr + Fixed Fields before SSID */
@@ -580,7 +580,7 @@
 		/* calculate the memory size to allocate */
 		size += ieLen;
 
-		pSirSmeRsp = cdf_mem_malloc(size);
+		pSirSmeRsp = qdf_mem_malloc(size);
 		if (NULL == pSirSmeRsp) {
 			/* / Buffer not available. Log error */
 			lim_log(pMac, LOGP,
@@ -589,7 +589,7 @@
 
 			return;
 		}
-		cdf_mem_set((uint8_t *) pSirSmeRsp, size, 0);
+		qdf_mem_set((uint8_t *) pSirSmeRsp, size, 0);
 		size = sizeof(tSirSmeStartBssRsp);
 		if (resultCode == eSIR_SME_SUCCESS) {
 
@@ -618,12 +618,12 @@
 				psessionEntry->currentOperChannel;
 
 			curLen = psessionEntry->schBeaconOffsetBegin - ieOffset;
-			cdf_mem_copy((uint8_t *) &pSirSmeRsp->bssDescription.
+			qdf_mem_copy((uint8_t *) &pSirSmeRsp->bssDescription.
 				     ieFields,
 				     psessionEntry->pSchBeaconFrameBegin +
 				     ieOffset, (uint32_t) curLen);
 
-			cdf_mem_copy(((uint8_t *) &pSirSmeRsp->bssDescription.
+			qdf_mem_copy(((uint8_t *) &pSirSmeRsp->bssDescription.
 				      ieFields) + curLen,
 				     psessionEntry->pSchBeaconFrameEnd,
 				     (uint32_t) psessionEntry->
@@ -747,13 +747,13 @@
 	lim_log(pMac, LOG1, FL("send SME_SCAN_RSP (reasonCode %s)."),
 		lim_result_code_str(resultCode));
 
-	pSirSmeScanRsp = cdf_mem_malloc(sizeof(tSirSmeScanRsp));
+	pSirSmeScanRsp = qdf_mem_malloc(sizeof(tSirSmeScanRsp));
 	if (NULL == pSirSmeScanRsp) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for eWNI_SME_SCAN_RSP"));
 		return;
 	}
-	cdf_mem_set((void *)pSirSmeScanRsp, sizeof(tSirSmeScanRsp), 0);
+	qdf_mem_set((void *)pSirSmeScanRsp, sizeof(tSirSmeScanRsp), 0);
 
 	pSirSmeScanRsp->messageType = eWNI_SME_SCAN_RSP;
 	pSirSmeScanRsp->statusCode = resultCode;
@@ -820,7 +820,7 @@
 	msgLength = sizeof(tSirOemDataRsp);
 
 	/* now allocate memory for the char buffer */
-	pSirSmeOemDataRsp = cdf_mem_malloc(msgLength);
+	pSirSmeOemDataRsp = qdf_mem_malloc(msgLength);
 	if (NULL == pSirSmeOemDataRsp) {
 		lim_log(pMac, LOGP,
 			FL
@@ -836,11 +836,11 @@
 	pSirSmeOemDataRsp->messageType = eWNI_SME_OEM_DATA_RSP;
 #endif
 	pSirSmeOemDataRsp->target_rsp = pMlmOemDataRsp->target_rsp;
-	cdf_mem_copy(pSirSmeOemDataRsp->oemDataRsp, pMlmOemDataRsp->oemDataRsp,
+	qdf_mem_copy(pSirSmeOemDataRsp->oemDataRsp, pMlmOemDataRsp->oemDataRsp,
 		     OEM_DATA_RSP_SIZE);
 
 	/* Now free the memory from MLM Rsp Message */
-	cdf_mem_free(pMlmOemDataRsp);
+	qdf_mem_free(pMlmOemDataRsp);
 
 	mmhMsg.type = eWNI_SME_OEM_DATA_RSP;
 	mmhMsg.bodyptr = pSirSmeOemDataRsp;
@@ -928,7 +928,7 @@
 		 * host triggered disassociation
 		 */
 
-		pSirSmeDisassocRsp = cdf_mem_malloc(sizeof(tSirSmeDisassocRsp));
+		pSirSmeDisassocRsp = qdf_mem_malloc(sizeof(tSirSmeDisassocRsp));
 		if (NULL == pSirSmeDisassocRsp) {
 			/* Log error */
 			lim_log(pMac, LOGP, FL("Memory allocation failed"));
@@ -954,7 +954,7 @@
 		pBuf += sizeof(tSirResultCodes);
 
 		/* peerMacAddr */
-		cdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr));
+		qdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr));
 		pBuf += sizeof(tSirMacAddr);
 
 		/* Clear Station Stats */
@@ -974,7 +974,7 @@
 		 * frame reception from peer entity or due to
 		 * loss of link with peer entity.
 		 */
-		pSirSmeDisassocInd = cdf_mem_malloc(sizeof(tSirSmeDisassocInd));
+		pSirSmeDisassocInd = qdf_mem_malloc(sizeof(tSirSmeDisassocInd));
 		if (NULL == pSirSmeDisassocInd) {
 			/* Log error */
 			lim_log(pMac, LOGP, FL("Memory allocation failed"));
@@ -996,10 +996,10 @@
 		lim_copy_u32(pBuf, reasonCode);
 		pBuf += sizeof(tSirResultCodes);
 
-		cdf_mem_copy(pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
+		qdf_mem_copy(pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
 		pBuf += sizeof(tSirMacAddr);
 
-		cdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr));
+		qdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr));
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM    /* FEATURE_WLAN_DIAG_SUPPORT */
 		lim_diag_event_report(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT,
@@ -1042,7 +1042,7 @@
 	tSirMsgQ mmhMsg;
 	tSirSmeDisassocInd *pSirSmeDisassocInd;
 
-	pSirSmeDisassocInd = cdf_mem_malloc(sizeof(tSirSmeDisassocInd));
+	pSirSmeDisassocInd = qdf_mem_malloc(sizeof(tSirSmeDisassocInd));
 	if (NULL == pSirSmeDisassocInd) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for eWNI_SME_DISASSOC_IND"));
@@ -1057,10 +1057,10 @@
 	pSirSmeDisassocInd->statusCode = pStaDs->mlmStaContext.disassocReason;
 	pSirSmeDisassocInd->reasonCode = pStaDs->mlmStaContext.disassocReason;
 
-	cdf_mem_copy(pSirSmeDisassocInd->bssid.bytes, psessionEntry->bssId,
+	qdf_mem_copy(pSirSmeDisassocInd->bssid.bytes, psessionEntry->bssId,
 		     QDF_MAC_ADDR_SIZE);
 
-	cdf_mem_copy(pSirSmeDisassocInd->peer_macaddr.bytes, pStaDs->staAddr,
+	qdf_mem_copy(pSirSmeDisassocInd->peer_macaddr.bytes, pStaDs->staAddr,
 		     QDF_MAC_ADDR_SIZE);
 
 	pSirSmeDisassocInd->staId = pStaDs->staIndex;
@@ -1098,7 +1098,7 @@
 	tSirMsgQ mmhMsg;
 	tSirSmeDeauthInd *pSirSmeDeauthInd;
 
-	pSirSmeDeauthInd = cdf_mem_malloc(sizeof(tSirSmeDeauthInd));
+	pSirSmeDeauthInd = qdf_mem_malloc(sizeof(tSirSmeDeauthInd));
 	if (NULL == pSirSmeDeauthInd) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for eWNI_SME_DEAUTH_IND "));
@@ -1119,10 +1119,10 @@
 			(tSirResultCodes) pStaDs->mlmStaContext.disassocReason;
 	}
 	/* BSSID */
-	cdf_mem_copy(pSirSmeDeauthInd->bssid.bytes, psessionEntry->bssId,
+	qdf_mem_copy(pSirSmeDeauthInd->bssid.bytes, psessionEntry->bssId,
 		     QDF_MAC_ADDR_SIZE);
 	/* peerMacAddr */
-	cdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, pStaDs->staAddr,
+	qdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, pStaDs->staAddr,
 		     QDF_MAC_ADDR_SIZE);
 	pSirSmeDeauthInd->reasonCode = pStaDs->mlmStaContext.disassocReason;
 
@@ -1172,7 +1172,7 @@
 	tSirMsgQ mmhMsg;
 	tSirTdlsDelStaInd *pSirTdlsDelStaInd;
 
-	pSirTdlsDelStaInd = cdf_mem_malloc(sizeof(tSirTdlsDelStaInd));
+	pSirTdlsDelStaInd = qdf_mem_malloc(sizeof(tSirTdlsDelStaInd));
 	if (NULL == pSirTdlsDelStaInd) {
 		lim_log(pMac, LOGP,
 			FL
@@ -1187,7 +1187,7 @@
 	pSirTdlsDelStaInd->sessionId = psessionEntry->smeSessionId;
 
 	/* peerMacAddr */
-	cdf_mem_copy(pSirTdlsDelStaInd->peermac.bytes, pStaDs->staAddr,
+	qdf_mem_copy(pSirTdlsDelStaInd->peermac.bytes, pStaDs->staAddr,
 		     QDF_MAC_ADDR_SIZE);
 
 	/* staId */
@@ -1229,7 +1229,7 @@
 	tSirMsgQ mmhMsg;
 	tSirTdlsDelAllPeerInd *pSirTdlsDelAllPeerInd;
 
-	pSirTdlsDelAllPeerInd = cdf_mem_malloc(sizeof(tSirTdlsDelAllPeerInd));
+	pSirTdlsDelAllPeerInd = qdf_mem_malloc(sizeof(tSirTdlsDelAllPeerInd));
 	if (NULL == pSirTdlsDelAllPeerInd) {
 		lim_log(pMac, LOGP,
 			FL
@@ -1278,7 +1278,7 @@
 	tSirMgmtTxCompletionInd *pSirMgmtTxCompletionInd;
 
 	pSirMgmtTxCompletionInd =
-		cdf_mem_malloc(sizeof(tSirMgmtTxCompletionInd));
+		qdf_mem_malloc(sizeof(tSirMgmtTxCompletionInd));
 	if (NULL == pSirMgmtTxCompletionInd) {
 		lim_log(pMac, LOGP,
 			FL
@@ -1377,7 +1377,7 @@
 		 * Deauthentication response to host triggered
 		 * deauthentication.
 		 */
-		pSirSmeDeauthRsp = cdf_mem_malloc(sizeof(tSirSmeDeauthRsp));
+		pSirSmeDeauthRsp = qdf_mem_malloc(sizeof(tSirSmeDeauthRsp));
 		if (NULL == pSirSmeDeauthRsp) {
 			/* Log error */
 			lim_log(pMac, LOGP,
@@ -1396,7 +1396,7 @@
 		pSirSmeDeauthRsp->transactionId = smetransactionId;
 
 		pBuf = (uint8_t *) pSirSmeDeauthRsp->peer_macaddr.bytes;
-		cdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr));
+		qdf_mem_copy(pBuf, peerMacAddr, sizeof(tSirMacAddr));
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM    /* FEATURE_WLAN_DIAG_SUPPORT */
 		lim_diag_event_report(pMac, WLAN_PE_DIAG_DEAUTH_RSP_EVENT,
@@ -1412,7 +1412,7 @@
 		 * frame reception from peer entity or due to
 		 * loss of link with peer entity.
 		 */
-		pSirSmeDeauthInd = cdf_mem_malloc(sizeof(tSirSmeDeauthInd));
+		pSirSmeDeauthInd = qdf_mem_malloc(sizeof(tSirSmeDeauthInd));
 		if (NULL == pSirSmeDeauthInd) {
 			/* Log error */
 			lim_log(pMac, LOGP,
@@ -1441,11 +1441,11 @@
 		pBuf += sizeof(tSirResultCodes);
 
 		/* bssId */
-		cdf_mem_copy(pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
+		qdf_mem_copy(pBuf, psessionEntry->bssId, sizeof(tSirMacAddr));
 		pBuf += sizeof(tSirMacAddr);
 
 		/* peerMacAddr */
-		cdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, peerMacAddr,
+		qdf_mem_copy(pSirSmeDeauthInd->peer_macaddr.bytes, peerMacAddr,
 			     QDF_MAC_ADDR_SIZE);
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM    /* FEATURE_WLAN_DIAG_SUPPORT */
@@ -1490,7 +1490,7 @@
 	tSirMsgQ msg;
 	tSirSmeWmStatusChangeNtf *wm_status_change_ntf;
 
-	wm_status_change_ntf = cdf_mem_malloc(sizeof(tSirSmeWmStatusChangeNtf));
+	wm_status_change_ntf = qdf_mem_malloc(sizeof(tSirSmeWmStatusChangeNtf));
 	if (NULL == wm_status_change_ntf) {
 		lim_log(mac_ctx, LOGE,
 			FL("Mem Alloc failed - eWNI_SME_WM_STATUS_CHANGE_NTF"));
@@ -1512,7 +1512,7 @@
 		wm_status_change_ntf->sessionId = session_id;
 		if (sizeof(wm_status_change_ntf->statusChangeInfo) >=
 			info_len) {
-			cdf_mem_copy(
+			qdf_mem_copy(
 			    (uint8_t *) &wm_status_change_ntf->statusChangeInfo,
 			    (uint8_t *) status_change_info, info_len);
 		}
@@ -1524,7 +1524,7 @@
 
 	MTRACE(mac_trace_msg_tx(mac_ctx, session_id, msg.type));
 	if (eSIR_SUCCESS != lim_sys_process_mmh_msg_api(mac_ctx, &msg, ePROT)) {
-		cdf_mem_free(wm_status_change_ntf);
+		qdf_mem_free(wm_status_change_ntf);
 		lim_log(mac_ctx, LOGP,
 			FL("lim_sys_process_mmh_msg_api failed"));
 	}
@@ -1567,7 +1567,7 @@
 	tSirMsgQ mmhMsg;
 	tSirSmeSetContextRsp *pSirSmeSetContextRsp;
 
-	pSirSmeSetContextRsp = cdf_mem_malloc(sizeof(tSirSmeSetContextRsp));
+	pSirSmeSetContextRsp = qdf_mem_malloc(sizeof(tSirSmeSetContextRsp));
 	if (NULL == pSirSmeSetContextRsp) {
 		/* Log error */
 		lim_log(pMac, LOGP,
@@ -1664,7 +1664,7 @@
 	 */
 	val = pBssDescr->bssDescription.length + sizeof(uint16_t) +
 		sizeof(uint32_t) + sizeof(uint8_t);
-	pNewBssInd = cdf_mem_malloc(val);
+	pNewBssInd = qdf_mem_malloc(val);
 	if (NULL == pNewBssInd) {
 		/* Log error */
 		lim_log(pMac, LOGP,
@@ -1678,7 +1678,7 @@
 	pNewBssInd->length = (uint16_t) val;
 	pNewBssInd->sessionId = 0;
 
-	cdf_mem_copy((uint8_t *) pNewBssInd->bssDescription,
+	qdf_mem_copy((uint8_t *) pNewBssInd->bssDescription,
 		     (uint8_t *) &pBssDescr->bssDescription,
 		     pBssDescr->bssDescription.length + sizeof(uint16_t));
 
@@ -1710,13 +1710,13 @@
 	if (!rspReqd)
 		return;
 
-	rsp = cdf_mem_malloc(sizeof(tSirAddtsRsp));
+	rsp = qdf_mem_malloc(sizeof(tSirAddtsRsp));
 	if (NULL == rsp) {
 		lim_log(pMac, LOGP, FL("AllocateMemory failed for ADDTS_RSP"));
 		return;
 	}
 
-	cdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
+	qdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
 	rsp->messageType = eWNI_SME_ADDTS_RSP;
 	rsp->rc = status;
 	rsp->rsp.status = (enum eSirMacStatusCodes)status;
@@ -1758,19 +1758,19 @@
 	if (!delts->rspReqd)
 		return;
 
-	rsp = cdf_mem_malloc(sizeof(tSirDeltsRsp));
+	rsp = qdf_mem_malloc(sizeof(tSirDeltsRsp));
 	if (NULL == rsp) {
 		/* Log error */
 		lim_log(pMac, LOGP, FL("AllocateMemory failed for DELTS_RSP"));
 		return;
 	}
-	cdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
+	qdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
 
 	if (psessionEntry != NULL) {
 
 		rsp->aid = delts->aid;
 		qdf_copy_macaddr(&rsp->macaddr, &delts->macaddr);
-		cdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) &delts->req,
+		qdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) &delts->req,
 			     sizeof(tSirDeltsReqInfo));
 	}
 
@@ -1808,18 +1808,18 @@
 	lim_log(pMac, LOGW, "SendSmeDeltsInd (aid %d, tsid %d, up %d)",
 		aid, delts->tsinfo.traffic.tsid, delts->tsinfo.traffic.userPrio);
 
-	rsp = cdf_mem_malloc(sizeof(tSirDeltsRsp));
+	rsp = qdf_mem_malloc(sizeof(tSirDeltsRsp));
 	if (NULL == rsp) {
 		/* Log error */
 		lim_log(pMac, LOGP, FL("AllocateMemory failed for DELTS_IND"));
 		return;
 	}
-	cdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
+	qdf_mem_set((uint8_t *) rsp, sizeof(*rsp), 0);
 
 	rsp->messageType = eWNI_SME_DELTS_IND;
 	rsp->rc = eSIR_SUCCESS;
 	rsp->aid = aid;
-	cdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) delts, sizeof(*delts));
+	qdf_mem_copy((uint8_t *) &rsp->rsp, (uint8_t *) delts, sizeof(*delts));
 
 	/* Update SME  session Id and SME transaction Id */
 
@@ -1964,16 +1964,16 @@
 	tSirMsgQ mmhMsg;
 	tSmeIbssPeerInd *pNewPeerInd;
 
-	pNewPeerInd = cdf_mem_malloc(sizeof(tSmeIbssPeerInd) + beaconLen);
+	pNewPeerInd = qdf_mem_malloc(sizeof(tSmeIbssPeerInd) + beaconLen);
 	if (NULL == pNewPeerInd) {
 		PELOGE(lim_log(pMac, LOGE, FL("Failed to allocate memory"));)
 		return;
 	}
 
-	cdf_mem_set((void *)pNewPeerInd, (sizeof(tSmeIbssPeerInd) + beaconLen),
+	qdf_mem_set((void *)pNewPeerInd, (sizeof(tSmeIbssPeerInd) + beaconLen),
 		    0);
 
-	cdf_mem_copy((uint8_t *) pNewPeerInd->peer_addr.bytes,
+	qdf_mem_copy((uint8_t *) pNewPeerInd->peer_addr.bytes,
 		     peerMacAddr, QDF_MAC_ADDR_SIZE);
 	pNewPeerInd->staId = staIndex;
 	pNewPeerInd->ucastSig = ucastIdx;
@@ -1983,7 +1983,7 @@
 	pNewPeerInd->sessionId = sessionId;
 
 	if (beacon != NULL) {
-		cdf_mem_copy((void *)((uint8_t *) pNewPeerInd +
+		qdf_mem_copy((void *)((uint8_t *) pNewPeerInd +
 				      sizeof(tSmeIbssPeerInd)), (void *)beacon,
 			     beaconLen);
 	}
@@ -2181,17 +2181,17 @@
 			session_entry->gLimChannelSwitch.ch_width);
 
 		lim_prepare_for11h_channel_switch(mac_ctx, session_entry);
-		csa_offload_ind = cdf_mem_malloc(sizeof(tSmeCsaOffloadInd));
+		csa_offload_ind = qdf_mem_malloc(sizeof(tSmeCsaOffloadInd));
 		if (NULL == csa_offload_ind) {
 			lim_log(mac_ctx, LOGE,
 				FL("memalloc fail eWNI_SME_CSA_OFFLOAD_EVENT"));
 			goto err;
 		}
 
-		cdf_mem_set(csa_offload_ind, sizeof(tSmeCsaOffloadInd), 0);
+		qdf_mem_set(csa_offload_ind, sizeof(tSmeCsaOffloadInd), 0);
 		csa_offload_ind->mesgType = eWNI_SME_CSA_OFFLOAD_EVENT;
 		csa_offload_ind->mesgLen = sizeof(tSmeCsaOffloadInd);
-		cdf_mem_copy(csa_offload_ind->bssid.bytes, session_entry->bssId,
+		qdf_mem_copy(csa_offload_ind->bssid.bytes, session_entry->bssId,
 				QDF_MAC_ADDR_SIZE);
 		mmh_msg.type = eWNI_SME_CSA_OFFLOAD_EVENT;
 		mmh_msg.bodyptr = csa_offload_ind;
@@ -2209,7 +2209,7 @@
 	}
 
 err:
-	cdf_mem_free(csa_params);
+	qdf_mem_free(csa_params);
 }
 
 /*--------------------------------------------------------------------------
@@ -2278,13 +2278,13 @@
 	tSirMsgQ mmhMsg;
 	tSmeMaxAssocInd *pSmeMaxAssocInd;
 
-	pSmeMaxAssocInd = cdf_mem_malloc(sizeof(tSmeMaxAssocInd));
+	pSmeMaxAssocInd = qdf_mem_malloc(sizeof(tSmeMaxAssocInd));
 	if (NULL == pSmeMaxAssocInd) {
 		PELOGE(lim_log(pMac, LOGE, FL("Failed to allocate memory"));)
 		return;
 	}
-	cdf_mem_set((void *)pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd), 0);
-	cdf_mem_copy((uint8_t *) pSmeMaxAssocInd->peer_mac.bytes,
+	qdf_mem_set((void *)pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd), 0);
+	qdf_mem_copy((uint8_t *) pSmeMaxAssocInd->peer_mac.bytes,
 		     (uint8_t *) peerMacAddr, QDF_MAC_ADDR_SIZE);
 	pSmeMaxAssocInd->mesgType = eWNI_SME_MAX_ASSOC_EXCEEDED;
 	pSmeMaxAssocInd->mesgLen = sizeof(tSmeMaxAssocInd);
@@ -2375,17 +2375,17 @@
 	uint8_t channelId;
 
 	pSmeSwithChnlParams = (tSwitchChannelParams *)
-			      cdf_mem_malloc(sizeof(tSwitchChannelParams));
+			      qdf_mem_malloc(sizeof(tSwitchChannelParams));
 	if (NULL == pSmeSwithChnlParams) {
 		lim_log(pMac, LOGP,
 			FL("AllocateMemory failed for pSmeSwithChnlParams\n"));
 		return;
 	}
 
-	cdf_mem_set((void *)pSmeSwithChnlParams,
+	qdf_mem_set((void *)pSmeSwithChnlParams,
 		    sizeof(tSwitchChannelParams), 0);
 
-	cdf_mem_copy(pSmeSwithChnlParams, pChnlParams,
+	qdf_mem_copy(pSmeSwithChnlParams, pChnlParams,
 		     sizeof(tSwitchChannelParams));
 
 	channelId = pSmeSwithChnlParams->channelNumber;
@@ -2476,7 +2476,7 @@
 			psessionEntry->dfsIncludeChanWrapperIe = false;
 
 			pChanSwTxResponse = (tSirSmeCSAIeTxCompleteRsp *)
-					    cdf_mem_malloc(length);
+					    qdf_mem_malloc(length);
 
 			if (NULL == pChanSwTxResponse) {
 				lim_log(pMac, LOGP,
@@ -2485,7 +2485,7 @@
 				return;
 			}
 
-			cdf_mem_set((void *)pChanSwTxResponse, length, 0);
+			qdf_mem_set((void *)pChanSwTxResponse, length, 0);
 			pChanSwTxResponse->sessionId =
 				psessionEntry->smeSessionId;
 			pChanSwTxResponse->chanSwIeTxStatus =
@@ -2503,14 +2503,14 @@
 		/* Done with nss update, send response back to SME */
 		psessionEntry->gLimOperatingMode.present = 0;
 		beacon_tx_comp_rsp_ptr = (struct sir_beacon_tx_complete_rsp *)
-				cdf_mem_malloc(sizeof(*beacon_tx_comp_rsp_ptr));
+				qdf_mem_malloc(sizeof(*beacon_tx_comp_rsp_ptr));
 		if (NULL == beacon_tx_comp_rsp_ptr) {
 			lim_log(pMac, LOGP,
 				FL
 				("AllocateMemory failed for beacon_tx_comp_rsp_ptr"));
 			return;
 		}
-		cdf_mem_set((void *)beacon_tx_comp_rsp_ptr,
+		qdf_mem_set((void *)beacon_tx_comp_rsp_ptr,
 					sizeof(*beacon_tx_comp_rsp_ptr), 0);
 		beacon_tx_comp_rsp_ptr->session_id =
 			psessionEntry->smeSessionId;
diff --git a/core/mac/src/pe/lim/lim_session.c b/core/mac/src/pe/lim/lim_session.c
index c2e5dc0..7d85ec1 100644
--- a/core/mac/src/pe/lim/lim_session.c
+++ b/core/mac/src/pe/lim/lim_session.c
@@ -74,19 +74,19 @@
 	psessionEntry->beaconParams.gHTObssMode = 0;
 
 	/* Number of legacy STAs associated */
-	cdf_mem_set((void *)&psessionEntry->gLim11bParams,
+	qdf_mem_set((void *)&psessionEntry->gLim11bParams,
 		    sizeof(tLimProtStaParams), 0);
-	cdf_mem_set((void *)&psessionEntry->gLim11aParams,
+	qdf_mem_set((void *)&psessionEntry->gLim11aParams,
 		    sizeof(tLimProtStaParams), 0);
-	cdf_mem_set((void *)&psessionEntry->gLim11gParams,
+	qdf_mem_set((void *)&psessionEntry->gLim11gParams,
 		    sizeof(tLimProtStaParams), 0);
-	cdf_mem_set((void *)&psessionEntry->gLimNonGfParams,
+	qdf_mem_set((void *)&psessionEntry->gLimNonGfParams,
 		    sizeof(tLimProtStaParams), 0);
-	cdf_mem_set((void *)&psessionEntry->gLimHt20Params,
+	qdf_mem_set((void *)&psessionEntry->gLimHt20Params,
 		    sizeof(tLimProtStaParams), 0);
-	cdf_mem_set((void *)&psessionEntry->gLimLsigTxopParams,
+	qdf_mem_set((void *)&psessionEntry->gLimLsigTxopParams,
 		    sizeof(tLimProtStaParams), 0);
-	cdf_mem_set((void *)&psessionEntry->gLimOlbcParams,
+	qdf_mem_set((void *)&psessionEntry->gLimOlbcParams,
 		    sizeof(tLimProtStaParams), 0);
 }
 
@@ -133,34 +133,34 @@
 		  pe_session_entry->old_protection_state,
 		  current_protection_state);
 
-	cdf_mem_zero(&pe_session_entry->gLimOverlap11gParams,
+	qdf_mem_zero(&pe_session_entry->gLimOverlap11gParams,
 		     sizeof(pe_session_entry->gLimOverlap11gParams));
-	cdf_mem_zero(&pe_session_entry->gLimOverlap11aParams,
+	qdf_mem_zero(&pe_session_entry->gLimOverlap11aParams,
 		     sizeof(pe_session_entry->gLimOverlap11aParams));
-	cdf_mem_zero(&pe_session_entry->gLimOverlapHt20Params,
+	qdf_mem_zero(&pe_session_entry->gLimOverlapHt20Params,
 		     sizeof(pe_session_entry->gLimOverlapHt20Params));
-	cdf_mem_zero(&pe_session_entry->gLimOverlapNonGfParams,
+	qdf_mem_zero(&pe_session_entry->gLimOverlapNonGfParams,
 		     sizeof(pe_session_entry->gLimOverlapNonGfParams));
 
-	cdf_mem_zero(&pe_session_entry->gLimOlbcParams,
+	qdf_mem_zero(&pe_session_entry->gLimOlbcParams,
 		     sizeof(pe_session_entry->gLimOlbcParams));
 
-	cdf_mem_zero(&pe_session_entry->beaconParams,
+	qdf_mem_zero(&pe_session_entry->beaconParams,
 		     sizeof(pe_session_entry->beaconParams));
 
-	cdf_mem_zero(&mac_ctx->lim.gLimOverlap11gParams,
+	qdf_mem_zero(&mac_ctx->lim.gLimOverlap11gParams,
 		     sizeof(mac_ctx->lim.gLimOverlap11gParams));
-	cdf_mem_zero(&mac_ctx->lim.gLimOverlap11aParams,
+	qdf_mem_zero(&mac_ctx->lim.gLimOverlap11aParams,
 		     sizeof(mac_ctx->lim.gLimOverlap11aParams));
-	cdf_mem_zero(&mac_ctx->lim.gLimOverlapHt20Params,
+	qdf_mem_zero(&mac_ctx->lim.gLimOverlapHt20Params,
 		     sizeof(mac_ctx->lim.gLimOverlapHt20Params));
-	cdf_mem_zero(&mac_ctx->lim.gLimOverlapNonGfParams,
+	qdf_mem_zero(&mac_ctx->lim.gLimOverlapNonGfParams,
 		     sizeof(mac_ctx->lim.gLimOverlapNonGfParams));
 
 	old_op_mode = pe_session_entry->htOperMode;
 	pe_session_entry->htOperMode = eSIR_HT_OP_MODE_PURE;
 
-	cdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
+	qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
 	/* index 0, is self node, peers start from 1 */
 	for (i = 1 ; i <= mac_ctx->lim.gLimAssocStaLimit ; i++) {
 		station_hash_node = dph_get_hash_entry(mac_ctx, i,
@@ -181,7 +181,7 @@
 			  QDF_TRACE_LEVEL_ERROR,
 			  FL("protection changed, update beacon template\n"));
 		/* update beacon fix params and send update to FW */
-		cdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
+		qdf_mem_zero(&beacon_params, sizeof(tUpdateBeaconParams));
 		beacon_params.bssIdx = pe_session_entry->bssIdx;
 		beacon_params.fShortPreamble =
 				pe_session_entry->beaconParams.fShortPreamble;
@@ -258,20 +258,20 @@
 	}
 
 	session_ptr = &pMac->lim.gpSession[i];
-	cdf_mem_set((void *)session_ptr, sizeof(tPESession), 0);
+	qdf_mem_set((void *)session_ptr, sizeof(tPESession), 0);
 	/* Allocate space for Station Table for this session. */
 	session_ptr->dph.dphHashTable.pHashTable =
-		cdf_mem_malloc(sizeof(tpDphHashNode) * (numSta + 1));
+		qdf_mem_malloc(sizeof(tpDphHashNode) * (numSta + 1));
 	if (NULL == session_ptr->dph.dphHashTable.pHashTable) {
 		lim_log(pMac, LOGE, FL("memory allocate failed!"));
 		return NULL;
 	}
 
 	session_ptr->dph.dphHashTable.pDphNodeArray =
-		cdf_mem_malloc(sizeof(tDphHashNode) * (numSta + 1));
+		qdf_mem_malloc(sizeof(tDphHashNode) * (numSta + 1));
 	if (NULL == session_ptr->dph.dphHashTable.pDphNodeArray) {
 		lim_log(pMac, LOGE, FL("memory allocate failed!"));
-		cdf_mem_free(session_ptr->dph.dphHashTable.pHashTable);
+		qdf_mem_free(session_ptr->dph.dphHashTable.pHashTable);
 		session_ptr->dph.dphHashTable.
 		pHashTable = NULL;
 		return NULL;
@@ -279,17 +279,17 @@
 
 	session_ptr->dph.dphHashTable.size = numSta + 1;
 	dph_hash_table_class_init(pMac, &session_ptr->dph.dphHashTable);
-	session_ptr->gpLimPeerIdxpool = cdf_mem_malloc(
+	session_ptr->gpLimPeerIdxpool = qdf_mem_malloc(
 		sizeof(*(session_ptr->gpLimPeerIdxpool)) * (numSta + 1));
 	if (NULL == session_ptr->gpLimPeerIdxpool) {
 		lim_log(pMac, LOGE, FL("memory allocate failed!"));
-		cdf_mem_free(session_ptr->dph.dphHashTable.pHashTable);
-		cdf_mem_free(session_ptr->dph.dphHashTable.pDphNodeArray);
+		qdf_mem_free(session_ptr->dph.dphHashTable.pHashTable);
+		qdf_mem_free(session_ptr->dph.dphHashTable.pDphNodeArray);
 		session_ptr->dph.dphHashTable.pHashTable = NULL;
 		session_ptr->dph.dphHashTable.pDphNodeArray = NULL;
 		return NULL;
 	}
-	cdf_mem_set(session_ptr->gpLimPeerIdxpool,
+	qdf_mem_set(session_ptr->gpLimPeerIdxpool,
 		    sizeof(*session_ptr->gpLimPeerIdxpool) * (numSta + 1),
 		    0);
 	session_ptr->freePeerIdxHead = 0;
@@ -318,7 +318,7 @@
 	session_ptr->htRecommendedTxWidthSet = 0;
 	session_ptr->htSecondaryChannelOffset = 0;
 #ifdef FEATURE_WLAN_TDLS
-	cdf_mem_set(session_ptr->peerAIDBitmap,
+	qdf_mem_set(session_ptr->peerAIDBitmap,
 		    sizeof(session_ptr->peerAIDBitmap), 0);
 	session_ptr->tdls_prohibited = false;
 	session_ptr->tdls_chan_swit_prohibited = false;
@@ -334,21 +334,21 @@
 	    || eSIR_IBSS_MODE == bssType
 	    || eSIR_BTAMP_AP_MODE == bssType) {
 		session_ptr->pSchProbeRspTemplate =
-			cdf_mem_malloc(SCH_MAX_PROBE_RESP_SIZE);
+			qdf_mem_malloc(SCH_MAX_PROBE_RESP_SIZE);
 		session_ptr->pSchBeaconFrameBegin =
-			cdf_mem_malloc(SCH_MAX_BEACON_SIZE);
+			qdf_mem_malloc(SCH_MAX_BEACON_SIZE);
 		session_ptr->pSchBeaconFrameEnd =
-			cdf_mem_malloc(SCH_MAX_BEACON_SIZE);
+			qdf_mem_malloc(SCH_MAX_BEACON_SIZE);
 		if ((NULL == session_ptr->pSchProbeRspTemplate)
 		    || (NULL == session_ptr->pSchBeaconFrameBegin)
 		    || (NULL == session_ptr->pSchBeaconFrameEnd)) {
 			lim_log(pMac, LOGE, FL("memory allocate failed!"));
-			cdf_mem_free(session_ptr->dph.dphHashTable.pHashTable);
-			cdf_mem_free(session_ptr->dph.dphHashTable.pDphNodeArray);
-			cdf_mem_free(session_ptr->gpLimPeerIdxpool);
-			cdf_mem_free(session_ptr->pSchProbeRspTemplate);
-			cdf_mem_free(session_ptr->pSchBeaconFrameBegin);
-			cdf_mem_free(session_ptr->pSchBeaconFrameEnd);
+			qdf_mem_free(session_ptr->dph.dphHashTable.pHashTable);
+			qdf_mem_free(session_ptr->dph.dphHashTable.pDphNodeArray);
+			qdf_mem_free(session_ptr->gpLimPeerIdxpool);
+			qdf_mem_free(session_ptr->pSchProbeRspTemplate);
+			qdf_mem_free(session_ptr->pSchBeaconFrameBegin);
+			qdf_mem_free(session_ptr->pSchBeaconFrameEnd);
 
 			session_ptr->dph.dphHashTable.pHashTable = NULL;
 			session_ptr->dph.dphHashTable.pDphNodeArray = NULL;
@@ -559,54 +559,54 @@
 	lim_ft_cleanup(mac_ctx, session);
 #endif
 	if (session->pLimStartBssReq != NULL) {
-		cdf_mem_free(session->pLimStartBssReq);
+		qdf_mem_free(session->pLimStartBssReq);
 		session->pLimStartBssReq = NULL;
 	}
 
 	if (session->pLimJoinReq != NULL) {
-		cdf_mem_free(session->pLimJoinReq);
+		qdf_mem_free(session->pLimJoinReq);
 		session->pLimJoinReq = NULL;
 	}
 
 	if (session->pLimReAssocReq != NULL) {
-		cdf_mem_free(session->pLimReAssocReq);
+		qdf_mem_free(session->pLimReAssocReq);
 		session->pLimReAssocReq = NULL;
 	}
 
 	if (session->pLimMlmJoinReq != NULL) {
-		cdf_mem_free(session->pLimMlmJoinReq);
+		qdf_mem_free(session->pLimMlmJoinReq);
 		session->pLimMlmJoinReq = NULL;
 	}
 
 	if (session->dph.dphHashTable.pHashTable != NULL) {
-		cdf_mem_free(session->dph.dphHashTable.pHashTable);
+		qdf_mem_free(session->dph.dphHashTable.pHashTable);
 		session->dph.dphHashTable.pHashTable = NULL;
 	}
 
 	if (session->dph.dphHashTable.pDphNodeArray != NULL) {
-		cdf_mem_free(session->dph.dphHashTable.pDphNodeArray);
+		qdf_mem_free(session->dph.dphHashTable.pDphNodeArray);
 		session->dph.dphHashTable.pDphNodeArray = NULL;
 	}
 
 	if (session->gpLimPeerIdxpool != NULL) {
-		cdf_mem_free(session->gpLimPeerIdxpool);
+		qdf_mem_free(session->gpLimPeerIdxpool);
 		session->gpLimPeerIdxpool = NULL;
 	}
 
 	if (session->beacon != NULL) {
-		cdf_mem_free(session->beacon);
+		qdf_mem_free(session->beacon);
 		session->beacon = NULL;
 		session->bcnLen = 0;
 	}
 
 	if (session->assocReq != NULL) {
-		cdf_mem_free(session->assocReq);
+		qdf_mem_free(session->assocReq);
 		session->assocReq = NULL;
 		session->assocReqLen = 0;
 	}
 
 	if (session->assocRsp != NULL) {
-		cdf_mem_free(session->assocRsp);
+		qdf_mem_free(session->assocRsp);
 		session->assocRsp = NULL;
 		session->assocRspLen = 0;
 	}
@@ -620,58 +620,58 @@
 			tmp_ptr = ((tpSirAssocReq)
 				  (session->parsedAssocReq[i]));
 			if (tmp_ptr->assocReqFrame) {
-				cdf_mem_free(tmp_ptr->assocReqFrame);
+				qdf_mem_free(tmp_ptr->assocReqFrame);
 				tmp_ptr->assocReqFrame = NULL;
 				tmp_ptr->assocReqFrameLength = 0;
 			}
-			cdf_mem_free(session->parsedAssocReq[i]);
+			qdf_mem_free(session->parsedAssocReq[i]);
 			session->parsedAssocReq[i] = NULL;
 		}
 		/* Cleanup the whole block */
-		cdf_mem_free(session->parsedAssocReq);
+		qdf_mem_free(session->parsedAssocReq);
 		session->parsedAssocReq = NULL;
 	}
 	if (NULL != session->limAssocResponseData) {
-		cdf_mem_free(session->limAssocResponseData);
+		qdf_mem_free(session->limAssocResponseData);
 		session->limAssocResponseData = NULL;
 	}
 	if (NULL != session->pLimMlmReassocRetryReq) {
-		cdf_mem_free(session->pLimMlmReassocRetryReq);
+		qdf_mem_free(session->pLimMlmReassocRetryReq);
 		session->pLimMlmReassocRetryReq = NULL;
 	}
 	if (NULL != session->pLimMlmReassocReq) {
-		cdf_mem_free(session->pLimMlmReassocReq);
+		qdf_mem_free(session->pLimMlmReassocReq);
 		session->pLimMlmReassocReq = NULL;
 	}
 
 	if (NULL != session->pSchProbeRspTemplate) {
-		cdf_mem_free(session->pSchProbeRspTemplate);
+		qdf_mem_free(session->pSchProbeRspTemplate);
 		session->pSchProbeRspTemplate = NULL;
 	}
 
 	if (NULL != session->pSchBeaconFrameBegin) {
-		cdf_mem_free(session->pSchBeaconFrameBegin);
+		qdf_mem_free(session->pSchBeaconFrameBegin);
 		session->pSchBeaconFrameBegin = NULL;
 	}
 
 	if (NULL != session->pSchBeaconFrameEnd) {
-		cdf_mem_free(session->pSchBeaconFrameEnd);
+		qdf_mem_free(session->pSchBeaconFrameEnd);
 		session->pSchBeaconFrameEnd = NULL;
 	}
 
 	/* Must free the buffer before peSession invalid */
 	if (NULL != session->addIeParams.probeRespData_buff) {
-		cdf_mem_free(session->addIeParams.probeRespData_buff);
+		qdf_mem_free(session->addIeParams.probeRespData_buff);
 		session->addIeParams.probeRespData_buff = NULL;
 		session->addIeParams.probeRespDataLen = 0;
 	}
 	if (NULL != session->addIeParams.assocRespData_buff) {
-		cdf_mem_free(session->addIeParams.assocRespData_buff);
+		qdf_mem_free(session->addIeParams.assocRespData_buff);
 		session->addIeParams.assocRespData_buff = NULL;
 		session->addIeParams.assocRespDataLen = 0;
 	}
 	if (NULL != session->addIeParams.probeRespBCNData_buff) {
-		cdf_mem_free(session->addIeParams.probeRespBCNData_buff);
+		qdf_mem_free(session->addIeParams.probeRespBCNData_buff);
 		session->addIeParams.probeRespBCNData_buff = NULL;
 		session->addIeParams.probeRespBCNDataLen = 0;
 	}
diff --git a/core/mac/src/pe/lim/lim_sme_req_utils.c b/core/mac/src/pe/lim/lim_sme_req_utils.c
index 88c021e..fc26863 100644
--- a/core/mac/src/pe/lim/lim_sme_req_utils.c
+++ b/core/mac/src/pe/lim/lim_sme_req_utils.c
@@ -543,7 +543,7 @@
 	   Reject Join Req if the Self Mac Address and
 	   the Ap's Mac Address is same
 	 */
-	if (cdf_mem_compare((uint8_t *) pJoinReq->selfMacAddr,
+	if (!qdf_mem_cmp((uint8_t *) pJoinReq->selfMacAddr,
 			    (uint8_t *) pJoinReq->bssDescription.bssId,
 			    (uint8_t) (sizeof(tSirMacAddr)))) {
 		/* Log the event */
diff --git a/core/mac/src/pe/lim/lim_timer_utils.c b/core/mac/src/pe/lim/lim_timer_utils.c
index 185e6bb..92fa504 100644
--- a/core/mac/src/pe/lim/lim_timer_utils.c
+++ b/core/mac/src/pe/lim/lim_timer_utils.c
@@ -300,7 +300,7 @@
 		lim_log(pMac, LOGP, FL("could not retrieve mac preauth value"));
 	pMac->lim.gLimPreAuthTimerTable.numEntry = cfgValue;
 	pMac->lim.gLimPreAuthTimerTable.pTable =
-		cdf_mem_malloc(cfgValue * sizeof(tLimPreAuthNode));
+		qdf_mem_malloc(cfgValue * sizeof(tLimPreAuthNode));
 
 	if (pMac->lim.gLimPreAuthTimerTable.pTable == NULL) {
 		lim_log(pMac, LOGP, FL("AllocateMemory failed!"));
@@ -427,7 +427,7 @@
 	tx_timer_delete(&pMac->lim.limTimers.gLimActiveToPassiveChannelTimer);
 
 	if (NULL != pMac->lim.gLimPreAuthTimerTable.pTable) {
-		cdf_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
+		qdf_mem_free(pMac->lim.gLimPreAuthTimerTable.pTable);
 		pMac->lim.gLimPreAuthTimerTable.pTable = NULL;
 	}
 	return TX_TIMER_ERROR;
@@ -471,7 +471,8 @@
 	msg.bodyptr = NULL;
 	msg.bodyval = 0;
 
-	if ((statusCode = lim_post_msg_api(pMac, &msg)) != eSIR_SUCCESS)
+	statusCode = lim_post_msg_api(pMac, &msg);
+	if (statusCode != eSIR_SUCCESS)
 		lim_log(pMac, LOGE,
 			FL("posting message %X to LIM failed, reason=%d"),
 			msg.type, statusCode);
@@ -583,7 +584,7 @@
 				FL("Reassoc request retry MAX(%d) reached"),
 				LIM_MAX_REASSOC_RETRY_LIMIT);
 			if (NULL != session->pLimMlmReassocRetryReq) {
-				cdf_mem_free(session->pLimMlmReassocRetryReq);
+				qdf_mem_free(session->pLimMlmReassocRetryReq);
 				session->pLimMlmReassocRetryReq = NULL;
 			}
 		}
@@ -1274,7 +1275,8 @@
 	msg.bodyval = 0;
 	msg.bodyptr = NULL;
 
-	if ((statusCode = lim_post_msg_api(pMac, &msg)) != eSIR_SUCCESS)
+	statusCode = lim_post_msg_api(pMac, &msg);
+	if (statusCode != eSIR_SUCCESS)
 		lim_log(pMac, LOGE,
 			FL("posting to LIM failed, reason=%d"), statusCode);
 
@@ -1308,7 +1310,8 @@
 	msg.bodyval = (uint32_t) param;
 	msg.bodyptr = NULL;
 
-	if ((statusCode = lim_post_msg_api(pMac, &msg)) != eSIR_SUCCESS)
+	statusCode = lim_post_msg_api(pMac, &msg);
+	if (statusCode != eSIR_SUCCESS)
 		lim_log(pMac, LOGE,
 			FL("posting to LIM failed, reason=%d"), statusCode);
 
diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h
index 40e91cf..ed6e61c 100644
--- a/core/mac/src/pe/lim/lim_types.h
+++ b/core/mac/src/pe/lim/lim_types.h
@@ -114,11 +114,11 @@
 #define LIM_MIN_MEM_ASSOC       4
 
 /* / Verifies whether given mac addr matches the CURRENT Bssid */
-#define IS_CURRENT_BSSID(pMac, addr, psessionEntry)  (cdf_mem_compare(addr, \
+#define IS_CURRENT_BSSID(pMac, addr, psessionEntry)  (!qdf_mem_cmp(addr, \
 								      psessionEntry->bssId, \
 								      sizeof(psessionEntry->bssId)))
 /* / Verifies whether given addr matches the REASSOC Bssid */
-#define IS_REASSOC_BSSID(pMac, addr, psessionEntry)  (cdf_mem_compare(addr, \
+#define IS_REASSOC_BSSID(pMac, addr, psessionEntry)  (!qdf_mem_cmp(addr, \
 								      psessionEntry->limReAssocbssId, \
 								      sizeof(psessionEntry->limReAssocbssId)))
 
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 2e71821..d259646 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -78,7 +78,7 @@
 		pCurrNode = pMac->lim.pDialogueTokenHead;
 		pMac->lim.pDialogueTokenHead =
 			pMac->lim.pDialogueTokenHead->next;
-		cdf_mem_free(pCurrNode);
+		qdf_mem_free(pCurrNode);
 		pCurrNode = NULL;
 	}
 	pMac->lim.pDialogueTokenTail = NULL;
@@ -956,7 +956,7 @@
 		mac_ctx->lim.gLimDeferredMsgQ.write = 0;
 
 	/* save the message to the queue and advanced the write pointer */
-	cdf_mem_copy((uint8_t *) &mac_ctx->lim.gLimDeferredMsgQ.
+	qdf_mem_copy((uint8_t *) &mac_ctx->lim.gLimDeferredMsgQ.
 			deferredQueue[mac_ctx->lim.gLimDeferredMsgQ.write++],
 				(uint8_t *) lim_msg, sizeof(tSirMsgQ));
 	return TX_SUCCESS;
@@ -1066,7 +1066,7 @@
 		return;
 	}
 
-	cdf_mem_set((uint8_t *) &beaconParams, sizeof(tUpdateBeaconParams), 0);
+	qdf_mem_set((uint8_t *) &beaconParams, sizeof(tUpdateBeaconParams), 0);
 	beaconParams.bssIdx = psessionEntry->bssIdx;
 
 	beaconParams.paramChangeBitmap = 0;
@@ -1212,7 +1212,7 @@
 				       LOG1);
 			       )
 
-			if (cdf_mem_compare
+			if (!qdf_mem_cmp
 				    (psessionEntry->protStaCache[i].addr,
 				    peerMacAddr, sizeof(tSirMacAddr))) {
 				PELOG1(lim_log
@@ -1236,7 +1236,7 @@
 		return;
 	}
 
-	cdf_mem_copy(psessionEntry->protStaCache[i].addr,
+	qdf_mem_copy(psessionEntry->protStaCache[i].addr,
 		     peerMacAddr, sizeof(tSirMacAddr));
 
 	psessionEntry->protStaCache[i].protStaCacheType = protStaCacheType;
@@ -1456,7 +1456,7 @@
 		if (LIM_IS_AP_ROLE(psession_entry) &&
 			(psession_entry->gLimNoShortParams.
 				staNoShortCache[i].active) &&
-			(cdf_mem_compare
+			(!qdf_mem_cmp
 				(psession_entry->gLimNoShortParams.
 				staNoShortCache[i].addr,
 				peer_mac_addr, sizeof(tSirMacAddr))))
@@ -1464,7 +1464,7 @@
 		else if (!LIM_IS_AP_ROLE(psession_entry) &&
 				(mac_ctx->lim.gLimNoShortParams.
 					staNoShortCache[i].active) &&
-			(cdf_mem_compare(mac_ctx->lim.gLimNoShortParams.
+			(!qdf_mem_cmp(mac_ctx->lim.gLimNoShortParams.
 				staNoShortCache[i].addr,
 				peer_mac_addr,
 				sizeof(tSirMacAddr))))
@@ -1503,14 +1503,14 @@
 	}
 
 	if (LIM_IS_AP_ROLE(psession_entry)) {
-		cdf_mem_copy(psession_entry->gLimNoShortParams.
+		qdf_mem_copy(psession_entry->gLimNoShortParams.
 				staNoShortCache[i].addr,
 				peer_mac_addr, sizeof(tSirMacAddr));
 		psession_entry->gLimNoShortParams.staNoShortCache[i].
 							active = true;
 		psession_entry->gLimNoShortParams.numNonShortPreambleSta++;
 	} else {
-		cdf_mem_copy(mac_ctx->lim.gLimNoShortParams.
+		qdf_mem_copy(mac_ctx->lim.gLimNoShortParams.
 					staNoShortCache[i].addr,
 				peer_mac_addr, sizeof(tSirMacAddr));
 		mac_ctx->lim.gLimNoShortParams.staNoShortCache[i].active = true;
@@ -1573,7 +1573,7 @@
 			if (LIM_IS_AP_ROLE(session_entry) &&
 				session_entry->gLimNoShortSlotParams.
 					staNoShortSlotCache[i].active) {
-				if (cdf_mem_compare(
+				if (!qdf_mem_cmp(
 					session_entry->gLimNoShortSlotParams.
 					staNoShortSlotCache[i].addr,
 					peer_mac_addr, sizeof(tSirMacAddr)))
@@ -1581,7 +1581,7 @@
 			} else if (!LIM_IS_AP_ROLE(session_entry)) {
 				if (mac_ctx->lim.gLimNoShortSlotParams.
 					staNoShortSlotCache[i].active) {
-					if (cdf_mem_compare(mac_ctx->lim.
+					if (!qdf_mem_cmp(mac_ctx->lim.
 							gLimNoShortSlotParams.
 							staNoShortSlotCache[i].
 							addr, peer_mac_addr,
@@ -1625,7 +1625,7 @@
 		}
 
 		if (LIM_IS_AP_ROLE(session_entry)) {
-			cdf_mem_copy(session_entry->gLimNoShortSlotParams.
+			qdf_mem_copy(session_entry->gLimNoShortSlotParams.
 					staNoShortSlotCache[i].addr,
 					peer_mac_addr, sizeof(tSirMacAddr));
 			session_entry->gLimNoShortSlotParams.
@@ -1633,7 +1633,7 @@
 			session_entry->gLimNoShortSlotParams.
 				numNonShortSlotSta++;
 		} else {
-			cdf_mem_copy(mac_ctx->lim.gLimNoShortSlotParams.
+			qdf_mem_copy(mac_ctx->lim.gLimNoShortSlotParams.
 					staNoShortSlotCache[i].addr,
 					peer_mac_addr, sizeof(tSirMacAddr));
 			mac_ctx->lim.gLimNoShortSlotParams.
@@ -2671,7 +2671,7 @@
 	}
 
 	mmhMsg.type = eWNI_SME_SWITCH_CHL_IND;
-	pSirSmeSwitchChInd = cdf_mem_malloc(sizeof(tSirSmeSwitchChannelInd));
+	pSirSmeSwitchChInd = qdf_mem_malloc(sizeof(tSirSmeSwitchChannelInd));
 	if (NULL == pSirSmeSwitchChInd) {
 		lim_log(pMac, LOGP,
 			FL("Failed to allocate buffer for buffer descriptor"));
@@ -2683,7 +2683,7 @@
 	pSirSmeSwitchChInd->newChannelId =
 		psessionEntry->gLimChannelSwitch.primaryChannel;
 	pSirSmeSwitchChInd->sessionId = psessionEntry->smeSessionId;
-	cdf_mem_copy(pSirSmeSwitchChInd->bssid.bytes, psessionEntry->bssId,
+	qdf_mem_copy(pSirSmeSwitchChInd->bssid.bytes, psessionEntry->bssId,
 		     QDF_MAC_ADDR_SIZE);
 	mmhMsg.bodyptr = pSirSmeSwitchChInd;
 	mmhMsg.bodyval = 0;
@@ -5139,14 +5139,14 @@
 		break;
 
 	default:
-		cdf_mem_free(msgParam);
+		qdf_mem_free(msgParam);
 		lim_log(pMac, LOGP, FL("invalid message id = %d received"),
 			msgId);
 		return eSIR_FAILURE;
 	}
 
 	if (lim_post_msg_api(pMac, &msg) != eSIR_SUCCESS) {
-		cdf_mem_free(msgParam);
+		qdf_mem_free(msgParam);
 		lim_log(pMac, LOGP, FL("lim_post_msg_api failed for msgid = %d"),
 			msg.type);
 		return eSIR_FAILURE;
@@ -5302,7 +5302,7 @@
 	tSirMsgQ msg;
 	tpHalIndCB pHalCB;
 
-	pHalCB = cdf_mem_malloc(sizeof(tHalIndCB));
+	pHalCB = qdf_mem_malloc(sizeof(tHalIndCB));
 	if (NULL == pHalCB) {
 		lim_log(pMac, LOGP, FL("AllocateMemory() failed"));
 		return;
@@ -5316,7 +5316,7 @@
 
 	MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msg.type));
 	if (eSIR_SUCCESS != wma_post_ctrl_msg(pMac, &msg)) {
-		cdf_mem_free(pHalCB);
+		qdf_mem_free(pHalCB);
 		lim_log(pMac, LOGP, FL("wma_post_ctrl_msg() failed"));
 	}
 
@@ -5351,7 +5351,7 @@
 	if (psessionEntry == NULL) {
 		lim_log(pMac, LOGE,
 			FL("session does not exist for given BssId"));
-		cdf_mem_free(limMsg->bodyptr);
+		qdf_mem_free(limMsg->bodyptr);
 		limMsg->bodyptr = NULL;
 		return;
 	}
@@ -5376,19 +5376,19 @@
 		goto error1;
 	}
 
-	pDelTsReq = cdf_mem_malloc(sizeof(tSirDeltsReq));
+	pDelTsReq = qdf_mem_malloc(sizeof(tSirDeltsReq));
 	if (NULL == pDelTsReq) {
 		PELOGE(lim_log(pMac, LOGE, FL("AllocateMemory() failed"));)
 		goto error1;
 	}
 
-	cdf_mem_set((uint8_t *) pDelTsReq, sizeof(tSirDeltsReq), 0);
+	qdf_mem_set((uint8_t *) pDelTsReq, sizeof(tSirDeltsReq), 0);
 
 	if (pSta->wmeEnabled)
-		cdf_mem_copy(&(pDelTsReq->req.tspec), &(pTspecInfo->tspec),
+		qdf_mem_copy(&(pDelTsReq->req.tspec), &(pTspecInfo->tspec),
 			     sizeof(tSirMacTspecIE));
 	else
-		cdf_mem_copy(&(pDelTsReq->req.tsinfo),
+		qdf_mem_copy(&(pDelTsReq->req.tsinfo),
 			     &(pTspecInfo->tspec.tsinfo),
 			     sizeof(tSirMacTSInfo));
 
@@ -5409,29 +5409,29 @@
 					&pDelTsReq->req.tspec, psessionEntry);
 
 	/* prepare and send an sme indication to HDD */
-	pDelTsReqInfo = cdf_mem_malloc(sizeof(tSirDeltsReqInfo));
+	pDelTsReqInfo = qdf_mem_malloc(sizeof(tSirDeltsReqInfo));
 	if (NULL == pDelTsReqInfo) {
 		PELOGE(lim_log(pMac, LOGE, FL("AllocateMemory() failed"));)
 		goto error3;
 	}
-	cdf_mem_set((uint8_t *) pDelTsReqInfo, sizeof(tSirDeltsReqInfo), 0);
+	qdf_mem_set((uint8_t *) pDelTsReqInfo, sizeof(tSirDeltsReqInfo), 0);
 
 	if (pSta->wmeEnabled)
-		cdf_mem_copy(&(pDelTsReqInfo->tspec), &(pTspecInfo->tspec),
+		qdf_mem_copy(&(pDelTsReqInfo->tspec), &(pTspecInfo->tspec),
 			     sizeof(tSirMacTspecIE));
 	else
-		cdf_mem_copy(&(pDelTsReqInfo->tsinfo),
+		qdf_mem_copy(&(pDelTsReqInfo->tsinfo),
 			     &(pTspecInfo->tspec.tsinfo),
 			     sizeof(tSirMacTSInfo));
 
 	lim_send_sme_delts_ind(pMac, pDelTsReqInfo, pDelTsReq->aid, psessionEntry);
 
 error3:
-	cdf_mem_free(pDelTsReqInfo);
+	qdf_mem_free(pDelTsReqInfo);
 error2:
-	cdf_mem_free(pDelTsReq);
+	qdf_mem_free(pDelTsReq);
 error1:
-	cdf_mem_free(limMsg->bodyptr);
+	qdf_mem_free(limMsg->bodyptr);
 	limMsg->bodyptr = NULL;
 	return;
 }
@@ -5466,7 +5466,7 @@
 	msgQ.type = WMA_SET_MIMOPS_REQ;
 
 	/* Allocate for WMA_SET_MIMOPS_REQ */
-	pMIMO_PSParams = cdf_mem_malloc(sizeof(tSetMIMOPS));
+	pMIMO_PSParams = qdf_mem_malloc(sizeof(tSetMIMOPS));
 	if (NULL == pMIMO_PSParams) {
 		lim_log(pMac, LOGP, FL(" AllocateMemory failed"));
 		return eSIR_MEM_ALLOC_FAILED;
@@ -5476,7 +5476,7 @@
 	pMIMO_PSParams->staIdx = staIdx;
 	pMIMO_PSParams->fsendRsp = true;
 	pMIMO_PSParams->sessionId = sessionId;
-	cdf_mem_copy(pMIMO_PSParams->peerMac, pPeerStaMac, sizeof(tSirMacAddr));
+	qdf_mem_copy(pMIMO_PSParams->peerMac, pPeerStaMac, sizeof(tSirMacAddr));
 
 	msgQ.bodyptr = pMIMO_PSParams;
 	msgQ.bodyval = 0;
@@ -5490,7 +5490,7 @@
 			FL
 				("Posting WMA_SET_MIMOPS_REQ to HAL failed! Reason = %d"),
 			retCode);
-		cdf_mem_free(pMIMO_PSParams);
+		qdf_mem_free(pMIMO_PSParams);
 		return retCode;
 	}
 
@@ -5536,7 +5536,7 @@
 
 void lim_resset_scan_channel_info(tpAniSirGlobal pMac)
 {
-	cdf_mem_set(&pMac->lim.scanChnInfo, sizeof(tLimScanChnInfo), 0);
+	qdf_mem_set(&pMac->lim.scanChnInfo, sizeof(tLimScanChnInfo), 0);
 }
 
 /**
@@ -5663,16 +5663,16 @@
 	 * Make it to align to 4 byte boundary  */
 	nBytes = (uint8_t) HALMSG_NUMBYTES_STATION_BITMAP(pMac->lim.maxStation);
 
-	pTxCtrlMsg = cdf_mem_malloc(sizeof(*pTxCtrlMsg) + nBytes);
+	pTxCtrlMsg = qdf_mem_malloc(sizeof(*pTxCtrlMsg) + nBytes);
 	if (NULL == pTxCtrlMsg) {
 		lim_log(pMac, LOGP, FL("AllocateMemory() failed"));
 		return;
 	}
 
-	cdf_mem_set((void *)pTxCtrlMsg, (sizeof(*pTxCtrlMsg) + nBytes), 0);
+	qdf_mem_set((void *)pTxCtrlMsg, (sizeof(*pTxCtrlMsg) + nBytes), 0);
 	status = __lim_fill_tx_control_params(pMac, pTxCtrlMsg, type, mode);
 	if (status != QDF_STATUS_SUCCESS) {
-		cdf_mem_free(pTxCtrlMsg);
+		qdf_mem_free(pTxCtrlMsg);
 		lim_log(pMac, LOGP,
 			FL("__lim_fill_tx_control_params failed, status = %d"),
 			status);
@@ -5686,7 +5686,7 @@
 
 	MTRACE(mac_trace_msg_tx(pMac, NO_SESSION, msgQ.type));
 	if (wma_post_ctrl_msg(pMac, &msgQ) != eSIR_SUCCESS) {
-		cdf_mem_free(pTxCtrlMsg);
+		qdf_mem_free(pTxCtrlMsg);
 		lim_log(pMac, LOGP, FL("Posting Message to HAL failed"));
 		return;
 	}
@@ -6030,7 +6030,7 @@
 	if (psessionEntry == NULL) {
 		lim_log(pMac, LOGP,
 			FL("Session Does not exist for given sessionID"));
-		cdf_mem_free(pAddStaParams);
+		qdf_mem_free(pAddStaParams);
 		return;
 	}
 	psessionEntry->csaOffloadEnable = pAddStaParams->csaOffloadEnable;
@@ -6200,7 +6200,7 @@
 		cds_pkt_return_packet((cds_pkt_t *) pLimMsg->bodyptr);
 		pLimMsg->bodyptr = NULL;
 	} else if (pLimMsg->bodyptr != NULL) {
-		cdf_mem_free(pLimMsg->bodyptr);
+		qdf_mem_free(pLimMsg->bodyptr);
 		pLimMsg->bodyptr = NULL;
 	}
 
@@ -6224,15 +6224,15 @@
 	tSirMacAddr nullBssid = { 0, 0, 0, 0, 0, 0 };
 	WLAN_HOST_DIAG_EVENT_DEF(peEvent, host_event_wlan_pe_payload_type);
 
-	cdf_mem_set(&peEvent, sizeof(host_event_wlan_pe_payload_type), 0);
+	qdf_mem_set(&peEvent, sizeof(host_event_wlan_pe_payload_type), 0);
 
 	if (NULL == pSessionEntry) {
-		cdf_mem_copy(peEvent.bssid, nullBssid, sizeof(tSirMacAddr));
+		qdf_mem_copy(peEvent.bssid, nullBssid, sizeof(tSirMacAddr));
 		peEvent.sme_state = (uint16_t) pMac->lim.gLimSmeState;
 		peEvent.mlm_state = (uint16_t) pMac->lim.gLimMlmState;
 
 	} else {
-		cdf_mem_copy(peEvent.bssid, pSessionEntry->bssId,
+		qdf_mem_copy(peEvent.bssid, pSessionEntry->bssId,
 			     sizeof(tSirMacAddr));
 		peEvent.sme_state = (uint16_t) pSessionEntry->limSmeState;
 		peEvent.mlm_state = (uint16_t) pSessionEntry->limMlmState;
@@ -6291,8 +6291,8 @@
 
 	ptr[length++] = SIR_MAC_EID_VENDOR;
 	ptr[length++] = ie_len + SIR_MAC_P2P_OUI_SIZE;
-	cdf_mem_copy(&ptr[length], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE);
-	cdf_mem_copy(&ptr[length + SIR_MAC_P2P_OUI_SIZE], data, ie_len);
+	qdf_mem_copy(&ptr[length], SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE);
+	qdf_mem_copy(&ptr[length + SIR_MAC_P2P_OUI_SIZE], data, ie_len);
 	return ie_len + SIR_P2P_IE_HEADER_LEN;
 }
 
@@ -6306,14 +6306,14 @@
 
 	if ((noaLen <= (SIR_MAX_NOA_ATTR_LEN + SIR_P2P_IE_HEADER_LEN)) &&
 	    (noaLen >= overFlowLen) && (overFlowLen <= SIR_MAX_NOA_ATTR_LEN)) {
-		cdf_mem_copy(overFlowP2pStream,
+		qdf_mem_copy(overFlowP2pStream,
 			     noaStream + noaLen - overFlowLen, overFlowLen);
 		noaStream[noaLen - overFlowLen] = SIR_MAC_EID_VENDOR;
 		noaStream[noaLen - overFlowLen + 1] =
 			overFlowLen + SIR_MAC_P2P_OUI_SIZE;
-		cdf_mem_copy(noaStream + noaLen - overFlowLen + 2,
+		qdf_mem_copy(noaStream + noaLen - overFlowLen + 2,
 			     SIR_MAC_P2P_OUI, SIR_MAC_P2P_OUI_SIZE);
-		cdf_mem_copy(noaStream + noaLen + 2 + SIR_MAC_P2P_OUI_SIZE -
+		qdf_mem_copy(noaStream + noaLen + 2 + SIR_MAC_P2P_OUI_SIZE -
 			     overFlowLen, overFlowP2pStream, overFlowLen);
 	}
 
@@ -6519,7 +6519,7 @@
 	tempParam.opMode = chanWidth;
 	tempParam.staId = staId;
 	tempParam.smesessionId = psessionEntry->smeSessionId;
-	cdf_mem_copy(tempParam.peer_mac, peerMac, sizeof(tSirMacAddr));
+	qdf_mem_copy(tempParam.peer_mac, peerMac, sizeof(tSirMacAddr));
 
 	lim_send_mode_update(pMac, &tempParam, psessionEntry);
 
@@ -6534,7 +6534,7 @@
 	tempParam.rxNss = rxNss;
 	tempParam.staId = staId;
 	tempParam.smesessionId = psessionEntry->smeSessionId;
-	cdf_mem_copy(tempParam.peer_mac, peerMac, sizeof(tSirMacAddr));
+	qdf_mem_copy(tempParam.peer_mac, peerMac, sizeof(tSirMacAddr));
 
 	lim_send_rx_nss_update(pMac, &tempParam, psessionEntry);
 
@@ -6552,7 +6552,7 @@
 	tempParamMembership.membership = membership;
 	tempParamMembership.staId = staId;
 	tempParamMembership.smesessionId = psessionEntry->smeSessionId;
-	cdf_mem_copy(tempParamMembership.peer_mac, psessionEntry->bssId,
+	qdf_mem_copy(tempParamMembership.peer_mac, psessionEntry->bssId,
 		     sizeof(tSirMacAddr));
 
 	lim_set_membership(pMac, &tempParamMembership, psessionEntry);
@@ -6560,7 +6560,7 @@
 	tempParamUserPosition.userPos = userPosition;
 	tempParamUserPosition.staId = staId;
 	tempParamUserPosition.smesessionId = psessionEntry->smeSessionId;
-	cdf_mem_copy(tempParamUserPosition.peer_mac, psessionEntry->bssId,
+	qdf_mem_copy(tempParamUserPosition.peer_mac, psessionEntry->bssId,
 		     sizeof(tSirMacAddr));
 
 	lim_set_user_pos(pMac, &tempParamUserPosition, psessionEntry);
@@ -6690,7 +6690,7 @@
 		p_ht_cap->lsigTXOPProtection = dot11_ht_cap.lsigTXOPProtection;
 		p_ht_cap->maxRxAMPDUFactor = dot11_ht_cap.maxRxAMPDUFactor;
 		p_ht_cap->mpduDensity = dot11_ht_cap.mpduDensity;
-		cdf_mem_copy((void *)p_ht_cap->supportedMCSSet,
+		qdf_mem_copy((void *)p_ht_cap->supportedMCSSet,
 			(void *)(dot11_ht_cap.supportedMCSSet),
 			sizeof(p_ht_cap->supportedMCSSet));
 		p_ht_cap->pco = dot11_ht_cap.pco;
@@ -6821,7 +6821,7 @@
 		/* just for fail safe, don't handle MC/BC a1 in this routine */
 		return true;
 	}
-	if (!cdf_mem_compare(a1, session->selfMacAddr, 6)) {
+	if (qdf_mem_cmp(a1, session->selfMacAddr, 6)) {
 		lim_log(mac_ctx, LOGE,
 				FL("Invalid A1 address in received frame"));
 		return false;
@@ -6842,13 +6842,13 @@
 void lim_check_and_reset_protection_params(tpAniSirGlobal mac_ctx)
 {
 	if (!pe_get_active_session_count(mac_ctx)) {
-		cdf_mem_zero(&mac_ctx->lim.gLimOverlap11gParams,
+		qdf_mem_zero(&mac_ctx->lim.gLimOverlap11gParams,
 			sizeof(mac_ctx->lim.gLimOverlap11gParams));
-		cdf_mem_zero(&mac_ctx->lim.gLimOverlap11aParams,
+		qdf_mem_zero(&mac_ctx->lim.gLimOverlap11aParams,
 			sizeof(mac_ctx->lim.gLimOverlap11aParams));
-		cdf_mem_zero(&mac_ctx->lim.gLimOverlapHt20Params,
+		qdf_mem_zero(&mac_ctx->lim.gLimOverlapHt20Params,
 			sizeof(mac_ctx->lim.gLimOverlapHt20Params));
-		cdf_mem_zero(&mac_ctx->lim.gLimOverlapNonGfParams,
+		qdf_mem_zero(&mac_ctx->lim.gLimOverlapNonGfParams,
 			sizeof(mac_ctx->lim.gLimOverlapNonGfParams));
 
 		mac_ctx->lim.gHTOperMode = eSIR_HT_OP_MODE_PURE;
@@ -6932,7 +6932,7 @@
 	}
 
 	/* Allocate memory for the WMI request, and copy the parameter */
-	vdev_ie = cdf_mem_malloc(sizeof(*vdev_ie) + num_bytes);
+	vdev_ie = qdf_mem_malloc(sizeof(*vdev_ie) + num_bytes);
 	if (!vdev_ie) {
 		lim_log(mac_ctx, LOGE, FL("Failed to allocate memory"));
 		return QDF_STATUS_E_NOMEM;
@@ -6949,7 +6949,7 @@
 		lim_log(mac_ctx, LOG1, FL("%d byte is %02x"), i+1, *temp);
 
 	vdev_ie->data = (uint8_t *)vdev_ie + sizeof(*vdev_ie);
-	cdf_mem_copy(vdev_ie->data, ext_cap_data.bytes, num_bytes);
+	qdf_mem_copy(vdev_ie->data, ext_cap_data.bytes, num_bytes);
 
 	msg.type = WMA_SET_IE_INFO;
 	msg.bodyptr = vdev_ie;
@@ -6959,7 +6959,7 @@
 		cds_mq_post_message(QDF_MODULE_ID_WMA, &msg)) {
 		lim_log(mac_ctx, LOGE,
 		       FL("Not able to post WMA_SET_IE_INFO to WDA"));
-		cdf_mem_free(vdev_ie);
+		qdf_mem_free(vdev_ie);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -6992,7 +6992,7 @@
 		return eSIR_IGNORE_IE;
 	}
 
-	tempbuf = cdf_mem_malloc(left);
+	tempbuf = qdf_mem_malloc(left);
 	if (NULL == tempbuf) {
 		lim_log(mac_ctx, LOGE, FL("Unable to allocate memory"));
 		return eSIR_MEM_ALLOC_FAILED;
@@ -7006,28 +7006,28 @@
 			lim_log(mac_ctx, LOGE,
 				FL("Invalid IEs eid = %d elem_len=%d left=%d"),
 				elem_id, elem_len, left);
-			cdf_mem_free(tempbuf);
+			qdf_mem_free(tempbuf);
 			return eSIR_FAILURE;
 		}
 		if (!(DOT11F_EID_EXTCAP == elem_id)) {
-			cdf_mem_copy(tempbuf + templen, &ptr[0], elem_len + 2);
+			qdf_mem_copy(tempbuf + templen, &ptr[0], elem_len + 2);
 			templen += (elem_len + 2);
 		} else {
 			if (NULL != extracted_ie) {
-				cdf_mem_set(extracted_ie,
+				qdf_mem_set(extracted_ie,
 					DOT11F_IE_EXTCAP_MAX_LEN + 2, 0);
 				if (elem_len <= DOT11F_IE_EXTCAP_MAX_LEN)
-					cdf_mem_copy(extracted_ie, &ptr[0],
+					qdf_mem_copy(extracted_ie, &ptr[0],
 						     elem_len + 2);
 			}
 		}
 		left -= elem_len;
 		ptr += (elem_len + 2);
 	}
-	cdf_mem_copy(addn_ie, tempbuf, templen);
+	qdf_mem_copy(addn_ie, tempbuf, templen);
 
 	*addn_ielen = templen;
-	cdf_mem_free(tempbuf);
+	qdf_mem_free(tempbuf);
 
 	return eSIR_SUCCESS;
 }
@@ -7064,8 +7064,8 @@
 		return;
 	}
 
-	cdf_mem_set((uint8_t *)&out[0], DOT11F_IE_EXTCAP_MAX_LEN, 0);
-	cdf_mem_copy(&out[0], &buf[2], DOT11F_IE_EXTCAP_MAX_LEN);
+	qdf_mem_set((uint8_t *)&out[0], DOT11F_IE_EXTCAP_MAX_LEN, 0);
+	qdf_mem_copy(&out[0], &buf[2], DOT11F_IE_EXTCAP_MAX_LEN);
 
 	if (DOT11F_PARSE_SUCCESS != dot11f_unpack_ie_ext_cap(mac_ctx, &out[0],
 					DOT11F_IE_EXTCAP_MAX_LEN, dst))
@@ -7091,7 +7091,7 @@
 	uint8_t extracted_buff[DOT11F_IE_EXTCAP_MAX_LEN + 2];
 	tSirRetStatus status;
 
-	cdf_mem_set((uint8_t *)&extracted_buff[0], DOT11F_IE_EXTCAP_MAX_LEN + 2,
+	qdf_mem_set((uint8_t *)&extracted_buff[0], DOT11F_IE_EXTCAP_MAX_LEN + 2,
 		     0);
 	status = lim_strip_extcap_ie(mac_ctx, addn_ie, addn_ielen,
 				     extracted_buff);
diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c
index 05af857..ecad9b1 100644
--- a/core/mac/src/pe/rrm/rrm_api.c
+++ b/core/mac/src/pe/rrm/rrm_api.c
@@ -156,7 +156,7 @@
 		PELOGE(lim_log(pMac, LOGE, FL("Invalid parameters"));)
 		return eSIR_FAILURE;
 	}
-	pMaxTxParams = cdf_mem_malloc(sizeof(tMaxTxPowerParams));
+	pMaxTxParams = qdf_mem_malloc(sizeof(tMaxTxPowerParams));
 	if (NULL == pMaxTxParams) {
 		lim_log(pMac, LOGP,
 			FL("Unable to allocate memory for pMaxTxParams "));
@@ -165,9 +165,9 @@
 	}
 	/* Allocated memory for pMaxTxParams...will be freed in other module */
 	pMaxTxParams->power = txPower;
-	cdf_mem_copy(pMaxTxParams->bssId.bytes, pSessionEntry->bssId,
+	qdf_mem_copy(pMaxTxParams->bssId.bytes, pSessionEntry->bssId,
 		     QDF_MAC_ADDR_SIZE);
-	cdf_mem_copy(pMaxTxParams->selfStaMacAddr.bytes,
+	qdf_mem_copy(pMaxTxParams->selfStaMacAddr.bytes,
 			pSessionEntry->selfMacAddr,
 			QDF_MAC_ADDR_SIZE);
 
@@ -187,7 +187,7 @@
 			FL
 				("Posting WMA_SET_MAX_TX_POWER_REQ to HAL failed, reason=%X"),
 			retCode);
-		cdf_mem_free(pMaxTxParams);
+		qdf_mem_free(pMaxTxParams);
 		return retCode;
 	}
 	return retCode;
@@ -239,7 +239,7 @@
 		}
 	}
 
-	cdf_mem_free(limMsgQ->bodyptr);
+	qdf_mem_free(limMsgQ->bodyptr);
 	limMsgQ->bodyptr = NULL;
 	return retCode;
 }
@@ -381,19 +381,19 @@
 		  (pNeighborRep->num_NeighborReport - 1));
 
 	/* Prepare the request to send to SME. */
-	pSmeNeighborRpt = cdf_mem_malloc(length);
+	pSmeNeighborRpt = qdf_mem_malloc(length);
 	if (NULL == pSmeNeighborRpt) {
 		PELOGE(lim_log(pMac, LOGP, FL("Unable to allocate memory"));)
 		return eSIR_MEM_ALLOC_FAILED;
 
 	}
-	cdf_mem_set(pSmeNeighborRpt, length, 0);
+	qdf_mem_set(pSmeNeighborRpt, length, 0);
 
 	/* Allocated memory for pSmeNeighborRpt...will be freed by other module */
 
 	for (i = 0; i < pNeighborRep->num_NeighborReport; i++) {
 		pSmeNeighborRpt->sNeighborBssDescription[i].length = sizeof(tSirNeighborBssDescription);        /*+ any optional ies */
-		cdf_mem_copy(pSmeNeighborRpt->sNeighborBssDescription[i].bssId,
+		qdf_mem_copy(pSmeNeighborRpt->sNeighborBssDescription[i].bssId,
 			     pNeighborRep->NeighborReport[i].bssid,
 			     sizeof(tSirMacAddr));
 		pSmeNeighborRpt->sNeighborBssDescription[i].bssidInfo.rrmInfo.
@@ -436,7 +436,7 @@
 	pSmeNeighborRpt->length = length;
 	pSmeNeighborRpt->sessionId = pSessionEntry->smeSessionId;
 	pSmeNeighborRpt->numNeighborReports = pNeighborRep->num_NeighborReport;
-	cdf_mem_copy(pSmeNeighborRpt->bssId, pSessionEntry->bssId,
+	qdf_mem_copy(pSmeNeighborRpt->bssId, pSessionEntry->bssId,
 		     sizeof(tSirMacAddr));
 
 	/* Send request to SME. */
@@ -489,12 +489,12 @@
 
 	lim_log(pMac, LOG1, FL("SSID present = %d "), pNeighborReq->noSSID);
 
-	cdf_mem_set(&NeighborReportReq, sizeof(tSirMacNeighborReportReq), 0);
+	qdf_mem_set(&NeighborReportReq, sizeof(tSirMacNeighborReportReq), 0);
 
 	NeighborReportReq.dialogToken = ++pMac->rrm.rrmPEContext.DialogToken;
 	NeighborReportReq.ssid_present = !pNeighborReq->noSSID;
 	if (NeighborReportReq.ssid_present) {
-		cdf_mem_copy(&NeighborReportReq.ssid, &pNeighborReq->ucSSID,
+		qdf_mem_copy(&NeighborReportReq.ssid, &pNeighborReq->ucSSID,
 			     sizeof(tSirMacSSid));
 		PELOGE(sir_dump_buf
 			       (pMac, SIR_LIM_MODULE_ID, LOGE,
@@ -601,7 +601,7 @@
 
 	if (pBeaconReq->measurement_request.Beacon.RequestedInfo.present) {
 		pCurrentReq->request.Beacon.reqIes.pElementIds =
-			cdf_mem_malloc(sizeof(uint8_t) *
+			qdf_mem_malloc(sizeof(uint8_t) *
 				       pBeaconReq->measurement_request.Beacon.
 				       RequestedInfo.num_requested_eids);
 		if (NULL == pCurrentReq->request.Beacon.reqIes.pElementIds) {
@@ -615,7 +615,7 @@
 		pCurrentReq->request.Beacon.reqIes.num =
 			pBeaconReq->measurement_request.Beacon.RequestedInfo.
 			num_requested_eids;
-		cdf_mem_copy(pCurrentReq->request.Beacon.reqIes.pElementIds,
+		qdf_mem_copy(pCurrentReq->request.Beacon.reqIes.pElementIds,
 			     pBeaconReq->measurement_request.Beacon.
 			     RequestedInfo.requested_eids,
 			     pCurrentReq->request.Beacon.reqIes.num);
@@ -631,7 +631,7 @@
 				APChannelReport[num_APChanReport].num_channelList;
 	}
 	/* Prepare the request to send to SME. */
-	pSmeBcnReportReq = cdf_mem_malloc(sizeof(tSirBeaconReportReqInd));
+	pSmeBcnReportReq = qdf_mem_malloc(sizeof(tSirBeaconReportReqInd));
 	if (NULL == pSmeBcnReportReq) {
 		lim_log(pMac, LOGP,
 			FL
@@ -641,10 +641,10 @@
 
 	}
 
-	cdf_mem_set(pSmeBcnReportReq, sizeof(tSirBeaconReportReqInd), 0);
+	qdf_mem_set(pSmeBcnReportReq, sizeof(tSirBeaconReportReqInd), 0);
 
 	/* Allocated memory for pSmeBcnReportReq....will be freed by other modulea */
-	cdf_mem_copy(pSmeBcnReportReq->bssId, pSessionEntry->bssId,
+	qdf_mem_copy(pSmeBcnReportReq->bssId, pSessionEntry->bssId,
 		     sizeof(tSirMacAddr));
 	pSmeBcnReportReq->messageType = eWNI_SME_BEACON_REPORT_REQ_IND;
 	pSmeBcnReportReq->length = sizeof(tSirBeaconReportReqInd);
@@ -659,14 +659,14 @@
 	pSmeBcnReportReq->measurementDuration[0] = SYS_TU_TO_MS(measDuration);
 	pSmeBcnReportReq->fMeasurementtype[0] =
 		pBeaconReq->measurement_request.Beacon.meas_mode;
-	cdf_mem_copy(pSmeBcnReportReq->macaddrBssid,
+	qdf_mem_copy(pSmeBcnReportReq->macaddrBssid,
 		     pBeaconReq->measurement_request.Beacon.BSSID,
 		     sizeof(tSirMacAddr));
 
 	if (pBeaconReq->measurement_request.Beacon.SSID.present) {
 		pSmeBcnReportReq->ssId.length =
 			pBeaconReq->measurement_request.Beacon.SSID.num_ssid;
-		cdf_mem_copy(pSmeBcnReportReq->ssId.ssId,
+		qdf_mem_copy(pSmeBcnReportReq->ssId.ssId,
 			     pBeaconReq->measurement_request.Beacon.SSID.ssid,
 			     pSmeBcnReportReq->ssId.length);
 	}
@@ -681,7 +681,7 @@
 		     num_APChanReport <
 		     pBeaconReq->measurement_request.Beacon.num_APChannelReport;
 		     num_APChanReport++) {
-			cdf_mem_copy(pChanList,
+			qdf_mem_copy(pChanList,
 				     pBeaconReq->measurement_request.Beacon.
 				     APChannelReport[num_APChanReport].
 				     channelList,
@@ -766,7 +766,7 @@
 				lim_log(pMac, LOG3, "Adding Eid %d, len=%d",
 					*pBcnIes, len);
 
-				cdf_mem_copy(pIes, pBcnIes, len);
+				qdf_mem_copy(pIes, pBcnIes, len);
 				pIes += len;
 				*pNumIes += len;
 				count++;
@@ -839,7 +839,7 @@
 			return eSIR_FAILURE;
 		}
 
-		pReport = cdf_mem_malloc(pBcnReport->numBssDesc *
+		pReport = qdf_mem_malloc(pBcnReport->numBssDesc *
 					 sizeof(tSirMacRadioMeasureReport));
 
 		if (NULL == pReport) {
@@ -850,7 +850,7 @@
 			return eSIR_MEM_ALLOC_FAILED;
 		}
 
-		cdf_mem_zero(pReport,
+		qdf_mem_zero(pReport,
 			     pBcnReport->numBssDesc *
 			     sizeof(tSirMacRadioMeasureReport));
 
@@ -879,7 +879,7 @@
 						pBcnReport->
 						pBssDescription[bssDescCnt]->
 						channelId;
-					cdf_mem_copy(pReport[bssDescCnt].report.
+					qdf_mem_copy(pReport[bssDescCnt].report.
 						     beaconReport.measStartTime,
 						     pBcnReport->
 						     pBssDescription
@@ -913,7 +913,7 @@
 						pBcnReport->
 						pBssDescription[bssDescCnt]->
 						parentTSF;
-					cdf_mem_copy(pReport[bssDescCnt].report.
+					qdf_mem_copy(pReport[bssDescCnt].report.
 						     beaconReport.bssid,
 						     pBcnReport->
 						     pBssDescription
@@ -1009,7 +1009,7 @@
 	}
 
 	if (NULL != pReport)
-		cdf_mem_free(pReport);
+		qdf_mem_free(pReport);
 
 	return status;
 }
@@ -1021,14 +1021,14 @@
 	tpSirMacRadioMeasureReport pReport = NULL;
 	tpRRMReq pCurrentReq = pMac->rrm.rrmPEContext.pCurrentReq;
 
-	pReport = cdf_mem_malloc(sizeof(tSirMacRadioMeasureReport));
+	pReport = qdf_mem_malloc(sizeof(tSirMacRadioMeasureReport));
 	if (NULL == pReport) {
 		lim_log(pMac, LOGP,
 			FL
 				("Unable to allocate memory during RRM Req processing"));
 		return;
 	}
-	cdf_mem_set(pReport, sizeof(tSirMacRadioMeasureReport), 0);
+	qdf_mem_set(pReport, sizeof(tSirMacRadioMeasureReport), 0);
 	pReport->token = pCurrentReq->token;
 	pReport->type = SIR_MAC_RRM_BEACON_TYPE;
 
@@ -1045,14 +1045,14 @@
 				       (" Beacon request processing failed no report sent with status %d "),
 			       status);
 		       );
-		cdf_mem_free(pReport);
+		qdf_mem_free(pReport);
 		return;
 	}
 
 	lim_send_radio_measure_report_action_frame(pMac, pCurrentReq->dialog_token, 1,
 						   pReport, peer, pSessionEntry);
 
-	cdf_mem_free(pReport);
+	qdf_mem_free(pReport);
 	lim_log(pMac, LOG3, FL(" Free memory for pReport"));
 	return;
 }
@@ -1091,14 +1091,14 @@
 	if (!pRRMReq->num_MeasurementRequest) {
 		/* No measurement requests.... */
 		/* */
-		pReport = cdf_mem_malloc(sizeof(tSirMacRadioMeasureReport));
+		pReport = qdf_mem_malloc(sizeof(tSirMacRadioMeasureReport));
 		if (NULL == pReport) {
 			lim_log(pMac, LOGP,
 				FL
 					("Unable to allocate memory during RRM Req processing"));
 			return eSIR_MEM_ALLOC_FAILED;
 		}
-		cdf_mem_set(pReport, sizeof(tSirMacRadioMeasureReport), 0);
+		qdf_mem_set(pReport, sizeof(tSirMacRadioMeasureReport), 0);
 		PELOGE(lim_log(pMac, LOGE,
 			       FL
 				       ("No requestIes in the measurement request, sending incapable report"));
@@ -1109,7 +1109,7 @@
 							   pRRMReq->DialogToken.token,
 							   num_report, pReport, peer,
 							   pSessionEntry);
-		cdf_mem_free(pReport);
+		qdf_mem_free(pReport);
 		return eSIR_FAILURE;
 	}
 	/* PF Fix */
@@ -1119,14 +1119,14 @@
 			pRRMReq->NumOfRepetitions.repetitions);
 
 		/* Send a report with incapable bit set. Not supporting repetitions. */
-		pReport = cdf_mem_malloc(sizeof(tSirMacRadioMeasureReport));
+		pReport = qdf_mem_malloc(sizeof(tSirMacRadioMeasureReport));
 		if (NULL == pReport) {
 			lim_log(pMac, LOGP,
 				FL
 					("Unable to allocate memory during RRM Req processing"));
 			return eSIR_MEM_ALLOC_FAILED;
 		}
-		cdf_mem_set(pReport, sizeof(tSirMacRadioMeasureReport), 0);
+		qdf_mem_set(pReport, sizeof(tSirMacRadioMeasureReport), 0);
 		PELOGE(lim_log(pMac, LOGE, FL(" Allocated memory for pReport"));)
 		pReport->incapable = 1;
 		pReport->type = pRRMReq->MeasurementRequest[0].measurement_type;
@@ -1142,7 +1142,7 @@
 			if (pCurrentReq) {
 				if (pReport == NULL) {  /* Allocate memory to send reports for any subsequent requests. */
 					pReport =
-						cdf_mem_malloc(sizeof
+						qdf_mem_malloc(sizeof
 							       (tSirMacRadioMeasureReport)
 							       *
 							       (pRRMReq->
@@ -1154,7 +1154,7 @@
 								("Unable to allocate memory during RRM Req processing"));
 						return eSIR_MEM_ALLOC_FAILED;
 					}
-					cdf_mem_set(pReport,
+					qdf_mem_set(pReport,
 						    sizeof
 						    (tSirMacRadioMeasureReport)
 						    *
@@ -1177,17 +1177,17 @@
 				continue;
 			} else {
 				pCurrentReq =
-					cdf_mem_malloc(sizeof(*pCurrentReq));
+					qdf_mem_malloc(sizeof(*pCurrentReq));
 				if (NULL == pCurrentReq) {
 					lim_log(pMac, LOGP,
 						FL
 							("Unable to allocate memory during RRM Req processing"));
-					cdf_mem_free(pReport);
+					qdf_mem_free(pReport);
 					return eSIR_MEM_ALLOC_FAILED;
 				}
 				lim_log(pMac, LOG3,
 					FL(" Processing Beacon Report request"));
-				cdf_mem_set(pCurrentReq, sizeof(*pCurrentReq),
+				qdf_mem_set(pCurrentReq, sizeof(*pCurrentReq),
 					    0);
 				pCurrentReq->dialog_token =
 					pRRMReq->DialogToken.token;
@@ -1223,7 +1223,7 @@
 			/* Send a report with incapabale bit set. */
 			if (pReport == NULL) { /* Allocate memory to send reports for any subsequent requests. */
 				pReport =
-					cdf_mem_malloc(sizeof
+					qdf_mem_malloc(sizeof
 						       (tSirMacRadioMeasureReport)
 						       *
 						       (pRRMReq->
@@ -1235,7 +1235,7 @@
 							("Unable to allocate memory during RRM Req processing"));
 					return eSIR_MEM_ALLOC_FAILED;
 				}
-				cdf_mem_set(pReport,
+				qdf_mem_set(pReport,
 					    sizeof(tSirMacRadioMeasureReport)
 					    * (pRRMReq->num_MeasurementRequest -
 					       i), 0);
@@ -1261,7 +1261,7 @@
 							   num_report, pReport, peer,
 							   pSessionEntry);
 
-		cdf_mem_free(pReport);
+		qdf_mem_free(pReport);
 		lim_log(pMac, LOG3, FL(" Free memory for pReport"));
 	}
 	return status;
@@ -1358,7 +1358,7 @@
 
 	pMac->rrm.rrmPEContext.rrmEnable = 0;
 
-	cdf_mem_set(pRRMCaps, sizeof(tRRMCaps), 0);
+	qdf_mem_set(pRRMCaps, sizeof(tRRMCaps), 0);
 	pRRMCaps->LinkMeasurement = 1;
 	pRRMCaps->NeighborRpt = 1;
 	pRRMCaps->BeaconPassive = 1;
@@ -1397,12 +1397,12 @@
 	if (pMac->rrm.rrmPEContext.pCurrentReq) {
 		if (pMac->rrm.rrmPEContext.pCurrentReq->request.Beacon.reqIes.
 		    pElementIds) {
-			cdf_mem_free(pMac->rrm.rrmPEContext.pCurrentReq->
+			qdf_mem_free(pMac->rrm.rrmPEContext.pCurrentReq->
 				     request.Beacon.reqIes.pElementIds);
 			lim_log(pMac, LOG4, FL(" Free memory for pElementIds"));
 		}
 
-		cdf_mem_free(pMac->rrm.rrmPEContext.pCurrentReq);
+		qdf_mem_free(pMac->rrm.rrmPEContext.pCurrentReq);
 		lim_log(pMac, LOG4, FL(" Free memory for pCurrentReq"));
 	}
 
@@ -1454,7 +1454,7 @@
 			       tpSirSmeJoinReq join_req)
 {
 	mac_ctx->rrm.rrmPEContext.rrmEnable = join_req->rrm_config.rrm_enabled;
-	cdf_mem_copy(&mac_ctx->rrm.rrmPEContext.rrmEnabledCaps,
+	qdf_mem_copy(&mac_ctx->rrm.rrmPEContext.rrmEnabledCaps,
 		     &join_req->rrm_config.rm_capability,
 		     RMENABLEDCAP_MAX_LEN);
 
diff --git a/core/mac/src/pe/sch/sch_api.c b/core/mac/src/pe/sch/sch_api.c
index 5a6744d..48d6560 100644
--- a/core/mac/src/pe/sch/sch_api.c
+++ b/core/mac/src/pe/sch/sch_api.c
@@ -245,7 +245,7 @@
 			("Indicating HAL to copy the beacon template [%d bytes] to memory"),
 		size);
 
-	beaconParams = cdf_mem_malloc(sizeof(tSendbeaconParams));
+	beaconParams = qdf_mem_malloc(sizeof(tSendbeaconParams));
 	if (NULL == beaconParams)
 		return eSIR_MEM_ALLOC_FAILED;
 
@@ -255,7 +255,7 @@
 	msgQ.reserved = 0;
 
 	/* Fill in tSendbeaconParams members */
-	cdf_mem_copy(beaconParams->bssId, psessionEntry->bssId,
+	qdf_mem_copy(beaconParams->bssId, psessionEntry->bssId,
 		     sizeof(psessionEntry->bssId));
 
 	if (LIM_IS_IBSS_ROLE(psessionEntry)) {
@@ -271,7 +271,7 @@
 		sch_log(pMac, LOGE, FL("Invalid p2pIeOffset:[%d]"),
 			pMac->sch.schObject.p2pIeOffset);
 		QDF_ASSERT(0);
-		cdf_mem_free(beaconParams);
+		qdf_mem_free(beaconParams);
 		return eSIR_FAILURE;
 	}
 	beaconParams->p2pIeOffset = pMac->sch.schObject.p2pIeOffset;
@@ -288,15 +288,15 @@
 
 	/* free previous copy of the beacon */
 	if (psessionEntry->beacon) {
-		cdf_mem_free(psessionEntry->beacon);
+		qdf_mem_free(psessionEntry->beacon);
 	}
 
 	psessionEntry->bcnLen = 0;
 	psessionEntry->beacon = NULL;
 
-	psessionEntry->beacon = cdf_mem_malloc(size);
+	psessionEntry->beacon = qdf_mem_malloc(size);
 	if (psessionEntry->beacon != NULL) {
-		cdf_mem_copy(psessionEntry->beacon, beaconPayload, size);
+		qdf_mem_copy(psessionEntry->beacon, beaconPayload, size);
 		psessionEntry->bcnLen = size;
 	}
 
@@ -341,7 +341,7 @@
 	uint32_t offset = 0;
 	uint8_t eid = 0xDD;
 
-	cdf_mem_copy(addIeWoP2pIe, ptr, left);
+	qdf_mem_copy(addIeWoP2pIe, ptr, left);
 	*addnIELenWoP2pIe = left;
 
 	if (addIeWoP2pIe != NULL) {
@@ -354,11 +354,11 @@
 				return eSIR_FAILURE;
 			}
 			if ((elem_id == eid) &&
-				(cdf_mem_compare(&ptr[2],
+				(!qdf_mem_cmp(&ptr[2],
 					"\x50\x6f\x9a\x09", 4))) {
 				left -= elem_len;
 				ptr += (elem_len + 2);
-				cdf_mem_copy(&addIeWoP2pIe[offset], ptr, left);
+				qdf_mem_copy(&addIeWoP2pIe[offset], ptr, left);
 				*addnIELenWoP2pIe -= (2 + elem_len);
 			} else {
 				left -= elem_len;
@@ -418,7 +418,7 @@
 		* by the FW, may also have P2P IE which will fail
 		* P2P cert case 6.1.3
 		*/
-		addIeWoP2pIe = cdf_mem_malloc(psessionEntry->addIeParams.
+		addIeWoP2pIe = qdf_mem_malloc(psessionEntry->addIeParams.
 						probeRespDataLen);
 		if (NULL == addIeWoP2pIe) {
 			sch_log(pMac, LOGE,
@@ -429,19 +429,19 @@
 		retStatus = lim_remove_p2p_ie_from_add_ie(pMac, psessionEntry,
 					addIeWoP2pIe, &addnIELenWoP2pIe);
 		if (retStatus != eSIR_SUCCESS) {
-			cdf_mem_free(addIeWoP2pIe);
+			qdf_mem_free(addIeWoP2pIe);
 			return eSIR_FAILURE;
 		}
 
 		/* Probe rsp IE available */
 		/*need to check the data length */
 		addIE =
-			cdf_mem_malloc(addnIELenWoP2pIe);
+			qdf_mem_malloc(addnIELenWoP2pIe);
 		if (NULL == addIE) {
 			sch_log(pMac, LOGE,
 				FL
 					("Unable to get WNI_CFG_PROBE_RSP_ADDNIE_DATA1 length"));
-			cdf_mem_free(addIeWoP2pIe);
+			qdf_mem_free(addIeWoP2pIe);
 			return eSIR_MEM_ALLOC_FAILED;
 		}
 		addnIELen = addnIELenWoP2pIe;
@@ -449,11 +449,11 @@
 		if (addnIELen <= WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN && addnIELen
 		    && (nBytes + addnIELen) <= SIR_MAX_PACKET_SIZE) {
 
-			cdf_mem_copy(addIE,
+			qdf_mem_copy(addIE,
 				     addIeWoP2pIe,
 				     addnIELenWoP2pIe);
 		}
-		cdf_mem_free(addIeWoP2pIe);
+		qdf_mem_free(addIeWoP2pIe);
 	}
 
 	if (addnIEPresent) {
@@ -463,7 +463,7 @@
 			addnIEPresent = false;  /* Dont include the IE. */
 	}
 	/* Paranoia: */
-	cdf_mem_set(pFrame2Hal, nBytes, 0);
+	qdf_mem_set(pFrame2Hal, nBytes, 0);
 
 	/* Next, we fill out the buffer descriptor: */
 	lim_populate_mac_header(pMac, pFrame2Hal, SIR_MAC_MGMT_FRAME,
@@ -486,7 +486,7 @@
 			FL("Failed to pack a Probe Response (0x%08x)."),
 			nStatus);
 
-		cdf_mem_free(addIE);
+		qdf_mem_free(addIE);
 		return retCode; /* allocated! */
 	} else if (DOT11F_WARNED(nStatus)) {
 		sch_log(pMac, LOGE, FL("There were warnings while packing a P"
@@ -494,14 +494,14 @@
 	}
 
 	if (addnIEPresent) {
-		cdf_mem_copy(&pFrame2Hal[nBytes - addnIELen],
+		qdf_mem_copy(&pFrame2Hal[nBytes - addnIELen],
 			     &addIE[0], addnIELen);
 	}
 
 	/* free the allocated Memory */
-	cdf_mem_free(addIE);
+	qdf_mem_free(addIE);
 
-	pprobeRespParams = cdf_mem_malloc(sizeof(tSendProbeRespParams));
+	pprobeRespParams = qdf_mem_malloc(sizeof(tSendProbeRespParams));
 	if (NULL == pprobeRespParams) {
 		sch_log(pMac, LOGE,
 			FL
@@ -511,7 +511,7 @@
 		sir_copy_mac_addr(pprobeRespParams->bssId, psessionEntry->bssId);
 		pprobeRespParams->pProbeRespTemplate = pFrame2Hal;
 		pprobeRespParams->probeRespTemplateLen = nBytes;
-		cdf_mem_copy(pprobeRespParams->ucProxyProbeReqValidIEBmap,
+		qdf_mem_copy(pprobeRespParams->ucProxyProbeReqValidIEBmap,
 			     IeBitmap, (sizeof(uint32_t) * 8));
 		msgQ.type = WMA_SEND_PROBE_RSP_TMPL;
 		msgQ.reserved = 0;
@@ -525,7 +525,7 @@
 				FL
 					("lim_send_probe_rsp_template_to_hal: FAIL bytes %d retcode[%X]"),
 				nBytes, retCode);
-			cdf_mem_free(pprobeRespParams);
+			qdf_mem_free(pprobeRespParams);
 		} else {
 			sch_log(pMac, LOG1,
 				FL
@@ -557,7 +557,7 @@
 		{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
 	};
 
-	cdf_mem_zero((uint8_t *)&frame, sizeof(tDot11fTimingAdvertisementFrame));
+	qdf_mem_zero((uint8_t *)&frame, sizeof(tDot11fTimingAdvertisementFrame));
 
 	/* Populate the TA fields */
 	status = populate_dot11f_timing_advert_frame(mac_ctx, &frame);
@@ -578,12 +578,12 @@
 	}
 
 	buf_size = sizeof(tSirMacMgmtHdr) + payload_size;
-	*buf = cdf_mem_malloc(buf_size);
+	*buf = qdf_mem_malloc(buf_size);
 	if (*buf == NULL) {
 		sch_log(mac_ctx, LOGE, FL("Cannot allocate memory"));
 		return eSIR_FAILURE;
 	}
-	cdf_mem_zero(*buf, buf_size);
+	qdf_mem_zero(*buf, buf_size);
 
 	payload_size = 0;
 	status = dot11f_pack_timing_advertisement_frame(mac_ctx, &frame,
@@ -623,6 +623,6 @@
 
 fail:
 	if (*buf)
-		cdf_mem_free(*buf);
+		qdf_mem_free(*buf);
 	return status;
 }
diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c
index 28d1941..efb73f4 100644
--- a/core/mac/src/pe/sch/sch_beacon_gen.c
+++ b/core/mac/src/pe/sch/sch_beacon_gen.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -73,7 +73,7 @@
 	/* Calculate the P2P IE Offset */
 	do {
 		if (*pExtraIe == 0xDD) {
-			if (cdf_mem_compare
+			if (!qdf_mem_cmp
 				    ((void *)(pExtraIe + 2), &p2p_oui, sizeof(p2p_oui))) {
 				status = eSIR_SUCCESS;
 				break;
@@ -117,7 +117,7 @@
 	    ((len + *num_bytes) <= max_bcn_size)))
 		return status;
 
-	cdf_mem_copy(&add_ie[0], session->addIeParams.probeRespBCNData_buff,
+	qdf_mem_copy(&add_ie[0], session->addIeParams.probeRespBCNData_buff,
 		     len);
 
 	p2p_ie = limGetP2pIEPtr(mac_ctx, &add_ie[0], len);
@@ -127,7 +127,7 @@
 		if (noa_len) {
 			if ((noa_len + len) <=
 			    WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA_LEN) {
-				cdf_mem_copy(&add_ie[len], noa_strm, noa_len);
+				qdf_mem_copy(&add_ie[len], noa_strm, noa_len);
 				len += noa_len;
 				p2p_ie[1] += noa_len;
 			} else {
@@ -137,7 +137,7 @@
 		}
 	}
 	if (len <= WNI_CFG_PROBE_RSP_BCN_ADDNIE_DATA_LEN) {
-		cdf_mem_copy(frm, &add_ie[0], len);
+		qdf_mem_copy(frm, &add_ie[0], len);
 		*num_bytes = *num_bytes + len;
 	} else {
 		sch_log(mac_ctx, LOGW,
@@ -177,24 +177,24 @@
 	tSirRetStatus status = eSIR_SUCCESS;
 	bool is_vht_enabled = false;
 
-	bcn_1 = cdf_mem_malloc(sizeof(tDot11fBeacon1));
+	bcn_1 = qdf_mem_malloc(sizeof(tDot11fBeacon1));
 	if (NULL == bcn_1) {
 		sch_log(mac_ctx, LOGE, FL("Failed to allocate memory"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	bcn_2 = cdf_mem_malloc(sizeof(tDot11fBeacon2));
+	bcn_2 = qdf_mem_malloc(sizeof(tDot11fBeacon2));
 	if (NULL == bcn_2) {
 		sch_log(mac_ctx, LOGE, FL("Failed to allocate memory"));
-		cdf_mem_free(bcn_1);
+		qdf_mem_free(bcn_1);
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	wsc_prb_res = cdf_mem_malloc(sizeof(tDot11fIEWscProbeRes));
+	wsc_prb_res = qdf_mem_malloc(sizeof(tDot11fIEWscProbeRes));
 	if (NULL == wsc_prb_res) {
 		sch_log(mac_ctx, LOGE, FL("Failed to allocate memory"));
-		cdf_mem_free(bcn_1);
-		cdf_mem_free(bcn_2);
+		qdf_mem_free(bcn_1);
+		qdf_mem_free(bcn_2);
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
@@ -204,7 +204,7 @@
 	 * First set the fixed fields:
 	 * set the TFP headers, set the mac header
 	 */
-	cdf_mem_set((uint8_t *) &bcn_struct->macHdr, sizeof(tSirMacMgmtHdr), 0);
+	qdf_mem_set((uint8_t *) &bcn_struct->macHdr, sizeof(tSirMacMgmtHdr), 0);
 	mac = (tpSirMacMgmtHdr) &bcn_struct->macHdr;
 	mac->fc.type = SIR_MAC_MGMT_FRAME;
 	mac->fc.subType = SIR_MAC_MGMT_BEACON;
@@ -212,15 +212,15 @@
 	for (i = 0; i < 6; i++)
 		mac->da[i] = 0xff;
 
-	cdf_mem_copy(mac->sa, session->selfMacAddr,
+	qdf_mem_copy(mac->sa, session->selfMacAddr,
 		     sizeof(session->selfMacAddr));
-	cdf_mem_copy(mac->bssId, session->bssId, sizeof(session->bssId));
+	qdf_mem_copy(mac->bssId, session->bssId, sizeof(session->bssId));
 
 	mac->fc.fromDS = 0;
 	mac->fc.toDS = 0;
 
 	/* Now set the beacon body */
-	cdf_mem_set((uint8_t *) bcn_1, sizeof(tDot11fBeacon1), 0);
+	qdf_mem_set((uint8_t *) bcn_1, sizeof(tDot11fBeacon1), 0);
 
 	/* Skip over the timestamp (it'll be updated later). */
 	bcn_1->BeaconInterval.interval =
@@ -247,11 +247,11 @@
 
 	if (LIM_IS_AP_ROLE(session)) {
 		/* Initialize the default IE bitmap to zero */
-		cdf_mem_set((uint8_t *) &(session->DefProbeRspIeBitmap),
+		qdf_mem_set((uint8_t *) &(session->DefProbeRspIeBitmap),
 			    (sizeof(uint32_t) * 8), 0);
 
 		/* Initialize the default IE bitmap to zero */
-		cdf_mem_set((uint8_t *) &(session->probeRespFrame),
+		qdf_mem_set((uint8_t *) &(session->probeRespFrame),
 			    sizeof(session->probeRespFrame), 0);
 
 		/*
@@ -270,9 +270,9 @@
 		sch_log(mac_ctx, LOGE,
 			FL("Failed to packed a tDot11fBeacon1 (0x%08x.)."),
 			n_status);
-		cdf_mem_free(bcn_1);
-		cdf_mem_free(bcn_2);
-		cdf_mem_free(wsc_prb_res);
+		qdf_mem_free(bcn_1);
+		qdf_mem_free(bcn_2);
+		qdf_mem_free(wsc_prb_res);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(n_status)) {
 		sch_log(mac_ctx, LOGE,
@@ -280,7 +280,7 @@
 			n_status);
 	}
 	/*changed  to correct beacon corruption */
-	cdf_mem_set((uint8_t *) bcn_2, sizeof(tDot11fBeacon2), 0);
+	qdf_mem_set((uint8_t *) bcn_2, sizeof(tDot11fBeacon2), 0);
 	session->schBeaconOffsetBegin = offset + (uint16_t) n_bytes;
 	sch_log(mac_ctx, LOG1, FL("Initialized beacon begin, offset %d"),
 		offset);
@@ -443,7 +443,7 @@
 				set_probe_rsp_ie_bitmap(
 					&session->DefProbeRspIeBitmap[0],
 					SIR_MAC_WPA_EID);
-				cdf_mem_copy((void *)
+				qdf_mem_copy((void *)
 					&session->probeRespFrame.WscProbeRes,
 					(void *)wsc_prb_res,
 					sizeof(tDot11fIEWscProbeRes));
@@ -459,9 +459,9 @@
 		sch_log(mac_ctx, LOGE,
 			FL("Failed to packed a tDot11fBeacon2 (0x%08x.)."),
 			n_status);
-		cdf_mem_free(bcn_1);
-		cdf_mem_free(bcn_2);
-		cdf_mem_free(wsc_prb_res);
+		qdf_mem_free(bcn_1);
+		qdf_mem_free(bcn_2);
+		qdf_mem_free(wsc_prb_res);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(n_status)) {
 		sch_log(mac_ctx, LOGE,
@@ -490,9 +490,9 @@
 	sch_log(mac_ctx, LOG1, FL("Initialized beacon end, offset %d"),
 		session->schBeaconOffsetEnd);
 	mac_ctx->sch.schObject.fBeaconChanged = 1;
-	cdf_mem_free(bcn_1);
-	cdf_mem_free(bcn_2);
-	cdf_mem_free(wsc_prb_res);
+	qdf_mem_free(bcn_1);
+	qdf_mem_free(bcn_2);
+	qdf_mem_free(wsc_prb_res);
 	return eSIR_SUCCESS;
 }
 
@@ -510,7 +510,7 @@
 	DefProbeRspIeBitmap = &psessionEntry->DefProbeRspIeBitmap[0];
 	prb_rsp = &psessionEntry->probeRespFrame;
 	prb_rsp->BeaconInterval = beacon1->BeaconInterval;
-	cdf_mem_copy((void *)&prb_rsp->Capabilities,
+	qdf_mem_copy((void *)&prb_rsp->Capabilities,
 		     (void *)&beacon1->Capabilities,
 		     sizeof(beacon1->Capabilities));
 
@@ -523,7 +523,7 @@
 	/* supported rates */
 	if (beacon1->SuppRates.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_RATESET_EID);
-		cdf_mem_copy((void *)&prb_rsp->SuppRates,
+		qdf_mem_copy((void *)&prb_rsp->SuppRates,
 			     (void *)&beacon1->SuppRates,
 			     sizeof(beacon1->SuppRates));
 
@@ -532,7 +532,7 @@
 	if (beacon1->DSParams.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_DS_PARAM_SET_EID);
-		cdf_mem_copy((void *)&prb_rsp->DSParams,
+		qdf_mem_copy((void *)&prb_rsp->DSParams,
 			     (void *)&beacon1->DSParams,
 			     sizeof(beacon1->DSParams));
 
@@ -551,7 +551,7 @@
 	/* country */
 	if (beacon2->Country.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_COUNTRY_EID);
-		cdf_mem_copy((void *)&prb_rsp->Country,
+		qdf_mem_copy((void *)&prb_rsp->Country,
 			     (void *)&beacon2->Country,
 			     sizeof(beacon2->Country));
 
@@ -560,7 +560,7 @@
 	if (beacon2->PowerConstraints.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_PWR_CONSTRAINT_EID);
-		cdf_mem_copy((void *)&prb_rsp->PowerConstraints,
+		qdf_mem_copy((void *)&prb_rsp->PowerConstraints,
 			     (void *)&beacon2->PowerConstraints,
 			     sizeof(beacon2->PowerConstraints));
 
@@ -569,7 +569,7 @@
 	if (beacon2->ChanSwitchAnn.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_CHNL_SWITCH_ANN_EID);
-		cdf_mem_copy((void *)&prb_rsp->ChanSwitchAnn,
+		qdf_mem_copy((void *)&prb_rsp->ChanSwitchAnn,
 			     (void *)&beacon2->ChanSwitchAnn,
 			     sizeof(beacon2->ChanSwitchAnn));
 
@@ -579,7 +579,7 @@
 	if (beacon2->ext_chan_switch_ann.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 			SIR_MAC_CHNL_EXTENDED_SWITCH_ANN_EID);
-		cdf_mem_copy((void *)&prb_rsp->ext_chan_switch_ann,
+		qdf_mem_copy((void *)&prb_rsp->ext_chan_switch_ann,
 			(void *)&beacon2->ext_chan_switch_ann,
 			sizeof(beacon2->ext_chan_switch_ann));
 	}
@@ -588,7 +588,7 @@
 	if (beacon2->SuppOperatingClasses.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_OPERATING_CLASS_EID);
-		cdf_mem_copy((void *)&prb_rsp->SuppOperatingClasses,
+		qdf_mem_copy((void *)&prb_rsp->SuppOperatingClasses,
 				(void *)&beacon2->SuppOperatingClasses,
 				sizeof(beacon2->SuppOperatingClasses));
 	}
@@ -597,7 +597,7 @@
 	if (beacon2->QComVendorIE.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_QCOM_VENDOR_EID);
-		cdf_mem_copy((void *)&prb_rsp->QComVendorIE,
+		qdf_mem_copy((void *)&prb_rsp->QComVendorIE,
 			     (void *)&beacon2->QComVendorIE,
 			     sizeof(beacon2->QComVendorIE));
 	}
@@ -606,7 +606,7 @@
 	/* ERP information */
 	if (beacon2->ERPInfo.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_ERP_INFO_EID);
-		cdf_mem_copy((void *)&prb_rsp->ERPInfo,
+		qdf_mem_copy((void *)&prb_rsp->ERPInfo,
 			     (void *)&beacon2->ERPInfo,
 			     sizeof(beacon2->ERPInfo));
 
@@ -615,7 +615,7 @@
 	if (beacon2->ExtSuppRates.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_EXTENDED_RATE_EID);
-		cdf_mem_copy((void *)&prb_rsp->ExtSuppRates,
+		qdf_mem_copy((void *)&prb_rsp->ExtSuppRates,
 			     (void *)&beacon2->ExtSuppRates,
 			     sizeof(beacon2->ExtSuppRates));
 
@@ -624,7 +624,7 @@
 	/* WPA */
 	if (beacon2->WPA.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_WPA_EID);
-		cdf_mem_copy((void *)&prb_rsp->WPA, (void *)&beacon2->WPA,
+		qdf_mem_copy((void *)&prb_rsp->WPA, (void *)&beacon2->WPA,
 			     sizeof(beacon2->WPA));
 
 	}
@@ -632,7 +632,7 @@
 	/* RSN */
 	if (beacon2->RSNOpaque.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_RSN_EID);
-		cdf_mem_copy((void *)&prb_rsp->RSNOpaque,
+		qdf_mem_copy((void *)&prb_rsp->RSNOpaque,
 			     (void *)&beacon2->RSNOpaque,
 			     sizeof(beacon2->RSNOpaque));
 	}
@@ -641,7 +641,7 @@
 	if (beacon2->EDCAParamSet.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_EDCA_PARAM_SET_EID);
-		cdf_mem_copy((void *)&prb_rsp->EDCAParamSet,
+		qdf_mem_copy((void *)&prb_rsp->EDCAParamSet,
 			     (void *)&beacon2->EDCAParamSet,
 			     sizeof(beacon2->EDCAParamSet));
 
@@ -652,34 +652,34 @@
 	if (beacon2->HTCaps.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_HT_CAPABILITIES_EID);
-		cdf_mem_copy((void *)&prb_rsp->HTCaps, (void *)&beacon2->HTCaps,
+		qdf_mem_copy((void *)&prb_rsp->HTCaps, (void *)&beacon2->HTCaps,
 			     sizeof(beacon2->HTCaps));
 	}
 	/* HT Info IE */
 	if (beacon2->HTInfo.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_HT_INFO_EID);
-		cdf_mem_copy((void *)&prb_rsp->HTInfo, (void *)&beacon2->HTInfo,
+		qdf_mem_copy((void *)&prb_rsp->HTInfo, (void *)&beacon2->HTInfo,
 			     sizeof(beacon2->HTInfo));
 	}
 #ifdef WLAN_FEATURE_11AC
 	if (beacon2->VHTCaps.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_VHT_CAPABILITIES_EID);
-		cdf_mem_copy((void *)&prb_rsp->VHTCaps,
+		qdf_mem_copy((void *)&prb_rsp->VHTCaps,
 			     (void *)&beacon2->VHTCaps,
 			     sizeof(beacon2->VHTCaps));
 	}
 	if (beacon2->VHTOperation.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_VHT_OPERATION_EID);
-		cdf_mem_copy((void *)&prb_rsp->VHTOperation,
+		qdf_mem_copy((void *)&prb_rsp->VHTOperation,
 			     (void *)&beacon2->VHTOperation,
 			     sizeof(beacon2->VHTOperation));
 	}
 	if (beacon2->VHTExtBssLoad.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap,
 					SIR_MAC_VHT_EXT_BSS_LOAD_EID);
-		cdf_mem_copy((void *)&prb_rsp->VHTExtBssLoad,
+		qdf_mem_copy((void *)&prb_rsp->VHTExtBssLoad,
 			     (void *)&beacon2->VHTExtBssLoad,
 			     sizeof(beacon2->VHTExtBssLoad));
 	}
@@ -688,14 +688,14 @@
 	/* WMM IE */
 	if (beacon2->WMMParams.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_WPA_EID);
-		cdf_mem_copy((void *)&prb_rsp->WMMParams,
+		qdf_mem_copy((void *)&prb_rsp->WMMParams,
 			     (void *)&beacon2->WMMParams,
 			     sizeof(beacon2->WMMParams));
 	}
 	/* WMM capability - most of the case won't be present */
 	if (beacon2->WMMCaps.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, SIR_MAC_WPA_EID);
-		cdf_mem_copy((void *)&prb_rsp->WMMCaps,
+		qdf_mem_copy((void *)&prb_rsp->WMMCaps,
 			     (void *)&beacon2->WMMCaps,
 			     sizeof(beacon2->WMMCaps));
 	}
@@ -703,7 +703,7 @@
 	/* Extended Capability */
 	if (beacon2->ExtCap.present) {
 		set_probe_rsp_ie_bitmap(DefProbeRspIeBitmap, DOT11F_EID_EXTCAP);
-		cdf_mem_copy((void *)&prb_rsp->ExtCap,
+		qdf_mem_copy((void *)&prb_rsp->ExtCap,
 			     (void *)&beacon2->ExtCap,
 			     sizeof(beacon2->ExtCap));
 	}
@@ -878,8 +878,8 @@
 	tpPESession psessionEntry;
 	uint8_t sessionId;
 
-	if ((psessionEntry =
-		     pe_find_session_by_bssid(pMac, pMsg->bssId, &sessionId)) == NULL) {
+	psessionEntry = pe_find_session_by_bssid(pMac, pMsg->bssId, &sessionId);
+	if (psessionEntry == NULL) {
 		PELOGE(sch_log(pMac, LOGE, FL("session lookup fails"));)
 		goto end;
 	}
@@ -945,6 +945,6 @@
 	}
 
 end:
-		cdf_mem_free(pMsg);
+		qdf_mem_free(pMsg);
 
 	}
diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c
index 10809e6..a8b8ed8 100644
--- a/core/mac/src/pe/sch/sch_beacon_process.c
+++ b/core/mac/src/pe/sch/sch_beacon_process.c
@@ -392,7 +392,7 @@
 		return false;
 
 	beaconParams->bssIdx = *bssIdx;
-	cdf_mem_copy((uint8_t *) &session->lastBeaconTimeStamp,
+	qdf_mem_copy((uint8_t *) &session->lastBeaconTimeStamp,
 			(uint8_t *) bcn->timeStamp, sizeof(uint64_t));
 	session->lastBeaconDtimCount = bcn->tim.dtimCount;
 	session->lastBeaconDtimPeriod = bcn->tim.dtimPeriod;
@@ -727,7 +727,7 @@
 #if defined FEATURE_WLAN_ESE || defined WLAN_FEATURE_VOWIFI
 	int8_t regMax = 0, maxTxPower = 0;
 #endif
-	cdf_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams));
+	qdf_mem_zero(&beaconParams, sizeof(tUpdateBeaconParams));
 	beaconParams.paramChangeBitmap = 0;
 
 	if (LIM_IS_IBSS_ROLE(session)) {
@@ -863,7 +863,7 @@
 	tpPESession ap_session = NULL;
 	uint8_t i;
 
-	cdf_mem_zero(&bcn_prm, sizeof(tUpdateBeaconParams));
+	qdf_mem_zero(&bcn_prm, sizeof(tUpdateBeaconParams));
 	bcn_prm.paramChangeBitmap = 0;
 	mac_ctx->sch.gSchBcnRcvCnt++;
 	/* Convert the beacon frame into a structure */
diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c
index 059dbcd..aab767f 100644
--- a/core/mac/src/sys/common/src/wlan_qct_sys.c
+++ b/core/mac/src/sys/common/src/wlan_qct_sys.c
@@ -212,7 +212,7 @@
 				QDF_TRACE(QDF_MODULE_ID_SYS,
 						QDF_TRACE_LEVEL_ERROR,
 						FL("Invalid hal"));
-				cdf_mem_free(pMsg->bodyptr);
+				qdf_mem_free(pMsg->bodyptr);
 				break;
 			}
 			mac_ctx = PMAC_STRUCT(hHal);
@@ -220,19 +220,19 @@
 				QDF_TRACE(QDF_MODULE_ID_SYS,
 						QDF_TRACE_LEVEL_ERROR,
 						FL("Invalid mac context"));
-				cdf_mem_free(pMsg->bodyptr);
+				qdf_mem_free(pMsg->bodyptr);
 				break;
 			}
 			if (NULL == mac_ctx->ftm_msg_processor_callback) {
 				QDF_TRACE(QDF_MODULE_ID_SYS,
 						QDF_TRACE_LEVEL_ERROR,
 						FL("callback pointer is NULL"));
-				cdf_mem_free(pMsg->bodyptr);
+				qdf_mem_free(pMsg->bodyptr);
 				break;
 			}
 			mac_ctx->ftm_msg_processor_callback(
 					(void *)pMsg->bodyptr);
-			cdf_mem_free(pMsg->bodyptr);
+			qdf_mem_free(pMsg->bodyptr);
 			break;
 
 		default:
@@ -251,7 +251,7 @@
 		qdf_status = QDF_STATUS_E_BADMSG;
 
 		if (pMsg->bodyptr)
-			cdf_mem_free(pMsg->bodyptr);
+			qdf_mem_free(pMsg->bodyptr);
 	}
 	return qdf_status;
 }
@@ -345,7 +345,7 @@
 		 * It allocate memory for bodyptr free the mem and return
 		 */
 		if (pMsg->bodyptr)
-			cdf_mem_free(pMsg->bodyptr);
+			qdf_mem_free(pMsg->bodyptr);
 	}
 
 }
diff --git a/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h b/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h
index ab955b4..b6109f0 100644
--- a/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h
+++ b/core/mac/src/sys/legacy/src/platform/inc/sys_wrapper.h
@@ -50,7 +50,7 @@
 #include "qdf_mc_timer.h"
 #include "qdf_types.h"
 #include "qdf_trace.h"
-#include "cdf_memory.h"
+#include "qdf_mem.h"
 
 /* Interlocked Compare Exchange related definitions */
 
diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c
index 02a46f5..3876857 100644
--- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c
+++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c
@@ -120,12 +120,12 @@
 	 */
 
 	/* Allocate p_mac */
-	p_mac = cdf_mem_malloc(sizeof(tAniSirGlobal));
+	p_mac = qdf_mem_malloc(sizeof(tAniSirGlobal));
 	if (NULL == p_mac)
 		return eSIR_MEM_ALLOC_FAILED;
 
 	/* Initialize the p_mac structure */
-	cdf_mem_set(p_mac, sizeof(tAniSirGlobal), 0);
+	qdf_mem_set(p_mac, sizeof(tAniSirGlobal), 0);
 
 	/*
 	 * Set various global fields of p_mac here
@@ -138,13 +138,13 @@
 	{
 		/* Call various PE (and other layer init here) */
 		if (eSIR_SUCCESS != log_init(p_mac)) {
-			cdf_mem_free(p_mac);
+			qdf_mem_free(p_mac);
 			return eSIR_FAILURE;
 		}
 
 		/* Call routine to initialize CFG data structures */
 		if (eSIR_SUCCESS != cfg_init(p_mac)) {
-			cdf_mem_free(p_mac);
+			qdf_mem_free(p_mac);
 			return eSIR_FAILURE;
 		}
 
@@ -158,7 +158,7 @@
 	status =  pe_open(p_mac, pMacOpenParms);
 	if (eSIR_SUCCESS != status) {
 		sys_log(p_mac, LOGE, FL("mac_open failure\n"));
-		cdf_mem_free(p_mac);
+		qdf_mem_free(p_mac);
 	}
 
 	return status;
@@ -188,7 +188,7 @@
 	log_deinit(pMac);
 
 	/* Finally, de-allocate the global MAC datastructure: */
-	cdf_mem_free(pMac);
+	qdf_mem_free(pMac);
 
 	return eSIR_SUCCESS;
 }
diff --git a/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c b/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c
index 97703dc..057de05 100644
--- a/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c
+++ b/core/mac/src/sys/legacy/src/system/src/sys_entry_func.c
@@ -78,7 +78,7 @@
 tSirRetStatus sys_init_globals(tpAniSirGlobal pMac)
 {
 
-	cdf_mem_set((uint8_t *) &pMac->sys, sizeof(pMac->sys), 0);
+	qdf_mem_set((uint8_t *) &pMac->sys, sizeof(pMac->sys), 0);
 
 	pMac->sys.gSysEnableScanMode = 1;
 	pMac->sys.gSysEnableLinkMonitorMode = 0;
diff --git a/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h b/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h
index 8cc4e97..7a155bf 100644
--- a/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h
+++ b/core/mac/src/sys/legacy/src/utils/inc/dot11fdefs.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2012, 2014-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2012, 2014-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -45,11 +45,11 @@
 
 /* This controls how the "dot11f" code copies memory */
 #define DOT11F_MEMCPY(ctx, dst, src, len) \
-	cdf_mem_copy((uint8_t *)(dst), (uint8_t *)(src), (len))
+	qdf_mem_copy((uint8_t *)(dst), (uint8_t *)(src), (len))
 
 /* This controls how the "dot11f" code compares memory */
 #define DOT11F_MEMCMP(ctx, lhs, rhs, len) \
-	(!cdf_mem_compare((uint8_t *)(lhs), (uint8_t *)(rhs), (len)))
+	(qdf_mem_cmp((uint8_t *)(lhs), (uint8_t *)(rhs), (len)))
 
 #if defined(DBG) && (DBG != 0)
 
diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
index 0c2038a..92c4280 100644
--- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
+++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c
@@ -44,7 +44,7 @@
 #include "csr_neighbor_roam.h"
 #include "csr_internal.h"
 #include "lim_global.h"
-#include "cdf_memory.h"
+#include "qdf_mem.h"
 #include "qdf_trace.h"
 #include "wma_if.h"
 
diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
index 30ea1a7..7a5e691 100644
--- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c
+++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c
@@ -415,7 +415,7 @@
 		CFG_GET_STR(nSirStatus, pMac, WNI_CFG_COUNTRY_CODE,
 			    code, codelen, 3);
 
-		cdf_mem_copy(pDot11f->country, code, codelen);
+		qdf_mem_copy(pDot11f->country, code, codelen);
 
 		if (len > MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE) {
 			dot11f_log(pMac, LOGE,
@@ -425,7 +425,7 @@
 		}
 
 		pDot11f->num_triplets = (uint8_t) (len / 3);
-		cdf_mem_copy((uint8_t *) pDot11f->triplets, temp, len);
+		qdf_mem_copy((uint8_t *) pDot11f->triplets, temp, len);
 
 		pDot11f->present = 1;
 	}
@@ -619,7 +619,7 @@
 	if (POPULATE_DOT11F_RATES_OPERATIONAL == nChannelNum) {
 		if (psessionEntry != NULL) {
 			nRates = psessionEntry->extRateSet.numRates;
-			cdf_mem_copy(rates, psessionEntry->extRateSet.rate,
+			qdf_mem_copy(rates, psessionEntry->extRateSet.rate,
 				     nRates);
 		} else {
 			dot11f_log(pMac, LOGE,
@@ -634,7 +634,7 @@
 
 	if (0 != nRates) {
 		pDot11f->num_rates = (uint8_t) nRates;
-		cdf_mem_copy(pDot11f->rates, rates, nRates);
+		qdf_mem_copy(pDot11f->rates, rates, nRates);
 		pDot11f->present = 1;
 	}
 
@@ -663,7 +663,7 @@
 
 	if (0 != nRates) {
 		pDot11f->num_rates = (uint8_t) nRates;
-		cdf_mem_copy(pDot11f->rates, rates, nRates);
+		qdf_mem_copy(pDot11f->rates, rates, nRates);
 		pDot11f->present = 1;
 	}
 
@@ -1582,7 +1582,7 @@
 		if (0 <= idx) {
 			pDot11f->present = 1;
 			pDot11f->num_data = pRsnIe->rsnIEdata[idx + 1];
-			cdf_mem_copy(pDot11f->data, pRsnIe->rsnIEdata + idx + 2,        /* EID, len */
+			qdf_mem_copy(pDot11f->data, pRsnIe->rsnIEdata + idx + 2,        /* EID, len */
 				     pRsnIe->rsnIEdata[idx + 1]);
 		}
 	}
@@ -1633,7 +1633,7 @@
 		if (0 <= idx) {
 			pDot11f->present = 1;
 			pDot11f->num_data = pRsnIe->rsnIEdata[idx + 1];
-			cdf_mem_copy(pDot11f->data, pRsnIe->rsnIEdata + idx + 2,        /* EID, len */
+			qdf_mem_copy(pDot11f->data, pRsnIe->rsnIEdata + idx + 2,        /* EID, len */
 				     pRsnIe->rsnIEdata[idx + 1]);
 		}
 	}
@@ -1651,7 +1651,7 @@
 	pDot11f->present = 1;
 	pDot11f->num_ssid = pInternal->length;
 	if (pInternal->length) {
-		cdf_mem_copy((uint8_t *) pDot11f->ssid,
+		qdf_mem_copy((uint8_t *) pDot11f->ssid,
 			     (uint8_t *) &pInternal->ssId, pInternal->length);
 	}
 } /* End populate_dot11f_ssid. */
@@ -1731,7 +1731,7 @@
 #endif /* TO SUPPORT BT-AMP */
 		if (psessionEntry != NULL) {
 			nRates = psessionEntry->rateSet.numRates;
-			cdf_mem_copy(rates, psessionEntry->rateSet.rate,
+			qdf_mem_copy(rates, psessionEntry->rateSet.rate,
 				     nRates);
 		} else {
 			dot11f_log(pMac, LOGE,
@@ -1749,7 +1749,7 @@
 
 	if (0 != nRates) {
 		pDot11f->num_rates = (uint8_t) nRates;
-		cdf_mem_copy(pDot11f->rates, rates, nRates);
+		qdf_mem_copy(pDot11f->rates, rates, nRates);
 		pDot11f->present = 1;
 	}
 
@@ -1832,18 +1832,18 @@
 
 	if (temp_rateset.numRates <= MAX_NUM_SUPPORTED_RATES) {
 		p_supp_rates->num_rates = temp_rateset.numRates;
-		cdf_mem_copy(p_supp_rates->rates, temp_rateset.rate,
+		qdf_mem_copy(p_supp_rates->rates, temp_rateset.rate,
 			     p_supp_rates->num_rates);
 		p_supp_rates->present = 1;
 	}  else { /* Populate extended capability as well */
 		p_supp_rates->num_rates = MAX_NUM_SUPPORTED_RATES;
-		cdf_mem_copy(p_supp_rates->rates, temp_rateset.rate,
+		qdf_mem_copy(p_supp_rates->rates, temp_rateset.rate,
 			     p_supp_rates->num_rates);
 		p_supp_rates->present = 1;
 
 		p_ext_supp_rates->num_rates = temp_rateset.numRates -
 				     MAX_NUM_SUPPORTED_RATES;
-		cdf_mem_copy(p_ext_supp_rates->rates,
+		qdf_mem_copy(p_ext_supp_rates->rates,
 			     (uint8_t *)temp_rateset.rate +
 			     MAX_NUM_SUPPORTED_RATES,
 			     p_ext_supp_rates->num_rates);
@@ -2122,7 +2122,7 @@
 		if (0 <= idx) {
 			pDot11f->present = 1;
 			pDot11f->num_data = pRsnIe->rsnIEdata[idx + 1] - 4;
-			cdf_mem_copy(pDot11f->data, pRsnIe->rsnIEdata + idx + 2 + 4,    /* EID, len, OUI */
+			qdf_mem_copy(pDot11f->data, pRsnIe->rsnIEdata + idx + 2 + 4,    /* EID, len, OUI */
 				     pRsnIe->rsnIEdata[idx + 1] - 4);   /* OUI */
 		}
 	}
@@ -2142,7 +2142,7 @@
 	tDot11fProbeRequest pr;
 
 	/* Ok, zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pProbeReq, sizeof(tSirProbeReq), 0);
+	qdf_mem_set((uint8_t *) pProbeReq, sizeof(tSirProbeReq), 0);
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_probe_request(pMac, pFrame, nFrame, &pr);
@@ -2193,7 +2193,7 @@
 	}
 
 	if (pr.HTCaps.present) {
-		cdf_mem_copy(&pProbeReq->HTCaps, &pr.HTCaps,
+		qdf_mem_copy(&pProbeReq->HTCaps, &pr.HTCaps,
 			     sizeof(tDot11fIEHTCaps));
 	}
 
@@ -2204,7 +2204,7 @@
 	}
 #ifdef WLAN_FEATURE_11AC
 	if (pr.VHTCaps.present) {
-		cdf_mem_copy(&pProbeReq->VHTCaps, &pr.VHTCaps,
+		qdf_mem_copy(&pProbeReq->VHTCaps, &pr.VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 	}
 #endif
@@ -2226,15 +2226,15 @@
 	tDot11fProbeResponse *pr;
 
 	/* Ok, zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pProbeResp, sizeof(tSirProbeRespBeacon), 0);
+	qdf_mem_set((uint8_t *) pProbeResp, sizeof(tSirProbeRespBeacon), 0);
 
-	pr = cdf_mem_malloc(sizeof(tDot11fProbeResponse));
+	pr = qdf_mem_malloc(sizeof(tDot11fProbeResponse));
 	if (NULL == pr) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory\n"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set((uint8_t *) pr, sizeof(tDot11fProbeResponse), 0);
+	qdf_mem_set((uint8_t *) pr, sizeof(tDot11fProbeResponse), 0);
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_probe_response(pMac, pFrame, nFrame, pr);
@@ -2246,7 +2246,7 @@
 		PELOG2(sir_dump_buf
 			       (pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);
 		       )
-		cdf_mem_free(pr);
+		qdf_mem_free(pr);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(pMac, LOGW,
@@ -2260,7 +2260,7 @@
 	/* & "transliterate" from a 'tDot11fProbeResponse' to a 'tSirProbeRespBeacon'... */
 
 	/* Timestamp */
-	cdf_mem_copy((uint8_t *) pProbeResp->timeStamp,
+	qdf_mem_copy((uint8_t *) pProbeResp->timeStamp,
 		     (uint8_t *) &pr->TimeStamp, sizeof(tSirMacTimeStamp));
 
 	/* Beacon Interval */
@@ -2332,57 +2332,57 @@
 
 	if (pr->ChanSwitchAnn.present) {
 		pProbeResp->channelSwitchPresent = 1;
-		cdf_mem_copy(&pProbeResp->channelSwitchIE, &pr->ChanSwitchAnn,
+		qdf_mem_copy(&pProbeResp->channelSwitchIE, &pr->ChanSwitchAnn,
 			     sizeof(pProbeResp->channelSwitchIE));
 	}
 
 	if (pr->ext_chan_switch_ann.present) {
 		pProbeResp->ext_chan_switch_present = 1;
-		cdf_mem_copy(&pProbeResp->ext_chan_switch,
+		qdf_mem_copy(&pProbeResp->ext_chan_switch,
 			     &pr->ext_chan_switch_ann,
 			     sizeof(tDot11fIEext_chan_switch_ann));
 	}
 
 	if (pr->SuppOperatingClasses.present) {
 		pProbeResp->supp_operating_class_present = 1;
-		cdf_mem_copy(&pProbeResp->supp_operating_classes,
+		qdf_mem_copy(&pProbeResp->supp_operating_classes,
 			&pr->SuppOperatingClasses,
 			sizeof(tDot11fIESuppOperatingClasses));
 	}
 
 	if (pr->sec_chan_offset_ele.present) {
 		pProbeResp->sec_chan_offset_present = 1;
-		cdf_mem_copy(&pProbeResp->sec_chan_offset,
+		qdf_mem_copy(&pProbeResp->sec_chan_offset,
 			     &pr->sec_chan_offset_ele,
 			     sizeof(pProbeResp->sec_chan_offset));
 	}
 
 	if (pr->TPCReport.present) {
 		pProbeResp->tpcReportPresent = 1;
-		cdf_mem_copy(&pProbeResp->tpcReport, &pr->TPCReport,
+		qdf_mem_copy(&pProbeResp->tpcReport, &pr->TPCReport,
 			     sizeof(tDot11fIETPCReport));
 	}
 
 	if (pr->PowerConstraints.present) {
 		pProbeResp->powerConstraintPresent = 1;
-		cdf_mem_copy(&pProbeResp->localPowerConstraint,
+		qdf_mem_copy(&pProbeResp->localPowerConstraint,
 			     &pr->PowerConstraints,
 			     sizeof(tDot11fIEPowerConstraints));
 	}
 
 	if (pr->Quiet.present) {
 		pProbeResp->quietIEPresent = 1;
-		cdf_mem_copy(&pProbeResp->quietIE, &pr->Quiet,
+		qdf_mem_copy(&pProbeResp->quietIE, &pr->Quiet,
 			     sizeof(tDot11fIEQuiet));
 	}
 
 	if (pr->HTCaps.present) {
-		cdf_mem_copy(&pProbeResp->HTCaps, &pr->HTCaps,
+		qdf_mem_copy(&pProbeResp->HTCaps, &pr->HTCaps,
 			     sizeof(tDot11fIEHTCaps));
 	}
 
 	if (pr->HTInfo.present) {
-		cdf_mem_copy(&pProbeResp->HTInfo, &pr->HTInfo,
+		qdf_mem_copy(&pProbeResp->HTInfo, &pr->HTInfo,
 			     sizeof(tDot11fIEHTInfo));
 	}
 
@@ -2434,7 +2434,7 @@
 	if (pr->MobilityDomain.present) {
 		/* MobilityDomain */
 		pProbeResp->mdiePresent = 1;
-		cdf_mem_copy((uint8_t *) &(pProbeResp->mdie[0]),
+		qdf_mem_copy((uint8_t *) &(pProbeResp->mdie[0]),
 			     (uint8_t *) &(pr->MobilityDomain.MDID),
 			     sizeof(uint16_t));
 		pProbeResp->mdie[2] =
@@ -2452,25 +2452,25 @@
 	if (pr->ESEVersion.present)
 		pProbeResp->is_ese_ver_ie_present = 1;
 	if (pr->QBSSLoad.present) {
-		cdf_mem_copy(&pProbeResp->QBSSLoad, &pr->QBSSLoad,
+		qdf_mem_copy(&pProbeResp->QBSSLoad, &pr->QBSSLoad,
 			     sizeof(tDot11fIEQBSSLoad));
 	}
 #endif
 	if (pr->P2PProbeRes.present) {
-		cdf_mem_copy(&pProbeResp->P2PProbeRes, &pr->P2PProbeRes,
+		qdf_mem_copy(&pProbeResp->P2PProbeRes, &pr->P2PProbeRes,
 			     sizeof(tDot11fIEP2PProbeRes));
 	}
 #ifdef WLAN_FEATURE_11AC
 	if (pr->VHTCaps.present) {
-		cdf_mem_copy(&pProbeResp->VHTCaps, &pr->VHTCaps,
+		qdf_mem_copy(&pProbeResp->VHTCaps, &pr->VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 	}
 	if (pr->VHTOperation.present) {
-		cdf_mem_copy(&pProbeResp->VHTOperation, &pr->VHTOperation,
+		qdf_mem_copy(&pProbeResp->VHTOperation, &pr->VHTOperation,
 			     sizeof(tDot11fIEVHTOperation));
 	}
 	if (pr->VHTExtBssLoad.present) {
-		cdf_mem_copy(&pProbeResp->VHTExtBssLoad, &pr->VHTExtBssLoad,
+		qdf_mem_copy(&pProbeResp->VHTExtBssLoad, &pr->VHTExtBssLoad,
 			     sizeof(tDot11fIEVHTExtBssLoad));
 	}
 #endif
@@ -2483,16 +2483,16 @@
 		pProbeResp->vendor2_ie.sub_type = pr->vendor2_ie.sub_type;
 	}
 	if (pr->vendor2_ie.VHTCaps.present) {
-		cdf_mem_copy(&pProbeResp->vendor2_ie.VHTCaps,
+		qdf_mem_copy(&pProbeResp->vendor2_ie.VHTCaps,
 				&pr->vendor2_ie.VHTCaps,
 				sizeof(tDot11fIEVHTCaps));
 	}
 	if (pr->vendor2_ie.VHTOperation.present) {
-		cdf_mem_copy(&pProbeResp->vendor2_ie.VHTOperation,
+		qdf_mem_copy(&pProbeResp->vendor2_ie.VHTOperation,
 				&pr->vendor2_ie.VHTOperation,
 				sizeof(tDot11fIEVHTOperation));
 	}
-	cdf_mem_free(pr);
+	qdf_mem_free(pr);
 	return eSIR_SUCCESS;
 
 } /* End sir_convert_probe_frame2_struct. */
@@ -2505,14 +2505,14 @@
 	tDot11fAssocRequest *ar;
 	uint32_t status;
 
-	ar = cdf_mem_malloc(sizeof(tDot11fAssocRequest));
+	ar = qdf_mem_malloc(sizeof(tDot11fAssocRequest));
 	if (NULL == ar) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory\n"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pAssocReq, sizeof(tSirAssocReq), 0);
-	cdf_mem_set((uint8_t *) ar, sizeof(tDot11fAssocRequest), 0);
+	qdf_mem_set((uint8_t *) pAssocReq, sizeof(tSirAssocReq), 0);
+	qdf_mem_set((uint8_t *) ar, sizeof(tDot11fAssocRequest), 0);
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_assoc_request(pMac, pFrame, nFrame, ar);
@@ -2524,7 +2524,7 @@
 		PELOG2(sir_dump_buf
 			       (pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);
 		       )
-		cdf_mem_free(ar);
+		qdf_mem_free(ar);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(pMac, LOGW,
@@ -2634,13 +2634,13 @@
 	}
 
 	if (ar->HTCaps.present) {
-		cdf_mem_copy(&pAssocReq->HTCaps, &ar->HTCaps,
+		qdf_mem_copy(&pAssocReq->HTCaps, &ar->HTCaps,
 			     sizeof(tDot11fIEHTCaps));
 	}
 
 	if (ar->WMMInfoStation.present) {
 		pAssocReq->wmeInfoPresent = 1;
-		cdf_mem_copy(&pAssocReq->WMMInfoStation, &ar->WMMInfoStation,
+		qdf_mem_copy(&pAssocReq->WMMInfoStation, &ar->WMMInfoStation,
 			     sizeof(tDot11fIEWMMInfoStation));
 
 	}
@@ -2652,7 +2652,7 @@
 		PELOG2(lim_log
 			       (pMac, LOG2, FL("Received Assoc without SSID IE.\n"));
 		       )
-		cdf_mem_free(ar);
+		qdf_mem_free(ar);
 		return eSIR_FAILURE;
 	}
 
@@ -2661,18 +2661,18 @@
 			       (pMac, LOG2,
 			       FL("Received Assoc without supp rate IE.\n"));
 		       )
-		cdf_mem_free(ar);
+		qdf_mem_free(ar);
 		return eSIR_FAILURE;
 	}
 #ifdef WLAN_FEATURE_11AC
 	if (ar->VHTCaps.present) {
-		cdf_mem_copy(&pAssocReq->VHTCaps, &ar->VHTCaps,
+		qdf_mem_copy(&pAssocReq->VHTCaps, &ar->VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 		lim_log(pMac, LOGW, FL("Received Assoc Req with VHT Cap\n"));
 		lim_log_vht_cap(pMac, &pAssocReq->VHTCaps);
 	}
 	if (ar->OperatingMode.present) {
-		cdf_mem_copy(&pAssocReq->operMode, &ar->OperatingMode,
+		qdf_mem_copy(&pAssocReq->operMode, &ar->OperatingMode,
 			     sizeof(tDot11fIEOperatingMode));
 		lim_log(pMac, LOGW,
 			FL("Received Assoc Req with Operating Mode IE\n"));
@@ -2681,7 +2681,7 @@
 #endif
 	if (ar->ExtCap.present) {
 		struct s_ext_cap *ext_cap;
-		cdf_mem_copy(&pAssocReq->ExtCap.bytes, &ar->ExtCap.bytes,
+		qdf_mem_copy(&pAssocReq->ExtCap.bytes, &ar->ExtCap.bytes,
 			     ar->ExtCap.num_bytes);
 
 		ext_cap = (struct s_ext_cap *)&pAssocReq->ExtCap.bytes;
@@ -2690,7 +2690,7 @@
 			ext_cap->timing_meas, ext_cap->fine_time_meas_initiator,
 			ext_cap->fine_time_meas_responder);
 	}
-	cdf_mem_free(ar);
+	qdf_mem_free(ar);
 	return eSIR_SUCCESS;
 
 } /* End sir_convert_assoc_req_frame2_struct. */
@@ -2705,7 +2705,7 @@
 	uint8_t cnt = 0;
 
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pAssocRsp, sizeof(tSirAssocRsp), 0);
+	qdf_mem_set((uint8_t *) pAssocRsp, sizeof(tSirAssocRsp), 0);
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_assoc_response(pMac, pFrame, nFrame, &ar);
@@ -2792,20 +2792,20 @@
 
 	if (ar.HTCaps.present) {
 		lim_log(pMac, LOG1, FL("Received Assoc Resp with HT Cap"));
-		cdf_mem_copy(&pAssocRsp->HTCaps, &ar.HTCaps,
+		qdf_mem_copy(&pAssocRsp->HTCaps, &ar.HTCaps,
 			     sizeof(tDot11fIEHTCaps));
 	}
 
 	if (ar.HTInfo.present) {
 		lim_log(pMac, LOG1, FL("Received Assoc Resp with HT Info"));
-		cdf_mem_copy(&pAssocRsp->HTInfo, &ar.HTInfo,
+		qdf_mem_copy(&pAssocRsp->HTInfo, &ar.HTInfo,
 			     sizeof(tDot11fIEHTInfo));
 	}
 #ifdef WLAN_FEATURE_VOWIFI_11R
 	if (ar.MobilityDomain.present) {
 		/* MobilityDomain */
 		pAssocRsp->mdiePresent = 1;
-		cdf_mem_copy((uint8_t *) &(pAssocRsp->mdie[0]),
+		qdf_mem_copy((uint8_t *) &(pAssocRsp->mdie[0]),
 			     (uint8_t *) &(ar.MobilityDomain.MDID),
 			     sizeof(uint16_t));
 		pAssocRsp->mdie[2] =
@@ -2823,7 +2823,7 @@
 			ar.FTInfo.R0KH_ID.num_PMK_R0_ID,
 			ar.FTInfo.R0KH_ID.present, ar.FTInfo.R1KH_ID.present);
 		pAssocRsp->ftinfoPresent = 1;
-		cdf_mem_copy(&pAssocRsp->FTInfo, &ar.FTInfo,
+		qdf_mem_copy(&pAssocRsp->FTInfo, &ar.FTInfo,
 			     sizeof(tDot11fIEFTInfo));
 	}
 #endif
@@ -2832,7 +2832,7 @@
 	if (ar.num_RICDataDesc) {
 		for (cnt = 0; cnt < ar.num_RICDataDesc; cnt++) {
 			if (ar.RICDataDesc[cnt].present) {
-				cdf_mem_copy(&pAssocRsp->RICData[cnt],
+				qdf_mem_copy(&pAssocRsp->RICData[cnt],
 					     &ar.RICDataDesc[cnt],
 					     sizeof(tDot11fIERICDataDesc));
 			}
@@ -2846,7 +2846,7 @@
 	if (ar.num_WMMTSPEC) {
 		pAssocRsp->num_tspecs = ar.num_WMMTSPEC;
 		for (cnt = 0; cnt < ar.num_WMMTSPEC; cnt++) {
-			cdf_mem_copy(&pAssocRsp->TSPECInfo[cnt],
+			qdf_mem_copy(&pAssocRsp->TSPECInfo[cnt],
 				     &ar.WMMTSPEC[cnt],
 				     (sizeof(tDot11fIEWMMTSPEC) *
 				      ar.num_WMMTSPEC));
@@ -2856,20 +2856,20 @@
 
 	if (ar.ESETrafStrmMet.present) {
 		pAssocRsp->tsmPresent = 1;
-		cdf_mem_copy(&pAssocRsp->tsmIE.tsid,
+		qdf_mem_copy(&pAssocRsp->tsmIE.tsid,
 			     &ar.ESETrafStrmMet.tsid, sizeof(tSirMacESETSMIE));
 	}
 #endif
 
 #ifdef WLAN_FEATURE_11AC
 	if (ar.VHTCaps.present) {
-		cdf_mem_copy(&pAssocRsp->VHTCaps, &ar.VHTCaps,
+		qdf_mem_copy(&pAssocRsp->VHTCaps, &ar.VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 		lim_log(pMac, LOG1, FL("Received Assoc Response with VHT Cap"));
 		lim_log_vht_cap(pMac, &pAssocRsp->VHTCaps);
 	}
 	if (ar.VHTOperation.present) {
-		cdf_mem_copy(&pAssocRsp->VHTOperation, &ar.VHTOperation,
+		qdf_mem_copy(&pAssocRsp->VHTOperation, &ar.VHTOperation,
 			     sizeof(tDot11fIEVHTOperation));
 		lim_log(pMac, LOG1,
 			FL("Received Assoc Response with VHT Operation"));
@@ -2879,7 +2879,7 @@
 
 	if (ar.ExtCap.present) {
 		struct s_ext_cap *ext_cap;
-		cdf_mem_copy(&pAssocRsp->ExtCap.bytes, &ar.ExtCap.bytes,
+		qdf_mem_copy(&pAssocRsp->ExtCap.bytes, &ar.ExtCap.bytes,
 			     ar.ExtCap.num_bytes);
 
 		ext_cap = (struct s_ext_cap *)&pAssocRsp->ExtCap.bytes;
@@ -2905,7 +2905,7 @@
 	}
 
 	if (ar.vendor2_ie.VHTCaps.present) {
-		cdf_mem_copy(&pAssocRsp->vendor2_ie.VHTCaps,
+		qdf_mem_copy(&pAssocRsp->vendor2_ie.VHTCaps,
 				&ar.vendor2_ie.VHTCaps,
 				sizeof(tDot11fIEVHTCaps));
 		lim_log(pMac, LOG1,
@@ -2913,7 +2913,7 @@
 		lim_log_vht_cap(pMac, &pAssocRsp->VHTCaps);
 	}
 	if (ar.vendor2_ie.VHTOperation.present) {
-		cdf_mem_copy(&pAssocRsp->vendor2_ie.VHTOperation,
+		qdf_mem_copy(&pAssocRsp->vendor2_ie.VHTOperation,
 				&ar.vendor2_ie.VHTOperation,
 				sizeof(tDot11fIEVHTOperation));
 		lim_log(pMac, LOG1,
@@ -2933,7 +2933,7 @@
 	uint32_t status;
 
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pAssocReq, sizeof(tSirAssocReq), 0);
+	qdf_mem_set((uint8_t *) pAssocReq, sizeof(tSirAssocReq), 0);
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_re_assoc_request(pMac, pFrame, nFrame, &ar);
@@ -3030,13 +3030,13 @@
 	}
 
 	if (ar.HTCaps.present) {
-		cdf_mem_copy(&pAssocReq->HTCaps, &ar.HTCaps,
+		qdf_mem_copy(&pAssocReq->HTCaps, &ar.HTCaps,
 			     sizeof(tDot11fIEHTCaps));
 	}
 
 	if (ar.WMMInfoStation.present) {
 		pAssocReq->wmeInfoPresent = 1;
-		cdf_mem_copy(&pAssocReq->WMMInfoStation, &ar.WMMInfoStation,
+		qdf_mem_copy(&pAssocReq->WMMInfoStation, &ar.WMMInfoStation,
 			     sizeof(tDot11fIEWMMInfoStation));
 
 	}
@@ -3080,11 +3080,11 @@
 
 #ifdef WLAN_FEATURE_11AC
 	if (ar.VHTCaps.present) {
-		cdf_mem_copy(&pAssocReq->VHTCaps, &ar.VHTCaps,
+		qdf_mem_copy(&pAssocReq->VHTCaps, &ar.VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 	}
 	if (ar.OperatingMode.present) {
-		cdf_mem_copy(&pAssocReq->operMode, &ar.OperatingMode,
+		qdf_mem_copy(&pAssocReq->operMode, &ar.OperatingMode,
 			     sizeof(tDot11fIEOperatingMode));
 		lim_log(pMac, LOGW,
 			FL("Received Assoc Req with Operating Mode IE\n"));
@@ -3094,7 +3094,7 @@
 
 	if (ar.ExtCap.present) {
 		struct s_ext_cap *ext_cap;
-		cdf_mem_copy(&pAssocReq->ExtCap.bytes, &ar.ExtCap.bytes,
+		qdf_mem_copy(&pAssocReq->ExtCap.bytes, &ar.ExtCap.bytes,
 			     ar.ExtCap.num_bytes);
 
 		ext_cap = (struct s_ext_cap *)&pAssocReq->ExtCap.bytes;
@@ -3125,9 +3125,9 @@
 	uint8_t *pos = NULL;
 
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) &eseBcnReportMandatoryIe,
+	qdf_mem_set((uint8_t *) &eseBcnReportMandatoryIe,
 		    sizeof(eseBcnReportMandatoryIe), 0);
-	pBies = cdf_mem_malloc(sizeof(tDot11fBeaconIEs));
+	pBies = qdf_mem_malloc(sizeof(tDot11fBeaconIEs));
 	if (NULL == pBies) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory\n"));
 		return eSIR_MEM_ALLOC_FAILED;
@@ -3139,7 +3139,7 @@
 		lim_log(pMac, LOGE,
 			FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"),
 			status, nPayload);
-		cdf_mem_free(pBies);
+		qdf_mem_free(pBies);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(pMac, LOGW,
@@ -3214,16 +3214,16 @@
 
 	if (pBies->RRMEnabledCap.present) {
 		eseBcnReportMandatoryIe.rrmPresent = 1;
-		cdf_mem_copy(&eseBcnReportMandatoryIe.rmEnabledCapabilities,
+		qdf_mem_copy(&eseBcnReportMandatoryIe.rmEnabledCapabilities,
 			     &pBies->RRMEnabledCap,
 			     sizeof(tDot11fIERRMEnabledCap));
 		numBytes += 1 + 1 + SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX;
 	}
 
-	*outIeBuf = cdf_mem_malloc(numBytes);
+	*outIeBuf = qdf_mem_malloc(numBytes);
 	if (NULL == *outIeBuf) {
 		lim_log(pMac, LOGP, FL("Memory Allocation failure"));
-		cdf_mem_free(pBies);
+		qdf_mem_free(pBies);
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 	pos = *outIeBuf;
@@ -3243,7 +3243,7 @@
 		pos++;
 		*pos = eseBcnReportMandatoryIe.ssId.length;
 		pos++;
-		cdf_mem_copy(pos,
+		qdf_mem_copy(pos,
 			     (uint8_t *) eseBcnReportMandatoryIe.ssId.ssId,
 			     eseBcnReportMandatoryIe.ssId.length);
 		pos += eseBcnReportMandatoryIe.ssId.length;
@@ -3263,7 +3263,7 @@
 		pos++;
 		*pos = eseBcnReportMandatoryIe.supportedRates.numRates;
 		pos++;
-		cdf_mem_copy(pos,
+		qdf_mem_copy(pos,
 			     (uint8_t *) eseBcnReportMandatoryIe.supportedRates.
 			     rate,
 			     eseBcnReportMandatoryIe.supportedRates.numRates);
@@ -3284,7 +3284,7 @@
 		pos++;
 		*pos = SIR_MAC_FH_PARAM_SET_EID_MAX;
 		pos++;
-		cdf_mem_copy(pos,
+		qdf_mem_copy(pos,
 			     (uint8_t *) &eseBcnReportMandatoryIe.fhParamSet,
 			     SIR_MAC_FH_PARAM_SET_EID_MAX);
 		pos += SIR_MAC_FH_PARAM_SET_EID_MAX;
@@ -3320,7 +3320,7 @@
 		pos++;
 		*pos = SIR_MAC_CF_PARAM_SET_EID_MAX;
 		pos++;
-		cdf_mem_copy(pos,
+		qdf_mem_copy(pos,
 			     (uint8_t *) &eseBcnReportMandatoryIe.cfParamSet,
 			     SIR_MAC_CF_PARAM_SET_EID_MAX);
 		pos += SIR_MAC_CF_PARAM_SET_EID_MAX;
@@ -3339,7 +3339,7 @@
 		pos++;
 		*pos = SIR_MAC_IBSS_PARAM_SET_EID_MAX;
 		pos++;
-		cdf_mem_copy(pos,
+		qdf_mem_copy(pos,
 			     (uint8_t *) &eseBcnReportMandatoryIe.ibssParamSet.
 			     atim, SIR_MAC_IBSS_PARAM_SET_EID_MAX);
 		pos += SIR_MAC_IBSS_PARAM_SET_EID_MAX;
@@ -3358,7 +3358,7 @@
 		pos++;
 		*pos = SIR_MAC_TIM_EID_MIN;
 		pos++;
-		cdf_mem_copy(pos,
+		qdf_mem_copy(pos,
 			     (uint8_t *) &eseBcnReportMandatoryIe.tim,
 			     SIR_MAC_TIM_EID_MIN);
 		pos += SIR_MAC_TIM_EID_MIN;
@@ -3377,7 +3377,7 @@
 		pos++;
 		*pos = SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX;
 		pos++;
-		cdf_mem_copy(pos,
+		qdf_mem_copy(pos,
 			     (uint8_t *) &eseBcnReportMandatoryIe.
 			     rmEnabledCapabilities,
 			     SIR_MAC_RM_ENABLED_CAPABILITY_EID_MAX);
@@ -3399,11 +3399,11 @@
 	 * that is returning failure.On success, the caller would take
 	 * care of freeing up the memory*/
 	if (retStatus == eSIR_FAILURE) {
-		cdf_mem_free(*outIeBuf);
+		qdf_mem_free(*outIeBuf);
 		*outIeBuf = NULL;
 	}
 
-	cdf_mem_free(pBies);
+	qdf_mem_free(pBies);
 	return retStatus;
 }
 
@@ -3418,9 +3418,9 @@
 	uint32_t status;
 
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pBeaconStruct, sizeof(tSirProbeRespBeacon), 0);
+	qdf_mem_set((uint8_t *) pBeaconStruct, sizeof(tSirProbeRespBeacon), 0);
 
-	pBies = cdf_mem_malloc(sizeof(tDot11fBeaconIEs));
+	pBies = qdf_mem_malloc(sizeof(tDot11fBeaconIEs));
 	if (NULL == pBies) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory\n"));
 		return eSIR_MEM_ALLOC_FAILED;
@@ -3435,7 +3435,7 @@
 		PELOG2(sir_dump_buf
 			       (pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);
 		       )
-		cdf_mem_free(pBies);
+		qdf_mem_free(pBies);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(pMac, LOGW,
@@ -3492,13 +3492,13 @@
 	/* 11h IEs */
 	if (pBies->TPCReport.present) {
 		pBeaconStruct->tpcReportPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->tpcReport,
+		qdf_mem_copy(&pBeaconStruct->tpcReport,
 			     &pBies->TPCReport, sizeof(tDot11fIETPCReport));
 	}
 
 	if (pBies->PowerConstraints.present) {
 		pBeaconStruct->powerConstraintPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->localPowerConstraint,
+		qdf_mem_copy(&pBeaconStruct->localPowerConstraint,
 			     &pBies->PowerConstraints,
 			     sizeof(tDot11fIEPowerConstraints));
 	}
@@ -3511,7 +3511,7 @@
 			pBies->ESETxmitPower.power_limit;
 	}
 	if (pBies->QBSSLoad.present) {
-		cdf_mem_copy(&pBeaconStruct->QBSSLoad, &pBies->QBSSLoad,
+		qdf_mem_copy(&pBeaconStruct->QBSSLoad, &pBies->QBSSLoad,
 			     sizeof(tDot11fIEQBSSLoad));
 	}
 #endif
@@ -3530,45 +3530,45 @@
 
 	if (pBies->ChanSwitchAnn.present) {
 		pBeaconStruct->channelSwitchPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->channelSwitchIE,
+		qdf_mem_copy(&pBeaconStruct->channelSwitchIE,
 			     &pBies->ChanSwitchAnn,
 			     sizeof(pBeaconStruct->channelSwitchIE));
 	}
 
 	if (pBies->SuppOperatingClasses.present) {
 		pBeaconStruct->supp_operating_class_present = 1;
-		cdf_mem_copy(&pBeaconStruct->supp_operating_classes,
+		qdf_mem_copy(&pBeaconStruct->supp_operating_classes,
 			&pBies->SuppOperatingClasses,
 			sizeof(tDot11fIESuppOperatingClasses));
 	}
 
 	if (pBies->ext_chan_switch_ann.present) {
 		pBeaconStruct->ext_chan_switch_present = 1;
-		cdf_mem_copy(&pBeaconStruct->ext_chan_switch,
+		qdf_mem_copy(&pBeaconStruct->ext_chan_switch,
 			     &pBies->ext_chan_switch_ann,
 			     sizeof(tDot11fIEext_chan_switch_ann));
 	}
 
 	if (pBies->sec_chan_offset_ele.present) {
 		pBeaconStruct->sec_chan_offset_present = 1;
-		cdf_mem_copy(&pBeaconStruct->sec_chan_offset,
+		qdf_mem_copy(&pBeaconStruct->sec_chan_offset,
 			     &pBies->sec_chan_offset_ele,
 			     sizeof(pBeaconStruct->sec_chan_offset));
 	}
 
 	if (pBies->Quiet.present) {
 		pBeaconStruct->quietIEPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->quietIE, &pBies->Quiet,
+		qdf_mem_copy(&pBeaconStruct->quietIE, &pBies->Quiet,
 			     sizeof(tDot11fIEQuiet));
 	}
 
 	if (pBies->HTCaps.present) {
-		cdf_mem_copy(&pBeaconStruct->HTCaps, &pBies->HTCaps,
+		qdf_mem_copy(&pBeaconStruct->HTCaps, &pBies->HTCaps,
 			     sizeof(tDot11fIEHTCaps));
 	}
 
 	if (pBies->HTInfo.present) {
-		cdf_mem_copy(&pBeaconStruct->HTInfo, &pBies->HTInfo,
+		qdf_mem_copy(&pBeaconStruct->HTInfo, &pBies->HTInfo,
 			     sizeof(tDot11fIEHTInfo));
 	}
 
@@ -3611,23 +3611,23 @@
 #ifdef WLAN_FEATURE_11AC
 	if (pBies->VHTCaps.present) {
 		pBeaconStruct->VHTCaps.present = 1;
-		cdf_mem_copy(&pBeaconStruct->VHTCaps, &pBies->VHTCaps,
+		qdf_mem_copy(&pBeaconStruct->VHTCaps, &pBies->VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 	}
 	if (pBies->VHTOperation.present) {
 		pBeaconStruct->VHTOperation.present = 1;
-		cdf_mem_copy(&pBeaconStruct->VHTOperation, &pBies->VHTOperation,
+		qdf_mem_copy(&pBeaconStruct->VHTOperation, &pBies->VHTOperation,
 			     sizeof(tDot11fIEVHTOperation));
 	}
 	if (pBies->VHTExtBssLoad.present) {
 		pBeaconStruct->VHTExtBssLoad.present = 1;
-		cdf_mem_copy(&pBeaconStruct->VHTExtBssLoad,
+		qdf_mem_copy(&pBeaconStruct->VHTExtBssLoad,
 			     &pBies->VHTExtBssLoad,
 			     sizeof(tDot11fIEVHTExtBssLoad));
 	}
 	if (pBies->OperatingMode.present) {
 		pBeaconStruct->OperatingMode.present = 1;
-		cdf_mem_copy(&pBeaconStruct->OperatingMode,
+		qdf_mem_copy(&pBeaconStruct->OperatingMode,
 			     &pBies->OperatingMode,
 			     sizeof(tDot11fIEOperatingMode));
 	}
@@ -3635,7 +3635,7 @@
 
 	if (pBies->MobilityDomain.present) {
 		pBeaconStruct->mdiePresent = 1;
-		cdf_mem_copy(pBeaconStruct->mdie, &pBies->MobilityDomain.MDID,
+		qdf_mem_copy(pBeaconStruct->mdie, &pBies->MobilityDomain.MDID,
 			     SIR_MDIE_SIZE);
 	}
 
@@ -3649,17 +3649,17 @@
 
 	if (pBies->vendor2_ie.VHTCaps.present) {
 		pBeaconStruct->vendor2_ie.VHTCaps.present = 1;
-		cdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTCaps,
+		qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTCaps,
 				&pBies->vendor2_ie.VHTCaps,
 				sizeof(tDot11fIEVHTCaps));
 	}
 	if (pBies->vendor2_ie.VHTOperation.present) {
 		pBeaconStruct->vendor2_ie.VHTOperation.present = 1;
-		cdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTOperation,
+		qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTOperation,
 				&pBies->vendor2_ie.VHTOperation,
 				sizeof(tDot11fIEVHTOperation));
 	}
-	cdf_mem_free(pBies);
+	qdf_mem_free(pBies);
 	return eSIR_SUCCESS;
 } /* End sir_parse_beacon_ie. */
 
@@ -3682,18 +3682,18 @@
 	rfBand = WMA_GET_RX_RFBAND(pFrame);
 
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pBeaconStruct, sizeof(tSirProbeRespBeacon), 0);
+	qdf_mem_set((uint8_t *) pBeaconStruct, sizeof(tSirProbeRespBeacon), 0);
 
-	pBeacon = cdf_mem_malloc(sizeof(tDot11fBeacon));
+	pBeacon = qdf_mem_malloc(sizeof(tDot11fBeacon));
 	if (NULL == pBeacon) {
 		lim_log(pMac, LOGE, FL("Failed to allocate memory\n"));
 		return eSIR_MEM_ALLOC_FAILED;
 	}
 
-	cdf_mem_set((uint8_t *) pBeacon, sizeof(tDot11fBeacon), 0);
+	qdf_mem_set((uint8_t *) pBeacon, sizeof(tDot11fBeacon), 0);
 
 	/* get the MAC address out of the BD, */
-	cdf_mem_copy(pBeaconStruct->bssid, pHdr->sa, 6);
+	qdf_mem_copy(pBeaconStruct->bssid, pHdr->sa, 6);
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_beacon(pMac, pPayload, nPayload, pBeacon);
@@ -3704,7 +3704,7 @@
 		PELOG2(sir_dump_buf
 			       (pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);
 		       )
-		cdf_mem_free(pBeacon);
+		qdf_mem_free(pBeacon);
 		return eSIR_FAILURE;
 	} else if (DOT11F_WARNED(status)) {
 		lim_log(pMac, LOGW,
@@ -3717,7 +3717,7 @@
 	}
 	/* & "transliterate" from a 'tDot11fBeacon' to a 'tSirProbeRespBeacon'... */
 	/* Timestamp */
-	cdf_mem_copy((uint8_t *) pBeaconStruct->timeStamp,
+	qdf_mem_copy((uint8_t *) pBeaconStruct->timeStamp,
 		     (uint8_t *) &pBeacon->TimeStamp,
 		     sizeof(tSirMacTimeStamp));
 
@@ -3807,51 +3807,51 @@
 
 	if (pBeacon->ChanSwitchAnn.present) {
 		pBeaconStruct->channelSwitchPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->channelSwitchIE,
+		qdf_mem_copy(&pBeaconStruct->channelSwitchIE,
 			     &pBeacon->ChanSwitchAnn,
 			     sizeof(pBeaconStruct->channelSwitchIE));
 	}
 
 	if (pBeacon->ext_chan_switch_ann.present) {
 		pBeaconStruct->ext_chan_switch_present = 1;
-		cdf_mem_copy(&pBeaconStruct->ext_chan_switch,
+		qdf_mem_copy(&pBeaconStruct->ext_chan_switch,
 			     &pBeacon->ext_chan_switch_ann,
 			     sizeof(tDot11fIEext_chan_switch_ann));
 	}
 
 	if (pBeacon->sec_chan_offset_ele.present) {
 		pBeaconStruct->sec_chan_offset_present = 1;
-		cdf_mem_copy(&pBeaconStruct->sec_chan_offset,
+		qdf_mem_copy(&pBeaconStruct->sec_chan_offset,
 			     &pBeacon->sec_chan_offset_ele,
 			     sizeof(pBeaconStruct->sec_chan_offset));
 	}
 
 	if (pBeacon->TPCReport.present) {
 		pBeaconStruct->tpcReportPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->tpcReport, &pBeacon->TPCReport,
+		qdf_mem_copy(&pBeaconStruct->tpcReport, &pBeacon->TPCReport,
 			     sizeof(tDot11fIETPCReport));
 	}
 
 	if (pBeacon->PowerConstraints.present) {
 		pBeaconStruct->powerConstraintPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->localPowerConstraint,
+		qdf_mem_copy(&pBeaconStruct->localPowerConstraint,
 			     &pBeacon->PowerConstraints,
 			     sizeof(tDot11fIEPowerConstraints));
 	}
 
 	if (pBeacon->Quiet.present) {
 		pBeaconStruct->quietIEPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->quietIE, &pBeacon->Quiet,
+		qdf_mem_copy(&pBeaconStruct->quietIE, &pBeacon->Quiet,
 			     sizeof(tDot11fIEQuiet));
 	}
 
 	if (pBeacon->HTCaps.present) {
-		cdf_mem_copy(&pBeaconStruct->HTCaps, &pBeacon->HTCaps,
+		qdf_mem_copy(&pBeaconStruct->HTCaps, &pBeacon->HTCaps,
 			     sizeof(tDot11fIEHTCaps));
 	}
 
 	if (pBeacon->HTInfo.present) {
-		cdf_mem_copy(&pBeaconStruct->HTInfo, &pBeacon->HTInfo,
+		qdf_mem_copy(&pBeaconStruct->HTInfo, &pBeacon->HTInfo,
 			     sizeof(tDot11fIEHTInfo));
 
 	}
@@ -3908,7 +3908,7 @@
 	if (pBeacon->MobilityDomain.present) {
 		/* MobilityDomain */
 		pBeaconStruct->mdiePresent = 1;
-		cdf_mem_copy((uint8_t *) &(pBeaconStruct->mdie[0]),
+		qdf_mem_copy((uint8_t *) &(pBeaconStruct->mdie[0]),
 			     (uint8_t *) &(pBeacon->MobilityDomain.MDID),
 			     sizeof(uint16_t));
 		pBeaconStruct->mdie[2] =
@@ -3926,39 +3926,39 @@
 	if (pBeacon->ESETxmitPower.present) {
 		/* copy ESE TPC info element */
 		pBeaconStruct->eseTxPwr.present = 1;
-		cdf_mem_copy(&pBeaconStruct->eseTxPwr,
+		qdf_mem_copy(&pBeaconStruct->eseTxPwr,
 			     &pBeacon->ESETxmitPower,
 			     sizeof(tDot11fIEESETxmitPower));
 	}
 	if (pBeacon->QBSSLoad.present) {
-		cdf_mem_copy(&pBeaconStruct->QBSSLoad,
+		qdf_mem_copy(&pBeaconStruct->QBSSLoad,
 			     &pBeacon->QBSSLoad, sizeof(tDot11fIEQBSSLoad));
 	}
 #endif
 
 #ifdef WLAN_FEATURE_11AC
 	if (pBeacon->VHTCaps.present) {
-		cdf_mem_copy(&pBeaconStruct->VHTCaps, &pBeacon->VHTCaps,
+		qdf_mem_copy(&pBeaconStruct->VHTCaps, &pBeacon->VHTCaps,
 			     sizeof(tDot11fIEVHTCaps));
 	}
 	if (pBeacon->VHTOperation.present) {
-		cdf_mem_copy(&pBeaconStruct->VHTOperation,
+		qdf_mem_copy(&pBeaconStruct->VHTOperation,
 			     &pBeacon->VHTOperation,
 			     sizeof(tDot11fIEVHTOperation));
 	}
 	if (pBeacon->VHTExtBssLoad.present) {
-		cdf_mem_copy(&pBeaconStruct->VHTExtBssLoad,
+		qdf_mem_copy(&pBeaconStruct->VHTExtBssLoad,
 			     &pBeacon->VHTExtBssLoad,
 			     sizeof(tDot11fIEVHTExtBssLoad));
 	}
 	if (pBeacon->OperatingMode.present) {
-		cdf_mem_copy(&pBeaconStruct->OperatingMode,
+		qdf_mem_copy(&pBeaconStruct->OperatingMode,
 			     &pBeacon->OperatingMode,
 			     sizeof(tDot11fIEOperatingMode));
 	}
 	if (pBeacon->WiderBWChanSwitchAnn.present) {
 		pBeaconStruct->WiderBWChanSwitchAnnPresent = 1;
-		cdf_mem_copy(&pBeaconStruct->WiderBWChanSwitchAnn,
+		qdf_mem_copy(&pBeaconStruct->WiderBWChanSwitchAnn,
 			     &pBeacon->WiderBWChanSwitchAnn,
 			     sizeof(tDot11fIEWiderBWChanSwitchAnn));
 	}
@@ -3967,7 +3967,7 @@
 	/* IBSS Peer Params */
 	if (pBeacon->IBSSParams.present) {
 		pBeaconStruct->IBSSParams.present = 1;
-		cdf_mem_copy(&pBeaconStruct->IBSSParams, &pBeacon->IBSSParams,
+		qdf_mem_copy(&pBeaconStruct->IBSSParams, &pBeacon->IBSSParams,
 			     sizeof(tDot11fIEIBSSParams));
 	}
 
@@ -3986,12 +3986,12 @@
 		      )
 	}
 	if (pBeacon->vendor2_ie.VHTCaps.present) {
-		cdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTCaps,
+		qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTCaps,
 				&pBeacon->vendor2_ie.VHTCaps,
 				sizeof(tDot11fIEVHTCaps));
 	}
 	if (pBeacon->vendor2_ie.VHTOperation.present) {
-		cdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTOperation,
+		qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTOperation,
 				&pBeacon->VHTOperation,
 				sizeof(tDot11fIEVHTOperation));
 	}
@@ -4007,7 +4007,7 @@
 #endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
 
 
-	cdf_mem_free(pBeacon);
+	qdf_mem_free(pBeacon);
 	return eSIR_SUCCESS;
 
 } /* End sir_convert_beacon_frame2_struct. */
@@ -4021,7 +4021,7 @@
 	uint32_t status;
 
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pAuth, sizeof(tSirMacAuthFrameBody), 0);
+	qdf_mem_set((uint8_t *) pAuth, sizeof(tSirMacAuthFrameBody), 0);
 
 	/* delegate to the framesc-generated code, */
 	status = dot11f_unpack_authentication(pMac, pFrame, nFrame, &auth);
@@ -4051,7 +4051,7 @@
 	if (auth.ChallengeText.present) {
 		pAuth->type = SIR_MAC_CHALLENGE_TEXT_EID;
 		pAuth->length = auth.ChallengeText.num_text;
-		cdf_mem_copy(pAuth->challengeText, auth.ChallengeText.text,
+		qdf_mem_copy(pAuth->challengeText, auth.ChallengeText.text,
 			     auth.ChallengeText.num_text);
 	}
 
@@ -4078,7 +4078,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pAddTs, sizeof(tSirAddtsReqInfo), 0);
+	qdf_mem_set((uint8_t *) pAddTs, sizeof(tSirAddtsReqInfo), 0);
 
 	/* delegate to the framesc-generated code, */
 	switch (*pFrame) {
@@ -4219,9 +4219,9 @@
 		return eSIR_FAILURE;
 	}
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pAddTs, sizeof(tSirAddtsRspInfo), 0);
-	cdf_mem_set((uint8_t *) &addts, sizeof(tDot11fAddTSResponse), 0);
-	cdf_mem_set((uint8_t *) &wmmaddts, sizeof(tDot11fWMMAddTSResponse), 0);
+	qdf_mem_set((uint8_t *) pAddTs, sizeof(tSirAddtsRspInfo), 0);
+	qdf_mem_set((uint8_t *) &addts, sizeof(tDot11fAddTSResponse), 0);
+	qdf_mem_set((uint8_t *) &wmmaddts, sizeof(tDot11fWMMAddTSResponse), 0);
 
 	/* delegate to the framesc-generated code, */
 	switch (*pFrame) {
@@ -4304,7 +4304,7 @@
 #ifdef FEATURE_WLAN_ESE
 		if (addts.ESETrafStrmMet.present) {
 			pAddTs->tsmPresent = 1;
-			cdf_mem_copy(&pAddTs->tsmIE.tsid,
+			qdf_mem_copy(&pAddTs->tsmIE.tsid,
 				     &addts.ESETrafStrmMet.tsid,
 				     sizeof(tSirMacESETSMIE));
 		}
@@ -4373,7 +4373,7 @@
 #ifdef FEATURE_WLAN_ESE
 		if (wmmaddts.ESETrafStrmMet.present) {
 			pAddTs->tsmPresent = 1;
-			cdf_mem_copy(&pAddTs->tsmIE.tsid,
+			qdf_mem_copy(&pAddTs->tsmIE.tsid,
 				     &wmmaddts.ESETrafStrmMet.tsid,
 				     sizeof(tSirMacESETSMIE));
 		}
@@ -4402,7 +4402,7 @@
 		return eSIR_FAILURE;
 	}
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pDelTs, sizeof(tSirDeltsReqInfo), 0);
+	qdf_mem_set((uint8_t *) pDelTs, sizeof(tSirDeltsReqInfo), 0);
 
 	/* delegate to the framesc-generated code, */
 	switch (*pFrame) {
@@ -4515,7 +4515,7 @@
 {
 	tDot11fTPCRequest req;
 	uint32_t status;
-	cdf_mem_set((uint8_t *) pTpcReqFrame, sizeof(tSirMacTpcReqActionFrame),
+	qdf_mem_set((uint8_t *) pTpcReqFrame, sizeof(tSirMacTpcReqActionFrame),
 		    0);
 	status = dot11f_unpack_tpc_request(pMac, pFrame, nFrame, &req);
 	if (DOT11F_FAILED(status)) {
@@ -4560,7 +4560,7 @@
 	uint32_t status;
 
 	/* Zero-init our [out] parameter, */
-	cdf_mem_set((uint8_t *) pMeasReqFrame,
+	qdf_mem_set((uint8_t *) pMeasReqFrame,
 		    sizeof(tpSirMacMeasReqActionFrame), 0);
 
 	/* delegate to the framesc-generated code, */
@@ -4618,7 +4618,7 @@
 	pMeasReqFrame->measReqIE.measReqField.channelNumber =
 		mr.MeasurementRequest[0].channel_no;
 
-	cdf_mem_copy(pMeasReqFrame->measReqIE.measReqField.measStartTime,
+	qdf_mem_copy(pMeasReqFrame->measReqIE.measReqField.measStartTime,
 		     mr.MeasurementRequest[0].meas_start_time, 8);
 
 	pMeasReqFrame->measReqIE.measReqField.measDuration =
@@ -4731,7 +4731,7 @@
 			pDot11f->present = 1;
 			/* Dont include OUI */
 			pDot11f->num_data = pCCKMie->cckmIEdata[idx + 1] - 4;
-			cdf_mem_copy(pDot11f->data, pCCKMie->cckmIEdata + idx + 2 + 4,  /* EID,len,OUI */
+			qdf_mem_copy(pDot11f->data, pCCKMie->cckmIEdata + idx + 2 + 4,  /* EID,len,OUI */
 				     pCCKMie->cckmIEdata[idx + 1] - 4); /* Skip OUI */
 		}
 	}
@@ -4744,7 +4744,7 @@
 			   uint8_t rate_length)
 {
 	pDot11f->tsid = pOld->tsid;
-	cdf_mem_copy(pDot11f->tsrates, pOld->rates, rate_length);
+	qdf_mem_copy(pDot11f->tsrates, pOld->rates, rate_length);
 	pDot11f->num_tsrates = rate_length;
 	pDot11f->present = 1;
 }
@@ -4760,19 +4760,19 @@
 
 	switch (pDot11f->classifier_type) {
 	case SIR_MAC_TCLASTYPE_ETHERNET:
-		cdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.source,
+		qdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.source,
 			     (uint8_t *) &pOld->tclasParams.eth.srcAddr, 6);
-		cdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.dest,
+		qdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.dest,
 			     (uint8_t *) &pOld->tclasParams.eth.dstAddr, 6);
 		pDot11f->info.EthParams.type = pOld->tclasParams.eth.type;
 		break;
 	case SIR_MAC_TCLASTYPE_TCPUDPIP:
 		pDot11f->info.IpParams.version = pOld->version;
 		if (SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version) {
-			cdf_mem_copy(pDot11f->info.IpParams.params.IpV4Params.
+			qdf_mem_copy(pDot11f->info.IpParams.params.IpV4Params.
 				     source, pOld->tclasParams.ipv4.srcIpAddr,
 				     4);
-			cdf_mem_copy(pDot11f->info.IpParams.params.IpV4Params.
+			qdf_mem_copy(pDot11f->info.IpParams.params.IpV4Params.
 				     dest, pOld->tclasParams.ipv4.dstIpAddr, 4);
 			pDot11f->info.IpParams.params.IpV4Params.src_port =
 				pOld->tclasParams.ipv4.srcPort;
@@ -4785,11 +4785,11 @@
 			pDot11f->info.IpParams.params.IpV4Params.reserved =
 				pOld->tclasParams.ipv4.rsvd;
 		} else {
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV6Params.source,
 				     (uint8_t *) pOld->tclasParams.ipv6.
 				     srcIpAddr, 16);
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV6Params.dest,
 				     (uint8_t *) pOld->tclasParams.ipv6.
 				     dstIpAddr, 16);
@@ -4797,7 +4797,7 @@
 				pOld->tclasParams.ipv6.srcPort;
 			pDot11f->info.IpParams.params.IpV6Params.dest_port =
 				pOld->tclasParams.ipv6.dstPort;
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV6Params.flow_label,
 				     (uint8_t *) pOld->tclasParams.ipv6.
 				     flowLabel, 3);
@@ -4831,20 +4831,20 @@
 
 	switch (pDot11f->classifier_type) {
 	case SIR_MAC_TCLASTYPE_ETHERNET:
-		cdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.source,
+		qdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.source,
 			     (uint8_t *) &pOld->tclasParams.eth.srcAddr, 6);
-		cdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.dest,
+		qdf_mem_copy((uint8_t *) &pDot11f->info.EthParams.dest,
 			     (uint8_t *) &pOld->tclasParams.eth.dstAddr, 6);
 		pDot11f->info.EthParams.type = pOld->tclasParams.eth.type;
 		break;
 	case SIR_MAC_TCLASTYPE_TCPUDPIP:
 		pDot11f->info.IpParams.version = pOld->version;
 		if (SIR_MAC_TCLAS_IPV4 == pDot11f->info.IpParams.version) {
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV4Params.source,
 				     (uint8_t *) pOld->tclasParams.ipv4.
 				     srcIpAddr, 4);
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV4Params.dest,
 				     (uint8_t *) pOld->tclasParams.ipv4.
 				     dstIpAddr, 4);
@@ -4859,11 +4859,11 @@
 			pDot11f->info.IpParams.params.IpV4Params.reserved =
 				pOld->tclasParams.ipv4.rsvd;
 		} else {
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV6Params.source,
 				     (uint8_t *) pOld->tclasParams.ipv6.
 				     srcIpAddr, 16);
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV6Params.dest,
 				     (uint8_t *) pOld->tclasParams.ipv6.
 				     dstIpAddr, 16);
@@ -4871,7 +4871,7 @@
 				pOld->tclasParams.ipv6.srcPort;
 			pDot11f->info.IpParams.params.IpV6Params.dest_port =
 				pOld->tclasParams.ipv6.dstPort;
-			cdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
+			qdf_mem_copy((uint8_t *) &pDot11f->info.IpParams.
 				     params.IpV6Params.flow_label,
 				     (uint8_t *) pOld->tclasParams.ipv6.
 				     flowLabel, 3);
@@ -5038,7 +5038,7 @@
 
 	if (pSirWPSProbeRspIE->FieldPresent & SIR_WPS_PROBRSP_UUIDE_PRESENT) {
 		pDot11f->UUID_E.present = 1;
-		cdf_mem_copy(pDot11f->UUID_E.uuid, pSirWPSProbeRspIE->UUID_E,
+		qdf_mem_copy(pDot11f->UUID_E.uuid, pSirWPSProbeRspIE->UUID_E,
 			     WNI_CFG_WPS_UUID_LEN);
 	} else
 		pDot11f->UUID_E.present = 0;
@@ -5048,7 +5048,7 @@
 		pDot11f->Manufacturer.present = 1;
 		pDot11f->Manufacturer.num_name =
 			pSirWPSProbeRspIE->Manufacture.num_name;
-		cdf_mem_copy(pDot11f->Manufacturer.name,
+		qdf_mem_copy(pDot11f->Manufacturer.name,
 			     pSirWPSProbeRspIE->Manufacture.name,
 			     pSirWPSProbeRspIE->Manufacture.num_name);
 	} else
@@ -5059,7 +5059,7 @@
 		pDot11f->ModelName.present = 1;
 		pDot11f->ModelName.num_text =
 			pSirWPSProbeRspIE->ModelName.num_text;
-		cdf_mem_copy(pDot11f->ModelName.text,
+		qdf_mem_copy(pDot11f->ModelName.text,
 			     pSirWPSProbeRspIE->ModelName.text,
 			     pDot11f->ModelName.num_text);
 	} else
@@ -5070,7 +5070,7 @@
 		pDot11f->ModelNumber.present = 1;
 		pDot11f->ModelNumber.num_text =
 			pSirWPSProbeRspIE->ModelNumber.num_text;
-		cdf_mem_copy(pDot11f->ModelNumber.text,
+		qdf_mem_copy(pDot11f->ModelNumber.text,
 			     pSirWPSProbeRspIE->ModelNumber.text,
 			     pDot11f->ModelNumber.num_text);
 	} else
@@ -5081,7 +5081,7 @@
 		pDot11f->SerialNumber.present = 1;
 		pDot11f->SerialNumber.num_text =
 			pSirWPSProbeRspIE->SerialNumber.num_text;
-		cdf_mem_copy(pDot11f->SerialNumber.text,
+		qdf_mem_copy(pDot11f->SerialNumber.text,
 			     pSirWPSProbeRspIE->SerialNumber.text,
 			     pDot11f->SerialNumber.num_text);
 	} else
@@ -5090,7 +5090,7 @@
 	if (pSirWPSProbeRspIE->
 	    FieldPresent & SIR_WPS_PROBRSP_PRIMARYDEVICETYPE_PRESENT) {
 		pDot11f->PrimaryDeviceType.present = 1;
-		cdf_mem_copy(pDot11f->PrimaryDeviceType.oui,
+		qdf_mem_copy(pDot11f->PrimaryDeviceType.oui,
 			     pSirWPSProbeRspIE->PrimaryDeviceOUI,
 			     sizeof(pSirWPSProbeRspIE->PrimaryDeviceOUI));
 		pDot11f->PrimaryDeviceType.primary_category =
@@ -5105,7 +5105,7 @@
 		pDot11f->DeviceName.present = 1;
 		pDot11f->DeviceName.num_text =
 			pSirWPSProbeRspIE->DeviceName.num_text;
-		cdf_mem_copy(pDot11f->DeviceName.text,
+		qdf_mem_copy(pDot11f->DeviceName.text,
 			     pSirWPSProbeRspIE->DeviceName.text,
 			     pDot11f->DeviceName.num_text);
 	} else
@@ -5218,7 +5218,7 @@
 
 	if (pSirWPSBeaconIE->FieldPresent & SIR_WPS_BEACON_UUIDE_PRESENT) {
 		pDot11f->UUID_E.present = 1;
-		cdf_mem_copy(pDot11f->UUID_E.uuid, pSirWPSBeaconIE->UUID_E,
+		qdf_mem_copy(pDot11f->UUID_E.uuid, pSirWPSBeaconIE->UUID_E,
 			     WNI_CFG_WPS_UUID_LEN);
 	} else
 		pDot11f->UUID_E.present = 0;
@@ -5519,7 +5519,7 @@
 
 	pDot11f->report.Beacon.regClass = pBeaconReport->regClass;
 	pDot11f->report.Beacon.channel = pBeaconReport->channel;
-	cdf_mem_copy(pDot11f->report.Beacon.meas_start_time,
+	qdf_mem_copy(pDot11f->report.Beacon.meas_start_time,
 		     pBeaconReport->measStartTime,
 		     sizeof(pDot11f->report.Beacon.meas_start_time));
 	pDot11f->report.Beacon.meas_duration = pBeaconReport->measDuration;
@@ -5528,14 +5528,14 @@
 		!pBeaconReport->bcnProbeRsp;
 	pDot11f->report.Beacon.RCPI = pBeaconReport->rcpi;
 	pDot11f->report.Beacon.RSNI = pBeaconReport->rsni;
-	cdf_mem_copy(pDot11f->report.Beacon.BSSID, pBeaconReport->bssid,
+	qdf_mem_copy(pDot11f->report.Beacon.BSSID, pBeaconReport->bssid,
 		     sizeof(tSirMacAddr));
 	pDot11f->report.Beacon.antenna_id = pBeaconReport->antennaId;
 	pDot11f->report.Beacon.parent_TSF = pBeaconReport->parentTSF;
 
 	if (pBeaconReport->numIes) {
 		pDot11f->report.Beacon.BeaconReportFrmBody.present = 1;
-		cdf_mem_copy(pDot11f->report.Beacon.BeaconReportFrmBody.
+		qdf_mem_copy(pDot11f->report.Beacon.BeaconReportFrmBody.
 			     reportedFields, pBeaconReport->Ies,
 			     pBeaconReport->numIes);
 		pDot11f->report.Beacon.BeaconReportFrmBody.num_reportedFields =
@@ -5704,12 +5704,12 @@
 		WNI_CFG_MAX_TX_POWER_5_LEN);
 	item = WNI_CFG_COUNTRY_CODE;
 	CFG_GET_STR(nSirStatus, mac_ctx, item, code, codelen, 3);
-	cdf_mem_copy(&frame->Country, code, codelen);
+	qdf_mem_copy(&frame->Country, code, codelen);
 	if (len > MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE)
 		len = MAX_SIZE_OF_TRIPLETS_IN_COUNTRY_IE;
 
 	frame->Country.num_triplets = (uint8_t)(len / 3);
-	cdf_mem_copy((uint8_t *)&frame->Country.triplets, temp, len);
+	qdf_mem_copy((uint8_t *)&frame->Country.triplets, temp, len);
 	frame->Country.present = 1;
 
 	/* PowerConstraints */
diff --git a/core/mac/src/sys/legacy/src/utils/src/utils_parser.c b/core/mac/src/sys/legacy/src/utils/src/utils_parser.c
index 9b91902..093e404 100644
--- a/core/mac/src/sys/legacy/src/utils/src/utils_parser.c
+++ b/core/mac/src/sys/legacy/src/utils/src/utils_parser.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -44,21 +44,21 @@
 void convert_ssid(tpAniSirGlobal pMac, tSirMacSSid *pOld, tDot11fIESSID *pNew)
 {
 	pOld->length = pNew->num_ssid;
-	cdf_mem_copy(pOld->ssId, pNew->ssid, pNew->num_ssid);
+	qdf_mem_copy(pOld->ssId, pNew->ssid, pNew->num_ssid);
 }
 
 void convert_supp_rates(tpAniSirGlobal pMac,
 			tSirMacRateSet *pOld, tDot11fIESuppRates *pNew)
 {
 	pOld->numRates = pNew->num_rates;
-	cdf_mem_copy(pOld->rate, pNew->rates, pNew->num_rates);
+	qdf_mem_copy(pOld->rate, pNew->rates, pNew->num_rates);
 }
 
 void convert_ext_supp_rates(tpAniSirGlobal pMac,
 			    tSirMacRateSet *pOld, tDot11fIEExtSuppRates *pNew)
 {
 	pOld->numRates = pNew->num_rates;
-	cdf_mem_copy(pOld->rate, pNew->rates, pNew->num_rates);
+	qdf_mem_copy(pOld->rate, pNew->rates, pNew->num_rates);
 }
 
 void convert_qos_caps(tpAniSirGlobal pMac,
@@ -101,7 +101,7 @@
 	}
 
 	pOld->length = (uint8_t) written - 2;
-	cdf_mem_copy(pOld->info, buffer + 2, pOld->length);
+	qdf_mem_copy(pOld->info, buffer + 2, pOld->length);
 
 	return eSIR_SUCCESS;
 }
@@ -116,7 +116,7 @@
 	pOld->info[1] = 0x50;
 	pOld->info[2] = 0xf2;
 	pOld->info[3] = 0x01;
-	cdf_mem_copy(pOld->info + 4, pNew->data, pNew->num_data);
+	qdf_mem_copy(pOld->info + 4, pNew->data, pNew->num_data);
 
 	return eSIR_SUCCESS;
 }
@@ -129,7 +129,7 @@
 	/* This is awful, I know, but the old code just rammed the IE into */
 	/* an opaque array.  Note that we need to explicitly add the OUI! */
 	pOld->length = pNew->num_data;
-	cdf_mem_copy(pOld->info, pNew->data, pNew->num_data);
+	qdf_mem_copy(pOld->info, pNew->data, pNew->num_data);
 
 	return eSIR_SUCCESS;
 }
@@ -149,7 +149,7 @@
 	pOld->addIEdata[curAddIELen++] = 0x50;
 	pOld->addIEdata[curAddIELen++] = 0xf2;
 	pOld->addIEdata[curAddIELen++] = 0x04;
-	cdf_mem_copy(pOld->addIEdata + curAddIELen, pNew->data, pNew->num_data);
+	qdf_mem_copy(pOld->addIEdata + curAddIELen, pNew->data, pNew->num_data);
 
 	return eSIR_SUCCESS;
 }
@@ -168,7 +168,7 @@
 	pOld->addIEdata[curAddIELen++] = 0x6f;
 	pOld->addIEdata[curAddIELen++] = 0x9A;
 	pOld->addIEdata[curAddIELen++] = 0x09;
-	cdf_mem_copy(pOld->addIEdata + curAddIELen, pNew->data, pNew->num_data);
+	qdf_mem_copy(pOld->addIEdata + curAddIELen, pNew->data, pNew->num_data);
 
 	return eSIR_SUCCESS;
 }
@@ -188,7 +188,7 @@
 	pOld->addIEdata[curAddIELen++] = 0x6f;
 	pOld->addIEdata[curAddIELen++] = 0x9A;
 	pOld->addIEdata[curAddIELen++] = 0x0a;
-	cdf_mem_copy(pOld->addIEdata + curAddIELen, pNew->data, pNew->num_data);
+	qdf_mem_copy(pOld->addIEdata + curAddIELen, pNew->data, pNew->num_data);
 
 	return eSIR_SUCCESS;
 }
@@ -207,7 +207,7 @@
 	}
 
 	pOld->length = (uint8_t) written - 2;
-	cdf_mem_copy(pOld->info, buffer + 2, pOld->length);
+	qdf_mem_copy(pOld->info, buffer + 2, pOld->length);
 
 	return eSIR_SUCCESS;
 }
@@ -218,7 +218,7 @@
 	/* This is awful, I know, but the old code just rammed the IE into */
 	/* an opaque array. */
 	pOld->length = pNew->num_data;
-	cdf_mem_copy(pOld->info, pNew->data, pOld->length);
+	qdf_mem_copy(pOld->info, pNew->data, pOld->length);
 
 	return eSIR_SUCCESS;
 }
@@ -239,7 +239,7 @@
 {
 	pOld->type = 36;
 	pOld->length = (pNew->num_bands * 2);
-	cdf_mem_copy((uint8_t *) pOld->supportedChannels,
+	qdf_mem_copy((uint8_t *) pOld->supportedChannels,
 		     (uint8_t *) pNew->bands, pOld->length);
 }
 
@@ -268,7 +268,7 @@
 	pOld->bitmapControl = pNew->bmpctl;
 	pOld->bitmapLength = pNew->num_vbmp;
 
-	cdf_mem_copy(pOld->bitmap, pNew->vbmp, pNew->num_vbmp);
+	qdf_mem_copy(pOld->bitmap, pNew->vbmp, pNew->num_vbmp);
 }
 
 void convert_country(tpAniSirGlobal pMac,
@@ -276,7 +276,7 @@
 {
 	int i;
 
-	cdf_mem_copy(pOld->countryString, pNew->country, COUNTRY_STRING_LENGTH);
+	qdf_mem_copy(pOld->countryString, pNew->country, COUNTRY_STRING_LENGTH);
 
 	pOld->numIntervals = pNew->num_triplets;
 
@@ -295,7 +295,7 @@
 	pOld->type = 221;
 	pOld->length = 24;
 
-	cdf_mem_copy((uint8_t *) &pOld->qosInfo, (uint8_t *) &pNew->qosInfo,
+	qdf_mem_copy((uint8_t *) &pOld->qosInfo, (uint8_t *) &pNew->qosInfo,
 		     1);
 
 	pOld->acbe.aci.aifsn = pNew->acbe_aifsn;
@@ -342,7 +342,7 @@
 	pOld->type = 12;
 	pOld->length = 20;
 
-	cdf_mem_copy((uint8_t *) &pOld->qosInfo, (uint8_t *) &pNew->qos, 1);
+	qdf_mem_copy((uint8_t *) &pOld->qosInfo, (uint8_t *) &pNew->qos, 1);
 
 	pOld->acbe.aci.aifsn = pNew->acbe_aifsn;
 	pOld->acbe.aci.acm = pNew->acbe_acm;
@@ -422,9 +422,9 @@
 
 	switch (pNew->classifier_type) {
 	case 0:
-		cdf_mem_copy(pOld->tclasParams.eth.srcAddr,
+		qdf_mem_copy(pOld->tclasParams.eth.srcAddr,
 			     pNew->info.EthParams.source, 6);
-		cdf_mem_copy(pOld->tclasParams.eth.dstAddr,
+		qdf_mem_copy(pOld->tclasParams.eth.dstAddr,
 			     pNew->info.EthParams.dest, 6);
 		pOld->tclasParams.eth.type = pNew->info.EthParams.type;
 		break;
@@ -432,10 +432,10 @@
 		pOld->version = pNew->info.IpParams.version;
 		if (4 == pNew->info.IpParams.version) {
 			pOld->tclasParams.ipv4.version = 4;
-			cdf_mem_copy(pOld->tclasParams.ipv4.srcIpAddr,
+			qdf_mem_copy(pOld->tclasParams.ipv4.srcIpAddr,
 				     pNew->info.IpParams.params.IpV4Params.
 				     source, 4);
-			cdf_mem_copy(pOld->tclasParams.ipv4.dstIpAddr,
+			qdf_mem_copy(pOld->tclasParams.ipv4.dstIpAddr,
 				     pNew->info.IpParams.params.IpV4Params.dest,
 				     4);
 			pOld->tclasParams.ipv4.srcPort =
@@ -450,11 +450,11 @@
 				pNew->info.IpParams.params.IpV4Params.reserved;
 		} else if (6 == pNew->info.IpParams.version) {
 			pOld->tclasParams.ipv6.version = 6;
-			cdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
+			qdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
 				     srcIpAddr,
 				     (uint8_t *) pNew->info.IpParams.params.
 				     IpV6Params.source, 16);
-			cdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
+			qdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
 				     dstIpAddr,
 				     (uint8_t *) pNew->info.IpParams.params.
 				     IpV6Params.dest, 16);
@@ -462,7 +462,7 @@
 				pNew->info.IpParams.params.IpV6Params.src_port;
 			pOld->tclasParams.ipv6.dstPort =
 				pNew->info.IpParams.params.IpV6Params.dest_port;
-			cdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
+			qdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
 				     flowLabel,
 				     (uint8_t *) pNew->info.IpParams.params.
 				     IpV6Params.flow_label, 3);
@@ -526,9 +526,9 @@
 
 	switch (pNew->classifier_type) {
 	case 0:
-		cdf_mem_copy(pOld->tclasParams.eth.srcAddr,
+		qdf_mem_copy(pOld->tclasParams.eth.srcAddr,
 			     pNew->info.EthParams.source, 6);
-		cdf_mem_copy(pOld->tclasParams.eth.dstAddr,
+		qdf_mem_copy(pOld->tclasParams.eth.dstAddr,
 			     pNew->info.EthParams.dest, 6);
 		pOld->tclasParams.eth.type = pNew->info.EthParams.type;
 		break;
@@ -536,10 +536,10 @@
 		pOld->version = pNew->info.IpParams.version;
 		if (4 == pNew->info.IpParams.version) {
 			pOld->tclasParams.ipv4.version = 4;
-			cdf_mem_copy(pOld->tclasParams.ipv4.srcIpAddr,
+			qdf_mem_copy(pOld->tclasParams.ipv4.srcIpAddr,
 				     pNew->info.IpParams.params.IpV4Params.
 				     source, 4);
-			cdf_mem_copy(pOld->tclasParams.ipv4.dstIpAddr,
+			qdf_mem_copy(pOld->tclasParams.ipv4.dstIpAddr,
 				     pNew->info.IpParams.params.IpV4Params.dest,
 				     4);
 			pOld->tclasParams.ipv4.srcPort =
@@ -554,11 +554,11 @@
 				pNew->info.IpParams.params.IpV4Params.reserved;
 		} else if (6 == pNew->info.IpParams.version) {
 			pOld->tclasParams.ipv6.version = 6;
-			cdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
+			qdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
 				     srcIpAddr,
 				     (uint8_t *) pNew->info.IpParams.params.
 				     IpV6Params.source, 16);
-			cdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
+			qdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
 				     dstIpAddr,
 				     (uint8_t *) pNew->info.IpParams.params.
 				     IpV6Params.dest, 16);
@@ -566,7 +566,7 @@
 				pNew->info.IpParams.params.IpV6Params.src_port;
 			pOld->tclasParams.ipv6.dstPort =
 				pNew->info.IpParams.params.IpV6Params.dest_port;
-			cdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
+			qdf_mem_copy((uint8_t *) pOld->tclasParams.ipv6.
 				     flowLabel,
 				     (uint8_t *) pNew->info.IpParams.params.
 				     IpV6Params.flow_label, 3);
@@ -624,8 +624,9 @@
 }
 
 /**
-    @brief   :    This functions converts the given buffer till given size to Big endian format assuming the
-                     bus is 32 bit. The size should be four byte aligned.
+    @brief   :    This functions converts the given buffer till given size to
+    Big endian format assuming the bus is 32 bit. The size should
+    be four byte aligned.
     @param :    ptr to be converted, size
     @return  :    void
  */
@@ -670,11 +671,11 @@
 	macMgmtHdr->seqControl.fragNum = 0;
 	macMgmtHdr->seqControl.seqNumLo = 0;
 	macMgmtHdr->seqControl.seqNumHi = 2;
-	cdf_mem_copy((void *)&macMgmtHdr->da,
+	qdf_mem_copy((void *)&macMgmtHdr->da,
 		     (void *)bssid, sizeof(tSirMacAddr));
-	cdf_mem_copy((void *)&macMgmtHdr->sa,
+	qdf_mem_copy((void *)&macMgmtHdr->sa,
 		     (void *)selfMacAddr, sizeof(tSirMacAddr));
-	cdf_mem_copy((void *)&macMgmtHdr->bssId,
+	qdf_mem_copy((void *)&macMgmtHdr->bssId,
 		     (void *)bssid, sizeof(tSirMacAddr));
 
 	return;
@@ -697,7 +698,7 @@
 		(uint8_t) (SIR_MAC_MAX_DURATION_MICRO_SECONDS & 0xff);
 	macMgmtHdr->durationHi =
 		(uint8_t) ((SIR_MAC_MAX_DURATION_MICRO_SECONDS & 0xff00) >> 8);
-	cdf_mem_copy((void *)macMgmtHdr->da, (void *)selfMac,
+	qdf_mem_copy((void *)macMgmtHdr->da, (void *)selfMac,
 		     sizeof(tSirMacAddr));
 
 	return;
@@ -754,9 +755,9 @@
 		macMgmtHdr->seqControl.fragNum = 0;
 		macMgmtHdr->seqControl.seqNumLo = 0;
 		macMgmtHdr->seqControl.seqNumHi = 2;
-		cdf_mem_copy((void *)&macMgmtHdr->da, (void *)pSta[0].bssId, 6);
-		cdf_mem_copy(&macMgmtHdr->sa, pSta[0].staAddr, 6);
-		cdf_mem_copy((void *)&macMgmtHdr->bssId, (void *)pSta[0].bssId,
+		qdf_mem_copy((void *)&macMgmtHdr->da, (void *)pSta[0].bssId, 6);
+		qdf_mem_copy(&macMgmtHdr->sa, pSta[0].staAddr, 6);
+		qdf_mem_copy((void *)&macMgmtHdr->bssId, (void *)pSta[0].bssId,
 			     6);
 	} else if (role == eSYSTEM_AP_ROLE || role == eSYSTEM_STA_IN_IBSS_ROLE) {
 		macMgmtHdr->fc.type = SIR_MAC_CTRL_FRAME;
@@ -774,7 +775,7 @@
 		macMgmtHdr->durationHi =
 			(uint8_t) ((SIR_MAC_MAX_DURATION_MICRO_SECONDS & 0xff00) >>
 				   8);
-		cdf_mem_copy((void *)macMgmtHdr->da, (void *)pSta[0].staAddr,
+		qdf_mem_copy((void *)macMgmtHdr->da, (void *)pSta[0].staAddr,
 			     6);
 	}
 	return;
@@ -813,9 +814,9 @@
 		macMgmtHdr->seqControl.fragNum = 0;
 		macMgmtHdr->seqControl.seqNumLo = 0;
 		macMgmtHdr->seqControl.seqNumHi = 2;
-		cdf_mem_copy((void *)macMgmtHdr->da, (void *)pSta[0].bssId, 6);
-		cdf_mem_copy(macMgmtHdr->sa, pSta[0].staAddr, 6);
-		cdf_mem_copy((void *)macMgmtHdr->bssId, (void *)pSta[0].bssId,
+		qdf_mem_copy((void *)macMgmtHdr->da, (void *)pSta[0].bssId, 6);
+		qdf_mem_copy(macMgmtHdr->sa, pSta[0].staAddr, 6);
+		qdf_mem_copy((void *)macMgmtHdr->bssId, (void *)pSta[0].bssId,
 			     6);
 
 	}