prima: WLAN Driver Release 3.2.0.10
diff --git a/CORE/SYS/legacy/src/utils/src/parserApi.c b/CORE/SYS/legacy/src/utils/src/parserApi.c
index 106fa55..24aa251 100644
--- a/CORE/SYS/legacy/src/utils/src/parserApi.c
+++ b/CORE/SYS/legacy/src/utils/src/parserApi.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2012, The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -1870,20 +1870,28 @@
                                           tpSirProbeRespBeacon pProbeResp)
 {
     tANI_U32             status;
-    tDot11fProbeResponse pr;
+    tDot11fProbeResponse *pr;
 
     // Ok, zero-init our [out] parameter,
     palZeroMemory( pMac->hHdd, ( tANI_U8* )pProbeResp, sizeof(tSirProbeRespBeacon) );
-    palZeroMemory( pMac->hHdd, ( tANI_U8* )&pr, sizeof(tDot11fProbeResponse) );
 
-    
+    status = palAllocateMemory(pMac->hHdd, (void **)&pr, sizeof(tDot11fProbeResponse));
+    if(!HAL_STATUS_SUCCESS(status))
+    {
+        limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
+        return eSIR_FAILURE;
+    }
+
+    palZeroMemory( pMac->hHdd, ( tANI_U8* )pr, sizeof(tDot11fProbeResponse) );
+
     // delegate to the framesc-generated code,
-    status = dot11fUnpackProbeResponse( pMac, pFrame, nFrame, &pr );
+    status = dot11fUnpackProbeResponse( pMac, pFrame, nFrame, pr );
     if ( DOT11F_FAILED( status ) )
     {
         limLog(pMac, LOGE, FL("Failed to parse a Probe Response (0x%08x, %d bytes):\n"),
                   status, nFrame);
         PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pFrame, nFrame);)
+        palFreeMemory(pMac->hHdd, pr);
         return eSIR_FAILURE;
     }
     else if ( DOT11F_WARNED( status ) )
@@ -1896,171 +1904,171 @@
     // & "transliterate" from a 'tDot11fProbeResponse' to a 'tSirProbeRespBeacon'...
 
     // Timestamp
-    palCopyMemory( pMac->hHdd, ( tANI_U8* )pProbeResp->timeStamp, ( tANI_U8* )&pr.TimeStamp, sizeof(tSirMacTimeStamp) );
+    palCopyMemory( pMac->hHdd, ( tANI_U8* )pProbeResp->timeStamp, ( tANI_U8* )&pr->TimeStamp, sizeof(tSirMacTimeStamp) );
 
     // Beacon Interval
-    pProbeResp->beaconInterval = pr.BeaconInterval.interval;
+    pProbeResp->beaconInterval = pr->BeaconInterval.interval;
 
     // Capabilities
-    pProbeResp->capabilityInfo.ess            = pr.Capabilities.ess;
-    pProbeResp->capabilityInfo.ibss           = pr.Capabilities.ibss;
-    pProbeResp->capabilityInfo.cfPollable     = pr.Capabilities.cfPollable;
-    pProbeResp->capabilityInfo.cfPollReq      = pr.Capabilities.cfPollReq;
-    pProbeResp->capabilityInfo.privacy        = pr.Capabilities.privacy;
-    pProbeResp->capabilityInfo.shortPreamble  = pr.Capabilities.shortPreamble;
-    pProbeResp->capabilityInfo.pbcc           = pr.Capabilities.pbcc;
-    pProbeResp->capabilityInfo.channelAgility = pr.Capabilities.channelAgility;
-    pProbeResp->capabilityInfo.spectrumMgt    = pr.Capabilities.spectrumMgt;
-    pProbeResp->capabilityInfo.qos            = pr.Capabilities.qos;
-    pProbeResp->capabilityInfo.shortSlotTime  = pr.Capabilities.shortSlotTime;
-    pProbeResp->capabilityInfo.apsd           = pr.Capabilities.apsd;
-    pProbeResp->capabilityInfo.rrm            = pr.Capabilities.rrm;
-    pProbeResp->capabilityInfo.dsssOfdm       = pr.Capabilities.dsssOfdm;
-    pProbeResp->capabilityInfo.delayedBA       = pr.Capabilities.delayedBA;
-    pProbeResp->capabilityInfo.immediateBA    = pr.Capabilities.immediateBA;
+    pProbeResp->capabilityInfo.ess            = pr->Capabilities.ess;
+    pProbeResp->capabilityInfo.ibss           = pr->Capabilities.ibss;
+    pProbeResp->capabilityInfo.cfPollable     = pr->Capabilities.cfPollable;
+    pProbeResp->capabilityInfo.cfPollReq      = pr->Capabilities.cfPollReq;
+    pProbeResp->capabilityInfo.privacy        = pr->Capabilities.privacy;
+    pProbeResp->capabilityInfo.shortPreamble  = pr->Capabilities.shortPreamble;
+    pProbeResp->capabilityInfo.pbcc           = pr->Capabilities.pbcc;
+    pProbeResp->capabilityInfo.channelAgility = pr->Capabilities.channelAgility;
+    pProbeResp->capabilityInfo.spectrumMgt    = pr->Capabilities.spectrumMgt;
+    pProbeResp->capabilityInfo.qos            = pr->Capabilities.qos;
+    pProbeResp->capabilityInfo.shortSlotTime  = pr->Capabilities.shortSlotTime;
+    pProbeResp->capabilityInfo.apsd           = pr->Capabilities.apsd;
+    pProbeResp->capabilityInfo.rrm            = pr->Capabilities.rrm;
+    pProbeResp->capabilityInfo.dsssOfdm       = pr->Capabilities.dsssOfdm;
+    pProbeResp->capabilityInfo.delayedBA       = pr->Capabilities.delayedBA;
+    pProbeResp->capabilityInfo.immediateBA    = pr->Capabilities.immediateBA;
 
-    if ( ! pr.SSID.present )
+    if ( ! pr->SSID.present )
     {
         PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
     }
     else
     {
         pProbeResp->ssidPresent = 1;
-        ConvertSSID( pMac, &pProbeResp->ssId, &pr.SSID );
+        ConvertSSID( pMac, &pProbeResp->ssId, &pr->SSID );
     }
 
-    if ( ! pr.SuppRates.present )
+    if ( ! pr->SuppRates.present )
     {
         PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
     }
     else
     {
         pProbeResp->suppRatesPresent = 1;
-        ConvertSuppRates( pMac, &pProbeResp->supportedRates, &pr.SuppRates );
+        ConvertSuppRates( pMac, &pProbeResp->supportedRates, &pr->SuppRates );
     }
 
-    if ( pr.ExtSuppRates.present )
+    if ( pr->ExtSuppRates.present )
     {
         pProbeResp->extendedRatesPresent = 1;
-        ConvertExtSuppRates( pMac, &pProbeResp->extendedRates, &pr.ExtSuppRates );
+        ConvertExtSuppRates( pMac, &pProbeResp->extendedRates, &pr->ExtSuppRates );
     }
 
 
-    if ( pr.CFParams.present )
+    if ( pr->CFParams.present )
     {
         pProbeResp->cfPresent = 1;
-        ConvertCFParams( pMac, &pProbeResp->cfParamSet, &pr.CFParams );
+        ConvertCFParams( pMac, &pProbeResp->cfParamSet, &pr->CFParams );
     }
 
-    if ( pr.Country.present )
+    if ( pr->Country.present )
     {
         pProbeResp->countryInfoPresent = 1;
-        ConvertCountry( pMac, &pProbeResp->countryInfoParam, &pr.Country );
+        ConvertCountry( pMac, &pProbeResp->countryInfoParam, &pr->Country );
     }
 
-    if ( pr.EDCAParamSet.present )
+    if ( pr->EDCAParamSet.present )
     {
         pProbeResp->edcaPresent = 1;
-        ConvertEDCAParam( pMac, &pProbeResp->edcaParams, &pr.EDCAParamSet );
+        ConvertEDCAParam( pMac, &pProbeResp->edcaParams, &pr->EDCAParamSet );
     }
 
-    if ( pr.ChanSwitchAnn.present )
+    if ( pr->ChanSwitchAnn.present )
     {
         pProbeResp->channelSwitchPresent = 1;
-        palCopyMemory( pMac, &pProbeResp->channelSwitchIE, &pr.ChanSwitchAnn,
+        palCopyMemory( pMac, &pProbeResp->channelSwitchIE, &pr->ChanSwitchAnn,
                        sizeof(tDot11fIEExtChanSwitchAnn) );
     }
 
-       if ( pr.ExtChanSwitchAnn.present )
+       if ( pr->ExtChanSwitchAnn.present )
     {
         pProbeResp->extChannelSwitchPresent = 1;
-        palCopyMemory( pMac, &pProbeResp->extChannelSwitchIE, &pr.ExtChanSwitchAnn,
+        palCopyMemory( pMac, &pProbeResp->extChannelSwitchIE, &pr->ExtChanSwitchAnn,
                        sizeof(tDot11fIEExtChanSwitchAnn) );
     }
 
-    if( pr.TPCReport.present)
+    if( pr->TPCReport.present)
     {
         pProbeResp->tpcReportPresent = 1;
-        palCopyMemory(pMac->hHdd, &pProbeResp->tpcReport, &pr.TPCReport, sizeof(tDot11fIETPCReport));
+        palCopyMemory(pMac->hHdd, &pProbeResp->tpcReport, &pr->TPCReport, sizeof(tDot11fIETPCReport));
     }
 
-    if( pr.PowerConstraints.present)
+    if( pr->PowerConstraints.present)
     {
         pProbeResp->powerConstraintPresent = 1;
-        palCopyMemory(pMac->hHdd, &pProbeResp->localPowerConstraint, &pr.PowerConstraints, sizeof(tDot11fIEPowerConstraints));
+        palCopyMemory(pMac->hHdd, &pProbeResp->localPowerConstraint, &pr->PowerConstraints, sizeof(tDot11fIEPowerConstraints));
     }
 
-    if ( pr.Quiet.present )
+    if ( pr->Quiet.present )
     {
         pProbeResp->quietIEPresent = 1;
-        palCopyMemory( pMac, &pProbeResp->quietIE, &pr.Quiet, sizeof(tDot11fIEQuiet) );
+        palCopyMemory( pMac, &pProbeResp->quietIE, &pr->Quiet, sizeof(tDot11fIEQuiet) );
     }
 
-    if ( pr.HTCaps.present )
+    if ( pr->HTCaps.present )
     {
-        palCopyMemory( pMac, &pProbeResp->HTCaps, &pr.HTCaps, sizeof( tDot11fIEHTCaps ) );
+        palCopyMemory( pMac, &pProbeResp->HTCaps, &pr->HTCaps, sizeof( tDot11fIEHTCaps ) );
     }
 
-    if ( pr.HTInfo.present )
+    if ( pr->HTInfo.present )
     {
-        palCopyMemory( pMac, &pProbeResp->HTInfo, &pr.HTInfo, sizeof( tDot11fIEHTInfo ) );
+        palCopyMemory( pMac, &pProbeResp->HTInfo, &pr->HTInfo, sizeof( tDot11fIEHTInfo ) );
     }
 
-    if ( pr.DSParams.present )
+    if ( pr->DSParams.present )
     {
         pProbeResp->dsParamsPresent = 1;
-        pProbeResp->channelNumber = pr.DSParams.curr_channel;
+        pProbeResp->channelNumber = pr->DSParams.curr_channel;
     }
-    else if(pr.HTInfo.present)
+    else if(pr->HTInfo.present)
     {
-        pProbeResp->channelNumber = pr.HTInfo.primaryChannel;
+        pProbeResp->channelNumber = pr->HTInfo.primaryChannel;
     }
 
-    if ( pr.RSN.present )
+    if ( pr->RSN.present )
     {
         pProbeResp->rsnPresent = 1;
-        ConvertRSN( pMac, &pProbeResp->rsn, &pr.RSN );
+        ConvertRSN( pMac, &pProbeResp->rsn, &pr->RSN );
     }
 
-    if ( pr.WPA.present )
+    if ( pr->WPA.present )
     {
         pProbeResp->wpaPresent = 1;
-        ConvertWPA( pMac, &pProbeResp->wpa, &pr.WPA );
+        ConvertWPA( pMac, &pProbeResp->wpa, &pr->WPA );
     }
 
-    if ( pr.WMMParams.present )
+    if ( pr->WMMParams.present )
     {
         pProbeResp->wmeEdcaPresent = 1;
-        ConvertWMMParams( pMac, &pProbeResp->edcaParams, &pr.WMMParams );
+        ConvertWMMParams( pMac, &pProbeResp->edcaParams, &pr->WMMParams );
         PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Probe Response Frame!\n"));
-                                __printWMMParams(pMac, &pr.WMMParams);)
+                                __printWMMParams(pMac, &pr->WMMParams);)
     }
 
-    if ( pr.WMMInfoAp.present )
+    if ( pr->WMMInfoAp.present )
     {
         pProbeResp->wmeInfoPresent = 1;
         PELOG1(limLog(pMac, LOG1, FL("WMM Information Element present in Probe Response Frame!\n"));)
     }
 
-    if ( pr.WMMCaps.present )
+    if ( pr->WMMCaps.present )
     {
         pProbeResp->wsmCapablePresent = 1;
     }
 
 
-    if ( pr.ERPInfo.present )
+    if ( pr->ERPInfo.present )
     {
         pProbeResp->erpPresent = 1;
-        ConvertERPInfo( pMac, &pProbeResp->erpIEInfo, &pr.ERPInfo );
+        ConvertERPInfo( pMac, &pProbeResp->erpIEInfo, &pr->ERPInfo );
     }
 
 #ifdef WLAN_FEATURE_VOWIFI_11R
-    if (pr.MobilityDomain.present)
+    if (pr->MobilityDomain.present)
     {
         // MobilityDomain
         pProbeResp->mdiePresent = 1;
-        palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pProbeResp->mdie[0]), (tANI_U8 *)&(pr.MobilityDomain.MDID), sizeof(tANI_U16) );
-        pProbeResp->mdie[2] = ((pr.MobilityDomain.overDSCap << 0) | (pr.MobilityDomain.resourceReqCap << 1));
+        palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pProbeResp->mdie[0]), (tANI_U8 *)&(pr->MobilityDomain.MDID), sizeof(tANI_U16) );
+        pProbeResp->mdie[2] = ((pr->MobilityDomain.overDSCap << 0) | (pr->MobilityDomain.resourceReqCap << 1));
 #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
         limLog(pMac, LOGE, FL("mdie=%02x%02x%02x\n"), (unsigned int)pProbeResp->mdie[0],
                (unsigned int)pProbeResp->mdie[1], (unsigned int)pProbeResp->mdie[2]);
@@ -2069,30 +2077,30 @@
 #endif
 
 #if defined FEATURE_WLAN_CCX
-    if (pr.QBSSLoad.present)
+    if (pr->QBSSLoad.present)
     {
-        palCopyMemory(pMac->hHdd, &pProbeResp->QBSSLoad, &pr.QBSSLoad, sizeof(tDot11fIEQBSSLoad));
+        palCopyMemory(pMac->hHdd, &pProbeResp->QBSSLoad, &pr->QBSSLoad, sizeof(tDot11fIEQBSSLoad));
     }
 #endif
 #ifdef WLAN_FEATURE_P2P
-    if (pr.P2PProbeRes.present)
+    if (pr->P2PProbeRes.present)
     {
-       palCopyMemory( pMac, &pProbeResp->P2PProbeRes, &pr.P2PProbeRes,
+       palCopyMemory( pMac, &pProbeResp->P2PProbeRes, &pr->P2PProbeRes,
                                                 sizeof(tDot11fIEP2PProbeRes) );
     }
 #endif
 #ifdef WLAN_FEATURE_11AC
-    if ( pr.VHTCaps.present )
+    if ( pr->VHTCaps.present )
     {
-       palCopyMemory( pMac, &pProbeResp->VHTCaps, &pr.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
+       palCopyMemory( pMac, &pProbeResp->VHTCaps, &pr->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
     }
-    if ( pr.VHTOperation.present )
+    if ( pr->VHTOperation.present )
     {
-        palCopyMemory( pMac, &pProbeResp->VHTOperation, &pr.VHTOperation, sizeof( tDot11fIEVHTOperation) );
+        palCopyMemory( pMac, &pProbeResp->VHTOperation, &pr->VHTOperation, sizeof( tDot11fIEVHTOperation) );
     }
-    if ( pr.VHTExtBssLoad.present )
+    if ( pr->VHTExtBssLoad.present )
     {
-        palCopyMemory( pMac, &pProbeResp->VHTExtBssLoad, &pr.VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
+        palCopyMemory( pMac, &pProbeResp->VHTExtBssLoad, &pr->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
     }
 #endif
     return eSIR_SUCCESS;
@@ -2849,7 +2857,7 @@
                              tANI_U8             *pFrame,
                              tpSirProbeRespBeacon pBeaconStruct)
 {
-    tDot11fBeacon   beacon;
+    tDot11fBeacon  *pBeacon;
     tANI_U32        status, nPayload;
     tANI_U8        *pPayload;
     tpSirMacMgmtHdr pHdr;
@@ -2862,18 +2870,27 @@
     
     // Zero-init our [out] parameter,
     palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct, sizeof(tSirProbeRespBeacon) );
-    palZeroMemory( pMac->hHdd, ( tANI_U8* )&beacon, sizeof(tDot11fBeacon) );
+    
+    status = palAllocateMemory(pMac->hHdd, (void **)&pBeacon, sizeof(tDot11fBeacon));
+    if(!HAL_STATUS_SUCCESS(status))
+    {
+        limLog(pMac, LOGE, FL("Failed to allocate memory\n") );
+        return eSIR_FAILURE;
+    }
+
+    palZeroMemory( pMac->hHdd, ( tANI_U8* )pBeacon, sizeof(tDot11fBeacon) );
 
     // get the MAC address out of the BD,
     palCopyMemory( pMac->hHdd, pBeaconStruct->bssid, pHdr->sa, 6 );
 
     // delegate to the framesc-generated code,
-    status = dot11fUnpackBeacon( pMac, pPayload, nPayload, &beacon );
+    status = dot11fUnpackBeacon( pMac, pPayload, nPayload, pBeacon );
     if ( DOT11F_FAILED( status ) )
     {
         limLog(pMac, LOGE, FL("Failed to parse Beacon IEs (0x%08x, %d bytes):\n"),
                   status, nPayload);
         PELOG2(sirDumpBuf(pMac, SIR_DBG_MODULE_ID, LOG2, pPayload, nPayload);)
+        palFreeMemory(pMac->hHdd, pBeacon);
         return eSIR_FAILURE;
     }
     else if ( DOT11F_WARNED( status ) )
@@ -2885,219 +2902,210 @@
 
     // & "transliterate" from a 'tDot11fBeacon' to a 'tSirProbeRespBeacon'...
     // Timestamp
-    palCopyMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct->timeStamp, ( tANI_U8* )&beacon.TimeStamp, sizeof(tSirMacTimeStamp) );
+    palCopyMemory( pMac->hHdd, ( tANI_U8* )pBeaconStruct->timeStamp, ( tANI_U8* )&pBeacon->TimeStamp, sizeof(tSirMacTimeStamp) );
 
     // Beacon Interval
-    pBeaconStruct->beaconInterval = beacon.BeaconInterval.interval;
+    pBeaconStruct->beaconInterval = pBeacon->BeaconInterval.interval;
 
     // Capabilities
-    pBeaconStruct->capabilityInfo.ess            = beacon.Capabilities.ess;
-    pBeaconStruct->capabilityInfo.ibss           = beacon.Capabilities.ibss;
-    pBeaconStruct->capabilityInfo.cfPollable     = beacon.Capabilities.cfPollable;
-    pBeaconStruct->capabilityInfo.cfPollReq      = beacon.Capabilities.cfPollReq;
-    pBeaconStruct->capabilityInfo.privacy        = beacon.Capabilities.privacy;
-    pBeaconStruct->capabilityInfo.shortPreamble  = beacon.Capabilities.shortPreamble;
-    pBeaconStruct->capabilityInfo.pbcc           = beacon.Capabilities.pbcc;
-    pBeaconStruct->capabilityInfo.channelAgility = beacon.Capabilities.channelAgility;
-    pBeaconStruct->capabilityInfo.spectrumMgt    = beacon.Capabilities.spectrumMgt;
-    pBeaconStruct->capabilityInfo.qos            = beacon.Capabilities.qos;
-    pBeaconStruct->capabilityInfo.shortSlotTime  = beacon.Capabilities.shortSlotTime;
-    pBeaconStruct->capabilityInfo.apsd           = beacon.Capabilities.apsd;
-    pBeaconStruct->capabilityInfo.rrm            = beacon.Capabilities.rrm;
-    pBeaconStruct->capabilityInfo.dsssOfdm      = beacon.Capabilities.dsssOfdm;
-    pBeaconStruct->capabilityInfo.delayedBA     = beacon.Capabilities.delayedBA;
-    pBeaconStruct->capabilityInfo.immediateBA    = beacon.Capabilities.immediateBA;
+    pBeaconStruct->capabilityInfo.ess            = pBeacon->Capabilities.ess;
+    pBeaconStruct->capabilityInfo.ibss           = pBeacon->Capabilities.ibss;
+    pBeaconStruct->capabilityInfo.cfPollable     = pBeacon->Capabilities.cfPollable;
+    pBeaconStruct->capabilityInfo.cfPollReq      = pBeacon->Capabilities.cfPollReq;
+    pBeaconStruct->capabilityInfo.privacy        = pBeacon->Capabilities.privacy;
+    pBeaconStruct->capabilityInfo.shortPreamble  = pBeacon->Capabilities.shortPreamble;
+    pBeaconStruct->capabilityInfo.pbcc           = pBeacon->Capabilities.pbcc;
+    pBeaconStruct->capabilityInfo.channelAgility = pBeacon->Capabilities.channelAgility;
+    pBeaconStruct->capabilityInfo.spectrumMgt    = pBeacon->Capabilities.spectrumMgt;
+    pBeaconStruct->capabilityInfo.qos            = pBeacon->Capabilities.qos;
+    pBeaconStruct->capabilityInfo.shortSlotTime  = pBeacon->Capabilities.shortSlotTime;
+    pBeaconStruct->capabilityInfo.apsd           = pBeacon->Capabilities.apsd;
+    pBeaconStruct->capabilityInfo.rrm            = pBeacon->Capabilities.rrm;
+    pBeaconStruct->capabilityInfo.dsssOfdm      = pBeacon->Capabilities.dsssOfdm;
+    pBeaconStruct->capabilityInfo.delayedBA     = pBeacon->Capabilities.delayedBA;
+    pBeaconStruct->capabilityInfo.immediateBA    = pBeacon->Capabilities.immediateBA;
  
-    if ( ! beacon.SSID.present )
+    if ( ! pBeacon->SSID.present )
     {
         PELOGW(limLog(pMac, LOGW, FL("Mandatory IE SSID not present!\n"));)
     }
     else
     {
         pBeaconStruct->ssidPresent = 1;
-        ConvertSSID( pMac, &pBeaconStruct->ssId, &beacon.SSID );
+        ConvertSSID( pMac, &pBeaconStruct->ssId, &pBeacon->SSID );
     }
 
-    if ( ! beacon.SuppRates.present )
+    if ( ! pBeacon->SuppRates.present )
     {
         PELOGW(limLog(pMac, LOGW, FL("Mandatory IE Supported Rates not present!\n"));)
     }
     else
     {
         pBeaconStruct->suppRatesPresent = 1;
-        ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &beacon.SuppRates );
+        ConvertSuppRates( pMac, &pBeaconStruct->supportedRates, &pBeacon->SuppRates );
     }
 
-    if ( beacon.ExtSuppRates.present )
+    if ( pBeacon->ExtSuppRates.present )
     {
         pBeaconStruct->extendedRatesPresent = 1;
-        ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &beacon.ExtSuppRates );
+        ConvertExtSuppRates( pMac, &pBeaconStruct->extendedRates, &pBeacon->ExtSuppRates );
     }
 
 
-    if ( beacon.CFParams.present )
+    if ( pBeacon->CFParams.present )
     {
         pBeaconStruct->cfPresent = 1;
-        ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &beacon.CFParams );
+        ConvertCFParams( pMac, &pBeaconStruct->cfParamSet, &pBeacon->CFParams );
     }
 
-    if ( beacon.TIM.present )
+    if ( pBeacon->TIM.present )
     {
         pBeaconStruct->timPresent = 1;
-        ConvertTIM( pMac, &pBeaconStruct->tim, &beacon.TIM );
+        ConvertTIM( pMac, &pBeaconStruct->tim, &pBeacon->TIM );
     }
 
-    if ( beacon.Country.present )
+    if ( pBeacon->Country.present )
     {
         pBeaconStruct->countryInfoPresent = 1;
-        ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &beacon.Country );
+        ConvertCountry( pMac, &pBeaconStruct->countryInfoParam, &pBeacon->Country );
     }
 
     // QOS Capabilities:
-    if ( beacon.QOSCapsAp.present )
+    if ( pBeacon->QOSCapsAp.present )
     {
         pBeaconStruct->qosCapabilityPresent = 1;
-        ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &beacon.QOSCapsAp );
+        ConvertQOSCaps( pMac, &pBeaconStruct->qosCapability, &pBeacon->QOSCapsAp );
     }
 
-    if ( beacon.EDCAParamSet.present )
+    if ( pBeacon->EDCAParamSet.present )
     {
         pBeaconStruct->edcaPresent = 1;
-        ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &beacon.EDCAParamSet );
+        ConvertEDCAParam( pMac, &pBeaconStruct->edcaParams, &pBeacon->EDCAParamSet );
     }
 
-    if ( beacon.ChanSwitchAnn.present )
+    if ( pBeacon->ChanSwitchAnn.present )
     {
         pBeaconStruct->channelSwitchPresent = 1;
-        palCopyMemory( pMac, &pBeaconStruct->channelSwitchIE, &beacon.ChanSwitchAnn,
+        palCopyMemory( pMac, &pBeaconStruct->channelSwitchIE, &pBeacon->ChanSwitchAnn,
                                                        sizeof(tDot11fIEChanSwitchAnn) );
     }
 
-    if ( beacon.ExtChanSwitchAnn.present )
+    if ( pBeacon->ExtChanSwitchAnn.present )
     {
         pBeaconStruct->extChannelSwitchPresent = 1;
-        palCopyMemory( pMac, &pBeaconStruct->extChannelSwitchIE, &beacon.ExtChanSwitchAnn,
+        palCopyMemory( pMac, &pBeaconStruct->extChannelSwitchIE, &pBeacon->ExtChanSwitchAnn,
                                                        sizeof(tDot11fIEExtChanSwitchAnn) );
     }
 
-    if( beacon.TPCReport.present)
+    if( pBeacon->TPCReport.present)
     {
         pBeaconStruct->tpcReportPresent = 1;
-        palCopyMemory(pMac->hHdd, &pBeaconStruct->tpcReport, &beacon.TPCReport,
+        palCopyMemory(pMac->hHdd, &pBeaconStruct->tpcReport, &pBeacon->TPCReport,
                                                      sizeof(tDot11fIETPCReport));
     }
 
-    if( beacon.PowerConstraints.present)
+    if( pBeacon->PowerConstraints.present)
     {
         pBeaconStruct->powerConstraintPresent = 1;
-        palCopyMemory(pMac->hHdd, &pBeaconStruct->localPowerConstraint, &beacon.PowerConstraints,
+        palCopyMemory(pMac->hHdd, &pBeaconStruct->localPowerConstraint, &pBeacon->PowerConstraints,
                                                                sizeof(tDot11fIEPowerConstraints));
     }
-#if defined FEATURE_WLAN_CCX
-    if (beacon.CCXTxmitPower.present)
-    {
-        palCopyMemory(pMac->hHdd, &pBeaconStruct->ccxTxPwr, &beacon.CCXTxmitPower,
-                                                               sizeof(tDot11fIECCXTxmitPower));
-    }
-    if (beacon.QBSSLoad.present)
-    {
-        palCopyMemory(pMac->hHdd, &pBeaconStruct->QBSSLoad, &beacon.QBSSLoad, sizeof(tDot11fIEQBSSLoad));
-    }
-#endif
-    if ( beacon.Quiet.present )
+
+    if ( pBeacon->Quiet.present )
     {
         pBeaconStruct->quietIEPresent = 1;
-        palCopyMemory( pMac, &pBeaconStruct->quietIE, &beacon.Quiet, sizeof(tDot11fIEQuiet));
+        palCopyMemory( pMac, &pBeaconStruct->quietIE, &pBeacon->Quiet, sizeof(tDot11fIEQuiet));
     }
 
-    if ( beacon.HTCaps.present )
+    if ( pBeacon->HTCaps.present )
     {
-        palCopyMemory( pMac, &pBeaconStruct->HTCaps, &beacon.HTCaps, sizeof( tDot11fIEHTCaps ) );
+        palCopyMemory( pMac, &pBeaconStruct->HTCaps, &pBeacon->HTCaps, sizeof( tDot11fIEHTCaps ) );
     }
 
-    if ( beacon.HTInfo.present )
+    if ( pBeacon->HTInfo.present )
     {
-        palCopyMemory( pMac, &pBeaconStruct->HTInfo, &beacon.HTInfo, sizeof( tDot11fIEHTInfo) );
+        palCopyMemory( pMac, &pBeaconStruct->HTInfo, &pBeacon->HTInfo, sizeof( tDot11fIEHTInfo) );
 
     }
 
-    if ( beacon.DSParams.present )
+    if ( pBeacon->DSParams.present )
     {
         pBeaconStruct->dsParamsPresent = 1;
-        pBeaconStruct->channelNumber = beacon.DSParams.curr_channel;
+        pBeaconStruct->channelNumber = pBeacon->DSParams.curr_channel;
     }
-    else if(beacon.HTInfo.present)
+    else if(pBeacon->HTInfo.present)
     {
-        pBeaconStruct->channelNumber = beacon.HTInfo.primaryChannel;
+        pBeaconStruct->channelNumber = pBeacon->HTInfo.primaryChannel;
     }
     else
     {
         pBeaconStruct->channelNumber = limUnmapChannel(mappedRXCh);
     }
 
-    if ( beacon.RSN.present )
+    if ( pBeacon->RSN.present )
     {
         pBeaconStruct->rsnPresent = 1;
-        ConvertRSN( pMac, &pBeaconStruct->rsn, &beacon.RSN );
+        ConvertRSN( pMac, &pBeaconStruct->rsn, &pBeacon->RSN );
     }
 
-    if ( beacon.WPA.present )
+    if ( pBeacon->WPA.present )
     {
         pBeaconStruct->wpaPresent = 1;
-        ConvertWPA( pMac, &pBeaconStruct->wpa, &beacon.WPA );
+        ConvertWPA( pMac, &pBeaconStruct->wpa, &pBeacon->WPA );
     }
 
-    if ( beacon.WMMParams.present )
+    if ( pBeacon->WMMParams.present )
     {
         pBeaconStruct->wmeEdcaPresent = 1;
-        ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &beacon.WMMParams );
+        ConvertWMMParams( pMac, &pBeaconStruct->edcaParams, &pBeacon->WMMParams );
         PELOG1(limLog(pMac, LOG1, FL("WMM Parameter present in Beacon Frame!\n"));
-        __printWMMParams(pMac, &beacon.WMMParams); )
+        __printWMMParams(pMac, &pBeacon->WMMParams); )
     }
 
-    if ( beacon.WMMInfoAp.present )
+    if ( pBeacon->WMMInfoAp.present )
     {
         pBeaconStruct->wmeInfoPresent = 1;
         PELOG1(limLog(pMac, LOG1, FL("WMM Info present in Beacon Frame!\n"));)
     }
 
-    if ( beacon.WMMCaps.present )
+    if ( pBeacon->WMMCaps.present )
     {
         pBeaconStruct->wsmCapablePresent = 1;
     }
 
-    if ( beacon.ERPInfo.present )
+    if ( pBeacon->ERPInfo.present )
     {
         pBeaconStruct->erpPresent = 1;
-        ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &beacon.ERPInfo );
+        ConvertERPInfo( pMac, &pBeaconStruct->erpIEInfo, &pBeacon->ERPInfo );
     }
 
 #ifdef WLAN_FEATURE_VOWIFI_11R
-    if (beacon.MobilityDomain.present)
+    if (pBeacon->MobilityDomain.present)
     {
         // MobilityDomain
         pBeaconStruct->mdiePresent = 1;
-        palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pBeaconStruct->mdie[0]), (tANI_U8 *)&(beacon.MobilityDomain.MDID), sizeof(tANI_U16) );
-        pBeaconStruct->mdie[2] = ((beacon.MobilityDomain.overDSCap << 0) | (beacon.MobilityDomain.resourceReqCap << 1));
+        palCopyMemory( pMac->hHdd, (tANI_U8 *)&(pBeaconStruct->mdie[0]), (tANI_U8 *)&(pBeacon->MobilityDomain.MDID), sizeof(tANI_U16) );
+        pBeaconStruct->mdie[2] = ((pBeacon->MobilityDomain.overDSCap << 0) | (pBeacon->MobilityDomain.resourceReqCap << 1));
 
     }
 #endif
 
 #ifdef WLAN_FEATURE_11AC
-    if ( beacon.VHTCaps.present )
+    if ( pBeacon->VHTCaps.present )
     {
-        palCopyMemory( pMac, &pBeaconStruct->VHTCaps, &beacon.VHTCaps, sizeof( tDot11fIEVHTCaps ) );
+        palCopyMemory( pMac, &pBeaconStruct->VHTCaps, &pBeacon->VHTCaps, sizeof( tDot11fIEVHTCaps ) );
     }
-    if ( beacon.VHTOperation.present )
+    if ( pBeacon->VHTOperation.present )
     {
-        palCopyMemory( pMac, &pBeaconStruct->VHTOperation, &beacon.VHTOperation, sizeof( tDot11fIEVHTOperation) );
+        palCopyMemory( pMac, &pBeaconStruct->VHTOperation, &pBeacon->VHTOperation, sizeof( tDot11fIEVHTOperation) );
     }
-    if ( beacon.VHTExtBssLoad.present )
+    if ( pBeacon->VHTExtBssLoad.present )
     {
-        palCopyMemory( pMac, &pBeaconStruct->VHTExtBssLoad, &beacon.VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
+        palCopyMemory( pMac, &pBeaconStruct->VHTExtBssLoad, &pBeacon->VHTExtBssLoad, sizeof( tDot11fIEVHTExtBssLoad) );
     }
 #endif
 
+    palFreeMemory(pMac->hHdd, pBeacon);
     return eSIR_SUCCESS;
 
 } // End sirConvertBeaconFrame2Struct.