prima: WLAN Driver Release 3.2.0.9
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index 6856670..b8391ed 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -128,9 +128,13 @@
     eCSR_DOT11_MODE_TAURUS_ONLY = 0x0200,
     eCSR_DOT11_MODE_11b_ONLY = 0x0400,
     eCSR_DOT11_MODE_11a_ONLY = 0x0800,
+#ifdef WLAN_FEATURE_11AC
+    eCSR_DOT11_MODE_11ac     = 0x1000,
+    eCSR_DOT11_MODE_11ac_ONLY = 0x2000,
+#endif
     //This is for WIFI test. It is same as eWNIAPI_MAC_PROTOCOL_ALL except when it starts IBSS in 11B of 2.4GHz
     //It is for CSR internal use
-    eCSR_DOT11_MODE_AUTO = 0x1000,
+    eCSR_DOT11_MODE_AUTO = 0x4000,
 
     eCSR_NUM_PHY_MODE = 16,     //specify the number of maximum bits for phyMode
 }eCsrPhyMode;
@@ -244,6 +248,7 @@
     eCsrRequestType requestType;    //11d scan or full scan
 #ifdef WLAN_FEATURE_P2P
     tANI_BOOLEAN p2pSearch;
+    tANI_BOOLEAN skipDfsChnlInP2pSearch;
 #endif
 }tCsrScanRequest;
 
@@ -495,6 +500,8 @@
 #endif
     // peer rejected assoc because max assoc limit reached. callback gets pointer to peer
     eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED,
+    //Assoc rejected due to concurrent session running on a different channel
+    eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL,
 }eCsrRoamResult;
 
 
@@ -626,6 +633,8 @@
 #define CSR_CB_CHANNEL_GAP 4
 #define CSR_CB_CENTER_CHANNEL_OFFSET    2
 #define CSR_MAX_24GHz_CHANNEL_NUMBER ( SIR_11B_CHANNEL_END )
+#define CSR_MIN_5GHz_CHANNEL_NUMBER  ( SIR_11A_CHANNEL_BEGIN )
+#define CSR_MAX_5GHz_CHANNEL_NUMBER  ( SIR_11A_CHANNEL_END )
 
 // WEP keysize (in bits)...
 typedef enum  
@@ -837,6 +846,7 @@
     tCsrEncryptionList mcEncryptionInfo;
     eCsrCBChoice CBMode; //up, down or auto
     tANI_U8 operationChannel;
+    tANI_U16   beaconInterval;
     tCsrKeys Keys;
     // meaningless on connect. It's an OUT param from CSR's point of view
     // During assoc response carries the ACM bit-mask i.e. what
@@ -883,8 +893,8 @@
 typedef struct tagCsrConfigParam
 {
     tANI_U32 FragmentationThreshold;
-    tANI_U32 channelBondingMode24GHz;
-    tANI_U32 channelBondingMode5GHz;
+    tANI_U32 channelBondingMode24GHz;   // keep this tANI_U32. This gets converted to ePhyChannelBondState
+    tANI_U32 channelBondingMode5GHz;    // in csrChangeDefaultConfigParam using convertCBIniValueToPhyCBState
     eCsrPhyMode phyMode;
     eCsrBand eBand;
     tANI_U32 RTSThreshold;
@@ -988,6 +998,14 @@
 
     //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
     tANI_BOOLEAN fScanTwice;
+#ifdef WLAN_FEATURE_11AC
+    tANI_U32  nVhtChannelWidth;
+#endif
+
+    /*
+    * To enable/disable scanning only 2.4Ghz channels on first scan
+    */
+    tANI_BOOLEAN fFirstScanOnly2GChnl;
 
 }tCsrConfigParam;   
 
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index 09468f9..8d9b406 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -89,10 +89,16 @@
     eCSR_CFG_DOT11_MODE_11N,   
     eCSR_CFG_DOT11_MODE_POLARIS,    
     eCSR_CFG_DOT11_MODE_TITAN,    
+#ifdef WLAN_FEATURE_11AC
+    eCSR_CFG_DOT11_MODE_11AC,
+#endif
 #ifdef WLAN_SOFTAP_FEATURE
     eCSR_CFG_DOT11_MODE_11G_ONLY,    
     eCSR_CFG_DOT11_MODE_11N_ONLY,   
 #endif 
+#ifdef WLAN_FEATURE_11AC
+    eCSR_CFG_DOT11_MODE_11AC_ONLY,
+#endif 
     //This value can never set to CFG. It is for CSR's internal use
     eCSR_CFG_DOT11_MODE_AUTO,
 }eCsrCfgDot11Mode;  //Used to determine what to set to the WNI_CFG_DOT11_MODE
@@ -201,6 +207,7 @@
     eCsrStartIbss,
     eCsrStartIbssSameIbss,
     eCsrReassocToSelfNoCapChange,
+    eCsrStopRoamingDueToConcurrency,
     
 }eCsrJoinState;
 
@@ -306,7 +313,7 @@
     tANI_U32 uJoinTimeOut;
     tSirMacCapabilityInfo BssCap;
     tANI_BOOLEAN f11hSupport;
-    tAniCBSecondaryMode cbMode;
+    ePhyChanBondState cbMode;
 }tBssConfigParam;
 
 
@@ -315,7 +322,7 @@
     tSirMacSSid         ssId;
     tCsrBssid           bssid;    //this is the BSSID for the party we want to join (only use for IBSS or WDS)
     tSirNwType          sirNwType;
-    tAniCBSecondaryMode cbMode;
+    ePhyChanBondState   cbMode;
     tSirMacRateSet      operationalRateSet;
     tSirMacRateSet      extendedRateSet;
     tANI_U8             operationChn;
@@ -561,10 +568,15 @@
     tANI_BOOLEAN addTSWhenACMIsOff;
 
     tANI_BOOLEAN fValidateList;
-    tANI_BOOLEAN concurrencyEnabled;
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+    tANI_BOOLEAN doBMPSWorkaround;
+#endif
 
     //To enable/disable scanning 2.4Ghz channels twice on a single scan request from HDD
     tANI_BOOLEAN fScanTwice;
+#ifdef WLAN_FEATURE_11AC
+    tANI_U32  nVhtChannelWidth;
+#endif
 
 }tCsrConfig;
 
@@ -661,6 +673,11 @@
     * (apprx 1.3 sec) */
     tANI_BOOLEAN fEnableDFSChnlScan;
 
+    /*
+    * To enable/disable scanning only 2.4Ghz channels on first scan
+    */
+    tANI_BOOLEAN fFirstScanOnly2GChnl;
+
     tANI_BOOLEAN fDropScanCmd; //true means we don't accept scan commands
 
 #ifdef WLAN_AP_STA_CONCURRENCY
@@ -909,10 +926,19 @@
         ((eCSR_DOT11_MODE_11a == (pMac)->roam.configParam.phyMode) ||\
         (eCSR_DOT11_MODE_11a_ONLY == (pMac)->roam.configParam.phyMode))
         
+#ifdef WLAN_FEATURE_11AC
+#define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
+        ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
+        (eCSR_DOT11_MODE_11ac & (phyMode)) || \
+        (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
+        (eCSR_DOT11_MODE_AUTO & (phyMode)))
+#else
 #define CSR_IS_PHY_MODE_DUAL_BAND(phyMode) \
         ((eCSR_DOT11_MODE_abg & (phyMode)) || (eCSR_DOT11_MODE_11n & (phyMode)) || \
         (eCSR_DOT11_MODE_TAURUS & (phyMode)) || \
         (eCSR_DOT11_MODE_AUTO & (phyMode)))
+#endif
+
 
 // this function returns TRUE if the NIC is operating exclusively in the 2.4 GHz band, meaning
 // it is NOT operating in the 5.0 GHz band.
@@ -948,7 +974,7 @@
         (CSR_IS_OPEARTING_DUAL_BAND((pMac)) || CSR_IS_RADIO_BG_ONLY((pMac)) || CSR_IS_24_BAND_ONLY((pMac)))
 
 #define CSR_IS_CHANNEL_5GHZ(chnNum) \
-        ((chnNum) > CSR_MAX_24GHz_CHANNEL_NUMBER)
+        (((chnNum) >= CSR_MIN_5GHz_CHANNEL_NUMBER) && ((chnNum) <= CSR_MAX_5GHz_CHANNEL_NUMBER))
 
 #define CSR_IS_CHANNEL_24GHZ(chnNum) \
         (((chnNum) > 0) && ((chnNum) <= CSR_MAX_24GHz_CHANNEL_NUMBER))
@@ -1010,11 +1036,16 @@
 tANI_BOOLEAN csrIsAllSessionDisconnected( tpAniSirGlobal pMac );
 tANI_BOOLEAN csrIsInfraConnected( tpAniSirGlobal pMac );
 tANI_BOOLEAN csrIsConcurrentInfraConnected( tpAniSirGlobal pMac );
+tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac );
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac );
+#endif
 tANI_BOOLEAN csrIsIBSSStarted( tpAniSirGlobal pMac );
 tANI_BOOLEAN csrIsBTAMPStarted( tpAniSirGlobal pMac );
 tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId );
 eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId );
-tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId);
+tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
+                                                  tSirBssDescription *pBssDesc);
 #ifdef WLAN_SOFTAP_FEATURE
 tANI_BOOLEAN csrIsConnStateConnectedInfraAp( tpAniSirGlobal pMac, tANI_U32 sessionId );
 #endif
@@ -1185,8 +1216,9 @@
 tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
 #endif
 
-
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
 void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
+#endif
 #ifdef FEATURE_WLAN_LFR
 //Returns whether "Legacy Fast Roaming" is enabled...or not
 tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac);
diff --git a/CORE/SME/inc/csrSupport.h b/CORE/SME/inc/csrSupport.h
index d7257e7..3a2368e 100644
--- a/CORE/SME/inc/csrSupport.h
+++ b/CORE/SME/inc/csrSupport.h
@@ -799,6 +799,15 @@
                       tCsrRoamModifyProfileFields *pModProfileFields,
                       tANI_U32 *pRoamId, v_BOOL_t fForce);
 
+eHalStatus
+csrIsconcurrentsessionValid(tpAniSirGlobal pMac,tANI_U32 cursessionId,
+                                 tVOS_CON_MODE currBssPersona);
+
+//BeaconInterval valiadation for MCC support
+eHalStatus csrValidateBeaconInterval(tpAniSirGlobal pMac, tANI_U8 channelId, 
+                                     tANI_U16 *beaconInterval, tANI_U32 cursessionId,
+                                     tVOS_CON_MODE currBssPersona);
+
 #ifdef WLAN_FEATURE_VOWIFI_11R
 tANI_BOOLEAN csrIsProfile11r( tCsrRoamProfile *pProfile );
 tANI_BOOLEAN csrIsAuthType11r( eCsrAuthType AuthType );
diff --git a/CORE/SME/inc/measApi.h b/CORE/SME/inc/measApi.h
deleted file mode 100644
index 1e9b029..0000000
--- a/CORE/SME/inc/measApi.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
diff --git a/CORE/SME/inc/measInternal.h b/CORE/SME/inc/measInternal.h
deleted file mode 100644
index 1e9b029..0000000
--- a/CORE/SME/inc/measInternal.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
diff --git a/CORE/SME/inc/oemDataApi.h b/CORE/SME/inc/oemDataApi.h
new file mode 100644
index 0000000..0c665db
--- /dev/null
+++ b/CORE/SME/inc/oemDataApi.h
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef FEATURE_OEM_DATA_SUPPORT
+
+/** ------------------------------------------------------------------------- * 
+    ------------------------------------------------------------------------- *  
+
+  
+    \file oemDataApi.h
+  
+    Exports and types for the Common OEM DATA REQ/RSP Module interfaces.
+  
+    Copyright (C) 2010 Qualcomm Inc.
+  
+ 
+   ========================================================================== */
+
+#ifndef __OEM_DATA_API_H__
+#define __OEM_DATA_API_H__
+#include "sirApi.h"
+#include "sirMacProtDef.h"
+#include "csrLinkList.h"
+
+#ifndef OEM_DATA_REQ_SIZE
+#define OEM_DATA_REQ_SIZE 70
+#endif
+
+#ifndef OEM_DATA_RSP_SIZE
+#define OEM_DATA_RSP_SIZE 968
+#endif
+
+/*************************************************************************************************************
+  OEM DATA REQ/RSP - DATA STRUCTURES
+*************************************************************************************************************/
+
+/* Structure for defining req sent to the PE */
+typedef struct tagOemDataReq
+{
+    tANI_U8   sessionId;
+    tANI_U8   oemDataReq[OEM_DATA_REQ_SIZE];
+} tOemDataReq, tOemDataReqConfig;
+
+/*************************************************************************************************************
+  OEM DATA RESPONSE - DATA STRUCTURES
+*************************************************************************************************************/
+typedef struct tagOemDataRsp
+{
+    tANI_U8   oemDataRsp[OEM_DATA_RSP_SIZE];
+} tOemDataRsp;
+
+/*************************************************************************************************************/
+
+typedef enum
+{
+    eOEM_DATA_REQ_SUCCESS=1,
+    eOEM_DATA_REQ_FAILURE,
+    eOEM_DATA_REQ_INVALID_MODE,
+} eOemDataReqStatus;
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_OemDataReqOpen
+    \brief This function must be called before any API call to MEAS (OEM DATA REQ/RSP module)
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+
+eHalStatus oemData_OemDataReqOpen(tHalHandle hHal);
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_OemDataReqClose
+    \brief This function must be called before closing the csr module
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+
+eHalStatus oemData_OemDataReqClose(tHalHandle hHal);
+
+/* HDD Callback function for the sme to callback when the oem data rsp is available */
+typedef eHalStatus (*oemData_OemDataReqCompleteCallback)(
+                                           tHalHandle, 
+                                           void* p2, 
+                                           tANI_U32 oemDataReqID, 
+                                           eOemDataReqStatus status);
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_OemDataReq
+    \brief Request an OEM DATA RSP
+    \param sessionId - Id of session to be used
+    \param pOemDataReqID - pointer to an object to get back the request ID
+    \param callback - a callback function that is called upon finish
+    \param pContext - a pointer passed in for the callback
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus oemData_OemDataReq(tHalHandle, tANI_U8, tOemDataReqConfig *, tANI_U32 *pOemDataReqID, 
+                            oemData_OemDataReqCompleteCallback callback, void *pContext);
+
+/* ---------------------------------------------------------------------------
+    \fn sme_HandleOemDataRsp
+    \brief This function processes the oem data response obtained from the PE
+    \param pMsg - Pointer to the pSirSmeOemDataRsp
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus sme_HandleOemDataRsp(tHalHandle hHal, tANI_U8*);
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_IsOemDataReqAllowed
+    \brief This function checks if oem data req/rsp can be performed in the 
+           current driver state
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus oemData_IsOemDataReqAllowed(tHalHandle hHal);
+
+#endif //_OEM_DATA_API_H__
+
+#endif //FEATURE_OEM_DATA_SUPPORT
diff --git a/CORE/SME/inc/oemDataInternal.h b/CORE/SME/inc/oemDataInternal.h
new file mode 100644
index 0000000..82c9197
--- /dev/null
+++ b/CORE/SME/inc/oemDataInternal.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef FEATURE_OEM_DATA_SUPPORT
+
+/** ------------------------------------------------------------------------- * 
+    ------------------------------------------------------------------------- *  
+
+  
+    \file oemDataInternal.h
+  
+    Exports and types for the Common OEM DATA REQ/RSP Module interfaces.
+  
+    Copyright (C) 2010 Qualcomm Inc.
+  
+   ========================================================================== */
+
+
+#ifndef __OEM_DATA_INTERNAL_H__
+#define __OEM_DATA_INTERNAL_H__
+
+#include "palTimer.h"
+#include "csrSupport.h"
+#include "vos_nvitem.h"
+#include "wlan_qct_tl.h"
+
+#include "oemDataApi.h"
+
+typedef struct tagOemDataStruct
+{
+    tANI_U32                         nextOemReqId; //a global req id
+    tANI_BOOLEAN                     oemDataReqActive; //indicates that currently a request has been posted and 
+                                                        //waiting for the response
+    oemData_OemDataReqCompleteCallback   callback; //callback function pointer for returning the response
+    void*                            pContext; //context of the original caller
+    tANI_U32                         oemDataReqID; //original request ID
+    tOemDataRsp*                     pOemDataRsp; //response
+    tOemDataReqConfig                oemDataReqConfig; //current oem data request
+    tANI_U8                          sessionId; //Session on which oem data req is active
+} tOemDataStruct;
+
+typedef struct tagOemDataCmd
+{
+    tANI_U32                            oemDataReqID;
+    oemData_OemDataReqCompleteCallback      callback;
+    void*                               pContext;
+    tOemDataReq                         oemDataReq;
+} tOemDataCmd;
+
+#endif //__OEM_DATA_INTERNAL_H__
+
+#endif //FEATURE_OEM_DATA_SUPPORT
diff --git a/CORE/SME/inc/p2p_Api.h b/CORE/SME/inc/p2p_Api.h
index 13276de..47449bc 100644
--- a/CORE/SME/inc/p2p_Api.h
+++ b/CORE/SME/inc/p2p_Api.h
@@ -476,7 +476,8 @@
 eHalStatus sme_updateP2pIe( tHalHandle hHal, void *p2pIe, 
                             tANI_U32 p2pIeLength );
 eHalStatus sme_sendAction( tHalHandle hHal, tANI_U8 sessionId,
-                           const tANI_U8 *pBuf, tANI_U32 len );
+                           const tANI_U8 *pBuf, tANI_U32 len,
+                           tANI_U16 wait, tANI_BOOLEAN noack);
 eHalStatus sme_CancelRemainOnChannel( tHalHandle hHal, tANI_U8 sessionId );
 eHalStatus sme_p2pOpen( tHalHandle hHal );
 eHalStatus p2pStop( tHalHandle hHal );
@@ -493,7 +494,8 @@
                                remainOnChanCallback callback, void *pContext);
 #endif
 eHalStatus p2pSendAction( tHalHandle hHal, tANI_U8 sessionId,
-                          const tANI_U8 *pBuf, tANI_U32 len );
+                          const tANI_U8 *pBuf, tANI_U32 len,
+                           tANI_U16 wait, tANI_BOOLEAN noack);
 eHalStatus p2pCancelRemainOnChannel( tHalHandle hHal, tANI_U8 sessionId );
 eHalStatus p2pSetPs( tHalHandle hHal, tP2pPsConfig *pNoA );
 #ifdef WLAN_FEATURE_P2P_INTERNAL
diff --git a/CORE/SME/inc/pmcApi.h b/CORE/SME/inc/pmcApi.h
index 05a7fff..fc01a98 100644
--- a/CORE/SME/inc/pmcApi.h
+++ b/CORE/SME/inc/pmcApi.h
@@ -420,7 +420,8 @@
 extern eHalStatus pmcExitWowl (tHalHandle hHal);
 
 
-extern eHalStatus pmcSetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest);
+extern eHalStatus pmcSetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest,
+                                          tANI_U8 *bssId);
 
 /* ---------------------------------------------------------------------------
     \fn pmcSetKeepAlive
@@ -431,7 +432,7 @@
             eHAL_STATUS_FAILURE  Cannot set the keepalive.
             eHAL_STATUS_SUCCESS  Request accepted. 
   ---------------------------------------------------------------------------*/
-extern eHalStatus pmcSetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest);
+extern eHalStatus pmcSetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest, tANI_U8 *bssId);
 
 extern tANI_BOOLEAN pmcValidateConnectState( tHalHandle hHal );
 
diff --git a/CORE/SME/inc/smeInside.h b/CORE/SME/inc/smeInside.h
index 742ac7d..c89f4eb 100644
--- a/CORE/SME/inc/smeInside.h
+++ b/CORE/SME/inc/smeInside.h
@@ -51,6 +51,9 @@
 #include "smeQosInternal.h"
 
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+#include "oemDataInternal.h"
+#endif
 
 #if defined WLAN_FEATURE_VOWIFI
 #include "sme_RrmApi.h"
@@ -114,6 +117,9 @@
         tRemoveKeyCmd removeKeyCmd;
         tGenericPmcCmd pmcCmd;
         tGenericQosCmd qosCmd;
+#ifdef FEATURE_OEM_DATA_SUPPORT
+        tOemDataCmd oemDataCmd;
+#endif
 #ifdef WLAN_FEATURE_P2P
         tRemainChlCmd remainChlCmd;
         tNoACmd NoACmd;
@@ -165,6 +171,9 @@
 eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme);
 eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme);
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand);
+#endif
 
 eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand );
 eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg);
@@ -181,7 +190,7 @@
             eHAL_STATUS_FAILURE  Cannot set the offload.
             eHAL_STATUS_SUCCESS  Request accepted. 
   ---------------------------------------------------------------------------*/
-eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest);
+eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 *bssId);
 #endif //WLAN_NS_OFFLOAD
 
 #ifdef FEATURE_WLAN_SCAN_PNO
diff --git a/CORE/SME/inc/smeInternal.h b/CORE/SME/inc/smeInternal.h
index 3d27d9b..2494651 100644
--- a/CORE/SME/inc/smeInternal.h
+++ b/CORE/SME/inc/smeInternal.h
@@ -80,6 +80,9 @@
     eSmeQosCommandMask = 0x40000,  //To identify Qos commands
     eSmeCommandAddTs,
     eSmeCommandDelTs,
+#ifdef FEATURE_OEM_DATA_SUPPORT
+    eSmeCommandOemDataReq = 0x80000, //To identify the oem data commands
+#endif
 #ifdef WLAN_FEATURE_P2P
     eSmeCommandRemainOnChannel,
     eSmeCommandNoAUpdate,
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index eed1638..8ccdf97 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -54,6 +54,9 @@
 #include "halFw.h"
 #endif
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+#include "oemDataApi.h"
+#endif
 
 #if defined WLAN_FEATURE_VOWIFI
 #include "smeRrmInternal.h"
@@ -1548,6 +1551,35 @@
                                         tANI_U32 *pNumItems );
 #endif /* FEATURE_WLAN_WAPI */
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+/********************************************************************************************
+  Oem data related modifications
+*********************************************************************************************/
+/* ---------------------------------------------------------------------------
+    \fn sme_OemDataReq
+    \param sessionId - session id of session to be used for oem data req.
+    \param pOemDataReqID - pointer to an object to get back the request ID
+    \param callback - a callback function that is called upon finish
+    \param pContext - a pointer passed in for the callback
+    \return eHalStatus     
+  ---------------------------------------------------------------------------*/
+eHalStatus sme_OemDataReq(tHalHandle hHal, 
+                                       tANI_U8 sessionId,
+                                       tOemDataReqConfig *, 
+                                       tANI_U32 *pOemDataReqID, 
+                                       oemData_OemDataReqCompleteCallback callback, 
+                                       void *pContext);
+
+/* ---------------------------------------------------------------------------
+    \fn sme_getOemDataRsp
+    \param pOemDataRsp - A pointer to the response object
+    \param pOemDataReqID - pointer to an object to get back the request ID
+    \return eHalStatus     
+  ---------------------------------------------------------------------------*/
+eHalStatus sme_getOemDataRsp(tHalHandle hHal, 
+                                         tOemDataRsp **pOemDataRsp);
+
+#endif /*FEATURE_OEM_DATA_SUPPORT*/
 
 
 #ifdef WLAN_SOFTAP_FEATURE
@@ -1608,7 +1640,8 @@
     \param  pRequest -  Pointer to the offload request.
     \return eHalStatus
    ---------------------------------------------------------------------------*/
-eHalStatus sme_SetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest);
+eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId,
+                                    tpSirHostOffloadReq pRequest);
 
 /* ---------------------------------------------------------------------------
     \fn sme_SetKeepAlive
@@ -1617,7 +1650,8 @@
     \param  pRequest -  Pointer to the Keep Alive request.
     \return eHalStatus
   ---------------------------------------------------------------------------*/
-eHalStatus sme_SetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest);
+eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId,
+                                  tpSirKeepAliveReq pRequest);
 
 
 /* ---------------------------------------------------------------------------
@@ -1906,7 +1940,8 @@
     \param  pRcvPktFilterCfg - Receive Packet Filter parameter
     \return eHalStatus   
   ---------------------------------------------------------------------------*/
-eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg);
+eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg,
+                                           tANI_U8 sessionId);
 
 /* ---------------------------------------------------------------------------
     \fn sme_GetFilterMatchCount
@@ -1928,7 +1963,8 @@
     \return eHalStatus   
   ---------------------------------------------------------------------------*/
 eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal,
-                                        tpSirRcvFltPktClearParam pRcvFltPktClearParam);
+                                        tpSirRcvFltPktClearParam pRcvFltPktClearParam,
+                                        tANI_U8  sessionId);
 #endif // WLAN_FEATURE_PACKET_FILTERING
 /* ---------------------------------------------------------------------------
 
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index c2c6059..3381d94 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -21,7 +21,7 @@
 
 /** ------------------------------------------------------------------------- * 
     ------------------------------------------------------------------------- *  
-
+  
   
     \file csrApiRoam.c
   
@@ -31,36 +31,27 @@
   
  
    ========================================================================== */
-
 /*===========================================================================
-
                       EDIT HISTORY FOR FILE
 
-
   This section contains comments describing changes made to the module.
   Notice that changes are listed in reverse chronological order.
 
-
-
   when            who                 what, where, why
 ----------       ---                --------------------------------------------------------
 06/03/10     js                     Added support to hostapd driven 
  *                                  deauth/disassoc/mic failure
-
 ===========================================================================*/
-
 #include "aniGlobal.h" //for tpAniSirGlobal
 #include "wlan_qct_wda.h"
-
 #ifdef FEATURE_WLAN_INTEGRATED_SOC
 #include "halMsgApi.h" //for HAL_STA_INVALID_IDX.
 #endif
-
 #ifdef FEATURE_WLAN_NON_INTEGRATED_SOC
 #include "halPhyApi.h"
 #include "halInternal.h"
 #endif
-
+#include "limUtils.h"
 #include "palApi.h"
 #include "csrInsideApi.h"
 #include "smsDebug.h"
@@ -73,15 +64,12 @@
 #include "csrApi.h"
 #include "pmc.h"
 #include "vos_nvitem.h"
-
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
 #include "csrNeighborRoam.h"
 #endif /* WLAN_FEATURE_NEIGHBOR_ROAMING */
-
 #ifdef FEATURE_WLAN_CCX
 #include "csrCcx.h"
 #endif /* FEATURE_WLAN_CCX */
-
 #define CSR_NUM_IBSS_START_CHANNELS_50      4
 #define CSR_NUM_IBSS_START_CHANNELS_24      3
 #define CSR_DEF_IBSS_START_CHANNEL_50       36
@@ -93,7 +81,6 @@
   OBIWAN recommends [8 10]% : pick 9% 
 ---------------------------------------------------------------------------*/
 #define CSR_VCC_UL_MAC_LOSS_THRESHOLD 9
-
 /*---------------------------------------------------------------------------
   OBIWAN recommends -85dBm 
 ---------------------------------------------------------------------------*/
@@ -102,51 +89,43 @@
 #define CSR_MIN_GLOBAL_STAT_QUERY_PERIOD_IN_BMPS 2000 //ms
 #define CSR_MIN_TL_STAT_QUERY_PERIOD       500 //ms
 #define CSR_DIAG_LOG_STAT_PERIOD           3000 //ms
-
 //We use constatnt 4 here
 //This macro returns true when higher AC parameter is bigger than lower AC for a difference
 //The bigger the number, the less chance of TX
 //It must put lower AC as the first parameter.
 #define SME_DETECT_AC_WEIGHT_DIFF(loAC, hiAC)   (v_BOOL_t)(((hiAC) > (loAC)) ? (((hiAC)-(loAC)) > 4) : 0)
-
 //Flag to send/do not send disassoc frame over the air
 #define CSR_DONT_SEND_DISASSOC_OVER_THE_AIR 1
-
 #define RSSI_HACK_BMPS (-40)
+#define MAX_CB_VALUE_IN_INI (2)
+
 /*-------------------------------------------------------------------------- 
   Static Type declarations
   ------------------------------------------------------------------------*/
 static tChannelListWithPower csrRoamPowerTableFromEeprom[WNI_CFG_VALID_CHANNEL_LIST_LEN];
 static tChannelListWithPower csrRoamPowerTableFromEeprom40MHz[WNI_CFG_VALID_CHANNEL_LIST_LEN];
 static tCsrRoamSession       csrRoamRoamSession[CSR_ROAM_SESSION_MAX];
-
 /*-------------------------------------------------------------------------- 
   Type declarations
   ------------------------------------------------------------------------*/
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
-
 int diagAuthTypeFromCSRType(eCsrAuthType authType)
 {
     int n = AUTH_OPEN;
-
     switch(authType)
     {
     case eCSR_AUTH_TYPE_SHARED_KEY:
         n = AUTH_SHARED;
         break;
-
     case eCSR_AUTH_TYPE_WPA:
         n = AUTH_WPA_EAP;
         break;
-
     case eCSR_AUTH_TYPE_WPA_PSK:
         n = AUTH_WPA_PSK;
         break;
-
     case eCSR_AUTH_TYPE_RSN:
         n = AUTH_WPA2_EAP;
         break;
-
     case eCSR_AUTH_TYPE_RSN_PSK:
         n = AUTH_WPA2_PSK;
         break;
@@ -154,43 +133,34 @@
     case eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE:
         n = AUTH_WAPI_CERT;
         break;
-
     case eCSR_AUTH_TYPE_WAPI_WAI_PSK:
         n = AUTH_WAPI_PSK;
         break;
 #endif /* FEATURE_WLAN_WAPI */
-
     default:
         break;
     }
-
     return (n);
 }
-
 int diagEncTypeFromCSRType(eCsrEncryptionType encType)
 {
     int n = ENC_MODE_OPEN;
-
     switch(encType)
     {
     case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY:
     case eCSR_ENCRYPT_TYPE_WEP40:
         n = ENC_MODE_WEP40;
         break;
-
     case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
     case eCSR_ENCRYPT_TYPE_WEP104:
         n = ENC_MODE_WEP104;
         break;
-
     case eCSR_ENCRYPT_TYPE_TKIP:
         n = ENC_MODE_TKIP;
         break;
-
     case eCSR_ENCRYPT_TYPE_AES:
         n = ENC_MODE_AES;
         break;
-
 #ifdef FEATURE_WLAN_WAPI
     case eCSR_ENCRYPT_TYPE_WPI:
         n = ENC_MODE_SMS4;
@@ -199,15 +169,11 @@
     default:
         break;
     }
-
     return (n);
 }
-
 #endif //#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
-
 static const tANI_U8 csrStartIbssChannels50[ CSR_NUM_IBSS_START_CHANNELS_50 ] = { 36, 40,  44,  48}; 
 static const tANI_U8 csrStartIbssChannels24[ CSR_NUM_IBSS_START_CHANNELS_24 ] = { 1, 6, 11 };
-
 static void initConfigParam(tpAniSirGlobal pMac);
 static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pCommand,
                                        eCsrRoamCompleteResult Result, void *Context );
@@ -216,8 +182,8 @@
                                     tANI_BOOLEAN *pfSameIbss );
 static void csrRoamUpdateConnectedProfileFromNewBss( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirSmeNewBssInfo *pNewBss );
 static void csrRoamPrepareBssParams(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
-                                     tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes);
-static tAniCBSecondaryMode csrGetCBModeFromIes(tpAniSirGlobal pMac, tANI_U8 primaryChn, tDot11fBeaconIEs *pIes);
+                                     tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig, tDot11fBeaconIEs *pIes);
+static ePhyChanBondState csrGetCBModeFromIes(tpAniSirGlobal pMac, tANI_U8 primaryChn, tDot11fBeaconIEs *pIes);
 eHalStatus csrInitGetChannels(tpAniSirGlobal pMac);
 static void csrRoamingStateConfigCnfProcessor( tpAniSirGlobal pMac, tANI_U32 result );
 eHalStatus csrRoamOpen(tpAniSirGlobal pMac);
@@ -237,6 +203,7 @@
 static void csrRoamWaitForKeyTimeOutHandler(void *pv);
  
 static eHalStatus CsrInit11dInfo(tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo);
+static eHalStatus csrInitChannelPowerList( tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo);
 static eHalStatus csrRoamFreeConnectedInfo( tpAniSirGlobal pMac, tCsrRoamConnectedInfo *pConnectedInfo );
 eHalStatus csrSendMBSetContextReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, 
            tSirMacAddr peerMacAddr, tANI_U8 numKeys, tAniEdType edType, 
@@ -248,7 +215,6 @@
                                     tCsrRoamProfile *pProfile );
 void csrRoamStatisticsTimerHandler(void *pv);
 void csrRoamStatsGlobalClassDTimerHandler(void *pv);
-
 static void csrRoamLinkUp(tpAniSirGlobal pMac, tCsrBssid bssid);
 VOS_STATUS csrRoamVccTriggerRssiIndCallback(tHalHandle hHal, 
                                             v_U8_t  rssiNotification, 
@@ -260,15 +226,12 @@
     pStaEntry is no longer invalid upon the return of this function.
 */
 static void csrRoamRemoveStatListEntry(tpAniSirGlobal pMac, tListElem *pEntry);
-
 #ifdef WLAN_SOFTAP_FEATURE
 static eCsrCfgDot11Mode csrRoamGetPhyModeBandForBss( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile,tANI_U8 operationChn, eCsrBand *pBand );
 #else
 static eCsrCfgDot11Mode csrRoamGetPhyModeBandForBss( tpAniSirGlobal pMac, eCsrPhyMode phyModeIn, tANI_U8 operationChn, eCsrBand *pBand );
 #endif
 static eHalStatus csrRoamGetQosInfoFromBss(tpAniSirGlobal pMac, tSirBssDescription *pBssDesc);
-
-
 tCsrStatsClientReqInfo * csrRoamInsertEntryIntoList( tpAniSirGlobal pMac,
                                                      tDblLinkList *pStaList,
                                                      tCsrStatsClientReqInfo *pStaEntry);
@@ -277,7 +240,7 @@
                                                  tANI_U32 periodicity, tANI_BOOLEAN *pFound, tANI_U8 staId);
 void csrRoamReportStatistics(tpAniSirGlobal pMac, tANI_U32 statsMask, 
                              tCsrStatsCallback callback, tANI_U8 staId, void *pContext);
-void csrRoamSaveStatsFromTl(tpAniSirGlobal pMac, WLANTL_TRANSFER_STA_TYPE tlStats);
+void csrRoamSaveStatsFromTl(tpAniSirGlobal pMac, WLANTL_TRANSFER_STA_TYPE *pTlStats);
 void csrRoamTlStatsTimerHandler(void *pv);
 void csrRoamPeStatsTimerHandler(void *pv);
 tListElem * csrRoamCheckClientReqList(tpAniSirGlobal pMac, tANI_U32 statsMask);
@@ -296,9 +259,7 @@
 void csrRoamJoinRetryTimerHandler(void *pv);
 #endif
 extern void SysProcessMmhMsg(tpAniSirGlobal pMac, tSirMsgQ* pMsg);
-
 extern void btampEstablishLogLinkHdlr(void* pMsg);
-
 static void csrSerDesUnpackDiassocRsp(tANI_U8 *pBuf, tSirSmeDisassocRsp *pRsp);
 
 //Initialize global variables
@@ -313,7 +274,6 @@
     return;
 }
 
-
 static void csrRoamDeInitGlobals(tpAniSirGlobal pMac)
 {
     if(pMac)
@@ -324,13 +284,11 @@
     }
     return;
 }
-
 eHalStatus csrOpen(tpAniSirGlobal pMac)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     static uNvTables nvTables;
     VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
-
     v_REGDOMAIN_t regId;
     tANI_U32 i;
     
@@ -338,7 +296,6 @@
     {
         /* Initialize CSR Roam Globals */
         csrRoamInitGlobals(pMac);
-
         for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
            csrRoamStateChange( pMac, eCSR_ROAMING_STATE_STOP, i);
 
@@ -354,7 +311,6 @@
            break;
         if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &pMac->roam.roamCmdPendingList)))
            break;
-
         vosStatus = vos_nv_readDefaultCountryTable( &nvTables );
         if ( VOS_IS_STATUS_SUCCESS(vosStatus) )
         {
@@ -372,23 +328,18 @@
             //status = eHAL_STATUS_SUCCESS;
         }
         smsLog( pMac, LOGE, FL(" country Code from nvRam %s\n"), pMac->scan.countryCodeDefault );
-
         csrGetRegulatoryDomainForCountry(pMac, pMac->scan.countryCodeDefault, &regId);
-
         WDA_SetRegDomain(pMac, regId);
         pMac->scan.domainIdDefault = regId;
         pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault;
-
         status = palCopyMemory(pMac->hHdd, pMac->scan.countryCodeCurrent, 
                          pMac->scan.countryCodeDefault, WNI_CFG_COUNTRY_CODE_LEN);
         status = csrInitGetChannels( pMac );
-
     }while(0);
     
     return (status);
 }
 
-
 #ifdef WLAN_SOFTAP_FEATURE
 eHalStatus csrSetRegInfo(tHalHandle hHal,  tANI_U8 *apCntryCode)
 {
@@ -396,37 +347,30 @@
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     v_REGDOMAIN_t regId;
     v_U8_t        cntryCodeLength;
-
     if(NULL == apCntryCode)
     {
        smsLog( pMac, LOGW, FL(" Invalid country Code Pointer\n") );
        return eHAL_STATUS_FAILURE;
     }
-
     smsLog( pMac, LOGW, FL(" country Code %s\n"), apCntryCode );
-
     /* To get correct Regulatory domain from NV table 
      * 2 character Country code should be used
      * 3rd charater is optional for indoor/outdoor setting */
     cntryCodeLength = strlen(apCntryCode);
-
     status = csrGetRegulatoryDomainForCountry(pMac, apCntryCode, &regId);
     if (status != eHAL_STATUS_SUCCESS)
     {
         smsLog( pMac, LOGE, FL("  fail to get regId for country Code %s\n"), apCntryCode );
         return status;
     }
-
     status = WDA_SetRegDomain(hHal, regId);
     if (status != eHAL_STATUS_SUCCESS)
     {
         smsLog( pMac, LOGE, FL("  fail to get regId for country Code %s\n"), apCntryCode );
         return status;
     }
-
     pMac->scan.domainIdDefault = regId;
     pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault;
-
     /* Clear CC field */
     palFillMemory( pMac->hHdd,
                    pMac->scan.countryCodeDefault,
@@ -435,7 +379,6 @@
     /* Copy 2 or 3 bytes country code */
     palCopyMemory( pMac->hHdd, pMac->scan.countryCodeDefault, 
                 apCntryCode, cntryCodeLength );
-
     /* If 2 bytes country code, 3rd byte must be filled with space */
     if((WNI_CFG_COUNTRY_CODE_LEN - 1) == cntryCodeLength)
     {
@@ -444,23 +387,18 @@
                       1,
                       0x20 );
     }
-
     status = palCopyMemory(pMac->hHdd, pMac->scan.countryCodeCurrent, 
                                pMac->scan.countryCodeDefault, WNI_CFG_COUNTRY_CODE_LEN);
     status = csrInitGetChannels( pMac );
-
     return status;
 }
-
 eHalStatus csrSetChannels(tHalHandle hHal,  tCsrConfigParam *pParam  )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     tANI_U8   index = 0;
-
     palCopyMemory( pMac->hHdd, pParam->Csr11dinfo.countryCode, 
                    pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN );
-
     for ( index = 0; index < pMac->scan.base20MHzChannels.numChannels ; index++)
     {
         pParam->Csr11dinfo.Channels.channelList[index] = pMac->scan.base20MHzChannels.channelList[ index ];
@@ -473,7 +411,6 @@
     return status;
 }
 #endif
-
 eHalStatus csrClose(tpAniSirGlobal pMac)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -484,13 +421,10 @@
     csrLLClose(&pMac->roam.statsClientReqList);
     csrLLClose(&pMac->roam.peStatsReqList);
     csrLLClose(&pMac->roam.roamCmdPendingList);
-
     /* DeInit Globals */
     csrRoamDeInitGlobals(pMac);
-
     return (status);
 } 
-
 eHalStatus csrStart(tpAniSirGlobal pMac)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -524,15 +458,12 @@
            break;
         }
     }while(0);
-
 #if defined(ANI_LOGDUMP)
     csrDumpInit(pMac);
 #endif //#if defined(ANI_LOGDUMP)
-
     return (status);
 }
 
-
 eHalStatus csrStop(tpAniSirGlobal pMac)
 {
     tANI_U32 sessionId;
@@ -542,22 +473,18 @@
     {
         csrRoamCloseSession(pMac, sessionId, TRUE, NULL, NULL);
     }
-
     csrScanDisable(pMac);
     pMac->scan.fCancelIdleScan = eANI_BOOLEAN_FALSE;
     pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE;
-
     csrLLPurge( &pMac->roam.roamCmdPendingList, eANI_BOOLEAN_TRUE );
     
 #if   defined WLAN_FEATURE_NEIGHBOR_ROAMING
     csrNeighborRoamClose(pMac);
 #endif
     csrScanFlushResult(pMac); //Do we want to do this?
-
     // deregister from PMC since we register during csrStart()
     // (ignore status since there is nothing we can do if it fails)
     (void) pmcDeregisterPowerSaveCheck(pMac, csrCheckPSReady);
-
     //Reset the domain back to the deault
     pMac->scan.domainIdCurrent = pMac->scan.domainIdDefault;
     csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE);
@@ -571,49 +498,44 @@
     return (eHAL_STATUS_SUCCESS);
 }
 
-
 eHalStatus csrReady(tpAniSirGlobal pMac)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
-
     csrScanGetSupportedChannels( pMac );
     //WNI_CFG_VALID_CHANNEL_LIST should be set by this time
     //use it to init the background scan list
     csrInitBGScanChannelList(pMac);
     /* HDD issues the init scan */
     csrScanStartResultAgingTimer(pMac);
-
     //Store the AC weights in TL for later use
     WLANTL_GetACWeights(pMac->roam.gVosContext, pMac->roam.ucACWeights);
-
     status = csrInitChannelList( pMac );
     if ( ! HAL_STATUS_SUCCESS( status ) )
     {
        smsLog( pMac, LOGE, "csrInitChannelList failed during csrReady with status=%d\n",
                status );
     }
-
     return (status);
 }
-
 void csrSetDefaultDot11Mode( tpAniSirGlobal pMac )
 {
     v_U32_t wniDot11mode = 0;
-
     wniDot11mode = csrTranslateToWNICfgDot11Mode(pMac,pMac->roam.configParam.uCfgDot11Mode);
     ccmCfgSetInt(pMac, WNI_CFG_DOT11_MODE, wniDot11mode, NULL, eANI_BOOLEAN_FALSE);
 }
-
 void csrSetGlobalCfgs( tpAniSirGlobal pMac )
 {
+
     ccmCfgSetInt(pMac, WNI_CFG_FRAGMENTATION_THRESHOLD, csrGetFragThresh(pMac), NULL, eANI_BOOLEAN_FALSE);
     ccmCfgSetInt(pMac, WNI_CFG_RTS_THRESHOLD, csrGetRTSThresh(pMac), NULL, eANI_BOOLEAN_FALSE);
     ccmCfgSetInt(pMac, WNI_CFG_11D_ENABLED,
                         ((pMac->roam.configParam.Is11hSupportEnabled) ? pMac->roam.configParam.Is11dSupportEnabled : pMac->roam.configParam.Is11dSupportEnabled), 
                         NULL, eANI_BOOLEAN_FALSE);
     ccmCfgSetInt(pMac, WNI_CFG_11H_ENABLED, pMac->roam.configParam.Is11hSupportEnabled, NULL, eANI_BOOLEAN_FALSE);
-    //Enable channel bonding at init; for 2.4 Ghz we will update this CFG at start BSS or join 
-    ccmCfgSetInt(pMac, WNI_CFG_CHANNEL_BONDING_MODE, WNI_CFG_CHANNEL_BONDING_MODE_ENABLE, NULL, eANI_BOOLEAN_FALSE);
+    /* For now we will just use the 5GHz CB mode ini parameter to decide whether CB supported or not in Probes when there is no session
+     * Once session is established we will use the session related params stored in PE session for CB mode
+     */
+    ccmCfgSetInt(pMac, WNI_CFG_CHANNEL_BONDING_MODE, !!(pMac->roam.configParam.channelBondingMode5GHz), NULL, eANI_BOOLEAN_FALSE);
     ccmCfgSetInt(pMac, WNI_CFG_HEART_BEAT_THRESHOLD, pMac->roam.configParam.HeartbeatThresh24, NULL, eANI_BOOLEAN_FALSE);
     
     //Update the operating mode to configured value during initialization,
@@ -621,13 +543,11 @@
     csrSetDefaultDot11Mode( pMac );    
 }
 
-
 eHalStatus csrRoamOpen(tpAniSirGlobal pMac)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tANI_U32 i;
     tCsrRoamSession *pSession;
-
     do
     {
         for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
@@ -636,7 +556,6 @@
             pSession->roamingTimerInfo.pMac = pMac;
             pSession->roamingTimerInfo.sessionId = CSR_SESSION_ID_INVALID;
         }
-
         pMac->roam.WaitForKeyTimerInfo.pMac = pMac;
         pMac->roam.WaitForKeyTimerInfo.sessionId = CSR_SESSION_ID_INVALID;
         status = palTimerAlloc(pMac->hHdd, &pMac->roam.hTimerWaitForKey, csrRoamWaitForKeyTimeOutHandler, 
@@ -646,7 +565,6 @@
         smsLog(pMac, LOGE, FL("cannot allocate memory for WaitForKey time out timer\n"));
         break;
       }
-
       status = palTimerAlloc(pMac->hHdd, &pMac->roam.tlStatsReqInfo.hTlStatsTimer, csrRoamTlStatsTimerHandler, pMac);
       if(!HAL_STATUS_SUCCESS(status))
       {
@@ -654,49 +572,38 @@
          return eHAL_STATUS_FAILURE;
       }
     }while (0);
-
     return (status);
 }
 
-
 eHalStatus csrRoamClose(tpAniSirGlobal pMac)
 {
     tANI_U32 sessionId;
-
     for(sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++)
     {
         csrRoamCloseSession(pMac, sessionId, TRUE, NULL, NULL);
     }
-
     palTimerStop(pMac->hHdd, pMac->roam.hTimerWaitForKey);
     palTimerFree(pMac->hHdd, pMac->roam.hTimerWaitForKey);
-
     palTimerStop(pMac->hHdd, pMac->roam.tlStatsReqInfo.hTlStatsTimer);
     palTimerFree(pMac->hHdd, pMac->roam.tlStatsReqInfo.hTlStatsTimer);
-
     return (eHAL_STATUS_SUCCESS);
 }
 
-
 eHalStatus csrRoamStart(tpAniSirGlobal pMac)
 {
     (void)pMac;
-
     return (eHAL_STATUS_SUCCESS);
 }
 
-
 void csrRoamStop(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
    csrRoamStopRoamingTimer(pMac, sessionId);
    /* deregister the clients requesting stats from PE/TL & also stop the corresponding timers*/
    csrRoamDeregStatisticsReq(pMac);
 }
-
 eHalStatus csrRoamGetConnectState(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrConnectState *pState)
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
-
     if( pState )
     {
         status = eHAL_STATUS_SUCCESS;
@@ -705,8 +612,6 @@
     return (status);
 }
 
-
-
 eHalStatus csrRoamCopyConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamConnectedProfile *pProfile)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
@@ -754,10 +659,8 @@
                     pProfile->MDID.mobilityDomain = 0;
                 }
 #endif
-
 #ifdef FEATURE_WLAN_CCX
                 pProfile->isCCXAssoc = pSession->connectedProfile.isCCXAssoc;
-
                 if (csrIsAuthTypeCCX(pSession->connectedProfile.AuthType))
                 {
                     palCopyMemory( pMac->hHdd, pProfile->ccxCckmInfo.krk, 
@@ -775,8 +678,6 @@
     return (status);
 }
 
-
-
 eHalStatus csrRoamGetConnectProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamConnectedProfile *pProfile)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
@@ -788,10 +689,8 @@
             status = csrRoamCopyConnectProfile(pMac, sessionId, pProfile);
         }
     }
-
     return (status);
 }
-
 eHalStatus csrRoamFreeConnectProfile(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pProfile)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -805,11 +704,9 @@
     return (status);
 }
 
-
 static eHalStatus csrRoamFreeConnectedInfo( tpAniSirGlobal pMac, tCsrRoamConnectedInfo *pConnectedInfo )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
-
     if( pConnectedInfo->pbFrames )
     {
         palFreeMemory( pMac->hHdd, pConnectedInfo->pbFrames );
@@ -825,59 +722,50 @@
 #ifdef FEATURE_WLAN_CCX
     pConnectedInfo->nTspecIeLength = 0;
 #endif    
-
-
     return ( status );
 }
 
-
     
                 
+                
 void csrReleaseCommandRoam(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     csrReinitRoamCmd(pMac, pCommand);
     csrReleaseCommand( pMac, pCommand );
 }
 
-
 void csrReleaseCommandScan(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     csrReinitScanCmd(pMac, pCommand);
     csrReleaseCommand( pMac, pCommand );
 }
 
-
 void csrReleaseCommandWmStatusChange(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     csrReinitWmStatusChangeCmd(pMac, pCommand);
     csrReleaseCommand( pMac, pCommand );
 }
 
-
 void csrReinitSetKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     palZeroMemory(pMac->hHdd, &pCommand->u.setKeyCmd, sizeof(tSetKeyCmd));
 }
 
-
 void csrReinitRemoveKeyCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     palZeroMemory(pMac->hHdd, &pCommand->u.removeKeyCmd, sizeof(tRemoveKeyCmd));
 }
 
-
 void csrReleaseCommandSetKey(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     csrReinitSetKeyCmd(pMac, pCommand);
     csrReleaseCommand( pMac, pCommand );
 }
-
 void csrReleaseCommandRemoveKey(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     csrReinitRemoveKeyCmd(pMac, pCommand);
     csrReleaseCommand( pMac, pCommand );
 }
-
 void csrAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping )
 {
 
@@ -896,7 +784,6 @@
             }
             csrReleaseCommandScan( pMac, pCommand );
             break;
-
         case eSmeCommandRoam:
             csrReleaseCommandRoam( pMac, pCommand );
             break;
@@ -921,21 +808,17 @@
     }
 }
 
-
-
 void csrRoamSubstateChange( tpAniSirGlobal pMac, eCsrRoamSubState NewSubstate, tANI_U32 sessionId)
 {
     smsLog( pMac, LOG1, "   CSR RoamSubstate: [ %d <== %d ]\n", NewSubstate, pMac->roam.curSubState[sessionId]);
 
-
     if(pMac->roam.curSubState[sessionId] == NewSubstate)
     {
        return;
-                }
+    }
     pMac->roam.curSubState[sessionId] = NewSubstate;
 }
 
-
 eCsrRoamState csrRoamStateChange( tpAniSirGlobal pMac, eCsrRoamState NewRoamState, tANI_U8 sessionId)
 {
     eCsrRoamState PreviousState;
@@ -957,11 +840,9 @@
     return( PreviousState );
 }
 
-
 void csrAssignRssiForCategory(tpAniSirGlobal pMac, tANI_U8 catOffset)
 {
     int i;
-
     if(catOffset)
     {
         pMac->roam.configParam.bCatRssiOffset = catOffset;
@@ -972,14 +853,13 @@
     }
 }
 
-
 static void initConfigParam(tpAniSirGlobal pMac)
 {
     int i;
-
     pMac->roam.configParam.agingCount = CSR_AGING_COUNT;
     pMac->roam.configParam.channelBondingMode24GHz = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
     pMac->roam.configParam.channelBondingMode5GHz = WNI_CFG_CHANNEL_BONDING_MODE_ENABLE;
+
     pMac->roam.configParam.phyMode = eCSR_DOT11_MODE_TAURUS;
     pMac->roam.configParam.eBand = eCSR_BAND_ALL;
     pMac->roam.configParam.uCfgDot11Mode = eCSR_CFG_DOT11_MODE_TAURUS;
@@ -989,7 +869,7 @@
     pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE;
     pMac->roam.configParam.Is11dSupportEnabledOriginal = eANI_BOOLEAN_FALSE;
     pMac->roam.configParam.Is11eSupportEnabled = eANI_BOOLEAN_TRUE;
-    pMac->roam.configParam.Is11hSupportEnabled = eANI_BOOLEAN_FALSE;
+    pMac->roam.configParam.Is11hSupportEnabled = eANI_BOOLEAN_TRUE;
     pMac->roam.configParam.RTSThreshold = 2346;
     pMac->roam.configParam.shortSlotTime = eANI_BOOLEAN_TRUE;
     pMac->roam.configParam.WMMSupportMode = eCsrRoamWmmAuto;
@@ -1008,23 +888,19 @@
     pMac->roam.configParam.nRoamingTime = CSR_DEFAULT_ROAMING_TIME;
     pMac->roam.configParam.fEnforce11dChannels = eANI_BOOLEAN_FALSE;
     pMac->roam.configParam.fSupplicantCountryCodeHasPriority = eANI_BOOLEAN_FALSE;
-
     pMac->roam.configParam.fEnforceCountryCodeMatch = eANI_BOOLEAN_FALSE;
     pMac->roam.configParam.fEnforceDefaultDomain = eANI_BOOLEAN_FALSE;
     pMac->roam.configParam.nActiveMaxChnTime = CSR_ACTIVE_MAX_CHANNEL_TIME;
     pMac->roam.configParam.nActiveMinChnTime = CSR_ACTIVE_MIN_CHANNEL_TIME;
     pMac->roam.configParam.nPassiveMaxChnTime = CSR_PASSIVE_MAX_CHANNEL_TIME;
     pMac->roam.configParam.nPassiveMinChnTime = CSR_PASSIVE_MIN_CHANNEL_TIME;
-
     pMac->roam.configParam.IsIdleScanEnabled = TRUE; //enable the idle scan by default
     pMac->roam.configParam.nTxPowerCap = CSR_MAX_TX_POWER;
     pMac->roam.configParam.statsReqPeriodicity = CSR_MIN_GLOBAL_STAT_QUERY_PERIOD;
     pMac->roam.configParam.statsReqPeriodicityInPS = CSR_MIN_GLOBAL_STAT_QUERY_PERIOD_IN_BMPS;
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
     pMac->roam.configParam.csr11rConfig.IsFTResourceReqSupported = 0;
 #endif
-
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
     pMac->roam.configParam.neighborRoamConfig.nMaxNeighborRetries = 3;
     pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = 120;
@@ -1038,22 +914,26 @@
     pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.channelList[2] = 11;
     pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = 20000; //20 seconds
 #endif
+#ifdef WLAN_FEATURE_11AC
+     pMac->roam.configParam.nVhtChannelWidth = WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ + 1;
+#endif
 
     pMac->roam.configParam.addTSWhenACMIsOff = 0;
     pMac->roam.configParam.fScanTwice = eANI_BOOLEAN_FALSE;
-}
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+    pMac->roam.configParam.doBMPSWorkaround = 0;
+#endif
 
+}
 eCsrBand csrGetCurrentBand(tHalHandle hHal)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     return pMac->roam.configParam.bandCapability;
 }
-
 eHalStatus csrSetBand(tHalHandle hHal, eCsrBand eBand)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     eHalStatus status = eHAL_STATUS_SUCCESS;
-    
     if (CSR_IS_PHY_MODE_A_ONLY(pMac) &&
             (eBand == eCSR_BAND_24))
     {
@@ -1064,7 +944,6 @@
             pMac->roam.configParam.uCfgDot11Mode, eBand);
         return eHAL_STATUS_INVALID_PARAMETER;
     }
-
     if ((CSR_IS_PHY_MODE_B_ONLY(pMac) ||
                 CSR_IS_PHY_MODE_G_ONLY(pMac)) &&
             (eBand == eCSR_BAND_5G))
@@ -1076,7 +955,6 @@
             pMac->roam.configParam.uCfgDot11Mode, eBand);
         return eHAL_STATUS_INVALID_PARAMETER;
     }
-
     VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, 
             "Band changed to %u (0 - ALL, 1 - 2.4 GHZ, 2 - 5GHZ)\n", eBand);
     pMac->roam.configParam.eBand = eBand; 
@@ -1087,6 +965,118 @@
         csrInitChannelList( hHal );
     return status;
 }
+/* The funcns csrConvertCBIniValueToPhyCBState and csrConvertPhyCBStateToIniValue have been
+ * introduced to convert the ini value to the ENUM used in csr and MAC for CB state
+ * Ideally we should have kept the ini value and enum value same and representing the same
+ * cb values as in 11n standard i.e. 
+ * Set to 1 (SCA) if the secondary channel is above the primary channel 
+ * Set to 3 (SCB) if the secondary channel is below the primary channel 
+ * Set to 0 (SCN) if no secondary channel is present 
+ * However, since our driver is already distributed we will keep the ini definition as it is which is:
+ * 0 - secondary none
+ * 1 - secondary LOW
+ * 2 - secondary HIGH
+ * and convert to enum value used within the driver in csrChangeDefaultConfigParam using this funcn
+ * The enum values are as follows:
+ * PHY_SINGLE_CHANNEL_CENTERED          = 0
+ * PHY_DOUBLE_CHANNEL_LOW_PRIMARY   = 1
+ * PHY_DOUBLE_CHANNEL_HIGH_PRIMARY  = 3
+ */
+ePhyChanBondState csrConvertCBIniValueToPhyCBState(v_U32_t cbIniValue)
+{
+
+   ePhyChanBondState phyCbState;
+   switch (cbIniValue) {
+      // secondary none
+      case 0:
+        phyCbState = PHY_SINGLE_CHANNEL_CENTERED;
+        break;
+      // secondary LOW
+      case 1:
+        phyCbState = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
+        break;
+      // secondary HIGH
+      case 2:
+        phyCbState = PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
+        break;
+#ifdef WLAN_FEATURE_11AC
+      case 3:
+        phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED; 
+        break;
+      case 4:
+        phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED;
+        break;
+      case 5:
+        phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED;
+        break; 
+      case 6:
+        phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW;
+        break;
+      case 7:
+        phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW;
+        break; 
+      case 8:
+        phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH;
+        break;
+      case 9:
+        phyCbState = PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH;
+        break; 
+#endif 
+      default:
+        // If an invalid value is passed, disable CHANNEL BONDING
+        phyCbState = PHY_SINGLE_CHANNEL_CENTERED;
+        break;
+   }
+   return phyCbState;
+}
+
+v_U32_t csrConvertPhyCBStateToIniValue(ePhyChanBondState phyCbState)
+{
+
+   v_U32_t cbIniValue;
+   switch (phyCbState) {
+      // secondary none
+      case PHY_SINGLE_CHANNEL_CENTERED:
+        cbIniValue = 0;
+        break;
+      // secondary LOW
+      case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
+        cbIniValue = 1;
+        break;
+      // secondary HIGH
+      case PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
+        cbIniValue = 2;
+        break;
+#ifdef WLAN_FEATURE_11AC
+      case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
+        cbIniValue = 3;
+        break;
+      case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
+        cbIniValue = 4;
+        break;
+      case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
+        cbIniValue = 5;
+        break;
+      case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
+        cbIniValue = 6;
+        break;
+      case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
+        cbIniValue = 7;
+        break;
+      case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
+        cbIniValue = 8;
+        break;
+      case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
+        cbIniValue = 9;
+        break;
+#endif
+      default:
+        // return some invalid value
+        cbIniValue = 10;
+        break;
+   }
+   return cbIniValue;
+}
 
 eHalStatus csrChangeDefaultConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
 {
@@ -1102,8 +1092,20 @@
         pMac->roam.configParam.Is11hSupportEnabled = pParam->Is11hSupportEnabled;
 
         pMac->roam.configParam.fenableMCCMode = pParam->fEnableMCCMode;
-        pMac->roam.configParam.channelBondingMode24GHz = pParam->channelBondingMode24GHz;
-        pMac->roam.configParam.channelBondingMode5GHz = pParam->channelBondingMode5GHz;
+        /* channelBondingMode5GHz plays a dual role right now
+         * INFRA STA will use this non zero value as CB enabled and SOFTAP will use this non-zero value to determine the secondary channel offset
+         * This is how channelBondingMode5GHz works now and this is kept intact to avoid any cfg.ini change
+         */
+        if (pParam->channelBondingMode24GHz > MAX_CB_VALUE_IN_INI)
+        {
+            smsLog( pMac, LOGW, "Invalid CB value from ini in 2.4GHz band %d, CB DISABLED\n", pParam->channelBondingMode24GHz); 
+        }
+        pMac->roam.configParam.channelBondingMode24GHz = csrConvertCBIniValueToPhyCBState(pParam->channelBondingMode24GHz);
+        if (pParam->channelBondingMode5GHz > MAX_CB_VALUE_IN_INI)
+        {
+            smsLog( pMac, LOGW, "Invalid CB value from ini in 5GHz band %d, CB DISABLED\n", pParam->channelBondingMode5GHz); 
+        }
+        pMac->roam.configParam.channelBondingMode5GHz = csrConvertCBIniValueToPhyCBState(pParam->channelBondingMode5GHz);
         pMac->roam.configParam.RTSThreshold = pParam->RTSThreshold;
         pMac->roam.configParam.phyMode = pParam->phyMode;
         pMac->roam.configParam.shortSlotTime = pParam->shortSlotTime;
@@ -1116,7 +1118,6 @@
         pMac->roam.configParam.bandCapability = pParam->bandCapability;
         pMac->roam.configParam.cbChoice = pParam->cbChoice;
         pMac->roam.configParam.bgScanInterval = pParam->bgScanInterval;
-
         //if HDD passed down non zero values then only update,
         //otherwise keep using the defaults
         if(pParam->nActiveMaxChnTime)
@@ -1140,7 +1141,6 @@
         {
             //Change the unit from second to microsecond
             tANI_U32 impsSleepTime = pParam->impsSleepTime * PAL_TIMER_TO_SEC_UNIT;
-
             if(CSR_IDLE_SCAN_NO_PS_INTERVAL_MIN <= impsSleepTime)
             {
                 pMac->roam.configParam.impsSleepTime = impsSleepTime;
@@ -1168,17 +1168,14 @@
         {
             pMac->roam.configParam.agingCount = pParam->nScanResultAgeCount;
         }
-
         if(pParam->scanAgeTimeNCNPS)
         {
             pMac->roam.configParam.scanAgeTimeNCNPS = pParam->scanAgeTimeNCNPS;  
         }
-
         if(pParam->scanAgeTimeNCPS)
         {
             pMac->roam.configParam.scanAgeTimeNCPS = pParam->scanAgeTimeNCPS;   
         }
-
         if(pParam->scanAgeTimeCNPS)
         {
             pMac->roam.configParam.scanAgeTimeCNPS = pParam->scanAgeTimeCNPS;   
@@ -1194,16 +1191,13 @@
         pMac->roam.configParam.fSupplicantCountryCodeHasPriority = pParam->fSupplicantCountryCodeHasPriority;
         pMac->roam.configParam.fEnforceCountryCodeMatch = pParam->fEnforceCountryCodeMatch;
         pMac->roam.configParam.fEnforceDefaultDomain = pParam->fEnforceDefaultDomain;
-
         pMac->roam.configParam.vccRssiThreshold = pParam->vccRssiThreshold;
         pMac->roam.configParam.vccUlMacLossThreshold = pParam->vccUlMacLossThreshold;
-
         pMac->roam.configParam.IsIdleScanEnabled = pParam->IsIdleScanEnabled;
         pMac->roam.configParam.statsReqPeriodicity = pParam->statsReqPeriodicity;
         pMac->roam.configParam.statsReqPeriodicityInPS = pParam->statsReqPeriodicityInPS;
         //Assign this before calling CsrInit11dInfo
         pMac->roam.configParam.nTxPowerCap = pParam->nTxPowerCap;
-
         if( csrIs11dSupported( pMac ) )
         {
             status = CsrInit11dInfo(pMac, &pParam->Csr11dinfo);
@@ -1212,16 +1206,23 @@
         {
             pMac->scan.curScanType = eSIR_ACTIVE_SCAN;
         }
+
+        /* Initialize the power + channel information if 11h is enabled.
+        If 11d is enabled this information has already been initialized */
+        if( csrIs11hSupported( pMac ) && !csrIs11dSupported( pMac ) )
+        {
+            csrInitChannelPowerList(pMac, &pParam->Csr11dinfo);
+        }
+
+
 #ifdef WLAN_FEATURE_VOWIFI_11R 
         palCopyMemory( pMac->hHdd, &pMac->roam.configParam.csr11rConfig, &pParam->csr11rConfig, sizeof(tCsr11rConfigParams) );
         smsLog( pMac, LOG1, "IsFTResourceReqSupp = %d\n", pMac->roam.configParam.csr11rConfig.IsFTResourceReqSupported); 
 #endif
-
 #if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         pMac->roam.configParam.isFastTransitionEnabled = pParam->isFastTransitionEnabled;
         pMac->roam.configParam.RoamRssiDiff = pParam->RoamRssiDiff;
 #endif
-
 #ifdef FEATURE_WLAN_LFR 
         pMac->roam.configParam.isFastRoamIniFeatureEnabled = pParam->isFastRoamIniFeatureEnabled;
 #endif
@@ -1229,10 +1230,8 @@
 #ifdef FEATURE_WLAN_CCX 
         pMac->roam.configParam.isCcxIniFeatureEnabled = pParam->isCcxIniFeatureEnabled;
 #endif
-
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
         palCopyMemory( pMac->hHdd, &pMac->roam.configParam.neighborRoamConfig, &pParam->neighborRoamConfig, sizeof(tCsrNeighborRoamConfigParams) );
-
         smsLog( pMac, LOG1, "nNeighborScanTimerPerioid = %d\n", pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod);
         smsLog( pMac, LOG1, "nNeighborReassocRssiThreshold = %d\n", pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold);  
         smsLog( pMac, LOG1, "nNeighborLookupRssiThreshold = %d\n", pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold);  
@@ -1240,11 +1239,9 @@
         smsLog( pMac, LOG1, "nNeighborScanMaxChanTime = %d\n", pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime);
         smsLog( pMac, LOG1, "nMaxNeighborRetries = %d\n", pMac->roam.configParam.neighborRoamConfig.nMaxNeighborRetries); 
         smsLog( pMac, LOG1, "nNeighborResultsRefreshPeriod = %d\n", pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod); 
-
         {
            int i;
            smsLog( pMac, LOG1, FL("Num of Channels in CFG Channel List: %d\n"), pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels); 
-
            for( i=0; i< pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.numChannels; i++)
            {
               smsLog( pMac, LOG1, "%d ", pMac->roam.configParam.neighborRoamConfig.neighborScanChanList.channelList[i] );
@@ -1252,22 +1249,32 @@
            smsLog( pMac, LOG1, "\n");
         }
 #endif
-
         pMac->roam.configParam.addTSWhenACMIsOff = pParam->addTSWhenACMIsOff;
         pMac->scan.fValidateList = pParam->fValidateList;
         pMac->scan.fEnableBypass11d = pParam->fEnableBypass11d;
         pMac->scan.fEnableDFSChnlScan = pParam->fEnableDFSChnlScan;
         pMac->roam.configParam.fScanTwice = pParam->fScanTwice;
+        pMac->scan.fFirstScanOnly2GChnl = pParam->fFirstScanOnly2GChnl;
+        /* This parameter is not available in cfg and not passed from upper layers. Instead it is initialized here
+         * This paramtere is used in concurrency to determine if there are concurrent active sessions.
+         * Is used as a temporary fix to disconnect all active sessions when BMPS enabled so the active session if Infra STA
+         * will automatically connect back and resume BMPS since resume BMPS is not working when moving from concurrent to
+         * single session
+         */
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+       pMac->roam.configParam.doBMPSWorkaround = 0;
+#endif
+#ifdef WLAN_FEATURE_11AC
+        pMac->roam.configParam.nVhtChannelWidth = pParam->nVhtChannelWidth;
+#endif
     }
     
     return status;
 }
 
-
 eHalStatus csrGetConfigParam(tpAniSirGlobal pMac, tCsrConfigParam *pParam)
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
-
     if(pParam)
     {
         pParam->WMMSupportMode = pMac->roam.configParam.WMMSupportMode;
@@ -1276,8 +1283,8 @@
         pParam->Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabled;
         pParam->Is11dSupportEnabledOriginal = pMac->roam.configParam.Is11dSupportEnabledOriginal;
         pParam->Is11hSupportEnabled = pMac->roam.configParam.Is11hSupportEnabled;
-        pParam->channelBondingMode24GHz = pMac->roam.configParam.channelBondingMode24GHz;
-        pParam->channelBondingMode5GHz = pMac->roam.configParam.channelBondingMode5GHz;
+        pParam->channelBondingMode24GHz = csrConvertPhyCBStateToIniValue(pMac->roam.configParam.channelBondingMode24GHz);
+        pParam->channelBondingMode5GHz = csrConvertPhyCBStateToIniValue(pMac->roam.configParam.channelBondingMode5GHz);
         pParam->RTSThreshold = pMac->roam.configParam.RTSThreshold;
         pParam->phyMode = pMac->roam.configParam.phyMode;
         pParam->shortSlotTime = pMac->roam.configParam.shortSlotTime;
@@ -1290,12 +1297,10 @@
         pParam->bandCapability = pMac->roam.configParam.bandCapability;
         pParam->cbChoice = pMac->roam.configParam.cbChoice;
         pParam->bgScanInterval = pMac->roam.configParam.bgScanInterval;
-
         pParam->nActiveMaxChnTime = pMac->roam.configParam.nActiveMaxChnTime;
         pParam->nActiveMinChnTime = pMac->roam.configParam.nActiveMinChnTime;
         pParam->nPassiveMaxChnTime = pMac->roam.configParam.nPassiveMaxChnTime;
         pParam->nPassiveMinChnTime = pMac->roam.configParam.nPassiveMinChnTime;
-
         //Change the unit from microsecond to second
         pParam->impsSleepTime = pMac->roam.configParam.impsSleepTime / PAL_TIMER_TO_SEC_UNIT;
         pParam->eBand = pMac->roam.configParam.eBand;
@@ -1312,38 +1317,37 @@
         pParam->fEnforceDefaultDomain = pMac->roam.configParam.fEnforceDefaultDomain;        
         pParam->vccRssiThreshold = pMac->roam.configParam.vccRssiThreshold;
         pParam->vccUlMacLossThreshold = pMac->roam.configParam.vccUlMacLossThreshold;
-
         pParam->IsIdleScanEnabled = pMac->roam.configParam.IsIdleScanEnabled;
         pParam->nTxPowerCap = pMac->roam.configParam.nTxPowerCap;
         pParam->statsReqPeriodicity = pMac->roam.configParam.statsReqPeriodicity;
         pParam->statsReqPeriodicityInPS = pMac->roam.configParam.statsReqPeriodicityInPS;
-
         pParam->addTSWhenACMIsOff = pMac->roam.configParam.addTSWhenACMIsOff;
         pParam->fValidateList = pMac->roam.configParam.fValidateList;
         pParam->fEnableBypass11d = pMac->scan.fEnableBypass11d;
         pParam->fEnableDFSChnlScan = pMac->scan.fEnableDFSChnlScan;
         pParam->fScanTwice = pMac->roam.configParam.fScanTwice;
+        pParam->fFirstScanOnly2GChnl = pMac->scan.fFirstScanOnly2GChnl;
 
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
         palCopyMemory( pMac->hHdd, &pParam->neighborRoamConfig, &pMac->roam.configParam.neighborRoamConfig, sizeof(tCsrNeighborRoamConfigParams) );
 #endif
+#ifdef WLAN_FEATURE_11AC
+        pParam->nVhtChannelWidth = pMac->roam.configParam.nVhtChannelWidth;
+#endif
 
         csrSetChannels(pMac, pParam);
 
         status = eHAL_STATUS_SUCCESS;
     }
-
     return (status);
 }
 
-
 eHalStatus csrSetPhyMode(tHalHandle hHal, tANI_U32 phyMode, eCsrBand eBand, tANI_BOOLEAN *pfRestartNeeded)
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     tANI_BOOLEAN fRestartNeeded = eANI_BOOLEAN_FALSE;
     eCsrPhyMode newPhyMode = eCSR_DOT11_MODE_AUTO;
-
     do
     {
         if(eCSR_BAND_24 == eBand)
@@ -1443,10 +1447,8 @@
                 newPhyMode = eCSR_DOT11_MODE_AUTO;
             }
         }
-
         //Done validating
         status = eHAL_STATUS_SUCCESS;
-
         //Now we need to check whether a restart is needed.
         if(eBand != pMac->roam.configParam.eBand)
         {
@@ -1458,9 +1460,7 @@
             fRestartNeeded = eANI_BOOLEAN_TRUE;
             break;
         }
-
     }while(0);
-
     if(HAL_STATUS_SUCCESS(status))
     {
         pMac->roam.configParam.eBand = eBand;
@@ -1470,16 +1470,13 @@
             *pfRestartNeeded = fRestartNeeded;
         }
     }
-
     return (status);
 }
     
-
 void csrPruneChannelListForMode( tpAniSirGlobal pMac, tCsrChannel *pChannelList )
 {
     tANI_U8 Index;
     tANI_U8 cChannels;
-
     // for dual band NICs, don't need to trim the channel list....
     if ( !CSR_IS_OPEARTING_DUAL_BAND( pMac ) )
     {
@@ -1496,7 +1493,6 @@
                     cChannels++;
                 }
             }
-
             // Cleanup the rest of channels.   Note we only need to clean up the channels if we had
             // to trim the list.  Calling palZeroMemory() with a 0 size is going to throw asserts on 
             // the debug builds so let's be a bit smarter about that.  Zero out the reset of the channels
@@ -1524,7 +1520,6 @@
                     cChannels++;
                 }
             }
-
             // Cleanup the rest of channels.   Note we only need to clean up the channels if we had
             // to trim the list.  Calling palZeroMemory() with a 0 size is going to throw asserts on 
             // the debug builds so let's be a bit smarter about that.  Zero out the reset of the channels
@@ -1541,9 +1536,7 @@
             pChannelList->numChannels = cChannels;
         }
     }
-
 }
-
 #ifdef WLAN_SOFTAP_FEATURE
 #define INFRA_AP_DEFAULT_CHANNEL 6
 eHalStatus csrIsValidChannel(tpAniSirGlobal pMac, tANI_U8 chnNum)
@@ -1560,7 +1553,6 @@
     return status;
 }
 #endif
-
 eHalStatus csrInitGetChannels(tpAniSirGlobal pMac)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -1568,7 +1560,7 @@
     VOS_STATUS vosStatus;
     tANI_U8 Index = 0;
     tANI_U8 num40MHzChannelsFound = 0;
-
+    
     
     //TODO: this interface changed to include the 40MHz channel list
     // this needs to be tied into the adapter structure somehow and referenced appropriately for CB operation
@@ -1610,16 +1602,13 @@
         }
         pMac->scan.base40MHzChannels.numChannels = num40MHzChannelsFound;
     }
-
     return (status);  
 }
 
-
 eHalStatus csrInitChannelList( tHalHandle hHal )
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     eHalStatus status = eHAL_STATUS_SUCCESS;
-
     csrPruneChannelListForMode(pMac, &pMac->scan.baseChannels);
     csrPruneChannelListForMode(pMac, &pMac->scan.base20MHzChannels);
     // Apply the base channel list, power info, and set the Country code...
@@ -1627,20 +1616,16 @@
  
     return (status);
 }
-
-
 eHalStatus csrChangeConfigParams(tpAniSirGlobal pMac, 
                                  tCsrUpdateConfigParam *pUpdateConfigParam)
 {
    eHalStatus status = eHAL_STATUS_FAILURE;
    tCsr11dinfo *ps11dinfo = NULL;
-
    ps11dinfo = &pUpdateConfigParam->Csr11dinfo;
    status = CsrInit11dInfo(pMac, ps11dinfo);
    return status;
 }
 
-
 static eHalStatus CsrInit11dInfo(tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo)
 {
   eHalStatus status = eHAL_STATUS_FAILURE;
@@ -1654,7 +1639,6 @@
   {
      return (status);
   }
-
   if ( ps11dinfo->Channels.numChannels && ( WNI_CFG_VALID_CHANNEL_LIST_LEN >= ps11dinfo->Channels.numChannels ) ) 
   {
     pMac->scan.base20MHzChannels.numChannels = ps11dinfo->Channels.numChannels;
@@ -1667,12 +1651,10 @@
      //No change
      return (eHAL_STATUS_SUCCESS);
   }
-
   //legacy maintenance
   status = palCopyMemory(pMac->hHdd, pMac->scan.countryCodeDefault, 
                          ps11dinfo->countryCode, WNI_CFG_COUNTRY_CODE_LEN);
   if(!HAL_STATUS_SUCCESS(status)) return (status);
-
   //Tush: at csropen get this initialized with default, during csr reset if this 
   // already set with some value no need initilaize with default again
   if(0 == pMac->scan.countryCodeCurrent[0])
@@ -1681,12 +1663,62 @@
                          ps11dinfo->countryCode, WNI_CFG_COUNTRY_CODE_LEN);
      if(!HAL_STATUS_SUCCESS(status)) return (status);
   }
-
   // need to add the max power channel list
   if(HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd, (void **)&pChanInfo, sizeof(tSirMacChanInfo) * WNI_CFG_VALID_CHANNEL_LIST_LEN)))
   {
       palZeroMemory(pMac->hHdd, pChanInfo, sizeof(tSirMacChanInfo) * WNI_CFG_VALID_CHANNEL_LIST_LEN);
       pChanInfoStart = pChanInfo;
+      for(index = 0; index < ps11dinfo->Channels.numChannels; index++)
+      {
+        pChanInfo->firstChanNum = ps11dinfo->ChnPower[index].firstChannel;
+        pChanInfo->numChannels  = ps11dinfo->ChnPower[index].numChannels;
+        pChanInfo->maxTxPower   = CSR_ROAM_MIN( ps11dinfo->ChnPower[index].maxtxPower, pMac->roam.configParam.nTxPowerCap );
+        pChanInfo++;
+        count++;
+      }
+      if(count)
+      {
+          csrSaveToChannelPower2G_5G( pMac, count * sizeof(tSirMacChanInfo), pChanInfoStart );
+      }
+      palFreeMemory(pMac->hHdd, pChanInfoStart);
+  }
+  //Only apply them to CFG when not in STOP state. Otherwise they will be applied later
+  if( HAL_STATUS_SUCCESS(status) )
+  {
+      for( index = 0; index < CSR_ROAM_SESSION_MAX; index++ )
+      {
+          if((CSR_IS_SESSION_VALID(pMac, index)) && CSR_IS_ROAM_STOP(pMac, index))
+          {
+              applyConfig = FALSE;
+          }
+    }
+
+    if(TRUE == applyConfig)
+    {
+        // Apply the base channel list, power info, and set the Country code...
+        csrApplyChannelPowerCountryInfo( pMac, &pMac->scan.base20MHzChannels, pMac->scan.countryCodeCurrent );
+    }
+
+  }
+  return (status);
+}
+/* Initialize the Channel + Power List in the local cache and in the CFG */
+eHalStatus csrInitChannelPowerList( tpAniSirGlobal pMac, tCsr11dinfo *ps11dinfo)
+{
+  tANI_U8  index;
+  tANI_U32 count=0;
+  tSirMacChanInfo *pChanInfo;
+  tSirMacChanInfo *pChanInfoStart;
+
+  if(!ps11dinfo || !pMac)
+  {
+     return eHAL_STATUS_FAILURE;
+  }
+
+  if(HAL_STATUS_SUCCESS(palAllocateMemory(pMac->hHdd, (void **)&pChanInfo, sizeof(tSirMacChanInfo) * WNI_CFG_VALID_CHANNEL_LIST_LEN)))
+  {
+      palZeroMemory(pMac->hHdd, pChanInfo, sizeof(tSirMacChanInfo) * WNI_CFG_VALID_CHANNEL_LIST_LEN);
+      pChanInfoStart = pChanInfo;
 
       for(index = 0; index < ps11dinfo->Channels.numChannels; index++)
       {
@@ -1703,26 +1735,7 @@
       palFreeMemory(pMac->hHdd, pChanInfoStart);
   }
 
-  //Only apply them to CFG when not in STOP state. Otherwise they will be applied later
-  if( HAL_STATUS_SUCCESS(status) )
-  {
-      for( index = 0; index < CSR_ROAM_SESSION_MAX; index++ )
-      {
-          if((CSR_IS_SESSION_VALID(pMac, index)) && CSR_IS_ROAM_STOP(pMac, index))
-          {
-              applyConfig = FALSE;
-          }
-    }
-
-    if(TRUE == applyConfig)
-    {
-        // Apply the base channel list, power info, and set the Country code...
-        csrApplyChannelPowerCountryInfo( pMac, &pMac->scan.base20MHzChannels, pMac->scan.countryCodeCurrent );
-    }
-
-  }
-
-  return (status);
+  return eHAL_STATUS_SUCCESS;
 }
 
 //pCommand may be NULL
@@ -1745,7 +1758,6 @@
     {
         pNextEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK );
         pDupCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
-
         // Remove the previous command if..
         // - the new roam command is for the same RoamReason...
         // - the new roam command is a NewProfileList.
@@ -1787,7 +1799,6 @@
     }
     csrLLClose(&localList);
 }
-
 eHalStatus csrRoamCallCallback(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamInfo *pRoamInfo, 
                                tANI_U32 roamId, eRoamCmdStatus u1, eCsrRoamResult u2)
 {
@@ -1796,7 +1807,6 @@
     WLAN_VOS_DIAG_EVENT_DEF(connectionStatus, vos_event_wlan_status_payload_type);
 #endif
     tCsrRoamSession *pSession;
-
     if( CSR_IS_SESSION_VALID( pMac, sessionId) )
     {
         pSession = CSR_GET_SESSION( pMac, sessionId );
@@ -1807,12 +1817,10 @@
        VOS_ASSERT(0);
        return eHAL_STATUS_FAILURE;
     }
-
     if(eCSR_ROAM_ASSOCIATION_COMPLETION == u1 && pRoamInfo)
     {
         smsLog(pMac, LOGW, " Assoc complete result = %d statusCode = %d reasonCode = %d\n", u2, pRoamInfo->statusCode, pRoamInfo->reasonCode);
     }
-
     if ( (pSession == NULL) ||
         (eANI_BOOLEAN_FALSE == pSession->sessionActive) )
     {
@@ -1850,7 +1858,6 @@
           connectionStatus.rssi = pRoamInfo->pBssDesc->rssi * (-1);
           connectionStatus.channel = pRoamInfo->pBssDesc->channelId;
        }
-
        connectionStatus.qosCapability = pRoamInfo->u.pConnectedProfile->qosConnection;
        connectionStatus.authType = (v_U8_t)diagAuthTypeFromCSRType(pRoamInfo->u.pConnectedProfile->AuthType);
        connectionStatus.encryptionType = (v_U8_t)diagEncTypeFromCSRType(pRoamInfo->u.pConnectedProfile->EncryptionType);
@@ -1858,40 +1865,34 @@
        connectionStatus.reason = eCSR_REASON_UNSPECIFIED;
        WLAN_VOS_DIAG_EVENT_REPORT(&connectionStatus, EVENT_WLAN_STATUS);
     }
-
     if((eCSR_ROAM_MIC_ERROR_IND == u1) || (eCSR_ROAM_RESULT_MIC_FAILURE == u2))
     {
        connectionStatus.eventId = eCSR_WLAN_STATUS_DISCONNECT;
        connectionStatus.reason = eCSR_REASON_MIC_ERROR;
        WLAN_VOS_DIAG_EVENT_REPORT(&connectionStatus, EVENT_WLAN_STATUS);
     }
-
     if(eCSR_ROAM_RESULT_FORCED == u2)
     {
        connectionStatus.eventId = eCSR_WLAN_STATUS_DISCONNECT;
        connectionStatus.reason = eCSR_REASON_USER_REQUESTED;
        WLAN_VOS_DIAG_EVENT_REPORT(&connectionStatus, EVENT_WLAN_STATUS);
     }
-
     if(eCSR_ROAM_RESULT_DISASSOC_IND == u2)
     {
        connectionStatus.eventId = eCSR_WLAN_STATUS_DISCONNECT;
        connectionStatus.reason = eCSR_REASON_DISASSOC;
        WLAN_VOS_DIAG_EVENT_REPORT(&connectionStatus, EVENT_WLAN_STATUS);
     }
-
     if(eCSR_ROAM_RESULT_DEAUTH_IND == u2)
     {
        connectionStatus.eventId = eCSR_WLAN_STATUS_DISCONNECT;
        connectionStatus.reason = eCSR_REASON_DEAUTH;
        WLAN_VOS_DIAG_EVENT_REPORT(&connectionStatus, EVENT_WLAN_STATUS);
     }
-
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
     
     return (status);
 }
-
 // Returns whether handoff is currently in progress or not
 tANI_BOOLEAN csrRoamIsHandoffInProgress(tpAniSirGlobal pMac)
 {
@@ -1900,9 +1901,7 @@
 #else
     return eANI_BOOLEAN_FALSE;
 #endif
-
 }
-
 eHalStatus csrRoamIssueDisassociate( tpAniSirGlobal pMac, tANI_U32 sessionId,
                                      eCsrRoamSubState NewSubstate, tANI_BOOLEAN fMICFailure )
 {   
@@ -1930,26 +1929,23 @@
     {
         reasonCode = eSIR_MAC_UNSPEC_FAILURE_REASON;
     }    
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
     if ( (csrRoamIsHandoffInProgress(pMac)) && 
          (NewSubstate != eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF))
     {
         tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
         palCopyMemory(pMac->hHdd, &bssId, pNeighborRoamInfo->csrNeighborRoamProfile.BSSIDs.bssid, sizeof(tSirMacAddr));
-
     } else 
 #endif
     if(pSession->pConnectBssDesc)
     {
         palCopyMemory(pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
     }
-
+    
     
     smsLog( pMac, LOGE, "CSR Attempting to Disassociate Bssid= %02x-%02x-%02x-%02x-%02x-%02x subState = %d\n", 
                   bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
                   bssId[ 3 ], bssId[ 4 ], bssId[ 5 ], NewSubstate );    
-
     csrRoamSubstateChange( pMac, NewSubstate, sessionId);
 
     status = csrSendMBDisassocReqMsg( pMac, sessionId, bssId, reasonCode );    
@@ -1957,7 +1953,6 @@
     if(HAL_STATUS_SUCCESS(status)) 
     {
         csrRoamLinkDown(pMac, sessionId);
-
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
         //no need to tell QoS that we are disassociating, it will be taken care off in assoc req for HO
         if(eCSR_ROAM_SUBSTATE_DISASSOC_HANDOFF != NewSubstate)
@@ -1967,14 +1962,10 @@
         }
 #endif
      }
-
     return (status);
 }
-
 #ifdef WLAN_SOFTAP_FEATURE
 
-
-
 /* ---------------------------------------------------------------------------
     \fn csrRoamIssueDisassociateStaCmd
     \brief csr function that HDD calls to disassociate a associated station
@@ -2017,7 +2008,6 @@
 }
 
 
-
 /* ---------------------------------------------------------------------------
     \fn csrRoamIssueDeauthSta
     \brief csr function that HDD calls to delete a associated station
@@ -2058,9 +2048,6 @@
 
     return status;
 }
-
-
-
 eHalStatus
 csrRoamIssueTkipCounterMeasures( tpAniSirGlobal pMac, tANI_U32 sessionId,
                                     tANI_BOOLEAN bEnable )
@@ -2068,13 +2055,11 @@
     eHalStatus status = eHAL_STATUS_FAILURE;
     tCsrBssid bssId = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if (!pSession)
     {
         smsLog( pMac, LOGE, "csrRoamIssueTkipCounterMeasures:CSR Session not found\n");
         return (status);
     }
-
     if (pSession->pConnectBssDesc)
     {
         palCopyMemory(pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
@@ -2084,15 +2069,12 @@
         smsLog( pMac, LOGE, "csrRoamIssueTkipCounterMeasures:Connected BSS Description in CSR Session not found\n");
         return (status);
     }
-
     smsLog( pMac, LOG2, "CSR issuing tkip counter measures for Bssid = %02x-%02x-%02x-%02x-%02x-%02x, Enable = %d\n", 
                   bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
                   bssId[ 3 ], bssId[ 4 ], bssId[ 5 ] , bEnable);
-
     status = csrSendMBTkipCounterMeasuresReqMsg( pMac, sessionId, bEnable, bssId );
     return (status);
 }
-
 eHalStatus
 csrRoamGetAssociatedStas( tpAniSirGlobal pMac, tANI_U32 sessionId,
                             VOS_MODULE_ID modId,  void *pUsrContext,
@@ -2101,13 +2083,11 @@
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tCsrBssid bssId = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if (!pSession)
     {
         smsLog( pMac, LOGE, "csrRoamGetAssociatedStas:CSR Session not found\n");
         return (status);
     }
-
     if(pSession->pConnectBssDesc)
     {
         palCopyMemory( pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid) );
@@ -2117,15 +2097,12 @@
         smsLog( pMac, LOGE, "csrRoamGetAssociatedStas:Connected BSS Description in CSR Session not found\n");
         return (status);
     }
-
     smsLog( pMac, LOG2, "CSR getting associated stations for Bssid = %02x-%02x-%02x-%02x-%02x-%02x\n",
                   bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
                   bssId[ 3 ], bssId[ 4 ], bssId[ 5 ] );
-
     status = csrSendMBGetAssociatedStasReqMsg( pMac, sessionId, modId, bssId, pUsrContext, pfnSapEventCallback, pAssocStasBuf );
     return (status);
 }
-
 eHalStatus
 csrRoamGetWpsSessionOverlap( tpAniSirGlobal pMac, tANI_U32 sessionId,
                              void *pUsrContext, void *pfnSapEventCallback, v_MACADDR_t pRemoveMac )
@@ -2139,7 +2116,6 @@
         smsLog( pMac, LOGE, "csrRoamGetWpsSessionOverlap:CSR Session not found\n");
         return (status);
     }
-
     if(pSession->pConnectBssDesc)
     {
         palCopyMemory( pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid) );
@@ -2149,7 +2125,6 @@
         smsLog( pMac, LOGE, "csrRoamGetWpsSessionOverlap:Connected BSS Description in CSR Session not found\n");
         return (status);
     }
-
     smsLog( pMac, LOG2, "CSR getting WPS Session Overlap for Bssid = %02x-%02x-%02x-%02x-%02x-%02x\n",
                   bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
                   bssId[ 3 ], bssId[ 4 ], bssId[ 5 ] );
@@ -2158,9 +2133,7 @@
             
     return (status);
 }
-
 #endif
-
 eHalStatus csrRoamIssueDeauth( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamSubState NewSubstate )
 {   
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -2171,11 +2144,9 @@
     {
         palCopyMemory(pMac->hHdd, &bssId, pSession->pConnectBssDesc->bssId, sizeof(tCsrBssid));
     }
-
     smsLog( pMac, LOG2, "CSR Attempting to Deauth Bssid= %02x-%02x-%02x-%02x-%02x-%02x\n", 
                   bssId[ 0 ], bssId[ 1 ], bssId[ 2 ],
                   bssId[ 3 ], bssId[ 4 ], bssId[ 5 ] );    
-
     csrRoamSubstateChange( pMac, NewSubstate, sessionId);
     
     status = csrSendMBDeauthReqMsg( pMac, sessionId, bssId, eSIR_MAC_DISASSOC_LEAVING_BSS_REASON );    
@@ -2183,8 +2154,6 @@
     return (status);
 }
 
-
-
 eHalStatus csrRoamSaveConnectedBssDesc( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pBssDesc )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -2221,18 +2190,16 @@
     return (status);
 }
 
-
 eHalStatus csrRoamPrepareBssConfig(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, 
                                     tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig,
                                     tDot11fBeaconIEs *pIes)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     eCsrCfgDot11Mode cfgDot11Mode;
-
 #if defined(VOSS_ENABLED)
     VOS_ASSERT( pIes != NULL );
 #endif
-    
+
     do
     {
         palCopyMemory(pMac->hHdd, &pBssConfig->BssCap, &pBssDesc->capabilityInfo, sizeof(tSirMacCapabilityInfo));
@@ -2283,7 +2250,6 @@
                 pBssConfig->uCfgDot11Mode = eCSR_CFG_DOT11_MODE_11A;
             }
         }
-
         //Qos
         if ((pBssConfig->uCfgDot11Mode != eCSR_CFG_DOT11_MODE_11N) &&
                 (pMac->roam.configParam.WMMSupportMode == eCsrRoamWmmNoQos))
@@ -2303,11 +2269,9 @@
             case eCSR_AUTH_TYPE_OPEN_SYSTEM:
                 pBssConfig->authType = eSIR_OPEN_SYSTEM;
                 break;
-
             case eCSR_AUTH_TYPE_SHARED_KEY:
                 pBssConfig->authType = eSIR_SHARED_KEY;
                 break;
-
             case eCSR_AUTH_TYPE_AUTOSWITCH:
                 pBssConfig->authType = eSIR_AUTO_SWITCH;
                 break;
@@ -2343,11 +2307,11 @@
         }
         //Join timeout
         // if we find a BeaconInterval in the BssDescription, then set the Join Timeout to 
-        // be 3 x the BeaconInterval.                          
+        // be 10 x the BeaconInterval.                          
         if ( pBssDesc->beaconInterval )
         {
             //Make sure it is bigger than the minimal
-            pBssConfig->uJoinTimeOut = CSR_ROAM_MAX(3 * pBssDesc->beaconInterval, CSR_JOIN_FAILURE_TIMEOUT_MIN);
+            pBssConfig->uJoinTimeOut = CSR_ROAM_MAX(10 * pBssDesc->beaconInterval, CSR_JOIN_FAILURE_TIMEOUT_MIN);
         }
         else 
         {
@@ -2356,11 +2320,9 @@
         //validate CB
         pBssConfig->cbMode = csrGetCBModeFromIes(pMac, pBssDesc->channelId, pIes);
     }while(0);
-
     return (status);
 }
 
-
 static eHalStatus csrRoamPrepareBssConfigFromProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, 
                                                      tBssConfigParam *pBssConfig, tSirBssDescription *pBssDesc)
 {
@@ -2379,7 +2341,6 @@
         //SSID must present
         return eHAL_STATUS_FAILURE;
     }
-
     //Settomg up the capabilities
     if( csrIsBssTypeIBSS(pProfile->BSSType) )
     {
@@ -2393,25 +2354,21 @@
     {
         pBssConfig->BssCap.privacy = 1;
     }
-
     pBssConfig->eBand = pMac->roam.configParam.eBand;
     //phymode
     if(pProfile->ChannelInfo.ChannelList)
     {
        operationChannel = pProfile->ChannelInfo.ChannelList[0];
     }
-
 #ifdef WLAN_SOFTAP_FEATURE
     pBssConfig->uCfgDot11Mode = csrRoamGetPhyModeBandForBss(pMac, pProfile, operationChannel, 
                                         &pBssConfig->eBand);
 #else
-
     pBssConfig->uCfgDot11Mode = csrRoamGetPhyModeBandForBss(pMac, (eCsrPhyMode)pProfile->phyMode, operationChannel, 
                                         &pBssConfig->eBand);
 #endif
     //QOS
     //Is this correct to always set to this //***
-
     if ( pBssConfig->BssCap.ess == 1 ) 
     {
 #ifdef WLAN_SOFTAP_FEATURE
@@ -2429,7 +2386,6 @@
     } else {
              qAPisEnabled = TRUE;
     }
-
     if (( eCsrRoamWmmNoQos != pMac->roam.configParam.WMMSupportMode && qAPisEnabled) ||
           (( eCSR_CFG_DOT11_MODE_11N == pBssConfig->uCfgDot11Mode && qAPisEnabled) ||
              ( eCSR_CFG_DOT11_MODE_TAURUS == pBssConfig->uCfgDot11Mode ) ) //For 11n, need QoS
@@ -2450,11 +2406,9 @@
         case eCSR_AUTH_TYPE_OPEN_SYSTEM:
             pBssConfig->authType = eSIR_OPEN_SYSTEM;
             break;
-
         case eCSR_AUTH_TYPE_SHARED_KEY:
             pBssConfig->authType = eSIR_SHARED_KEY;
             break;
-
         case eCSR_AUTH_TYPE_AUTOSWITCH:
             pBssConfig->authType = eSIR_AUTO_SWITCH;
             break;
@@ -2482,10 +2436,9 @@
     }
     //Join timeout
     pBssConfig->uJoinTimeOut = CSR_JOIN_FAILURE_TIMEOUT_DEFAULT;
-    
+
     return (status);
 }
-
 static eHalStatus csrRoamGetQosInfoFromBss(tpAniSirGlobal pMac, tSirBssDescription *pBssDesc)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
@@ -2498,7 +2451,6 @@
          //err msg
          VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, 
                    "csrRoamGetQosInfoFromBss() failed\n");
-
          break;
       }
       //check if the AP is QAP & it supports APSD
@@ -2507,14 +2459,11 @@
          return eHAL_STATUS_SUCCESS;
       }
    } while (0);
-
    return status;
 }
 
-
 void csrSetCfgPrivacy( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, tANI_BOOLEAN fPrivacy )
 {
-
     // !! Note:  the only difference between this function and the csrSetCfgPrivacyFromProfile() is the 
     // setting of the privacy CFG based on the advertised privacy setting from the AP for WPA associations. 
     // See !!Note: below in this function...
@@ -2559,7 +2508,6 @@
                         
             // Set the Wep default key ID.
             WepDefaultKeyId = pProfile->Keys.defaultIndex;
-
             // Wep key size if 5 bytes (40 bits).
             WepKeyLength = WNI_CFG_WEP_KEY_LENGTH_5;            
             
@@ -2603,7 +2551,6 @@
             {
                 Key3Length = 0;
             }      
-
             break;
         
         case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
@@ -2684,7 +2631,6 @@
             Key3Length = 0;        
           
             break;     
-
         default:
             PrivacyEnabled = 0;
             RsnEnabled = 0;
@@ -2701,7 +2647,6 @@
     ccmCfgSetInt(pMac, WNI_CFG_WEP_DEFAULT_KEYID, WepDefaultKeyId, NULL, eANI_BOOLEAN_FALSE);
 }
 
-
 static void csrSetCfgSsid( tpAniSirGlobal pMac, tSirMacSSid *pSSID )
 {
     tANI_U32 len = 0;
@@ -2712,58 +2657,46 @@
     ccmCfgSetStr(pMac, WNI_CFG_SSID, (tANI_U8 *)pSSID->ssId, len, NULL, eANI_BOOLEAN_FALSE);
 }
 
-
 eHalStatus csrSetQosToCfg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrMediaAccessType qosType )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tANI_U32 QoSEnabled;
     tANI_U32 WmeEnabled;
-
     // set the CFG enable/disable variables based on the qosType being configured...
     switch( qosType )
     {
-
         case eCSR_MEDIUM_ACCESS_WMM_eDCF_802dot1p:
             QoSEnabled = FALSE;
             WmeEnabled = TRUE;
             break;
-
         case eCSR_MEDIUM_ACCESS_WMM_eDCF_DSCP:
             QoSEnabled = FALSE;
             WmeEnabled = TRUE;
             break;
-
         case eCSR_MEDIUM_ACCESS_WMM_eDCF_NoClassify:
             QoSEnabled = FALSE;
             WmeEnabled = TRUE;
             break;
-
         case eCSR_MEDIUM_ACCESS_11e_eDCF:
             QoSEnabled = TRUE;
             WmeEnabled = FALSE;
             break;
-
         case eCSR_MEDIUM_ACCESS_11e_HCF:
             QoSEnabled = TRUE;
             WmeEnabled = FALSE;
             break;
-
         default:
         case eCSR_MEDIUM_ACCESS_DCF:
             QoSEnabled = FALSE;
             WmeEnabled = FALSE;
             break;
-
     }
     //save the WMM setting for later use
     pMac->roam.roamSession[sessionId].fWMMConnection = (tANI_BOOLEAN)WmeEnabled;
-
     status = ccmCfgSetInt(pMac, WNI_CFG_QOS_ENABLED, QoSEnabled, NULL, eANI_BOOLEAN_FALSE);
     status = ccmCfgSetInt(pMac, WNI_CFG_WME_ENABLED, WmeEnabled, NULL, eANI_BOOLEAN_FALSE);
-
     return (status);
 }
-
 static eHalStatus csrGetRateSet( tpAniSirGlobal pMac,  tCsrRoamProfile *pProfile, eCsrPhyMode phyMode, tSirBssDescription *pBssDesc,
                            tDot11fBeaconIEs *pIes, tSirMacRateSet *pOpRateSet, tSirMacRateSet *pExRateSet)
 {
@@ -2771,10 +2704,8 @@
     int i;
     eCsrCfgDot11Mode cfgDot11Mode;
     tANI_U8 *pDstRate;
-
     palZeroMemory(pMac->hHdd, pOpRateSet, sizeof(tSirMacRateSet));
     palZeroMemory(pMac->hHdd, pExRateSet, sizeof(tSirMacRateSet));
-
 #if defined(VOSS_ENABLED)
     VOS_ASSERT( pIes != NULL );
 #endif
@@ -2782,14 +2713,12 @@
     if( NULL != pIes )
     {
         csrIsPhyModeMatch( pMac, phyMode, pBssDesc, pProfile, &cfgDot11Mode, pIes );
-
         // Originally, we thought that for 11a networks, the 11a rates are always
         // in the Operational Rate set & for 11b and 11g networks, the 11b rates
         // appear in the Operational Rate set.  Consequently, in either case, we
         // would blindly put the rates we support into our Operational Rate set
         // (including the basic rates, which we have already verified are
         // supported earlier in the roaming decision).
-
         // However, it turns out that this is not always the case.  Some AP's
         // (e.g. D-Link DI-784) ram 11g rates into the Operational Rate set,
         // too.  Now, we're a little more careful:
@@ -2805,7 +2734,6 @@
                 }
             }
         }
-
         if ( eCSR_CFG_DOT11_MODE_11G == cfgDot11Mode || 
              eCSR_CFG_DOT11_MODE_11N == cfgDot11Mode ||
              eCSR_CFG_DOT11_MODE_TAURUS == cfgDot11Mode ||
@@ -2851,22 +2779,18 @@
     tANI_U32 PropRatesEnable = 0;
     tANI_U8 MCSRateIdxSet[ SIZE_OF_SUPPORTED_MCS_SET ];
     tANI_U32 MCSRateLength = 0;
-
 #if defined(VOSS_ENABLED)
     VOS_ASSERT( pIes != NULL );
 #endif
-
     if( NULL != pIes )
     {
         csrIsPhyModeMatch( pMac, phyMode, pBssDesc, pProfile, &cfgDot11Mode, pIes );
-
         // Originally, we thought that for 11a networks, the 11a rates are always
         // in the Operational Rate set & for 11b and 11g networks, the 11b rates
         // appear in the Operational Rate set.  Consequently, in either case, we
         // would blindly put the rates we support into our Operational Rate set
         // (including the basic rates, which we have already verified are
         // supported earlier in the roaming decision).
-
         // However, it turns out that this is not always the case.  Some AP's
         // (e.g. D-Link DI-784) ram 11g rates into the Operational Rate set,
         // too.  Now, we're a little more careful:
@@ -2883,7 +2807,6 @@
                 }
             }
         }
-
         if ( eCSR_CFG_DOT11_MODE_11G == cfgDot11Mode || 
              eCSR_CFG_DOT11_MODE_11N == cfgDot11Mode ||
              eCSR_CFG_DOT11_MODE_TAURUS == cfgDot11Mode ||
@@ -2906,7 +2829,6 @@
                 }
             }
         }
-
         // Enable proprietary MAC features if peer node is Airgo node and STA
         // user wants to use them
         if( pIes->Airgo.present && pMac->roam.configParam.ProprietaryRatesEnabled )
@@ -2917,7 +2839,6 @@
         {
             PropRatesEnable = 0;
         }
-
         // For ANI network companions, we need to populate the proprietary rate
         // set with any proprietary rates we found in the beacon, only if user
         // allows them...
@@ -2935,7 +2856,6 @@
             // No proprietary modes...
             ProprietaryOperationalRatesLength = 0;
         }
-
         /* Get MCS Rate */
         pDstRate = MCSRateIdxSet;
         if ( pIes->HTCaps.present )
@@ -2949,7 +2869,6 @@
               }
            }
         }
-
         // Set the operational rate set CFG variables...
         ccmCfgSetStr(pMac, WNI_CFG_OPERATIONAL_RATE_SET, OperationalRates, 
                         OperationalRatesLength, NULL, eANI_BOOLEAN_FALSE);
@@ -2968,7 +2887,6 @@
     }
 }
 
-
 static void csrSetCfgRateSetFromProfile( tpAniSirGlobal pMac,
                                          tCsrRoamProfile *pProfile  )
 {
@@ -2982,7 +2900,6 @@
                                                    SIR_MAC_RATE_36,
                                                    SIR_MAC_RATE_48,
                                                        SIR_MAC_RATE_54  } } };
-
     tSirMacRateSetIE DefaultSupportedRates11b = {  SIR_MAC_RATESET_EID, 
                                                    { 4, 
                                                      { SIR_MAC_RATE_1, 
@@ -3005,12 +2922,10 @@
     tANI_U32 ProprietaryOperationalRatesLength = 0;
     tANI_U32 PropRatesEnable = 0;
     tANI_U8 operationChannel = 0; 
-
     if(pProfile->ChannelInfo.ChannelList)
     {
        operationChannel = pProfile->ChannelInfo.ChannelList[0];
     }
-
 #ifdef WLAN_SOFTAP_FEATURE
     cfgDot11Mode = csrRoamGetPhyModeBandForBss( pMac, pProfile, operationChannel, &eBand );
 #else
@@ -3032,7 +2947,6 @@
                          
         // Nothing in the Extended rate set.
         ExtendedOperationalRatesLength = 0;
-
         // populate proprietary rates if user allows them
         if ( pMac->roam.configParam.ProprietaryRatesEnabled ) 
         {
@@ -3094,7 +3008,6 @@
             ProprietaryOperationalRatesLength = 0;         
         }    
     }  
-
     // set this to 1 if prop. rates need to be advertised in to the IBSS beacon and user wants to use them
     if ( ProprietaryOperationalRatesLength && pMac->roam.configParam.ProprietaryRatesEnabled ) 
     {
@@ -3114,12 +3027,11 @@
                     ProprietaryOperationalRates, 
                     ProprietaryOperationalRatesLength, NULL, eANI_BOOLEAN_FALSE);
     ccmCfgSetInt(pMac, WNI_CFG_PROPRIETARY_ANI_FEATURES_ENABLED, PropRatesEnable, NULL, eANI_BOOLEAN_FALSE);
-
 }
-
 void csrRoamCcmCfgSetCallback(tHalHandle hHal, tANI_S32 result)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
+
     tListElem *pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK);
     tANI_U32 sessionId;
     tSmeCmd *pCommand = NULL;
@@ -3138,7 +3050,6 @@
     }
 }
 
-
 //This function is very dump. It is here because PE still need WNI_CFG_PHY_MODE
 tANI_U32 csrRoamGetPhyModeFromDot11Mode(eCsrCfgDot11Mode dot11Mode, eCsrBand band)
 {
@@ -3151,11 +3062,30 @@
         if(eCSR_BAND_24 == band)
             return (WNI_CFG_PHY_MODE_11G);
     }
-
     return (WNI_CFG_PHY_MODE_11A);
 }
-
         
+        
+#ifdef WLAN_FEATURE_11AC
+ePhyChanBondState csrGetHTCBStateFromVHTCBState(ePhyChanBondState aniCBMode)
+{
+    switch ( aniCBMode )
+    {
+        case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW:
+        case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_CENTERED:
+        case PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH:
+            return PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
+        case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW:
+        case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_CENTERED:
+        case PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH:
+            return PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
+        case PHY_QUADRUPLE_CHANNEL_20MHZ_CENTERED_40MHZ_CENTERED:
+	    default :
+            return PHY_SINGLE_CHANNEL_CENTERED;
+    }
+}
+#endif
+
 //pIes may be NULL
 eHalStatus csrRoamSetBssConfigCfg(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
                           tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig,
@@ -3193,7 +3123,6 @@
     csrSetCfgPrivacy(pMac, pProfile, (tANI_BOOLEAN)pBssConfig->BssCap.privacy );
     //short slot time
     ccmCfgSetInt(pMac, WNI_CFG_11G_SHORT_SLOT_TIME_ENABLED, pBssConfig->uShortSlotTime, NULL, eANI_BOOLEAN_FALSE);
-
 #ifdef WLAN_SOFTAP_FEATURE
     //11d
     ccmCfgSetInt(pMac, WNI_CFG_11D_ENABLED,
@@ -3205,6 +3134,7 @@
     */
     ccmCfgSetInt(pMac, WNI_CFG_LOCAL_POWER_CONSTRAINT, pBssConfig->uPowerLimit, NULL, eANI_BOOLEAN_FALSE);
     //CB
+
     if(CSR_IS_INFRA_AP(pProfile) || CSR_IS_WDS_AP(pProfile))
     {
         channel = pProfile->operationChannel;
@@ -3224,10 +3154,22 @@
         }
         else
         {
-           //cfgCb = pBssConfig->cbMode;
-           cfgCb = pMac->roam.configParam.channelBondingMode5GHz;
+           cfgCb = pBssConfig->cbMode;
         }
     }
+#ifdef WLAN_FEATURE_11AC
+    if(cfgCb > 2 )
+    {
+	if(!WDA_getFwWlanFeatCaps(DOT11AC)) {
+            cfgCb = csrGetHTCBStateFromVHTCBState(cfgCb);
+	}
+	else 
+	{
+            ccmCfgSetInt(pMac, WNI_CFG_VHT_CHANNEL_WIDTH,  pMac->roam.configParam.nVhtChannelWidth, NULL, eANI_BOOLEAN_FALSE);
+	}
+    }
+    else
+#endif
     ccmCfgSetInt(pMac, WNI_CFG_CHANNEL_BONDING_MODE, cfgCb, NULL, eANI_BOOLEAN_FALSE);
     //Rate
     //Fixed Rate
@@ -3244,19 +3186,15 @@
     csrRoamSubstateChange( pMac, eCSR_ROAM_SUBSTATE_CONFIG, sessionId );
 
     ccmCfgSetInt(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT, pBssConfig->uJoinTimeOut, (tCcmCfgSetCallback)csrRoamCcmCfgSetCallback, eANI_BOOLEAN_FALSE);
-
     return (status);
 }
 
-
-
 eHalStatus csrRoamStopNetwork( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
                                tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes)
 {
     eHalStatus status;
     tBssConfigParam *pBssConfig;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     status = palAllocateMemory(pMac->hHdd, (void **)&pBssConfig, sizeof(tBssConfigParam)); 
     if(HAL_STATUS_SUCCESS(status))
     {
@@ -3265,6 +3203,8 @@
         if(HAL_STATUS_SUCCESS(status))
         {
             pSession->bssParams.uCfgDot11Mode = pBssConfig->uCfgDot11Mode;
+            /* This will allow to pass cbMode during join req */
+            pSession->bssParams.cbMode= pBssConfig->cbMode;
             //For IBSS, we need to prepare some more information
             if( csrIsBssTypeIBSS(pProfile->BSSType) || CSR_IS_WDS( pProfile )
 #ifdef WLAN_SOFTAP_FEATURE
@@ -3272,7 +3212,7 @@
 #endif
             )
             {
-                csrRoamPrepareBssParams(pMac, sessionId, pProfile, pBssDesc, pIes);
+                csrRoamPrepareBssParams(pMac, sessionId, pProfile, pBssDesc, pBssConfig, pIes);
             }
             // If we are in an IBSS, then stop the IBSS...
             ////Not worry about WDS connection for now
@@ -3327,7 +3267,6 @@
     return (status);
 }
 
-
 eCsrJoinState csrRoamJoin( tpAniSirGlobal pMac, tANI_U32 sessionId, 
                            tCsrScanResultInfo *pScanResult, tCsrRoamProfile *pProfile )
 {
@@ -3336,7 +3275,6 @@
     tSirBssDescription *pBssDesc = &pScanResult->BssDescriptor;
     tDot11fBeaconIEs *pIesLocal = (tDot11fBeaconIEs *)( pScanResult->pvIes ); //This may be NULL
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if( CSR_IS_WDS_STA( pProfile ) )
     {
         status = csrRoamStartWds( pMac, sessionId, pProfile, pBssDesc );
@@ -3377,13 +3315,13 @@
                 else
                 {
                     tBssConfigParam bssConfig;
-
                     //The key changes
                     palZeroMemory(pMac->hHdd, &bssConfig, sizeof(bssConfig));
                     status = csrRoamPrepareBssConfig(pMac, pProfile, pBssDesc, &bssConfig, pIesLocal);
                     if(HAL_STATUS_SUCCESS(status))
                     {
                         pSession->bssParams.uCfgDot11Mode = bssConfig.uCfgDot11Mode;
+                        pSession->bssParams.cbMode = bssConfig.cbMode;
                         //Reapply the config including Keys so reassoc is happening.
                         status = csrRoamSetBssConfigCfg(pMac, sessionId, pProfile, pBssDesc, &bssConfig, pIesLocal);
                         if(!HAL_STATUS_SUCCESS(status))
@@ -3433,23 +3371,19 @@
             palFreeMemory(pMac->hHdd, pIesLocal);
         }
     }
-
     return( eRoamState );
 }
 
-
 eHalStatus csrRoamShouldRoam(tpAniSirGlobal pMac, tANI_U32 sessionId, 
                              tSirBssDescription *pBssDesc, tANI_U32 roamId)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tCsrRoamInfo roamInfo;
-
     palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
     roamInfo.pBssDesc = pBssDesc;
     status = csrRoamCallCallback(pMac, sessionId, &roamInfo, roamId, eCSR_ROAM_SHOULD_ROAM, eCSR_ROAM_RESULT_NONE);
     return (status);
 }
-
 //In case no matching BSS is found, use whatever default we can find
 static void csrRoamAssignDefaultParam( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
@@ -3495,7 +3429,7 @@
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     tCsrRoamProfile *pProfile = &pCommand->u.roamCmd.roamProfile;
     tANI_U8  concurrentChannel = 0;
-    
+
     do  
     {
         // Check for Cardbus eject condition, before trying to Roam to any BSS
@@ -3535,16 +3469,15 @@
                 while(pCommand->u.roamCmd.pRoamBssEntry)
                 {
                     pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link);
-
                     /*If concurrency enabled take the concurrent connected channel first. */
                     /* Valid multichannel concurrent sessions exempted */
-                    if (vos_concurrent_sessions_running() && !csrIsValidMcConcurrentSession(pMac, sessionId))
+                    if (vos_concurrent_sessions_running() && 
+                        !csrIsValidMcConcurrentSession(pMac, sessionId, &pScanResult->Result.BssDescriptor))
                     {
                         concurrentChannel = 
                             csrGetConcurrentOperationChannel(pMac);
                         VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, "%s: "
                                 " csr Concurrent Channel = %d", __FUNCTION__, concurrentChannel);
-
                         if ((concurrentChannel) && 
                                 (concurrentChannel == 
                                  pScanResult->Result.BssDescriptor.channelId))
@@ -3556,14 +3489,8 @@
                                     FL("Concurrent channel match =%d"),
                                     concurrentChannel);
                             concurrentChannel = 0; 
-
                         }
                     }
-                    if ((vos_concurrent_sessions_running()) && 
-                         csrIsAnySessionInConnectState( pMac ))
-                    {
-                        pMac->roam.configParam.concurrencyEnabled = 1;
-                    }
 
                     if (!concurrentChannel)
                     {
@@ -3576,6 +3503,10 @@
                             break;
                         }
                      }
+                     else
+                     {
+                         eRoamState = eCsrStopRoamingDueToConcurrency;
+                     }
                     pCommand->u.roamCmd.pRoamBssEntry = csrLLNext(&pBSSList->List, pCommand->u.roamCmd.pRoamBssEntry, LL_ACCESS_LOCK);
                     if(NULL == pCommand->u.roamCmd.pRoamBssEntry)
                     {
@@ -3607,7 +3538,6 @@
             if(pScanResult)
             {
                 tDot11fBeaconIEs *pIesLocal = (tDot11fBeaconIEs *)pScanResult->Result.pvIes;
-
                 if( !pIesLocal && (!HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, &pScanResult->Result.BssDescriptor, &pIesLocal))) )
                 {
                     smsLog(pMac, LOGE, FL(" cannot parse IEs\n"));
@@ -3623,12 +3553,10 @@
                     CSR_IS_UAPSD_BSS(pIesLocal) )
                 {
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
-
                     acm_mask = sme_QosGetACMMask(pMac, &pScanResult->Result.BssDescriptor, 
                          pIesLocal);
                     pCommand->u.roamCmd.roamProfile.uapsd_mask &= ~(acm_mask);
 #endif /* WLAN_MDM_CODE_REDUCTION_OPT*/
-
                 }
                 else
                 {
@@ -3648,14 +3576,12 @@
             csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, 
                                  eCSR_ROAM_ASSOCIATION_START, eCSR_ROAM_RESULT_NONE );
         }
-
         if ( NULL == pCommand->u.roamCmd.pRoamBssEntry ) 
         {
             // If this is a start IBSS profile, then we need to start the IBSS.
             if ( CSR_IS_START_IBSS(pProfile) ) 
             {
                 tANI_BOOLEAN fSameIbss = eANI_BOOLEAN_FALSE;
-
                 // Attempt to start this IBSS...
                 csrRoamAssignDefaultParam( pMac, pCommand );
                 status = csrRoamStartIbss( pMac, sessionId, pProfile, &fSameIbss );
@@ -3733,7 +3659,6 @@
         }
         
     } while( 0 );
-
     if( (eCsrStopRoaming == eRoamState) && (CSR_IS_INFRASTRUCTURE( pProfile )) )
     {
         //Need to indicate association_completion if association_start has been done
@@ -3750,24 +3675,21 @@
     return( eRoamState );
 }
 
-
 static eHalStatus csrRoam( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     eCsrJoinState RoamState;
     tANI_U32 sessionId = pCommand->sessionId;
     
-    smsLog(pMac, LOG2, FL("is called\n"));
     //***if( hddIsRadioStateOn( pAdapter ) )
     {
         // Attept to join a Bss...
         RoamState = csrRoamJoinNextBss( pMac, pCommand, eANI_BOOLEAN_FALSE );
-    
+
         // if nothing to join..
-        if ( eCsrStopRoaming == RoamState ) 
+        if (( eCsrStopRoaming == RoamState ) || ( eCsrStopRoamingDueToConcurrency == RoamState))
         {
             tANI_BOOLEAN fComplete = eANI_BOOLEAN_FALSE;
-
             // and if connected in Infrastructure mode...
             if ( csrIsConnStateInfra(pMac, sessionId) ) 
             {
@@ -3809,7 +3731,14 @@
             if(fComplete)
             {
                // ... otherwise, we can complete the Roam command here.
-               csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
+               if(eCsrStopRoamingDueToConcurrency == RoamState)
+               {
+                   csrRoamComplete( pMac, eCsrJoinFailureDueToConcurrency, NULL );
+               }
+               else
+               {
+                   csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
+               }
             }    
        }
        else if ( eCsrReassocToSelfNoCapChange == RoamState )
@@ -3824,7 +3753,6 @@
     
     return status;
 }
-
 eHalStatus csrProcessFTReassocRoamCommand ( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     tANI_U32 sessionId;
@@ -3832,10 +3760,8 @@
     tCsrScanResult *pScanResult = NULL;
     tSirBssDescription *pBssDesc = NULL;
     eHalStatus status = eHAL_STATUS_SUCCESS;
-
     sessionId = pCommand->sessionId;
     pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if(CSR_IS_ROAMING(pSession) && pSession->fCancelRoaming)
     {
         //the roaming is cancelled. Simply complete the command
@@ -3843,7 +3769,6 @@
         csrRoamComplete(pMac, eCsrNothingToJoin, NULL); 
         return eHAL_STATUS_FAILURE;
     }
-
     if (pCommand->u.roamCmd.pRoamBssEntry)
     {
         pScanResult = GET_BASE_ADDR(pCommand->u.roamCmd.pRoamBssEntry, tCsrScanResult, Link);
@@ -3856,13 +3781,11 @@
         csrRoamComplete(pMac, eCsrNothingToJoin, NULL); 
         return eHAL_STATUS_FAILURE;
     }
-
     status = csrRoamIssueReassociate(pMac, sessionId, pBssDesc, 
         (tDot11fBeaconIEs *)( pScanResult->Result.pvIes ), &pCommand->u.roamCmd.roamProfile);
     return status;
 }
 
-
 eHalStatus csrRoamProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -3876,7 +3799,6 @@
         csrFreeRoamProfile(pMac, sessionId);
         status = csrRoamProcessDisassocDeauth( pMac, pCommand, TRUE, FALSE );
         break;
-
      case eCsrSmeIssuedDisassocForHandoff:
         //Not to free pMac->roam.pCurRoamProfile (via csrFreeRoamProfile) because it is needed after disconnect
 #if 0 // TODO : Confirm this change
@@ -3886,23 +3808,19 @@
 #endif
 
         break;
-
     case eCsrForcedDisassocMICFailure:
         csrFreeRoamProfile(pMac, sessionId);
         status = csrRoamProcessDisassocDeauth( pMac, pCommand, TRUE, TRUE );
         break;
-
     case eCsrForcedDeauth:
         csrFreeRoamProfile(pMac, sessionId);
         status = csrRoamProcessDisassocDeauth( pMac, pCommand, FALSE, FALSE );
         break;
-
     case eCsrHddIssuedReassocToSameAP:
     case eCsrSmeIssuedReassocToSameAP:
     {
         tDot11fBeaconIEs *pIes = NULL;
 
-
         if( pSession->pConnectBssDesc )
         {
             status = csrGetParsedBssDescriptionIEs(pMac, pSession->pConnectBssDesc, &pIes);
@@ -3915,7 +3833,6 @@
                 roamInfo.reasonCode = eCsrRoamReasonStaCapabilityChanged;
                 csrRoamCallCallback(pMac, pSession->sessionId, &roamInfo, 0, eCSR_ROAM_ROAMING_START, eCSR_ROAM_RESULT_NONE);
                 pSession->roamingReason = eCsrReassocRoaming;
-
                 roamInfo.pBssDesc = pSession->pConnectBssDesc;
                 roamInfo.pProfile = &pCommand->u.roamCmd.roamProfile;
                 pSession->bRefAssocStartCnt++;
@@ -3931,17 +3848,16 @@
         }
         break;
     }
-
     case eCsrCapsChange:
         smsLog(pMac, LOGE, FL("received eCsrCapsChange \n"));
         csrRoamStateChange( pMac, eCSR_ROAMING_STATE_JOINING, sessionId );
         status = csrRoamIssueDisassociate( pMac, sessionId, eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING, FALSE); 
         break;
-
     case eCsrSmeIssuedFTReassoc:
         smsLog(pMac, LOGE, FL("received FT Reassoc Req \n"));
         status = csrProcessFTReassocRoamCommand(pMac, pCommand);
         break;
+
     case eCsrStopBss:
        csrRoamStateChange( pMac, eCSR_ROAMING_STATE_JOINING, sessionId);
        status = csrRoamIssueStopBss( pMac, sessionId, eCSR_ROAM_SUBSTATE_STOP_BSS_REQ );
@@ -3982,11 +3898,9 @@
         status = csrRoam( pMac, pCommand );
         break;
     }
-
     return (status);
 }
 
-
 void csrReinitRoamCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand) 
 {
     if(pCommand->u.roamCmd.fReleaseBssList)
@@ -4005,25 +3919,20 @@
     palZeroMemory(pMac->hHdd, &pCommand->u.roamCmd, sizeof(tRoamCmd));
 }
 
-
 void csrReinitWmStatusChangeCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
     palZeroMemory(pMac->hHdd, &pCommand->u.wmStatusChangeCmd, sizeof(tWmStatusChangeCmd));
 }
-
 void csrRoamComplete( tpAniSirGlobal pMac, eCsrRoamCompleteResult Result, void *Context )
 {
     tListElem *pEntry;
     tSmeCmd *pCommand;
     tANI_BOOLEAN fReleaseCommand = eANI_BOOLEAN_TRUE;
-
     smsLog( pMac, LOG2, "roamQ: Roam Completion ...\n" );
-
     pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
     if ( pEntry )
     {
         pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
-
         // If the head of the queue is Active and it is a ROAM command, remove
         // and put this on the Free queue.
         if ( eSmeCommandRoam == pCommand->command )
@@ -4058,22 +3967,18 @@
     {
         smsLog( pMac, LOGW, "CSR: Roam Completion called but NO commands are ACTIVE ...\n" );
     }
-
     if( fReleaseCommand )
     {
         smeProcessPendingQueue( pMac );
     }
 }
 
-
 void csrResetPMKIDCandidateList( tpAniSirGlobal pMac, tANI_U32 sessionId )
 {
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     palZeroMemory( pMac->hHdd, &(pSession->PmkidCandidateInfo[0]), sizeof(tPmkidCandidateInfo) * CSR_MAX_PMKID_ALLOWED );
     pSession->NumPmkidCandidate = 0;
 }
-
 #ifdef FEATURE_WLAN_WAPI
 void csrResetBKIDCandidateList( tpAniSirGlobal pMac, tANI_U32 sessionId )
 {
@@ -4082,11 +3987,8 @@
     pSession->NumBkidCandidate = 0;
 }
 #endif /* FEATURE_WLAN_WAPI */
-
 extern tANI_U8 csrWpaOui[][ CSR_WPA_OUI_SIZE ];
 
-
-
 static eHalStatus csrRoamSaveSecurityRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrAuthType authType, 
                                          tSirBssDescription *pSirBssDesc,
                                          tDot11fBeaconIEs *pIes)
@@ -4094,7 +3996,6 @@
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     tDot11fBeaconIEs *pIesLocal = pIes;
-
     if((eCSR_AUTH_TYPE_WPA == authType) ||
         (eCSR_AUTH_TYPE_WPA_PSK == authType) ||
         (eCSR_AUTH_TYPE_RSN == authType) ||
@@ -4111,7 +4012,6 @@
 #endif /* FEATURE_WLAN_WAPI */
         )
     {
-
         if( !pIesLocal && (!HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, pSirBssDesc, &pIesLocal))) )
         {
             smsLog(pMac, LOGE, FL(" cannot parse IEs\n"));
@@ -4120,7 +4020,6 @@
         {
             tANI_U32 nIeLen;
             tANI_U8 *pIeBuf;
-
             if((eCSR_AUTH_TYPE_RSN == authType) ||
 #if defined WLAN_FEATURE_VOWIFI_11R
                 (eCSR_AUTH_TYPE_FT_RSN == authType) ||
@@ -4241,7 +4140,6 @@
     }
                       palCopyMemory(pMac->hHdd, pIeBuf, &pIesLocal->WAPI.unicast_cipher_suite_count, 2);
                       pIeBuf += 2;
-
                       if( pIesLocal->WAPI.unicast_cipher_suite_count )
                       {
                          //copy pwise_cipher_suites
@@ -4260,7 +4158,6 @@
                       }
                       pSession->nWapiRspIeLength = nIeLen + 2; 
                    }
-
                 }
           }
 #endif /* FEATURE_WLAN_WAPI */
@@ -4271,18 +4168,14 @@
         }
     }
     }
-
     return (status);
 }
 
-
-
 static void csrCheckAndUpdateACWeight( tpAniSirGlobal pMac, tDot11fBeaconIEs *pIEs )
 {
     v_U8_t bACWeights[WLANTL_MAX_AC];
     v_U8_t paramBk, paramBe, paramVi, paramVo;
     v_BOOL_t fWeightChange = VOS_FALSE;
-
     //Compare two ACs' EDCA parameters, from low to high (BK, BE, VI, VO)
     //The "formula" is, if lower AC's AIFSN+CWMin is bigger than a fixed amount
     //of the higher AC one, make the higher AC has the same weight as the lower AC.
@@ -4336,7 +4229,6 @@
         }
     }
 }
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
 //Returns whether the current association is a 11r assoc or not
 tANI_BOOLEAN csrRoamIs11rAssoc(tpAniSirGlobal pMac)
@@ -4348,7 +4240,6 @@
 #endif
 }
 #endif
-
 #ifdef FEATURE_WLAN_CCX
 //Returns whether the current association is a CCX assoc or not
 tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac)
@@ -4360,7 +4251,6 @@
 #endif
 }
 #endif
-
 #ifdef FEATURE_WLAN_LFR
 //Returns whether "Legacy Fast Roaming" is currently enabled...or not
 tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac)
@@ -4393,9 +4283,7 @@
     tSirSmeStartBssRsp  *pSmeStartBssRsp = NULL;
 #endif
 
-
     smsLog( pMac, LOG1, FL("Processing ROAM results...\n"));
-
     switch( Result )
     {
         case eCsrJoinSuccess:
@@ -4423,7 +4311,6 @@
                 palFreeMemory(pMac->hHdd, pSession->pWpaRsnRspIE);
                 pSession->pWpaRsnRspIE = NULL;
             }
-
 #ifdef FEATURE_WLAN_WAPI
             if(pSession->pWapiRspIE)
             {
@@ -4449,7 +4336,6 @@
             {
                 pSession->connectState = eCSR_ASSOC_STATE_TYPE_WDS_CONNECTED;
             }
-
             //Use the last connected bssdesc for reassoc-ing to the same AP.
             //NOTE: What to do when reassoc to a different AP???
             if( (eCsrHddIssuedReassocToSameAP == pCommand->u.roamCmd.roamReason) ||
@@ -4478,9 +4364,7 @@
             }
             if( pSirBssDesc )
             {
-
                 roamInfo.staId = HAL_STA_INVALID_IDX;
-
                 csrRoamSaveConnectedInfomation(pMac, sessionId, pProfile, pSirBssDesc, pIes);
                     //Save WPA/RSN IE
                 csrRoamSaveSecurityRspIE(pMac, sessionId, pProfile->negotiatedAuthType, pSirBssDesc, pIes);
@@ -4493,7 +4377,6 @@
                 // Moving even save profile above so that below mentioned conditon is also met.
                 // JEZ100225: Moved to after saving the profile. Fix needed in main/latest
                 csrRoamStateChange( pMac, eCSR_ROAMING_STATE_JOINED, sessionId );
-
                 // Make sure the Set Context is issued before link indication to NDIS.  After link indication is 
                 // made to NDIS, frames could start flowing.  If we have not set context with LIM, the frames
                 // will be dropped for the security context may not be set properly. 
@@ -4525,11 +4408,9 @@
                 {
                     //Need to wait for supplicant authtication
                     roamInfo.fAuthRequired = eANI_BOOLEAN_TRUE;
-
                     //Set the subestate to WaitForKey in case authentiation is needed
                     csrRoamSubstateChange( pMac, eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY, sessionId );
 
-
                     if(pProfile->bWPSAssociation)
                     {
                         key_timeout_interval = CSR_WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD;
@@ -4552,12 +4433,10 @@
                 
                 assocInfo.pBssDesc = pSirBssDesc; //could be NULL
                 assocInfo.pProfile = pProfile;
-
                 if(Context)
                 {
                     tSirSmeJoinRsp *pJoinRsp = (tSirSmeJoinRsp *)Context;
                     tANI_U32 len;
-
                     csrRoamFreeConnectedInfo( pMac, &pSession->connectedInfo );
                     len = pJoinRsp->assocReqLength + pJoinRsp->assocRspLength + pJoinRsp->beaconLength;
 #ifdef WLAN_FEATURE_VOWIFI_11R
@@ -4622,8 +4501,6 @@
                 // copying the frames 
                 sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, ind_qos, &assocInfo);
 #endif
-
-
                 roamInfo.pBssDesc = pSirBssDesc;
                 roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
                 roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
@@ -4631,7 +4508,6 @@
                 acm_mask = sme_QosGetACMMask(pMac, pSirBssDesc, NULL);
 #endif /* WLAN_MDM_CODE_REDUCTION_OPT*/
                 pSession->connectedProfile.acm_mask = acm_mask;
-
 #ifdef FEATURE_WLAN_UAPSD_FW_TRG_FRAMES
                 //start UAPSD if uapsd_mask is not 0 because HDD will configure for trigger frame
                 //It may be better to let QoS do this????
@@ -4642,16 +4518,20 @@
                     pmcStartUapsd( pMac, NULL, NULL );
                 }
 #endif
-
                 roamInfo.u.pConnectedProfile = &pSession->connectedProfile;
                 if( pSession->bRefAssocStartCnt > 0 )
                 {
                     pSession->bRefAssocStartCnt--;
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+                    if(  csrIsConcurrentSessionRunning( pMac ) )
+                    {
+                       pMac->roam.configParam.doBMPSWorkaround = 1;
+                    }
+#endif
                     csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, eCSR_ROAM_ASSOCIATION_COMPLETION, eCSR_ROAM_RESULT_ASSOCIATED);
                 }
                 
                 csrRoamCompletion(pMac, sessionId, NULL, pCommand, eCSR_ROAM_RESULT_NONE, eANI_BOOLEAN_TRUE);
-
                 // reset the PMKID candidate list
                 csrResetPMKIDCandidateList( pMac, sessionId );
                 //Update TL's AC weight base on the current EDCA parameters
@@ -4672,7 +4552,6 @@
             {
                 smsLog(pMac, LOGW, "  Roam command doesn't have a BSS desc\n");
             }
-
             csrScanCancelIdleScan(pMac);
             //Not to signal link up because keys are yet to be set.
             //The linkup function will overwrite the sub-state that we need to keep at this point.
@@ -4680,7 +4559,6 @@
             {
                 csrRoamLinkUp(pMac, pSession->connectedProfile.bssid);
             }
-
             //Check if BMPS is required and start the BMPS retry timer.  Timer period is large
             //enough to let security and DHCP handshake succeed before entry into BMPS
             if (pmcShouldBmpsTimerRun(pMac))
@@ -4692,10 +4570,8 @@
                 }
                 smsLog(pMac, LOG2, FL("BMPS Retry Timer already running or started"));
             }
-
             break;
 
-
         case eCsrStartBssSuccess:
             // on the StartBss Response, LIM is returning the Bss Description that we
             // are beaconing.  Add this Bss Description to our scan results and
@@ -4756,7 +4632,6 @@
                 }
                 //We are doen with the IEs so free it
                 palFreeMemory(pMac->hHdd, pIes);
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
                 {
                     vos_log_ibss_pkt_type *pIbssLog;
@@ -4790,7 +4665,6 @@
 #endif //#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
                 //Only set context for non-WDS_STA. We don't even need it for WDS_AP. But since the encryption
                 //is WPA2-PSK so it won't matter.
-
 #ifdef WLAN_SOFTAP_FEATURE
                 if( CSR_IS_ENC_TYPE_STATIC( pProfile->negotiatedUCEncryptionType ) && !CSR_IS_INFRA_AP( pSession->pCurRoamProfile ))
                 {
@@ -4860,6 +4734,12 @@
 #ifdef WLAN_SOFTAP_FEATURE
                 roamInfo.staId = (tANI_U8)pSmeStartBssRsp->staId;
 #endif
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+                if(  csrIsConcurrentSessionRunning( pMac ) )
+                {
+                   pMac->roam.configParam.doBMPSWorkaround = 1;
+                }
+#endif
                 csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, roamStatus, roamResult );
             }
     
@@ -4883,14 +4763,11 @@
                 csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, 
                                         eCSR_ROAM_WDS_IND, eCSR_ROAM_RESULT_WDS_STOPPED );
             }
-
             break;
-
         case eCsrStartBssFailure:
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
             {
                 vos_log_ibss_pkt_type *pIbssLog;
-
                 WLAN_VOS_DIAG_LOG_ALLOC(pIbssLog, vos_log_ibss_pkt_type, LOG_WLAN_IBSS_C);
                 if(pIbssLog)
                 {
@@ -4899,7 +4776,6 @@
                 }
             }
 #endif //#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
-
             roamStatus = eCSR_ROAM_IBSS_IND;
             roamResult = eCSR_ROAM_RESULT_IBSS_STARTED;
             if( CSR_IS_WDS( pProfile ) )
@@ -4928,7 +4804,6 @@
             csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, roamStatus, roamResult );
             csrSetDefaultDot11Mode( pMac );
             break;
-
         case eCsrSilentlyStopRoaming:
             // We are here because we try to start the same IBSS
             //No message to PE
@@ -4946,9 +4821,7 @@
             //HDD may be mistakenly mark to disconnected state.
             csrRoamCallCallback( pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, 
                                         eCSR_ROAM_IBSS_IND, eCSR_ROAM_RESULT_NONE );
-
             break;
-
         case eCsrSilentlyStopRoamingSaveState:
             //We are here because we try to connect to the same AP
             //No message to PE
@@ -4963,7 +4836,6 @@
             {
                 palCopyMemory(pMac->hHdd, &roamInfo.bssid, &roamInfo.pBssDesc->bssId, sizeof(tCsrBssid));
             }
-
             roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
             roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
             roamInfo.nBeaconLength = pSession->connectedInfo.nBeaconLength;
@@ -4980,7 +4852,6 @@
                                         eCSR_ROAM_ASSOCIATION_COMPLETION, eCSR_ROAM_RESULT_ASSOCIATED);
             csrRoamCompletion(pMac, sessionId, NULL, pCommand, eCSR_ROAM_RESULT_ASSOCIATED, eANI_BOOLEAN_TRUE);
             break;
-
         case eCsrReassocFailure:
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
             sme_QosCsrEventInd(pMac, (tANI_U8)sessionId, SME_QOS_CSR_REASSOC_FAILURE, NULL);
@@ -4999,9 +4870,9 @@
                                     eCSR_ROAM_RESULT_WDS_NOT_ASSOCIATED);
             //Need to issue stop_bss
             break;
-
         case eCsrJoinFailure:
         case eCsrNothingToJoin:
+        case eCsrJoinFailureDueToConcurrency:
         default:
         {
             smsLog(pMac, LOGW, FL("receives no association indication\n"));
@@ -5020,6 +4891,7 @@
                 // If this transition is because of an 802.11 OID, then we transition
                 // back to INIT state so we sit waiting for more OIDs to be issued and
                 // we don't start the IDLE timer.
+                case eCsrSmeIssuedFTReassoc:
                 case eCsrSmeIssuedAssocToSimilarAP:
                 case eCsrHddIssued:
                     csrRoamStateChange( pMac, eCSR_ROAMING_STATE_IDLE, sessionId );
@@ -5027,27 +4899,31 @@
                     roamInfo.pBssDesc = pCommand->u.roamCmd.pLastRoamBss;
                     roamInfo.statusCode = pSession->joinFailStatusCode.statusCode;
                     roamInfo.reasonCode = pSession->joinFailStatusCode.reasonCode;
-
                     /* Defeaturize this later if needed */
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
                     /* If Join fails while Handoff is in progress, indicate disassociated event to supplicant to reconnect */
                     if (csrRoamIsHandoffInProgress(pMac))
                     {
-                        csrRoamCallCallback(pMac, sessionId, NULL, pCommand->u.roamCmd.roamId, eCSR_ROAM_DISASSOCIATED, eCSR_ROAM_RESULT_FORCED);
                         /* Should indicate neighbor roam algorithm about the connect failure here */
                         csrNeighborRoamIndicateConnect(pMac, (tANI_U8)sessionId, VOS_STATUS_E_FAILURE);
                     }
-                    else
 #endif
-                    {
                         if(pSession->bRefAssocStartCnt > 0)
                         {
                             pSession->bRefAssocStartCnt--;
-                            csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, 
+                            if(eCsrJoinFailureDueToConcurrency == Result)
+                            {
+                                csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, 
+                                                eCSR_ROAM_ASSOCIATION_COMPLETION, 
+                                                eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL);
+                            }
+                            else
+                            {
+                                csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.roamCmd.roamId, 
                                                 eCSR_ROAM_ASSOCIATION_COMPLETION, 
                                                 eCSR_ROAM_RESULT_FAILURE);
+                            }
                         }
-                    }
                     smsLog(pMac, LOG1, FL("  roam(reason %d) failed\n"), pCommand->u.roamCmd.roamReason);
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
                     sme_QosCsrEventInd(pMac, (tANI_U8)sessionId, SME_QOS_CSR_DISCONNECT_IND, NULL);
@@ -5063,7 +4939,6 @@
                     }
 #endif
                     break;
-
                 case eCsrHddIssuedReassocToSameAP:
                 case eCsrSmeIssuedReassocToSameAP:
                     csrRoamStateChange( pMac, eCSR_ROAMING_STATE_IDLE, sessionId);
@@ -5158,23 +5033,18 @@
                     csrScanHandleFailedLostlink3(pMac, sessionId);
                     break;
             }
-
             break;
         }
     }
-
     return ( fReleaseCommand );
 }
 
-
 eHalStatus csrRoamRegisterCallback(tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
-
     return (status);
 }
 
-
 eHalStatus csrRoamCopyProfile(tpAniSirGlobal pMac, tCsrRoamProfile *pDstProfile, tCsrRoamProfile *pSrcProfile)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -5237,7 +5107,6 @@
             palCopyMemory(pMac->hHdd, pDstProfile->pWAPIReqIE, pSrcProfile->pWAPIReqIE, pSrcProfile->nWAPIReqIELength);
         }
 #endif /* FEATURE_WLAN_WAPI */
-
         if(pSrcProfile->nAddIEScanLength)
         {
             status = palAllocateMemory(pMac->hHdd,
@@ -5250,7 +5119,6 @@
             palCopyMemory(pMac->hHdd, pDstProfile->pAddIEScan, pSrcProfile->pAddIEScan,
                 pSrcProfile->nAddIEScanLength);
         }
-
         if(pSrcProfile->nAddIEAssocLength)
         {
             status = palAllocateMemory(pMac->hHdd,
@@ -5263,7 +5131,6 @@
             palCopyMemory(pMac->hHdd, pDstProfile->pAddIEAssoc, pSrcProfile->pAddIEAssoc,
                 pSrcProfile->nAddIEAssocLength);
         }
-
         if(pSrcProfile->ChannelInfo.ChannelList)
         {
             status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->ChannelInfo.ChannelList, pSrcProfile->ChannelInfo.numOfChannels);
@@ -5274,7 +5141,6 @@
             pDstProfile->ChannelInfo.numOfChannels = pSrcProfile->ChannelInfo.numOfChannels;
             palCopyMemory(pMac->hHdd, pDstProfile->ChannelInfo.ChannelList, pSrcProfile->ChannelInfo.ChannelList, pSrcProfile->ChannelInfo.numOfChannels);
         }
-
         pDstProfile->AuthType = pSrcProfile->AuthType;
         pDstProfile->EncryptionType = pSrcProfile->EncryptionType;
         pDstProfile->mcEncryptionType = pSrcProfile->mcEncryptionType;
@@ -5298,7 +5164,6 @@
         /*Save the WPS info*/
         pDstProfile->bWPSAssociation = pSrcProfile->bWPSAssociation;
         pDstProfile->uapsd_mask = pSrcProfile->uapsd_mask;
-
         pDstProfile->beaconInterval = pSrcProfile->beaconInterval;
 #ifdef WLAN_SOFTAP_FEATURE
         pDstProfile->privacy           = pSrcProfile->privacy;
@@ -5313,9 +5178,7 @@
         pDstProfile->wps_state         = pSrcProfile->wps_state;
         pDstProfile->ieee80211d        = pSrcProfile->ieee80211d;
 #endif
-
         palCopyMemory(pMac->hHdd, &pDstProfile->Keys, &pSrcProfile->Keys, sizeof(pDstProfile->Keys));
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
         if (pSrcProfile->MDID.mdiePresent)
         {
@@ -5323,7 +5186,6 @@
             pDstProfile->MDID.mobilityDomain = pSrcProfile->MDID.mobilityDomain;
         }
 #endif
-
     }while(0);
     
     if(!HAL_STATUS_SUCCESS(status))
@@ -5334,7 +5196,6 @@
     
     return (status);
 }
-
 eHalStatus csrRoamCopyConnectedProfile(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pDstProfile )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -5364,7 +5225,6 @@
             pDstProfile->SSIDs.SSIDList[0].ssidHidden = pSrcProfile->ssidHidden;
             palCopyMemory(pMac->hHdd, &pDstProfile->SSIDs.SSIDList[0].SSID, &pSrcProfile->SSID, sizeof(tSirMacSSid));
         }
-
         status = palAllocateMemory(pMac->hHdd, (void **)&pDstProfile->ChannelInfo.ChannelList, 1);
         if(!HAL_STATUS_SUCCESS(status))
         {
@@ -5372,7 +5232,6 @@
         }
         pDstProfile->ChannelInfo.numOfChannels = 1;
         pDstProfile->ChannelInfo.ChannelList[0] = pSrcProfile->operationChannel;
-
         pDstProfile->AuthType.numEntries = 1;
         pDstProfile->AuthType.authType[0] = pSrcProfile->AuthType;
         pDstProfile->negotiatedAuthType = pSrcProfile->AuthType;
@@ -5404,7 +5263,6 @@
     return (status);
 }
 
-
 eHalStatus csrRoamIssueConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
                                 tScanResultHandle hBSSList, 
                                 eCsrRoamReason reason, tANI_U32 roamId, tANI_BOOLEAN fImediate,
@@ -5455,11 +5313,9 @@
         //We need to free the BssList when the command is done
         pCommand->u.roamCmd.fReleaseBssList = eANI_BOOLEAN_TRUE;
         pCommand->u.roamCmd.fUpdateCurRoamProfile = eANI_BOOLEAN_TRUE;
-
         VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
                   FL("CSR PERSONA=%d"),
                   pCommand->u.roamCmd.roamProfile.csrPersona);
-
         status = csrQueueSmeCommand(pMac, pCommand, fImediate);
         if( !HAL_STATUS_SUCCESS( status ) )
         {
@@ -5470,7 +5326,6 @@
     
     return (status);
 }
-
 eHalStatus csrRoamIssueReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
                                tCsrRoamModifyProfileFields *pMmodProfileFields,
                                eCsrRoamReason reason, tANI_U32 roamId, tANI_BOOLEAN fImediate)
@@ -5490,22 +5345,18 @@
         csrScanAbortMacScanNotForConnect(pMac);
         if(pProfile)
         {
-
            //This is likely trying to reassoc to different profile
            pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_FALSE;
            //make a copy of the profile
            status = csrRoamCopyProfile(pMac, &pCommand->u.roamCmd.roamProfile, pProfile);
            pCommand->u.roamCmd.fUpdateCurRoamProfile = eANI_BOOLEAN_TRUE;
-
         }
         else
         {
             status = csrRoamCopyConnectedProfile(pMac, sessionId, &pCommand->u.roamCmd.roamProfile);
             //how to update WPA/WPA2 info in roamProfile??
             pCommand->u.roamCmd.roamProfile.uapsd_mask = pMmodProfileFields->uapsd_mask;
-
         }
-
         if(HAL_STATUS_SUCCESS(status))
         {
            pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_TRUE;
@@ -5519,7 +5370,6 @@
         pCommand->u.roamCmd.hBSSList = CSR_INVALID_SCANRESULT_HANDLE; 
         pCommand->u.roamCmd.fReleaseBssList = eANI_BOOLEAN_FALSE;
         pCommand->u.roamCmd.fReassoc = eANI_BOOLEAN_TRUE;
-
         status = csrQueueSmeCommand(pMac, pCommand, fImediate);
         if( !HAL_STATUS_SUCCESS( status ) )
     {
@@ -5528,18 +5378,15 @@
             csrReleaseCommandRoam( pMac, pCommand );
     }
     }
-
     return (status);
 }
 
-
 eHalStatus csrRoamConnectWithBSSList(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
                                      tScanResultHandle hBssListIn, tANI_U32 *pRoamId)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
     tScanResultHandle hBSSList;
     tANI_U32 roamId = 0;
-
     status = csrScanCopyResultList(pMac, hBssListIn, &hBSSList);
     if(HAL_STATUS_SUCCESS(status))
     {
@@ -5556,11 +5403,9 @@
             csrScanResultPurge(pMac, hBSSList);
         }
     }
-
     return (status);
 }
 
-
 eHalStatus csrRoamConnect(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
                           tScanResultHandle hBssListIn, tANI_U32 *pRoamId)
 {
@@ -5570,16 +5415,13 @@
     tANI_U32 roamId = 0;
     tANI_BOOLEAN fCallCallback = eANI_BOOLEAN_FALSE;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if (NULL == pProfile)
     {
         smsLog(pMac, LOGP, FL("No profile specified"));
         return eHAL_STATUS_FAILURE;
     }
-
     smsLog(pMac, LOG1, FL("called  BSSType = %d authtype = %d  encryType = %d\n"),
                 pProfile->BSSType, pProfile->AuthType.authType[0], pProfile->EncryptionType.encryptionType[0]);
-
     if( CSR_IS_WDS( pProfile ) && 
         !HAL_STATUS_SUCCESS( status = csrIsBTAMPAllowed( pMac, pProfile->operationChannel ) ) )
     {
@@ -5590,14 +5432,12 @@
     csrScanCancelIdleScan(pMac);
     //Only abort the scan if it is not used for other roam/connect purpose
     csrScanAbortMacScan(pMac);
-
 #ifdef WLAN_SOFTAP_FEATURE
     if (!vos_concurrent_sessions_running() && (VOS_STA_SAP_MODE == pProfile->csrPersona))//In case of AP mode we do not want idle mode scan
     {
         csrScanDisable(pMac);
     }
 #endif
-
     csrRoamRemoveDuplicateCommand(pMac, sessionId, NULL, eCsrHddIssued);
     //Check whether ssid changes
     if(csrIsConnStateConnected(pMac, sessionId))
@@ -5658,7 +5498,6 @@
                 {
                     pScanFilter->bWPSAssociation = 0;
                 }
-
                 do
                 {
                     if( (pProfile && CSR_IS_WDS_AP( pProfile ) )
@@ -5674,14 +5513,12 @@
                         {
                             fCallCallback = eANI_BOOLEAN_TRUE;
                         }
-
                         break;
                     }
                     status = csrScanGetResult(pMac, pScanFilter, &hBSSList);
                     smsLog(pMac, LOGE, "************ csrScanGetResult Status ********* %d\n", status);
                     if(HAL_STATUS_SUCCESS(status))
                     {
-
                         status = csrRoamIssueConnect(pMac, sessionId, pProfile, hBSSList, eCsrHddIssued, 
                                                     roamId, eANI_BOOLEAN_FALSE, eANI_BOOLEAN_FALSE);
                         if(!HAL_STATUS_SUCCESS(status))
@@ -5736,7 +5573,6 @@
    
     return (status);
 }                         
-
 eHalStatus csrRoamReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile,
                           tCsrRoamModifyProfileFields modProfileFields,
                           tANI_U32 *pRoamId)
@@ -5745,20 +5581,17 @@
    tANI_BOOLEAN fCallCallback = eANI_BOOLEAN_TRUE;
    tANI_U32 roamId = 0;
    tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
    if (NULL == pProfile)
    {
       smsLog(pMac, LOGP, FL("No profile specified"));
       return eHAL_STATUS_FAILURE;
    }
-
    smsLog(pMac, LOG1, FL("called  BSSType = %d authtype = %d  encryType = %d\n"), pProfile->BSSType, pProfile->AuthType.authType[0], pProfile->EncryptionType.encryptionType[0]);
    csrRoamCancelRoaming(pMac, sessionId);
    csrScanRemoveFreshScanCommand(pMac, sessionId);
    csrScanCancelIdleScan(pMac);
    csrScanAbortMacScanNotForConnect(pMac);
    csrRoamRemoveDuplicateCommand(pMac, sessionId, NULL, eCsrHddIssuedReassocToSameAP);
-
    if(csrIsConnStateConnected(pMac, sessionId))
    {
       if(pProfile)
@@ -5789,7 +5622,6 @@
    {
       smsLog(pMac, LOG1, FL("Not connected! No need to reassoc\n"));
    }
-
    if(!fCallCallback)
    {
       roamId = GET_NEXT_ROAM_ID(&pMac->roam);
@@ -5798,20 +5630,16 @@
          *pRoamId = roamId;
       }
 
-
       status = csrRoamIssueReassoc(pMac, sessionId, pProfile, &modProfileFields, 
                                    eCsrHddIssuedReassocToSameAP, roamId, eANI_BOOLEAN_FALSE);
-
    }
    else
    {
       status = csrRoamCallCallback(pMac, sessionId, NULL, roamId, 
                                    eCSR_ROAM_FAILED, eCSR_ROAM_RESULT_FAILURE);
    }
-
    return status;
 }
-
 eHalStatus csrRoamJoinLastProfile(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
@@ -5820,7 +5648,6 @@
     tANI_U32 roamId;
     tCsrRoamProfile *pProfile = NULL;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     do
     {
         if(pSession->pCurRoamProfile)
@@ -5887,14 +5714,11 @@
         csrReleaseProfile(pMac, pProfile);
         palFreeMemory(pMac->hHdd, pProfile);
     }
-
     return (status);
 }
-
 eHalStatus csrRoamReconnect(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
-
     if(csrIsConnStateConnected(pMac, sessionId))
     {
         status = csrRoamIssueDisassociateCmd(pMac, sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED);
@@ -5903,15 +5727,12 @@
             status = csrRoamJoinLastProfile(pMac, sessionId);
         }
     }
-
     return (status);
 }
 
-
 eHalStatus csrRoamConnectToLastProfile(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
-
     smsLog(pMac, LOGW, FL("is called\n"));
     csrRoamCancelRoaming(pMac, sessionId);
     csrRoamRemoveDuplicateCommand(pMac, sessionId, NULL, eCsrHddIssued);
@@ -5919,11 +5740,9 @@
     {
         status = csrRoamJoinLastProfile(pMac, sessionId);
     }
-
     return (status);
 }
 
-
 eHalStatus csrRoamProcessDisassocDeauth( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fDisassoc, tANI_BOOLEAN fMICFailure )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -6003,28 +5822,23 @@
     return (status);
 }
 
-
 /* This is been removed from latest code base */
 /*
 static eHalStatus csrRoamProcessStopBss( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status;
     tANI_U32 sessionId = pCommand->sessionId;
-
     csrRoamStateChange( pMac, eCSR_ROAMING_STATE_JOINING );
     status = csrRoamIssueStopBss( pMac, sessionId, eCSR_ROAM_SUBSTATE_STOP_BSS_REQ );
-
     return ( status );
 }
 */
 
-
 eHalStatus csrRoamIssueDisassociateCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDisconnectReason reason )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tSmeCmd *pCommand;
         tANI_BOOLEAN fHighPriority = eANI_BOOLEAN_FALSE;
-
     do
     {
         smsLog( pMac, LOGE, FL("  reason = %d\n"), reason );
@@ -6048,29 +5862,23 @@
         case eCSR_DISCONNECT_REASON_MIC_ERROR:
             pCommand->u.roamCmd.roamReason = eCsrForcedDisassocMICFailure;
             break;
-
         case eCSR_DISCONNECT_REASON_DEAUTH:
             pCommand->u.roamCmd.roamReason = eCsrForcedDeauth;
             break;
-
         case eCSR_DISCONNECT_REASON_HANDOFF:
             fHighPriority = eANI_BOOLEAN_TRUE;
             pCommand->u.roamCmd.roamReason = eCsrSmeIssuedDisassocForHandoff;
             break;
-
         case eCSR_DISCONNECT_REASON_UNSPECIFIED:
         case eCSR_DISCONNECT_REASON_DISASSOC:
             pCommand->u.roamCmd.roamReason = eCsrForcedDisassoc;
             break;
-
         case eCSR_DISCONNECT_REASON_IBSS_JOIN_FAILURE:
             pCommand->u.roamCmd.roamReason = eCsrSmeIssuedIbssJoinFailure;
             break;
-
         case eCSR_DISCONNECT_REASON_IBSS_LEAVE:
             pCommand->u.roamCmd.roamReason = eCsrForcedIbssLeave;
             break;
-
         default:
             break;
         }
@@ -6081,16 +5889,13 @@
             csrReleaseCommandRoam( pMac, pCommand );
         }
     } while( 0 );
-
     return( status );
 }
 
-
 eHalStatus csrRoamIssueStopBssCmd( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_BOOLEAN fHighPriority )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tSmeCmd *pCommand;
-
     pCommand = csrGetCommandBuffer( pMac );
     if ( NULL != pCommand ) 
     {
@@ -6115,11 +5920,9 @@
         smsLog( pMac, LOGE, FL(" fail to get command buffer\n") );
         status = eHAL_STATUS_RESOURCES;
     }
-
     return ( status );
 }
 
-
 eHalStatus csrRoamDisconnectInternal(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDisconnectReason reason)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -6139,15 +5942,12 @@
         smsLog(pMac, LOG2, FL("called\n"));
         status = csrRoamIssueDisassociateCmd(pMac, sessionId, reason);
     }
-
     return (status);
 }
 
-
 eHalStatus csrRoamDisconnect(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamDisconnectReason reason)
 {
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     csrRoamCancelRoaming(pMac, sessionId);
     pSession->ibss_join_pending = FALSE;
     csrRoamStopIbssJoinTimer(pMac, sessionId);
@@ -6156,7 +5956,6 @@
     return (csrRoamDisconnectInternal(pMac, sessionId, reason));
 }
 
-
 eHalStatus csrRoamSaveConnectedInfomation(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
                                           tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes)
 {
@@ -6177,6 +5976,8 @@
     pConnectProfile->BSSType = pProfile->BSSType;
     pConnectProfile->modifyProfileFields.uapsd_mask = pProfile->uapsd_mask;
     pConnectProfile->operationChannel = pSirBssDesc->channelId;
+    pConnectProfile->beaconInterval = pSirBssDesc->beaconInterval;
+
     palCopyMemory(pMac->hHdd, &pConnectProfile->Keys, &pProfile->Keys, sizeof(tCsrKeys));
     //Save bssid
     csrGetBssIdBssDesc(pMac, pSirBssDesc, &pConnectProfile->bssid);
@@ -6217,7 +6018,6 @@
         
         //Save the bss desc
         status = csrRoamSaveConnectedBssDesc(pMac, sessionId, pSirBssDesc);
-
            if( CSR_IS_QOS_BSS(pIesTemp) )
            {
               pConnectProfile->qap = TRUE;
@@ -6226,7 +6026,6 @@
            {
               pConnectProfile->qap = FALSE;
            }
-
         if ( NULL == pIes )
         {
             //Free memory if it allocated locally
@@ -6255,20 +6054,16 @@
     return (status);
 }
 
-
-
 static void csrRoamJoinRspProcessor( tpAniSirGlobal pMac, tSirSmeJoinRsp *pSmeJoinRsp )
 {
    tListElem *pEntry = NULL;
    tSmeCmd *pCommand = NULL;
-
    //The head of the active list is the request we sent
    pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK);
    if(pEntry)
    {
        pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
    }
-
    if ( eSIR_SME_SUCCESS == pSmeJoinRsp->statusCode ) 
    {
             if(pCommand && eCsrSmeIssuedAssocToSimilarAP == pCommand->u.roamCmd.roamReason)
@@ -6290,7 +6085,6 @@
         {
             roamId = pCommand->u.roamCmd.roamId;
         }
-
         pSession->joinFailStatusCode.statusCode = pSmeJoinRsp->statusCode;
         pSession->joinFailStatusCode.reasonCode = pSmeJoinRsp->protStatusCode;
         smsLog( pMac, LOGW, "SmeJoinReq failed with statusCode= 0x%08lX [%d]\n", pSmeJoinRsp->statusCode, pSmeJoinRsp->statusCode );
@@ -6327,32 +6121,26 @@
     } /*else: ( eSIR_SME_SUCCESS == pSmeJoinRsp->statusCode ) */
 }
 
-
 eHalStatus csrRoamIssueJoin( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pSirBssDesc, 
                              tDot11fBeaconIEs *pIes,
                              tCsrRoamProfile *pProfile, tANI_U32 roamId )
 {
     eHalStatus status;
-
     smsLog( pMac, LOG1, "Attempting to Join Bssid= %02x-%02x-%02x-%02x-%02x-%02x\n", 
                   pSirBssDesc->bssId[ 0 ],pSirBssDesc->bssId[ 1 ],pSirBssDesc->bssId[ 2 ],
                   pSirBssDesc->bssId[ 3 ],pSirBssDesc->bssId[ 4 ],pSirBssDesc->bssId[ 5 ] );
     
     // Set the roaming substate to 'join attempt'...
     csrRoamSubstateChange( pMac, eCSR_ROAM_SUBSTATE_JOIN_REQ, sessionId);
-
     // attempt to Join this BSS...
     status = csrSendJoinReqMsg( pMac, sessionId, pSirBssDesc, pProfile, pIes );
-
     return (status);
 }
 
-
 static eHalStatus csrRoamIssueReassociate( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pSirBssDesc, 
                               tDot11fBeaconIEs *pIes, tCsrRoamProfile *pProfile)
 {
     csrRoamStateChange( pMac, eCSR_ROAMING_STATE_JOINING, sessionId);
-
     // Set the roaming substate to 'join attempt'...
     csrRoamSubstateChange( pMac, eCSR_ROAM_SUBSTATE_REASSOC_REQ, sessionId );
 
@@ -6362,8 +6150,6 @@
     return csrSendSmeReassocReqMsg( pMac, sessionId, pSirBssDesc, pIes, pProfile );
 }
 
-
-
 void csrRoamReissueRoamCommand(tpAniSirGlobal pMac)
 {
     tListElem *pEntry;
@@ -6403,7 +6189,6 @@
  
 #endif                  
 
-
                 if( !HAL_STATUS_SUCCESS( csrRoamIssueStopBss( pMac, sessionId, eCSR_ROAM_SUBSTATE_STOP_BSS_REQ ) ) )
                 {
                     smsLog(pMac, LOGE, " Failed to reissue stop_bss command for WDS after disassociated\n");
@@ -6427,13 +6212,11 @@
     }
 }
 
-
 tANI_BOOLEAN csrIsRoamCommandWaitingForSession(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
     tListElem *pEntry;
     tSmeCmd *pCommand = NULL;
-
     //alwasy lock active list before locking pending list
     csrLLLock( &pMac->sme.smeCmdActiveList );
     pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
@@ -6462,16 +6245,13 @@
         csrLLUnlock(&pMac->sme.smeCmdPendingList);
     }
     csrLLUnlock( &pMac->sme.smeCmdActiveList );
-
     return (fRet);
 }
 
-
 tANI_BOOLEAN csrIsRoamCommandWaiting(tpAniSirGlobal pMac)
 {
     tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
     tANI_U32 i;
-
     for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
     {
         if( CSR_IS_SESSION_VALID( pMac, i ) && ( fRet = csrIsRoamCommandWaitingForSession( pMac, i ) ) )
@@ -6479,15 +6259,12 @@
             break;
         }
     }
-
     return ( fRet );
 }
 
-
 tANI_BOOLEAN csrIsCommandWaiting(tpAniSirGlobal pMac)
 {
     tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
-
     //alwasy lock active list before locking pending list
     csrLLLock( &pMac->sme.smeCmdActiveList );
     fRet = csrLLIsListEmpty(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
@@ -6496,17 +6273,14 @@
         fRet = csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK);
     }
     csrLLUnlock( &pMac->sme.smeCmdActiveList );
-
     return (fRet);
 }
 
-
 tANI_BOOLEAN csrIsScanForRoamCommandActive( tpAniSirGlobal pMac )
 {
     tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE;
     tListElem *pEntry;
     tCsrCmd *pCommand;
-
     //alwasy lock active list before locking pending list
     csrLLLock( &pMac->sme.smeCmdActiveList );
     pEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
@@ -6522,10 +6296,8 @@
         }
     }
     csrLLUnlock( &pMac->sme.smeCmdActiveList );
-
     return (fRet);
 }
-
 eHalStatus csrRoamIssueReassociateCmd( tpAniSirGlobal pMac, tANI_U32 sessionId )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -6533,7 +6305,6 @@
     tANI_BOOLEAN fHighPriority = eANI_BOOLEAN_TRUE;
     tANI_BOOLEAN fRemoveCmd = FALSE;
     tListElem *pEntry; 
-
     // Delete the old assoc command. All is setup for reassoc to be serialized
     pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
     if ( pEntry )
@@ -6562,13 +6333,11 @@
             }
         }
     }
-
     if(NULL == pCommand)
     {
         smsLog( pMac, LOGE, FL(" fail to get command buffer as expected based on previous connect roam command\n") );
         return eHAL_STATUS_RESOURCES;
     }
-
     do 
     {
         //Change the substate in case it is wait-for-key
@@ -6580,7 +6349,6 @@
         pCommand->command = eSmeCommandRoam;
         pCommand->sessionId = (tANI_U8)sessionId;
         pCommand->u.roamCmd.roamReason = eCsrSmeIssuedFTReassoc;
-
         status = csrQueueSmeCommand(pMac, pCommand, fHighPriority);
         if( !HAL_STATUS_SUCCESS( status ) )
         {
@@ -6589,7 +6357,6 @@
         }
     } while( 0 );
 
-
     return( status );
 }
 static void csrRoamingStateConfigCnfProcessor( tpAniSirGlobal pMac, tANI_U32 result )
@@ -6600,7 +6367,6 @@
     tSmeCmd *pCommand = NULL;
     tANI_U32 sessionId;
     tCsrRoamSession *pSession;
-
     if(NULL == pEntry)
     {
         smsLog(pMac, LOGW, "   CFG_CNF with active list empty\n");
@@ -6657,7 +6423,6 @@
                 if ( csrIsInfraBssDesc( pBssDesc ) )
                 {
                     tDot11fBeaconIEs *pIesLocal = (tDot11fBeaconIEs *)pScanResult->Result.pvIes;
-
                     if(pIesLocal || (HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, pBssDesc, &pIesLocal))) )
                     {
                     // ..and currently in an Infrastructure connection....
@@ -6704,7 +6469,6 @@
                         }
                         else
 #endif
-
 #ifdef FEATURE_WLAN_CCX
                         if (csrRoamIsHandoffInProgress(pMac) && 
                                                 csrRoamIsCCXAssoc(pMac))
@@ -6773,7 +6537,6 @@
     }//we have active entry
 }
 
-
 static void csrRoamRoamingStateAuthRspProcessor( tpAniSirGlobal pMac, tSirSmeAuthRsp *pSmeAuthRsp )
 {
     //No one is sending eWNI_SME_AUTH_REQ to PE.
@@ -6784,7 +6547,6 @@
         // Successfully authenticated with a new Bss.  Attempt to stop the current Bss and
         // join the new one...
         /***pBssDesc = profGetRoamingBssDesc( pAdapter, &pHddProfile );
-
         roamStopNetwork( pAdapter, &pBssDesc->SirBssDescription );***/
     }
     else {
@@ -6795,7 +6557,6 @@
     }
 }
 
-
 static void csrRoamRoamingStateReassocRspProcessor( tpAniSirGlobal pMac, tpSirSmeJoinRsp pSmeJoinRsp )
 {
     eCsrRoamCompleteResult result;
@@ -6807,7 +6568,6 @@
     {
         smsLog( pMac, LOGW, "CSR SmeReassocReq Successful\n" );
         result = eCsrReassocSuccess;
-
         /* Defeaturize this part later if needed */
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
         /* Since the neighbor roam algorithm uses reassoc req for handoff instead of join, 
@@ -6855,14 +6615,11 @@
     }
 }
 
-
 static void csrRoamRoamingStateStopBssRspProcessor(tpAniSirGlobal pMac, tSirSmeRsp *pSmeRsp)
 {
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
     {
         vos_log_ibss_pkt_type *pIbssLog;
-
         WLAN_VOS_DIAG_LOG_ALLOC(pIbssLog, vos_log_ibss_pkt_type, LOG_WLAN_IBSS_C);
         if(pIbssLog)
         {
@@ -6875,7 +6632,6 @@
         }
     }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
     pMac->roam.roamSession[pSmeRsp->sessionId].connectState = eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
     if(CSR_IS_ROAM_SUBSTATE_STOP_BSS_REQ( pMac, pSmeRsp->sessionId))
     {
@@ -6887,7 +6643,6 @@
     }
 }
 
-
 void csrRoamRoamingStateDisassocRspProcessor( tpAniSirGlobal pMac, tSirSmeDisassocRsp *pSmeRsp )
 {
     tSirResultCodes statusCode;
@@ -6904,6 +6659,7 @@
 #endif
     tANI_U32 sessionId;
     tCsrRoamSession *pSession;
+
     tSirSmeDisassocRsp SmeDisassocRsp;
 
     csrSerDesUnpackDiassocRsp((tANI_U8 *)pSmeRsp, &SmeDisassocRsp);
@@ -6916,7 +6672,6 @@
     {
         pMac->roam.roamSession[sessionId].connectState = eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
     }
-
     pSession = CSR_GET_SESSION( pMac, sessionId );
     if ( CSR_IS_ROAM_SUBSTATE_DISASSOC_NO_JOIN( pMac, sessionId ) )
     {
@@ -6932,7 +6687,6 @@
         } 
         csrRoamComplete( pMac, eCsrNothingToJoin, NULL );
     }
-
     else if ( CSR_IS_ROAM_SUBSTATE_DISASSOC_HO( pMac, sessionId ) )
     {
        smsLog( pMac, LOGE, "CSR SmeDisassocReq due to HO\n" );
@@ -6941,11 +6695,11 @@
         if ( pEntry )
         {
             pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
-
             // If the head of the queue is Active and it is a ROAM command, remove
             // and put this on the Free queue.
             if ( eSmeCommandRoam == pCommand->command )
             {
+
                 //we need to process the result first before removing it from active list because state changes 
                 //still happening insides roamQProcessRoamResults so no other roam command should be issued
                 fRemoveCmd = csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK );
@@ -6954,7 +6708,6 @@
                     csrReleaseProfile(pMac, &pCommand->u.roamCmd.roamProfile);
                     pCommand->u.roamCmd.fReleaseProfile = eANI_BOOLEAN_FALSE;
                 }
-
                 if( fRemoveCmd )
                 {
                     csrReleaseCommandRoam( pMac, pCommand );
@@ -6974,13 +6727,12 @@
         {
             smsLog( pMac, LOGW, "CSR: Roam Completion called but NO commands are ACTIVE ...\n" );
         }
-
         //notify HDD for handoff, providing the BSSID too
         roamInfo.reasonCode = eCsrRoamReasonBetterAP;
 
         palCopyMemory(pMac->hHdd, roamInfo.bssid, pMac->roam.neighborRoamInfo.csrNeighborRoamProfile.BSSIDs.bssid, sizeof(tSirMacAddr));
 
-        csrRoamCallCallback(pMac,sessionId, &roamInfo, 0, eCSR_ROAM_ROAMING_START, eCSR_ROAM_RESULT_NONE);
+            csrRoamCallCallback(pMac,sessionId, &roamInfo, 0, eCSR_ROAM_ROAMING_START, eCSR_ROAM_RESULT_NONE);
 
         status = palAllocateMemory(pMac->hHdd, (void **)&pScanFilter, sizeof(tCsrScanResultFilter));
         if(HAL_STATUS_SUCCESS(status))
@@ -7030,12 +6782,12 @@
         }
         if( pScanFilter )
         {
+
             csrFreeScanFilter(pMac, pScanFilter);
             palFreeMemory( pMac->hHdd, pScanFilter );
         }
-
-
 #endif
+
     } //else if ( CSR_IS_ROAM_SUBSTATE_DISASSOC_HO( pMac ) )
     else if ( CSR_IS_ROAM_SUBSTATE_REASSOC_FAIL( pMac, sessionId ) )
     {
@@ -7064,14 +6816,11 @@
         //We are not done yet. Get the data and continue roaming
         csrRoamReissueRoamCommand(pMac);
     }
-
 }
 
-
 static void csrRoamRoamingStateDeauthRspProcessor( tpAniSirGlobal pMac, tSirSmeDeauthRsp *pSmeRsp )
 {
     tSirResultCodes statusCode;
-
     //No one is sending eWNI_SME_DEAUTH_REQ to PE.
     smsLog(pMac, LOGW, FL("is no-op\n"));
     statusCode = csrGetDeAuthRspStatusCode( pSmeRsp );
@@ -7096,7 +6845,6 @@
     }
 }
 
-
 static void csrRoamRoamingStateStartBssRspProcessor( tpAniSirGlobal pMac, tSirSmeStartBssRsp *pSmeStartBssRsp )
 {
     eCsrRoamCompleteResult result;
@@ -7119,7 +6867,6 @@
 #endif
 }
 
-
 /*
   We need to be careful on whether to cast pMsgBuf (pSmeRsp) to other type of strucutres.
   It depends on how the message is constructed. If the message is sent by limSendSmeRsp,
@@ -7134,9 +6881,7 @@
     tCsrRoamInfo roamInfo;
         // TODO Session Id need to be acquired in this function
         tANI_U32 sessionId = 0;
-
     pSmeRsp = (tSirSmeRsp *)pMsgBuf;
-
     smsLog( pMac, LOG2, "Message %d[0x%04X] received in substate %d\n",
                 pSmeRsp->messageType, pSmeRsp->messageType,
                 pMac->roam.curSubState[pSmeRsp->sessionId] );
@@ -7214,9 +6959,7 @@
             {
                 csrRoamingStateConfigCnfProcessor( pMac, ((tCsrCfgSetRsp *)pSmeRsp)->respStatus );
             }
-
             break;
-
         //In case CSR issues STOP_BSS, we need to tell HDD about peer departed becasue PE is removing them
         case eWNI_SME_IBSS_PEER_DEPARTED_IND:
             pIbssPeerInd = (tSmeIbssPeerInd*)pSmeRsp;
@@ -7230,7 +6973,6 @@
                                 eCSR_ROAM_CONNECT_STATUS_UPDATE, 
                                 eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED);
             break;
-
         default:
             smsLog( pMac, LOG1, "Unexpected message type = %d[0x%X] received in substate %d\n",
                       pSmeRsp->messageType, pSmeRsp->messageType,
@@ -7245,11 +6987,9 @@
     }
 }
 
-
 void csrRoamJoinedStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf )
 {
     tSirSmeRsp *pSirMsg = (tSirSmeRsp *)pMsgBuf;
-
     switch (pSirMsg->messageType) 
     {
        case eWNI_SME_GET_STATISTICS_RSP:
@@ -7265,31 +7005,22 @@
             tCsrRoamInfo *pRoamInfo = NULL;
             tANI_U32 sessionId;
             eHalStatus status;
-
             smsLog( pMac, LOG1, FL("ASSOCIATION confirmation can be given to upper layer \n"));
-
             palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
             pRoamInfo = &roamInfo;
-
             pUpperLayerAssocCnf = (tSirSmeAssocIndToUpperLayerCnf *)pMsgBuf;
             status = csrRoamGetSessionIdFromBSSID( pMac, (tCsrBssid *)pUpperLayerAssocCnf->bssId, &sessionId );
             pSession = CSR_GET_SESSION(pMac, sessionId);
-
             pRoamInfo->statusCode = eSIR_SME_SUCCESS; //send the status code as Success 
             pRoamInfo->u.pConnectedProfile = &pSession->connectedProfile;
-
             pRoamInfo->staId = (tANI_U8)pUpperLayerAssocCnf->aid;
             pRoamInfo->rsnIELen = (tANI_U8)pUpperLayerAssocCnf->rsnIE.length;
             pRoamInfo->prsnIE = pUpperLayerAssocCnf->rsnIE.rsnIEdata;
-
             pRoamInfo->addIELen = (tANI_U8)pUpperLayerAssocCnf->addIE.length;
             pRoamInfo->paddIE = pUpperLayerAssocCnf->addIE.addIEdata;           
-
             palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pUpperLayerAssocCnf->peerMacAddr, sizeof(tSirMacAddr));
             palCopyMemory(pMac->hHdd, &pRoamInfo->bssid, pUpperLayerAssocCnf->bssId, sizeof(tCsrBssid));
-
             pRoamInfo->wmmEnabledSta = pUpperLayerAssocCnf->wmmEnabledSta;
-
             if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile) )
             {
                 pMac->roam.roamSession[sessionId].connectState = eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED;
@@ -7303,19 +7034,15 @@
                 status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_WDS_IND, eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND);//Sta
             }
 
-
         }
         break;
 #endif
-
        default:
           csrRoamCheckForLinkStatusChange( pMac, pSirMsg );
           break;
     }
-
 }
 
-
 eHalStatus csrRoamIssueSetContextReq( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrEncryptionType EncryptType, 
                                      tSirBssDescription *pBssDescription,
                                 tSirMacAddr *bssId, tANI_BOOLEAN addKey,
@@ -7339,7 +7066,6 @@
            addKey )     
     {
         tCsrRoamSetKey setKey;
-
         setKey.encType = EncryptType;
         setKey.keyDirection = aniKeyDirection;    //Tx, Rx or Tx-and-Rx
         palCopyMemory( pMac->hHdd, &setKey.peerMac, bssId, sizeof(tCsrBssid) );   
@@ -7352,11 +7078,9 @@
         }
         status = csrRoamIssueSetKeyCommand( pMac, sessionId, &setKey, 0 );
     }
-
     return (status);
 }
 
-
 static eHalStatus csrRoamIssueSetKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId, 
                                              tCsrRoamSetKey *pSetKey, tANI_U32 roamId )
 {
@@ -7458,6 +7182,7 @@
             break;
         }
 #endif /* FEATURE_WLAN_CCX */
+
 #ifdef WLAN_FEATURE_11W
         //Check for 11w BIP
         else if ( eCSR_ENCRYPT_TYPE_AES_CMAC == pSetKey->encType )
@@ -7488,7 +7213,6 @@
             smsLog( pMac, LOGE, FL(" fail to send message status = %d\n"), status );
         }
     } while (0);
-
     // Free the command if there has been a failure, or it is a 
     // "local" operation like the set CCX CCKM KRK key.
     if( (!HAL_STATUS_SUCCESS( status ) && ( NULL != pCommand )) 
@@ -7499,18 +7223,15 @@
     {
         csrReleaseCommandSetKey( pMac, pCommand );
     }
-
     return( status );
 }
 
-
 eHalStatus csrRoamIssueRemoveKeyCommand( tpAniSirGlobal pMac, tANI_U32 sessionId,
                                          tCsrRoamRemoveKey *pRemoveKey, tANI_U32 roamId )
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
     tSmeCmd *pCommand = NULL;
     tANI_BOOLEAN fImediate = eANI_BOOLEAN_TRUE;
-
     do
     {
         if( !csrIsSetKeyAllowed(pMac, sessionId) ) 
@@ -7537,7 +7258,6 @@
             //in this case, put it to the end of the Q incase there is a set key pending.
             fImediate = eANI_BOOLEAN_FALSE;
         }
-
         smsLog( pMac, LOGE, FL("keyType=%d, keyId=%d, PeerMac=%02x, %02x, %02x, %02x, %02x, %02x\n"),       
             pRemoveKey->encType, pRemoveKey->keyId,
             pCommand->u.removeKeyCmd.peerMac[0],
@@ -7546,7 +7266,6 @@
             pCommand->u.removeKeyCmd.peerMac[3], 
             pCommand->u.removeKeyCmd.peerMac[4],
             pCommand->u.removeKeyCmd.peerMac[5]);
-
         status = csrQueueSmeCommand(pMac, pCommand, fImediate);
         if( !HAL_STATUS_SUCCESS( status ) )
         {
@@ -7554,16 +7273,13 @@
             break;
         }
     } while (0);
-
     if( !HAL_STATUS_SUCCESS( status ) && ( NULL != pCommand ) )
     {
         csrReleaseCommandRemoveKey( pMac, pCommand );
     }
-
     return (status );
 }
 
-
 eHalStatus csrRoamProcessSetKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status;
@@ -7571,11 +7287,9 @@
     tAniEdType edType = csrTranslateEncryptTypeToEdType( pCommand->u.setKeyCmd.encType );
     tANI_BOOLEAN fUnicast = ( pCommand->u.setKeyCmd.peerMac[0] == 0xFF ) ? eANI_BOOLEAN_FALSE : eANI_BOOLEAN_TRUE;
     tANI_U32 sessionId = pCommand->sessionId;
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     WLAN_VOS_DIAG_EVENT_DEF(setKeyEvent, vos_event_wlan_security_payload_type);
-
     if(eCSR_ENCRYPT_TYPE_NONE != edType)
     {
         palZeroMemory(pMac->hHdd, &setKeyEvent, sizeof(vos_event_wlan_security_payload_type));
@@ -7595,7 +7309,6 @@
         if(CSR_IS_ENC_TYPE_STATIC(edType))
         {
             tANI_U32 defKeyId;
-
             //It has to be static WEP here
             if(HAL_STATUS_SUCCESS(ccmCfgGetInt(pMac, WNI_CFG_WEP_DEFAULT_KEYID, &defKeyId)))
             {
@@ -7610,7 +7323,6 @@
         WLAN_VOS_DIAG_EVENT_REPORT(&setKeyEvent, EVENT_WLAN_SECURITY);
     }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
     if( csrIsSetKeyAllowed(pMac, sessionId) )
     {
         status = csrSendMBSetContextReqMsg( pMac, sessionId, 
@@ -7630,7 +7342,6 @@
     {
         smsLog( pMac, LOGE, FL("  error status %d\n"), status );
         csrRoamCallCallback( pMac, sessionId, NULL, pCommand->u.setKeyCmd.roamId, eCSR_ROAM_SET_KEY_COMPLETE, eCSR_ROAM_RESULT_FAILURE);
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
         if(eCSR_ENCRYPT_TYPE_NONE != edType)
         {
@@ -7646,13 +7357,10 @@
             WLAN_VOS_DIAG_EVENT_REPORT(&setKeyEvent, EVENT_WLAN_SECURITY);
         }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
     }
-
     return ( status );
 }
 
-
 eHalStatus csrRoamProcessRemoveKeyCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status;
@@ -7660,11 +7368,9 @@
     tANI_U16 wMsgLen = sizeof(tSirSmeRemoveKeyReq);
     tANI_U8 *p;
     tANI_U32 sessionId = pCommand->sessionId;
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     WLAN_VOS_DIAG_EVENT_DEF(removeKeyEvent, vos_event_wlan_security_payload_type);
-
     palZeroMemory(pMac->hHdd, &removeKeyEvent, sizeof(vos_event_wlan_security_payload_type));
     removeKeyEvent.eventId = WLAN_SECURITY_EVENT_REMOVE_KEY_REQ;
     removeKeyEvent.encryptionModeMulticast = (v_U8_t)diagEncTypeFromCSRType(pSession->connectedProfile.mcEncryptionType);
@@ -7674,7 +7380,6 @@
     removeKeyEvent.authMode = (v_U8_t)diagAuthTypeFromCSRType(pSession->connectedProfile.AuthType);
     WLAN_VOS_DIAG_EVENT_REPORT(&removeKeyEvent, EVENT_WLAN_SECURITY);
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
     if( csrIsSetKeyAllowed(pMac, sessionId) )
     {
         status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, wMsgLen );
@@ -7690,7 +7395,6 @@
         palZeroMemory(pMac->hHdd, pMsg, wMsgLen);
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_REMOVEKEY_REQ);
                 pMsg->length = pal_cpu_to_be16(wMsgLen);
-
         pMsg->sessionId = (tANI_U8)sessionId;
         pMsg->transactionId = 0;
         p = (tANI_U8 *)pMsg + sizeof(pMsg->messageType) + sizeof(pMsg->length) +
@@ -7719,28 +7423,21 @@
         *p = pCommand->u.removeKeyCmd.keyId;
         p++;
         *p = (pCommand->u.removeKeyCmd.peerMac[0] == 0xFF ) ? 0 : 1;
-
         status = palSendMBMessage(pMac->hHdd, pMsg);
     }
-
     if( !HAL_STATUS_SUCCESS( status ) )
     {
         smsLog( pMac, LOGE, FL(" error status \n"), status );
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
         removeKeyEvent.eventId = WLAN_SECURITY_EVENT_REMOVE_KEY_RSP;
         removeKeyEvent.status = WLAN_SECURITY_STATUS_FAILURE;;
         WLAN_VOS_DIAG_EVENT_REPORT(&removeKeyEvent, EVENT_WLAN_SECURITY);
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
         csrRoamCallCallback( pMac, sessionId, NULL, pCommand->u.removeKeyCmd.roamId, eCSR_ROAM_REMOVE_KEY_COMPLETE, eCSR_ROAM_RESULT_FAILURE);
     }
-
     return ( status );
 }
 
-
-
 eHalStatus csrRoamSetKey( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 roamId )
 {
     eHalStatus status;
@@ -7753,11 +7450,9 @@
     {
         status = csrRoamIssueSetKeyCommand( pMac, sessionId, pSetKey, roamId );
     }
-
     return ( status );
 }
 
-
 /*
    Prepare a filter base on a profile for parsing the scan results.
    Upon successful return, caller MUST call csrFreeScanFilter on 
@@ -7826,14 +7521,12 @@
                  {
                          smsLog(pMac, LOG1, FL("process a channel (%d) that is invalid\n"), pProfile->ChannelInfo.ChannelList[index]);
                  }
-
             }
             }
             else
             {
                 break;
             }
-
         }
         else 
         {
@@ -7866,10 +7559,8 @@
              }
         }
 #endif /* FEATURE_WLAN_WAPI */
-
         /*Save the WPS info*/
         pScanFilter->bWPSAssociation = pProfile->bWPSAssociation;
-
         if( pProfile->countryCode[0] )
         {
             //This causes the matching function to use countryCode as one of the criteria.
@@ -7894,13 +7585,11 @@
     return(status);
 }
 
-
 tANI_BOOLEAN csrRoamIssueWmStatusChange( tpAniSirGlobal pMac, tANI_U32 sessionId,
                                          eCsrRoamWmStatusChangeTypes Type, tSirSmeRsp *pSmeRsp )
 {
     tANI_BOOLEAN fCommandQueued = eANI_BOOLEAN_FALSE;
     tSmeCmd *pCommand;
-
     do
     {
         // Validate the type is ok...
@@ -7940,16 +7629,12 @@
             csrReleaseCommandWmStatusChange( pMac, pCommand );
         }
 
-
         /* AP has issued Dissac/Deauth, Set the operating mode value to configured value */
         csrSetDefaultDot11Mode( pMac );
-
     } while( 0 );
-
     return( fCommandQueued );
 }
 
-
 static void csrUpdateRssi(tpAniSirGlobal pMac, void* pMsg)
 {
     v_S7_t  rssi = 0;
@@ -7982,6 +7667,27 @@
     }
     return;
 }
+static void csrRoamRssiIndHdlr(tpAniSirGlobal pMac, void* pMsg)
+{
+    WLANTL_TlIndicationReq *pTlRssiInd = (WLANTL_TlIndicationReq*)pMsg;
+    if(pTlRssiInd)
+    {
+        if(NULL != pTlRssiInd->tlCallback)
+        {
+            ((WLANTL_RSSICrossThresholdCBType)(pTlRssiInd->tlCallback))
+            (pTlRssiInd->pAdapter, pTlRssiInd->rssiNotification, pTlRssiInd->pUserCtxt);
+        }
+        else
+        {
+            smsLog( pMac, LOGE, FL("pTlRssiInd->tlCallback is NULL\n"));                
+        }
+    }
+    else
+    {
+        smsLog( pMac, LOGE, FL("pTlRssiInd is NULL\n"));    
+    }
+    return;
+}
 
 void csrRoamCheckForLinkStatusChange( tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg )
 {
@@ -8002,7 +7708,6 @@
     tCsrRoamSession *pSession = NULL;
     tpSirSmeSwitchChannelInd pSwitchChnInd;
     tSmeMaxAssocInd *pSmeMaxAssocInd;
-
 #if defined ANI_PRODUCT_TYPE_AP
     pSirMsg->messageType = pal_be16_to_cpu(pSirMsg->messageType);
     pSirMsg->length = pal_be16_to_cpu(pSirMsg->length);
@@ -8012,9 +7717,7 @@
     pSirMsg->length = (pSirMsg->length);
     pSirMsg->statusCode = (pSirMsg->statusCode);
 #endif
-
     palZeroMemory(pMac->hHdd, &roamInfo, sizeof(roamInfo));
-
     switch( pSirMsg->messageType ) 
     {
         case eWNI_SME_ASSOC_IND:
@@ -8044,7 +7747,6 @@
                 
                 pRoamInfo->addIELen = (tANI_U8)pAssocInd->addIE.length;
                 pRoamInfo->paddIE =  pAssocInd->addIE.addIEdata;
-
                     palCopyMemory(pMac->hHdd, pRoamInfo->peerMac, pAssocInd->peerMacAddr, sizeof(tSirMacAddr));
                     palCopyMemory(pMac->hHdd, &pRoamInfo->bssid, pAssocInd->bssId, sizeof(tCsrBssid));
 #ifdef WLAN_SOFTAP_FEATURE
@@ -8077,7 +7779,6 @@
                     
                     /* send a message to CSR itself just to avoid the EAPOL frames going
                      * OTA before association response */
-
                     if(CSR_IS_WDS_AP( pRoamInfo->u.pConnectedProfile))
                 {
                     status = csrSendAssocIndToUpperLayerCnfMsg(pMac, pAssocInd, status, sessionId);
@@ -8093,10 +7794,8 @@
                 }
             }
             break;
-
         case eWNI_SME_DISASSOC_IND:
             smsLog( pMac, LOGE, FL("DISASSOCIATION Indication from MAC\n"));
-
             // Check if AP dis-associated us because of MIC failure. If so,
             // then we need to take action immediately and not wait till the
             // the WmStatusChange requests is pushed and processed
@@ -8132,7 +7831,6 @@
                 {
                     pSession->connectState = eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
                 }
-
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
                 sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, SME_QOS_CSR_DISCONNECT_IND, NULL);
 #endif
@@ -8157,7 +7855,6 @@
 #endif                
             }
             break;
-
         case eWNI_SME_DEAUTH_IND:
             smsLog( pMac, LOG1, FL("DEAUTHENTICATION Indication from MAC\n"));
             pDeauthInd = (tpSirSmeDeauthInd)pSirMsg;
@@ -8192,7 +7889,6 @@
                 {
                     pSession->connectState = eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
                 }
-
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
                 sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, SME_QOS_CSR_DISCONNECT_IND, NULL);
 #endif
@@ -8244,7 +7940,6 @@
                 if( CSR_IS_SESSION_VALID(pMac, sessionId) )
                 {                    
                     pSession = CSR_GET_SESSION(pMac, sessionId);
-
                     if ( CSR_IS_INFRA_AP(&pSession->connectedProfile) )
                     {
                         pRoamInfo = &roamInfo;
@@ -8268,7 +7963,6 @@
                 if( CSR_IS_SESSION_VALID(pMac, sessionId) )
                 {                    
                     pSession = CSR_GET_SESSION(pMac, sessionId);
-
                     if ( CSR_IS_INFRA_AP(&pSession->connectedProfile) )
                     {
                         pRoamInfo = &roamInfo;
@@ -8282,13 +7976,11 @@
             }
 #endif
             break;
-
         case eWNI_SME_MIC_FAILURE_IND:
             {
                 tpSirSmeMicFailureInd pMicInd = (tpSirSmeMicFailureInd)pSirMsg;
                 tCsrRoamInfo roamInfo, *pRoamInfo = NULL;
                 eCsrRoamResult result = eCSR_ROAM_RESULT_MIC_ERROR_UNICAST;
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
                 {
                     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
@@ -8305,7 +7997,6 @@
                     WLAN_VOS_DIAG_EVENT_REPORT(&secEvent, EVENT_WLAN_SECURITY);
                 }
 #endif//FEATURE_WLAN_DIAG_SUPPORT_CSR
-
                 status = csrRoamGetSessionIdFromBSSID( pMac, (tCsrBssid *)pMicInd->bssId, &sessionId );
                 if( HAL_STATUS_SUCCESS( status ) )
                 {
@@ -8324,13 +8015,11 @@
                 }
             }
             break;
-
 #ifdef WLAN_SOFTAP_FEATURE
         case eWNI_SME_WPS_PBC_PROBE_REQ_IND:
             {
                 tpSirSmeProbeReqInd pProbeReqInd = (tpSirSmeProbeReqInd)pSirMsg;
                 tCsrRoamInfo roamInfo;
-
                 smsLog( pMac, LOG1, FL("WPS PBC Probe request Indication from SME\n"));
            
                 status = csrRoamGetSessionIdFromBSSID( pMac, (tCsrBssid *)pProbeReqInd->bssId, &sessionId );
@@ -8345,7 +8034,6 @@
             break;        
 #endif
             
-
         case eWNI_SME_WM_STATUS_CHANGE_NTF:
             pStatusChangeMsg = (tSirSmeWmStatusChangeNtf *)pSirMsg;
             switch( pStatusChangeMsg->statusChangeCode ) 
@@ -8370,7 +8058,6 @@
                         roamStatus = eCSR_ROAM_CONNECT_STATUS_UPDATE;
                     }
                     break;
-
                 case eSIR_SME_IBSS_INACTIVE:
                     sessionId = csrFindIbssSession( pMac );
                     if( CSR_SESSION_ID_INVALID != sessionId )
@@ -8381,7 +8068,6 @@
                         roamStatus = eCSR_ROAM_CONNECT_STATUS_UPDATE;
                     }
                     break;
-
                 case eSIR_SME_JOINED_NEW_BSS:    // IBSS coalescing.
                     sessionId = csrFindIbssSession( pMac );
                     if( CSR_SESSION_ID_INVALID != sessionId )
@@ -8389,12 +8075,10 @@
                         pSession = CSR_GET_SESSION( pMac, sessionId );
                         // update the connection state information
                         pNewBss = &pStatusChangeMsg->statusChangeInfo.newBssInfo;
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
                         {
                             vos_log_ibss_pkt_type *pIbssLog;
                             tANI_U32 bi;
-
                             WLAN_VOS_DIAG_LOG_ALLOC(pIbssLog, vos_log_ibss_pkt_type, LOG_WLAN_IBSS_C);
                             if(pIbssLog)
                             {
@@ -8417,7 +8101,6 @@
                             }
                         }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
                         csrRoamUpdateConnectedProfileFromNewBss( pMac, sessionId, pNewBss );
                         csrRoamIssueSetContextReq( pMac, sessionId, pSession->connectedProfile.EncryptionType, 
                                                     pSession->pConnectBssDesc,
@@ -8443,7 +8126,6 @@
                     }
                     smsLog(pMac, LOGW, "CSR:  eSIR_SME_JOINED_NEW_BSS received from PE\n");
                     break;
-
                 // detection by LIM that the capabilities of the associated AP have changed.
                 case eSIR_SME_AP_CAPS_CHANGED:
                     pApNewCaps = &pStatusChangeMsg->statusChangeInfo.apNewCaps;
@@ -8461,21 +8143,17 @@
                     roamStatus = eCSR_ROAM_FAILED;
                     result = eCSR_ROAM_RESULT_NONE;
                     break;
-
             }  // end switch on statusChangeCode
             if(eCSR_ROAM_RESULT_NONE != result)
             {
                 csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, roamStatus, result);
             }
             break;
-
         case eWNI_SME_IBSS_NEW_PEER_IND:
             pIbssPeerInd = (tSmeIbssPeerInd *)pSirMsg;
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
             {
                 vos_log_ibss_pkt_type *pIbssLog;
-
                 WLAN_VOS_DIAG_LOG_ALLOC(pIbssLog, vos_log_ibss_pkt_type, LOG_WLAN_IBSS_C);
                 if(pIbssLog)
                 {
@@ -8485,7 +8163,6 @@
                 }
             }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
             sessionId = csrFindIbssSession( pMac );
             if( CSR_SESSION_ID_INVALID != sessionId )
             {
@@ -8564,13 +8241,11 @@
                 }
             }
             break;
-
         case eWNI_SME_IBSS_PEER_DEPARTED_IND:
             pIbssPeerInd = (tSmeIbssPeerInd*)pSirMsg;
             sessionId = csrFindIbssSession( pMac );
             if( CSR_SESSION_ID_INVALID != sessionId )
             {
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
                 {
                     vos_log_ibss_pkt_type *pIbssLog;
@@ -8587,7 +8262,6 @@
                     }
                 }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
                 smsLog(pMac, LOGW, "CSR: Peer departed notification from LIM\n");
                 roamInfo.staId = (tANI_U8)pIbssPeerInd->staId;
                 roamInfo.ucastSig = (tANI_U8)pIbssPeerInd->ucastSig;
@@ -8597,7 +8271,6 @@
                         eCSR_ROAM_CONNECT_STATUS_UPDATE, eCSR_ROAM_RESULT_IBSS_PEER_DEPARTED);
             }
             break;
-
         case eWNI_SME_SETCONTEXT_RSP:
             {
                 tSirSmeSetContextRsp *pRsp = (tSirSmeSetContextRsp *)pSirMsg;
@@ -8656,17 +8329,17 @@
                         if( eSIR_SME_SUCCESS == pRsp->statusCode )
                         {
                             palCopyMemory( pMac, &roamInfo.peerMac, &pRsp->peerMacAddr, sizeof(tCsrBssid) );
-                            //Make sure we install the GTK before indicating to HDD as authenticated
-                            //This is to prevent broadcast packets go out after PTK and before GTK.
-                            if( palEqualMemory( pMac->hHdd, &Broadcastaddr, pRsp->peerMacAddr, 
-                                        sizeof(tSirMacAddr) ) )
-                            {
-                                result = eCSR_ROAM_RESULT_AUTHENTICATED;
-                            }
-                            else
-                            {
-                            result = eCSR_ROAM_RESULT_NONE;
-                            }
+                                //Make sure we install the GTK before indicating to HDD as authenticated
+                                //This is to prevent broadcast packets go out after PTK and before GTK.
+                                if( palEqualMemory( pMac->hHdd, &Broadcastaddr, pRsp->peerMacAddr, 
+                                           sizeof(tSirMacAddr) ) )
+                                {
+                                    result = eCSR_ROAM_RESULT_AUTHENTICATED;
+                                }
+                                else
+                                {
+                                    result = eCSR_ROAM_RESULT_NONE;
+                                }
                             pRoamInfo = &roamInfo;
                         }
                         else
@@ -8678,11 +8351,9 @@
                         }
                         csrRoamCallCallback(pMac, sessionId, &roamInfo, pCommand->u.setKeyCmd.roamId, 
                                             eCSR_ROAM_SET_KEY_COMPLETE, result);
-
                         // Indicate SME_QOS that the SET_KEY is completed, so that SME_QOS
                         // can go ahead and initiate the TSPEC if any are pending
                         sme_QosCsrEventInd(pMac, (v_U8_t)sessionId, SME_QOS_CSR_SET_KEY_SUCCESS_IND, NULL);
-
 #ifdef FEATURE_WLAN_CCX
                         //Send Adjacent AP repot to new AP.
                         if (result == eCSR_ROAM_RESULT_AUTHENTICATED &&
@@ -8695,7 +8366,6 @@
                             pSession->isPrevApInfoValid = FALSE;
                         }
 #endif
-
                         if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK ) )
                         {
                             csrReleaseCommandSetKey( pMac, pCommand );
@@ -8710,11 +8380,9 @@
                 {
                     smsLog( pMac, LOGE, "CSR: SetKey Completion called but NO commands are ACTIVE ...\n" );
                 }
-
                 smeProcessPendingQueue( pMac );
             }
             break;
-
         case eWNI_SME_REMOVEKEY_RSP:
             {
                 tSirSmeRemoveKeyRsp *pRsp = (tSirSmeRemoveKeyRsp *)pSirMsg;
@@ -8729,7 +8397,6 @@
                     {                
                         sessionId = pCommand->sessionId;
                         pSession = CSR_GET_SESSION( pMac, sessionId );
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
                         {
                             WLAN_VOS_DIAG_EVENT_DEF(removeKeyEvent, vos_event_wlan_security_payload_type);
@@ -8749,7 +8416,6 @@
                             WLAN_VOS_DIAG_EVENT_REPORT(&removeKeyEvent, EVENT_WLAN_SECURITY);
                         }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
                         if( eSIR_SME_SUCCESS == pRsp->statusCode )
                         {
                             palCopyMemory( pMac, &roamInfo.peerMac, &pRsp->peerMacAddr, sizeof(tCsrBssid) );
@@ -8776,28 +8442,23 @@
                 {
                     smsLog( pMac, LOGW, "CSR: SetKey Completion called but NO commands are ACTIVE ...\n" );
                 }
-
                 smeProcessPendingQueue( pMac );
             }
             break;
-
         case eWNI_SME_GET_STATISTICS_RSP:
             smsLog( pMac, LOGW, FL("Stats rsp from PE\n"));
             csrRoamStatsRspProcessor( pMac, pSirMsg );
             break;
-
         case eWNI_SME_GET_RSSI_REQ:
             smsLog( pMac, LOGW, FL("GetRssiReq from self\n"));
             csrUpdateRssi( pMac, pSirMsg );
             break;
 
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
         case eWNI_SME_FT_PRE_AUTH_RSP:
             csrRoamFTPreAuthRspProcessor( pMac, (tpSirFTPreAuthRsp)pSirMsg );
             break;
 #endif
-
         case eWNI_SME_MAX_ASSOC_EXCEEDED:
             pSmeMaxAssocInd = (tSmeMaxAssocInd*)pSirMsg;
             smsLog( pMac, LOG1, FL("send indication that max assoc have been reached and the new peer cannot be accepted\n"));          
@@ -8812,15 +8473,16 @@
             smsLog( pMac, LOG1, FL("Establish logical link req from HCI serialized through MC thread\n"));
             btampEstablishLogLinkHdlr( pSirMsg );
             break;
+        case eWNI_SME_RSSI_IND:
+            smsLog( pMac, LOG1, FL("RSSI indication from TL serialized through MC thread\n"));
+            csrRoamRssiIndHdlr( pMac, pSirMsg );
+        break;
 
         default:
             break;
-
     }  // end switch on message type
-
 }
 
-
 void csrCallRoamingCompletionCallback(tpAniSirGlobal pMac, tCsrRoamSession *pSession, 
                                       tCsrRoamInfo *pRoamInfo, tANI_U32 roamId, eCsrRoamResult roamResult)
 {
@@ -8847,17 +8509,14 @@
 eHalStatus csrRoamStartRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamingReason roamingReason)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
-
     if(CSR_IS_LOSTLINK_ROAMING(roamingReason) && 
         (eANI_BOOLEAN_FALSE == pMac->roam.roamSession[sessionId].fCancelRoaming))
     {
         status = csrScanRequestLostLink1( pMac, sessionId );
     }
-
     return(status);
 }
 
-
 //return a boolean to indicate whether roaming completed or continue.
 tANI_BOOLEAN csrRoamCompleteRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId, 
                                     tANI_BOOLEAN fForce, eCsrRoamResult roamResult)
@@ -8866,7 +8525,6 @@
     tANI_TIMESTAMP roamTime = (tANI_TIMESTAMP)(pMac->roam.configParam.nRoamingTime * PAL_TICKS_PER_SECOND);
     tANI_TIMESTAMP curTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd);
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     //Check whether time is up
     if(pSession->fCancelRoaming || fForce || 
        ((curTime - pSession->roamingStartTime) > roamTime) ||
@@ -8913,15 +8571,12 @@
             fCompleted = eANI_BOOLEAN_FALSE;
         }
     }
-
     return(fCompleted);
 }
 
-
 void csrRoamCancelRoaming(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if(CSR_IS_ROAMING(pSession))
     {
         smsLog(pMac, LOGW, "   Cancelling roaming\n");
@@ -8943,7 +8598,6 @@
     }
 }
 
-
 void csrRoamRoamingTimerHandler(void *pv)
 {
     tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv;
@@ -8961,7 +8615,6 @@
     }
 }
 
-
 eHalStatus csrRoamStartRoamingTimer(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval)
 {
     eHalStatus status;
@@ -8974,18 +8627,15 @@
     return (status);
 }
 
-
 eHalStatus csrRoamStopRoamingTimer(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     return (palTimerStop(pMac->hHdd, pMac->roam.roamSession[sessionId].hTimerRoaming));
 }
 
-
 void csrRoamWaitForKeyTimeOutHandler(void *pv)
 {
     tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv;
     tpAniSirGlobal pMac = pInfo->pMac;
-
     if( CSR_IS_WAIT_FOR_KEY( pMac, pInfo->sessionId ) )
     {
         smsLog(pMac, LOGW, " SME pre-auth state timeout. \n ");
@@ -8995,7 +8645,6 @@
     
 }
 
-
 eHalStatus csrRoamStartWaitForKeyTimer(tpAniSirGlobal pMac, tANI_U32 interval)
 {
     eHalStatus status;
@@ -9006,13 +8655,11 @@
     return (status);
 }
 
-
 eHalStatus csrRoamStopWaitForKeyTimer(tpAniSirGlobal pMac)
 {
     return (palTimerStop(pMac->hHdd, pMac->roam.hTimerWaitForKey));
 }
 
-
 void csrRoamIbssJoinTimerHandler(void *pv)
 {
     tCsrTimerInfo *pInfo = (tCsrTimerInfo *)pv;
@@ -9026,9 +8673,7 @@
     //csrRoamCallCallback(pMac, sessionId, NULL, 0, eCSR_ROAM_IBS_IND, eCSR_ROAM_RESULT_IBSS_JOIN_FAILED);
     // Send an IBSS stop request to PE
     csrRoamDisconnectInternal(pMac, sessionId, reason);
-
 }
-
 eHalStatus csrRoamStartIbssJoinTimer(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval)
 {
     eHalStatus status;
@@ -9040,12 +8685,10 @@
     
     return (status);
 }
-
 eHalStatus csrRoamStopIbssJoinTimer(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     return (palTimerStop(pMac->hHdd, pMac->roam.roamSession[sessionId].hTimerIbssJoining));
 }
-
 void csrRoamCompletion(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamInfo *pRoamInfo, tSmeCmd *pCommand, 
                         eCsrRoamResult roamResult, tANI_BOOLEAN fSuccess)
 {
@@ -9059,7 +8702,6 @@
         VOS_ASSERT( sessionId == pCommand->sessionId );
 #endif
     }
-
     if(eCSR_ROAM_ROAMING_COMPLETION == roamStatus)
     {
         //if success, force roaming completion
@@ -9073,7 +8715,6 @@
     }
 }
 
-
 eHalStatus csrRoamLostLink( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 type, tSirSmeRsp *pSirMsg)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -9085,7 +8726,6 @@
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     //Only need to roam for infra station. In this case P2P client will roam as well
     tANI_BOOLEAN fToRoam = CSR_IS_INFRASTRUCTURE(&pSession->connectedProfile);
-
     pSession->fCancelRoaming = eANI_BOOLEAN_FALSE;
     if ( eWNI_SME_DISASSOC_IND == type )
     {
@@ -9121,7 +8761,6 @@
     {
         status = csrSendMBDeauthCnfMsg(pMac, pDeauthIndMsg);
     }
-
     if(!HAL_STATUS_SUCCESS(status))
     {
        //If fail to send confirmation to PE, not to trigger roaming
@@ -9135,16 +8774,16 @@
 #ifdef WLAN_SOFTAP_FEATURE
     if( eWNI_SME_DISASSOC_IND == type)
     {
-        //staMacAddr
-        palCopyMemory(pMac->hHdd, roamInfo.peerMac, pDisassocIndMsg->peerMacAddr, sizeof(tSirMacAddr));
-        roamInfo.staId = (tANI_U8)pDisassocIndMsg->staId;
-    }
+            //staMacAddr
+            palCopyMemory(pMac->hHdd, roamInfo.peerMac, pDisassocIndMsg->peerMacAddr, sizeof(tSirMacAddr));
+            roamInfo.staId = (tANI_U8)pDisassocIndMsg->staId;
+        }
     else if( eWNI_SME_DEAUTH_IND == type )
     {
-        //staMacAddr
-        palCopyMemory(pMac->hHdd, roamInfo.peerMac, pDeauthIndMsg->peerMacAddr, sizeof(tSirMacAddr));
-        roamInfo.staId = (tANI_U8)pDeauthIndMsg->staId;
-    }
+            //staMacAddr
+            palCopyMemory(pMac->hHdd, roamInfo.peerMac, pDeauthIndMsg->peerMacAddr, sizeof(tSirMacAddr));
+            roamInfo.staId = (tANI_U8)pDeauthIndMsg->staId;
+        }
 #endif
     smsLog(pMac, LOGW, FL("roamInfo.staId (%d)\n"), roamInfo.staId);
     csrRoamCallCallback(pMac, sessionId, &roamInfo, 0, eCSR_ROAM_LOSTLINK, result);
@@ -9171,7 +8810,7 @@
                 {
                    roamInfo.reasonCode = eCsrRoamReasonSmeIssuedForLostLink;
                 }
-                pRoamInfo = &roamInfo;
+                    pRoamInfo = &roamInfo;
                 pSession->roamingReason = ( eWNI_SME_DEAUTH_IND == type ) ? 
                         eCsrLostlinkRoamingDeauth : eCsrLostlinkRoamingDisassoc;
                 pSession->roamingStartTime = (tANI_TIMESTAMP)palGetTickCount(pMac->hHdd);
@@ -9189,7 +8828,6 @@
             fToRoam = eANI_BOOLEAN_FALSE;
         }
     }
-
     if(!fToRoam)
     {
        if( eWNI_SME_DISASSOC_IND == type)
@@ -9217,7 +8855,6 @@
     return (status);
 }
 
-
 eHalStatus csrRoamLostLinkAfterhandoffFailure( tpAniSirGlobal pMac,tANI_U32 sessionId)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -9225,7 +8862,6 @@
     tSmeCmd *pCommand = NULL;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     pSession->fCancelRoaming =  eANI_BOOLEAN_FALSE;
-
     //Only remove the connected BSS in infrastructure mode
     csrRoamRemoveConnectedBssFromScanCache(pMac, &pSession->connectedProfile);
     if(pMac->roam.configParam.nRoamingTime)
@@ -9249,7 +8885,6 @@
                  }
              }
           }
-
           smsLog( pMac, LOGW, "Lost link roaming started ...\n");
        }
     }
@@ -9261,12 +8896,10 @@
     
     return (status);
 }
-
 void csrRoamWmStatusChangeComplete( tpAniSirGlobal pMac )
 {
     tListElem *pEntry;
     tSmeCmd *pCommand;
-
     pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
     if ( pEntry )
     {
@@ -9294,29 +8927,24 @@
     {
         smsLog( pMac, LOGW, "CSR: WmStatusChange Completion called but NO commands are ACTIVE ...\n" );
     }
-
     smeProcessPendingQueue( pMac );
 }
 
-
 void csrRoamProcessWmStatusChangeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
     tSirSmeRsp *pSirSmeMsg;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pCommand->sessionId );
-
     switch ( pCommand->u.wmStatusChangeCmd.Type )
     {
         case eCsrDisassociated:
             pSirSmeMsg = (tSirSmeRsp *)&pCommand->u.wmStatusChangeCmd.u.DisassocIndMsg;
             status = csrRoamLostLink(pMac, pCommand->sessionId, eWNI_SME_DISASSOC_IND, pSirSmeMsg);
             break;
-
         case eCsrDeauthenticated:
             pSirSmeMsg = (tSirSmeRsp *)&pCommand->u.wmStatusChangeCmd.u.DeauthIndMsg;
             status = csrRoamLostLink(pMac, pCommand->sessionId, eWNI_SME_DEAUTH_IND, pSirSmeMsg);
             break;
-
         default:
             smsLog(pMac, LOGW, FL("gets an unknown command %d\n"), pCommand->u.wmStatusChangeCmd.Type);
             break;
@@ -9330,13 +8958,11 @@
             smsLog(pMac, LOGE, FL("  failed to issue stopBSS command\n"));
         }
     }
-
     // Lost Link just triggers a roaming sequence.  We can complte the Lost Link
     // command here since there is nothing else to do.
     csrRoamWmStatusChangeComplete( pMac );
 }
 
-
 //This function returns band and mode information.
 //The only tricky part is that if phyMode is set to 11abg, this function may return eCSR_CFG_DOT11_MODE_11B
 //instead of eCSR_CFG_DOT11_MODE_11G if everything is set to auto-pick.
@@ -9348,7 +8974,6 @@
                                                      tANI_U8 operationChn, eCsrBand *pBand )
 #endif
 {
-
 #ifdef WLAN_SOFTAP_FEATURE
     eCsrPhyMode phyModeIn = (eCsrPhyMode)pProfile->phyMode;
     eCsrCfgDot11Mode cfgDot11Mode = csrGetCfgDot11ModeFromCsrPhyMode(pProfile, phyModeIn, 
@@ -9369,7 +8994,6 @@
     if( (eCSR_CFG_DOT11_MODE_AUTO == pMac->roam.configParam.uCfgDot11Mode) ||
         (eCSR_CFG_DOT11_MODE_ABG == pMac->roam.configParam.uCfgDot11Mode) ||
         (eCSR_CFG_DOT11_MODE_AUTO == cfgDot11Mode) || (eCSR_CFG_DOT11_MODE_ABG == cfgDot11Mode) )
-
 #endif
     {
         switch( pMac->roam.configParam.uCfgDot11Mode )
@@ -9470,21 +9094,18 @@
      smsLog(pMac, LOGE, FL("  Switching to Dot11B mode \n"));
      cfgDot11Mode = eCSR_CFG_DOT11_MODE_11B;
    }
-
     return( cfgDot11Mode );
 }
 
-
 eHalStatus csrRoamIssueStopBss( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamSubState NewSubstate )
 {
     eHalStatus status;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
+    
     
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
     {
         vos_log_ibss_pkt_type *pIbssLog;
-
         WLAN_VOS_DIAG_LOG_ALLOC(pIbssLog, vos_log_ibss_pkt_type, LOG_WLAN_IBSS_C);
         if(pIbssLog)
         {
@@ -9493,7 +9114,6 @@
         }
     }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
-
     pSession->ibss_join_pending = FALSE;
     csrRoamStopIbssJoinTimer(pMac, sessionId );
     // Set the roaming substate to 'stop Bss request'...
@@ -9505,7 +9125,6 @@
     return (status);
 }
 
-
 //pNumChan is a caller allocated space with the sizeof pChannels
 eHalStatus csrGetCfgValidChannels(tpAniSirGlobal pMac, tANI_U8 *pChannels, tANI_U32 *pNumChan)
 {
@@ -9515,7 +9134,6 @@
                   pNumChan));
 }
 
-
 tANI_BOOLEAN csrRoamIsChannelValid( tpAniSirGlobal pMac, tANI_U8 channel )
 {
     tANI_BOOLEAN fValid = FALSE;
@@ -9537,12 +9155,10 @@
     return fValid;
 }
 
-
 tANI_BOOLEAN csrRoamIsValid40MhzChannel(tpAniSirGlobal pMac, tANI_U8 channel)
 {
     tANI_BOOLEAN fValid = eANI_BOOLEAN_FALSE;
     tANI_U8 i;
-
     for(i = 0; i < pMac->scan.base40MHzChannels.numChannels; i++)
     {
         if(channel == pMac->scan.base40MHzChannels.channelList[i])
@@ -9551,18 +9167,15 @@
             break;
         }
     }
-
     return (fValid);
 }
 
-
 //This function check and validate whether the NIC can do CB (40MHz)
-static tAniCBSecondaryMode csrGetCBModeFromIes(tpAniSirGlobal pMac, tANI_U8 primaryChn, tDot11fBeaconIEs *pIes)
+ static ePhyChanBondState csrGetCBModeFromIes(tpAniSirGlobal pMac, tANI_U8 primaryChn, tDot11fBeaconIEs *pIes)
 {
-    tAniCBSecondaryMode eRet = eANI_CB_SECONDARY_NONE;
+    ePhyChanBondState eRet = PHY_SINGLE_CHANNEL_CENTERED;
     tANI_U8 centerChn;
     tANI_U32 ChannelBondingMode;
-
     if(CSR_IS_CHANNEL_24GHZ(primaryChn))
     {
         ChannelBondingMode = pMac->roam.configParam.channelBondingMode24GHz;
@@ -9578,39 +9191,44 @@
         {
             if(pIes->HTInfo.present)
             {
-                if(PHY_DOUBLE_CHANNEL_LOW_PRIMARY == pIes->HTInfo.secondaryChannelOffset)
-                {
-                    eRet = eANI_CB_SECONDARY_UP;
-                    centerChn = primaryChn + CSR_CB_CENTER_CHANNEL_OFFSET;
-                }
-                else if(PHY_DOUBLE_CHANNEL_HIGH_PRIMARY == pIes->HTInfo.secondaryChannelOffset)
-                {
-                    eRet = eANI_CB_SECONDARY_DOWN;
-                    centerChn = primaryChn - CSR_CB_CENTER_CHANNEL_OFFSET;
-                }
+                /* This is called during INFRA STA/CLIENT and should use the merged value of 
+                 * supported channel width and recommended tx width as per standard
+                 */
+                smsLog(pMac, LOG1, "scws %u rtws %u sco %u\n",
+                    pIes->HTCaps.supportedChannelWidthSet,
+                    pIes->HTInfo.recommendedTxWidthSet,
+                    pIes->HTInfo.secondaryChannelOffset);
+
+                if (pIes->HTInfo.recommendedTxWidthSet == eHT_CHANNEL_WIDTH_40MHZ)
+                    eRet = (ePhyChanBondState)pIes->HTInfo.secondaryChannelOffset;
                 else
-                {
-                    //PHY_SINGLE_CHANNEL_CENTERED
-                    centerChn = primaryChn;
-                    eRet = eANI_CB_SECONDARY_NONE;
+                    eRet = PHY_SINGLE_CHANNEL_CENTERED;
+                switch (eRet) {
+                    case PHY_DOUBLE_CHANNEL_LOW_PRIMARY:
+                        centerChn = primaryChn + CSR_CB_CENTER_CHANNEL_OFFSET;
+                        break;
+                    case PHY_DOUBLE_CHANNEL_HIGH_PRIMARY:
+                        centerChn = primaryChn - CSR_CB_CENTER_CHANNEL_OFFSET;
+                        break;
+                    case PHY_SINGLE_CHANNEL_CENTERED:
+                    default:
+                        centerChn = primaryChn;
+                        break;
                 }
-                if((eANI_CB_SECONDARY_NONE != eRet) && !csrRoamIsValid40MhzChannel(pMac, centerChn))
+                if((PHY_SINGLE_CHANNEL_CENTERED != eRet) && !csrRoamIsValid40MhzChannel(pMac, centerChn))
                 {
-                    smsLog(pMac, LOGW, "  Invalid center channel (%d), disable 40MHz mode\n", centerChn);
-                    eRet = eANI_CB_SECONDARY_NONE;
+                    smsLog(pMac, LOGE, "  Invalid center channel (%d), disable 40MHz mode\n", centerChn);
+                    //eRet = PHY_SINGLE_CHANNEL_CENTERED;
                 }
             }
         }
     }
-
     return eRet;
 }
-
 tANI_BOOLEAN csrIsEncryptionInList( tpAniSirGlobal pMac, tCsrEncryptionList *pCipherList, eCsrEncryptionType encryptionType )
 {
     tANI_BOOLEAN fFound = FALSE;
     tANI_U32 idx;
-
     for( idx = 0; idx < pCipherList->numEntries; idx++ )
     {
         if( pCipherList->encryptionType[idx] == encryptionType )
@@ -9619,15 +9237,12 @@
             break;
         }
     }
-
     return fFound;
 }
-
 tANI_BOOLEAN csrIsAuthInList( tpAniSirGlobal pMac, tCsrAuthList *pAuthList, eCsrAuthType authType )
 {
     tANI_BOOLEAN fFound = FALSE;
     tANI_U32 idx;
-
     for( idx = 0; idx < pAuthList->numEntries; idx++ )
     {
         if( pAuthList->authType[idx] == authType )
@@ -9636,10 +9251,8 @@
             break;
         }
     }
-
     return fFound;
 }
-
 tANI_BOOLEAN csrIsSameProfile(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pProfile1, tCsrRoamProfile *pProfile2)
 {
     tANI_BOOLEAN fCheck = eANI_BOOLEAN_FALSE;
@@ -9700,12 +9313,10 @@
     return (fCheck);
 }
 
-
 tANI_BOOLEAN csrRoamIsSameProfileKeys(tpAniSirGlobal pMac, tCsrRoamConnectedProfile *pConnProfile, tCsrRoamProfile *pProfile2)
 {
     tANI_BOOLEAN fCheck = eANI_BOOLEAN_FALSE;
     int i;
-
     do
     {
         //Only check for static WEP
@@ -9731,14 +9342,11 @@
             fCheck = eANI_BOOLEAN_TRUE;
         }
     }while(0);
-
     return (fCheck);
 }
 
-
 //IBSS
 
-
 tANI_U8 csrRoamGetIbssStartChannelNumber50( tpAniSirGlobal pMac )
 {
     tANI_U8 channel = 0;     
@@ -9768,7 +9376,6 @@
                 }
             }
         }
-
         // this is rare, but if it does happen, we find anyone in 11a bandwidth and return the first 11a channel found!
         if (!fFound)    
         {
@@ -9786,7 +9393,6 @@
     return( channel );    
 }
 
-
 tANI_U8 csrRoamGetIbssStartChannelNumber24( tpAniSirGlobal pMac )
 {
     tANI_U8 channel = 1;
@@ -9822,7 +9428,6 @@
     return( channel );    
 }
 
-
 static void csrRoamGetBssStartParms( tpAniSirGlobal pMac, tCsrRoamProfile *pProfile, 
                                       tCsrRoamStartBssParams *pParam )
 {
@@ -9856,21 +9461,17 @@
         VOS_ASSERT(0);
     }
 #endif
-
     switch( cfgDot11Mode )
     {
         case eCSR_CFG_DOT11_MODE_11G:
             nwType = eSIR_11G_NW_TYPE;
             break;
-
         case eCSR_CFG_DOT11_MODE_11B:
             nwType = eSIR_11B_NW_TYPE;
             break;   
-
         case eCSR_CFG_DOT11_MODE_11A:
             nwType = eSIR_11A_NW_TYPE;
             break;
-
         default:
         case eCSR_CFG_DOT11_MODE_11N:
         case eCSR_CFG_DOT11_MODE_TAURUS:
@@ -9936,7 +9537,6 @@
             pParam->operationalRateSet.rate[1] = SIR_MAC_RATE_2 | CSR_DOT11_BASIC_RATE_MASK;
             pParam->operationalRateSet.rate[2] = SIR_MAC_RATE_5_5 | CSR_DOT11_BASIC_RATE_MASK;
             pParam->operationalRateSet.rate[3] = SIR_MAC_RATE_11 | CSR_DOT11_BASIC_RATE_MASK;
-
             if ( eCSR_OPERATING_CHANNEL_ANY == operationChannel ) 
             {
                 channel = csrRoamGetIbssStartChannelNumber24( pMac );
@@ -9947,7 +9547,6 @@
             }
             
             break;     
-
         case eSIR_11G_NW_TYPE:
 #ifdef WLAN_FEATURE_P2P
             /* For P2P Client and P2P GO, disable 11b rates */ 
@@ -9970,14 +9569,12 @@
 #endif            
             {
             pParam->operationalRateSet.numRates = 4;
-
             pParam->operationalRateSet.rate[0] = SIR_MAC_RATE_1 | CSR_DOT11_BASIC_RATE_MASK;
             pParam->operationalRateSet.rate[1] = SIR_MAC_RATE_2 | CSR_DOT11_BASIC_RATE_MASK;
             pParam->operationalRateSet.rate[2] = SIR_MAC_RATE_5_5 | CSR_DOT11_BASIC_RATE_MASK;
             pParam->operationalRateSet.rate[3] = SIR_MAC_RATE_11 | CSR_DOT11_BASIC_RATE_MASK;
                
             pParam->extendedRateSet.numRates = 8;
-
                         pParam->extendedRateSet.rate[0] = SIR_MAC_RATE_6;
             pParam->extendedRateSet.rate[1] = SIR_MAC_RATE_9;
             pParam->extendedRateSet.rate[2] = SIR_MAC_RATE_12;
@@ -10003,7 +9600,6 @@
     pParam->sirNwType = nwType;
 }
 
-
 static void csrRoamGetBssStartParmsFromBssDesc( tpAniSirGlobal pMac, tSirBssDescription *pBssDesc, 
                                                  tDot11fBeaconIEs *pIes, tCsrRoamStartBssParams *pParam )
 {
@@ -10011,7 +9607,7 @@
     if( pParam )
     {
         pParam->sirNwType = pBssDesc->nwType;
-        pParam->cbMode = eANI_CB_SECONDARY_NONE;
+        pParam->cbMode = PHY_SINGLE_CHANNEL_CENTERED;
         pParam->operationChn = pBssDesc->channelId;
         palCopyMemory( pMac->hHdd, &pParam->bssid, pBssDesc->bssId, sizeof(tCsrBssid) );
     
@@ -10035,7 +9631,6 @@
                 palCopyMemory(pMac->hHdd, pParam->ssId.ssId, pIes->SSID.ssid, pParam->ssId.length);
             }
             pParam->cbMode = csrGetCBModeFromIes(pMac, pParam->operationChn, pIes);
-
         }
         else
         {
@@ -10045,7 +9640,6 @@
     }
 }
 
-
 static void csrRoamDetermineMaxRateForAdHoc( tpAniSirGlobal pMac, tSirMacRateSet *pSirRateSet )
 {
     tANI_U8 MaxRate = 0;
@@ -10065,7 +9659,6 @@
     return;
 }
 
-
 //this function finds a valid secondary channel for channel bonding with "channel".
 //Param: channel -- primary channel, caller must validate it
 //       cbChoice -- CB directory
@@ -10073,7 +9666,6 @@
 static tANI_U8 csrRoamGetSecondaryChannel(tpAniSirGlobal pMac, tANI_U8 channel, eCsrCBChoice cbChoice)
 {
     tANI_U8 chnUp = 0, chnDown = 0, chnRet = 0;
-
     switch (cbChoice)
     {
     case eCSR_CB_OFF:
@@ -10095,7 +9687,6 @@
         chnDown = channel - CSR_CB_CHANNEL_GAP;
         break;
     }
-
     //if CB_UP or auto, try channel up first
     if(chnUp && CSR_IS_SAME_BAND_CHANNELS(chnUp, channel) && csrRoamIsChannelValid(pMac, chnUp))
     {
@@ -10114,26 +9705,21 @@
             chnRet = chnDown;
         }
     }
-
     return chnRet;
 }
 
-
 eHalStatus csrRoamIssueStartBss( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamStartBssParams *pParam, 
                                  tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc, tANI_U32 roamId )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     eCsrBand eBand;
-
     // Set the roaming substate to 'Start BSS attempt'...
     csrRoamSubstateChange( pMac, eCSR_ROAM_SUBSTATE_START_BSS_REQ, sessionId );
-
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
     //Need to figure out whether we need to log WDS???
     if( CSR_IS_IBSS( pProfile ) )
     {
         vos_log_ibss_pkt_type *pIbssLog;
-
         WLAN_VOS_DIAG_LOG_ALLOC(pIbssLog, vos_log_ibss_pkt_type, LOG_WLAN_IBSS_C);
         if(pIbssLog)
         {
@@ -10165,7 +9751,6 @@
     pParam->nRSNIELength = (tANI_U16)pProfile->nRSNReqIELength;
     pParam->pRSNIE = pProfile->pRSNReqIE;
 
-
 #ifdef WLAN_SOFTAP_FEATURE
     pParam->privacy           = pProfile->privacy;
     pParam->fwdWPSPBCProbeReq = pProfile->fwdWPSPBCProbeReq;   
@@ -10181,14 +9766,12 @@
             pParam->operationChn = INFRA_AP_DEFAULT_CHANNEL;                   
         }  
     }
-
     pParam->protEnabled     = pProfile->protEnabled;
     pParam->obssProtEnabled = pProfile->obssProtEnabled;
     pParam->ht_protection   = pProfile->cfg_protection;
     pParam->wps_state       = pProfile->wps_state;
 #endif
     
-
 #ifdef WLAN_SOFTAP_FEATURE
     pParam->uCfgDot11Mode = csrRoamGetPhyModeBandForBss(pMac, pProfile, pParam->operationChn /* pProfile->operationChannel*/, 
                                         &eBand);
@@ -10199,19 +9782,16 @@
     pParam->bssPersona = pProfile->csrPersona;
     // When starting an IBSS, start on the channel from the Profile.
     status = csrSendMBStartBssReqMsg( pMac, sessionId, pProfile->BSSType, pParam, pBssDesc );
-
     return (status);
 }
 
-
 static void csrRoamPrepareBssParams(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
-                                     tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes)
+                                     tSirBssDescription *pBssDesc, tBssConfigParam *pBssConfig, tDot11fBeaconIEs *pIes)
 {
     tANI_U8 Channel, SecondChn;
-    tAniCBSecondaryMode cbMode = eANI_CB_SECONDARY_NONE;
+    ePhyChanBondState cbMode = PHY_SINGLE_CHANNEL_CENTERED;
     eCsrCBChoice cbChoice;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if( pBssDesc )
     {
         csrRoamGetBssStartParmsFromBssDesc( pMac, pBssDesc, pIes, &pSession->bssParams );
@@ -10226,7 +9806,6 @@
     else
     {
         csrRoamGetBssStartParms(pMac, pProfile, &pSession->bssParams);
-
         //Use the first SSID
         if(pProfile->SSIDs.numOfSSIDs)
         {
@@ -10248,7 +9827,6 @@
         }
     }
     Channel = pSession->bssParams.operationChn;
-
     //Set operating channel in pProfile which will be used 
     //in csrRoamSetBssConfigCfg() to determine channel bonding
     //mode and will be configured in CFG later 
@@ -10262,6 +9840,20 @@
     {
   
         csrRoamDetermineMaxRateForAdHoc( pMac, &pSession->bssParams.operationalRateSet );
+        if (CSR_IS_INFRA_AP(pProfile))
+        {
+            if(CSR_IS_CHANNEL_24GHZ(Channel))
+            {
+                cbMode = pMac->roam.configParam.channelBondingMode24GHz;
+            }
+            else
+            {
+                cbMode = pMac->roam.configParam.channelBondingMode5GHz;
+            }
+            smsLog(pMac, LOG1, "##softap cbMode %d\n", cbMode);
+            pBssConfig->cbMode = cbMode;
+            pSession->bssParams.cbMode = cbMode;
+        }
 
         if( CSR_IS_START_IBSS( pProfile ) )
         {
@@ -10286,7 +9878,6 @@
             }
             else {
                 tANI_U32 ChannelBondingMode;
-
                 if(CSR_IS_CHANNEL_24GHZ(Channel))
                 {
                     ChannelBondingMode = pMac->roam.configParam.channelBondingMode24GHz;
@@ -10295,38 +9886,34 @@
                 {
                     ChannelBondingMode = pMac->roam.configParam.channelBondingMode5GHz;
                 }
-
                 //now we have a valid channel
                 if(WNI_CFG_CHANNEL_BONDING_MODE_DISABLE != ChannelBondingMode)
                 {
                     //let's pick a secondard channel
                     SecondChn = csrRoamGetSecondaryChannel(pMac, Channel, cbChoice);
-
                     if(SecondChn > Channel)
                     {
-                        cbMode = eANI_CB_SECONDARY_UP;
+                        cbMode = PHY_DOUBLE_CHANNEL_LOW_PRIMARY;
                     }
                     else if(SecondChn && SecondChn < Channel)
                     {
-                        cbMode =eANI_CB_SECONDARY_DOWN;
+                        cbMode = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY;
                     }
                     else
                     {
-                        cbMode = eANI_CB_SECONDARY_NONE;
+                        cbMode = PHY_SINGLE_CHANNEL_CENTERED;
                     }
                     pSession->bssParams.cbMode = cbMode;
                 }
                 else
                 {
-                    pSession->bssParams.cbMode = eANI_CB_SECONDARY_NONE;
+                    pSession->bssParams.cbMode = PHY_SINGLE_CHANNEL_CENTERED;
                 }
             }
         }
     }
 }
 
-
-
 static eHalStatus csrRoamStartIbss( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, 
                                     tANI_BOOLEAN *pfSameIbss )
 {
@@ -10367,7 +9954,7 @@
                 //save dotMode
                 pMac->roam.roamSession[sessionId].bssParams.uCfgDot11Mode = pBssConfig->uCfgDot11Mode;
                 //Prepare some more parameters for this IBSS
-                csrRoamPrepareBssParams(pMac, sessionId, pProfile, NULL, NULL);
+                csrRoamPrepareBssParams(pMac, sessionId, pProfile, NULL, pBssConfig, NULL);
                 status = csrRoamSetBssConfigCfg(pMac, sessionId, pProfile, NULL, pBssConfig, NULL);
             }
             
@@ -10382,12 +9969,10 @@
     return( status );
 }
 
-
 static void csrRoamUpdateConnectedProfileFromNewBss( tpAniSirGlobal pMac, tANI_U32 sessionId, 
                                                      tSirSmeNewBssInfo *pNewBss )
 {
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if( pNewBss )
     {
         // Set the operating channel.
@@ -10396,18 +9981,15 @@
         palCopyMemory( pMac->hHdd, &pSession->connectedProfile.bssid, 
                       &(pNewBss->bssId), sizeof( tCsrBssid ) );    
     }
-
     return;
 }
 
-
 #ifdef FEATURE_WLAN_WAPI
 eHalStatus csrRoamSetBKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache,
                                  tANI_U32 numItems )
 {
    eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
    tCsrRoamSession *pSession;
-
    if(!CSR_IS_SESSION_VALID( pMac, sessionId ))
    {
        smsLog(pMac, LOGE, FL("  Invalid session ID\n"));
@@ -10426,22 +10008,18 @@
                            sizeof(tBkidCacheInfo) * numItems );
        }
    }
-
    return (status);
 }
-
 eHalStatus csrRoamGetBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum,
                                 tBkidCacheInfo *pBkidCache)
 {
    eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
    tCsrRoamSession *pSession;
-
    if(!CSR_IS_SESSION_VALID( pMac, sessionId ))
    {
        smsLog(pMac, LOGE, FL("  Invalid session ID\n"));
        return status;
    }
-
    pSession = CSR_GET_SESSION( pMac, sessionId );
    if(pNum && pBkidCache)
    {
@@ -10464,24 +10042,18 @@
            status = eHAL_STATUS_SUCCESS;
        }
    }
-
    return (status);
-
 }
-
 tANI_U32 csrRoamGetNumBKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
    return (pMac->roam.roamSession[sessionId].NumBkidCache);
-
 }
 #endif /* FEATURE_WLAN_WAPI */
-
 eHalStatus csrRoamSetPMKIDCache( tpAniSirGlobal pMac, tANI_U32 sessionId,
                                  tPmkidCacheInfo *pPMKIDCache, tANI_U32 numItems )
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     smsLog(pMac, LOGW, "csrRoamSetPMKIDCache called, numItems = %d\n", numItems);
     if(numItems <= CSR_MAX_PMKID_ALLOWED)
     {
@@ -10500,7 +10072,6 @@
             WLAN_VOS_DIAG_EVENT_REPORT(&secEvent, EVENT_WLAN_SECURITY);
         }
 #endif//FEATURE_WLAN_DIAG_SUPPORT_CSR
-
         status = eHAL_STATUS_SUCCESS;
         //numItems may be 0 to clear the cache
         pSession->NumPmkidCache = (tANI_U16)numItems;
@@ -10510,22 +10081,18 @@
                             sizeof(tPmkidCacheInfo) * numItems );
         }
     }
-
     return (status);
 }
 
-
 tANI_U32 csrRoamGetNumPMKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     return (pMac->roam.roamSession[sessionId].NumPmkidCache);
 }
 
-
 eHalStatus csrRoamGetPMKIDCache(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pNum, tPmkidCacheInfo *pPmkidCache)
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if(pNum && pPmkidCache)
     {
         if(pSession->NumPmkidCache == 0)
@@ -10547,17 +10114,14 @@
             status = eHAL_STATUS_SUCCESS;
         }
     }
-
     return (status);
 }
 
-
 eHalStatus csrRoamGetWpaRsnReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
     tANI_U32 len;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if(pLen)
     {
         len = *pLen;
@@ -10570,17 +10134,14 @@
             }
         }
     }
-
     return (status);
 }
 
-
 eHalStatus csrRoamGetWpaRsnRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
     tANI_U32 len;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if(pLen)
     {
         len = *pLen;
@@ -10593,10 +10154,8 @@
             }
         }
     }
-
     return (status);
 }
-
 #ifdef FEATURE_WLAN_WAPI
 eHalStatus csrRoamGetWapiReqIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
 {
@@ -10615,16 +10174,13 @@
             }
         }
     }
-
     return (status);
 }
-
 eHalStatus csrRoamGetWapiRspIE(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 *pLen, tANI_U8 *pBuf)
 {
     eHalStatus status = eHAL_STATUS_INVALID_PARAMETER;
     tANI_U32 len;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if(pLen)
     {
         len = *pLen;
@@ -10637,26 +10193,21 @@
             }
         }
     }
-
     return (status);
 }
 #endif /* FEATURE_WLAN_WAPI */
-
 eRoamCmdStatus csrGetRoamCompleteStatus(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     eRoamCmdStatus retStatus = eCSR_ROAM_CONNECT_COMPLETION;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     if(CSR_IS_ROAMING(pSession))
     {
         retStatus = eCSR_ROAM_ROAMING_COMPLETION;
         pSession->fRoaming = eANI_BOOLEAN_FALSE;
     }
-
     return (retStatus);
 }
 
-
 //This function remove the connected BSS from te cached scan result
 eHalStatus csrRoamRemoveConnectedBssFromScanCache(tpAniSirGlobal pMac,
                                                   tCsrRoamConnectedProfile *pConnProfile)
@@ -10667,7 +10218,6 @@
     tCsrScanResult *pResult;
         tDot11fBeaconIEs *pIes;
     tANI_BOOLEAN fMatch;
-
     if(!(csrIsMacAddressZero(pMac, &pConnProfile->bssid) ||
             csrIsMacAddressBroadcast(pMac, &pConnProfile->bssid)))
     {
@@ -10701,7 +10251,6 @@
             pScanFilter->bWPSAssociation = eANI_BOOLEAN_FALSE;
             pScanFilter->countryCode[0] = 0;
             pScanFilter->phyMode = eCSR_DOT11_MODE_TAURUS;
-
             csrLLLock(&pMac->scan.scanResultList);
             pEntry = csrLLPeekHead( &pMac->scan.scanResultList, LL_ACCESS_NOLOCK );
             while( pEntry ) 
@@ -10739,15 +10288,11 @@
     return (status);
 }
 
-
-
 //BT-AMP
-
 eHalStatus csrIsBTAMPAllowed( tpAniSirGlobal pMac, tANI_U32 chnId )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tANI_U32 sessionId;
-
     for( sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++ )
     {
         if( CSR_IS_SESSION_VALID( pMac, sessionId ) )
@@ -10772,17 +10317,14 @@
             }
         }
     }
-
     return ( status );
 }
 
-
 static eHalStatus csrRoamStartWds( tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrRoamProfile *pProfile, tSirBssDescription *pBssDesc )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     tBssConfigParam bssConfig;
-
     if ( csrIsConnStateIbss( pMac, sessionId ) ) 
     { 
         status = csrRoamIssueStopBss( pMac, sessionId, eCSR_ROAM_SUBSTATE_DISCONNECT_CONTINUE_ROAMING );
@@ -10818,9 +10360,8 @@
                 palZeroMemory(pMac->hHdd, pSession->pCurRoamProfile, sizeof(tCsrRoamProfile));
                 csrRoamCopyProfile(pMac, pSession->pCurRoamProfile, pProfile);
             }
-
             //Prepare some more parameters for this WDS
-            csrRoamPrepareBssParams(pMac, sessionId, pProfile, NULL, NULL);
+            csrRoamPrepareBssParams(pMac, sessionId, pProfile, NULL, &bssConfig, NULL);
             status = csrRoamSetBssConfigCfg(pMac, sessionId, pProfile, NULL, &bssConfig, NULL);
         }
     }
@@ -10828,10 +10369,8 @@
     return( status );
 }
 
-
 ////////////////////Mail box
 
-
 //pBuf is caller allocated memory point to &(tSirSmeJoinReq->rsnIE.rsnIEdata[ 0 ]) + pMsg->rsnIE.length;
 //or &(tSirSmeReassocReq->rsnIE.rsnIEdata[ 0 ]) + pMsg->rsnIE.length;
 static void csrPrepareJoinReassocReqBuffer( tpAniSirGlobal pMac, 
@@ -10844,16 +10383,13 @@
     tANI_BOOLEAN found = FALSE;
     tANI_U32 size = 0;
         tANI_U16 i;
-
     // plug in neighborhood occupancy info (i.e. BSSes on primary or secondary channels)
     *pBuf++ = (tANI_U8)FALSE;  //tAniTitanCBNeighborInfo->cbBssFoundPri
     *pBuf++ = (tANI_U8)FALSE;  //tAniTitanCBNeighborInfo->cbBssFoundSecDown
     *pBuf++ = (tANI_U8)FALSE;  //tAniTitanCBNeighborInfo->cbBssFoundSecUp
-
     // 802.11h
     //We can do this because it is in HOST CPU order for now.
     pAP_capabilityInfo = (tSirMacCapabilityInfo *)&pBssDescription->capabilityInfo;
-
         //tell the target AP my 11H capability only if both AP and STA support 11H and the channel being used is 11a
         if ( csrIs11hSupported( pMac ) && pAP_capabilityInfo->spectrumMgt && eSIR_11A_NW_TYPE == pBssDescription->nwType )   
         {  
@@ -10867,13 +10403,11 @@
     pBuf += sizeof(tAniBool);
     *pBuf++ = MIN_STA_PWR_CAP_DBM; // it is for pMsg->powerCap.minTxPower = 0;
         found = csrSearchChannelListForTxPower(pMac, pBssDescription, &channelGroup);
-
     // This is required for 11k test VoWiFi Ent: Test 2.
     // We need the power capabilities for Assoc Req. 
     // This macro is provided by the halPhyCfg.h. We pick our
     // max and min capability by the halPhy provided macros
     *pBuf++ = MAX_STA_PWR_CAP_DBM;
-
     size = sizeof(pMac->roam.validChannelList);
     if(HAL_STATUS_SUCCESS(csrGetCfgValidChannels(pMac, (tANI_U8 *)pMac->roam.validChannelList, &size)))
     { 
@@ -10889,7 +10423,6 @@
         smsLog(pMac, LOGE, FL("can not find any valid channel\n"));
         *pBuf++ = 0;  //tSirSupChnl->numChnl
     }                                                                                                                     
-
     //Check whether it is ok to enter UAPSD
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
     if( btcIsReadyForUapsd(pMac) )
@@ -10905,15 +10438,12 @@
     }
 #endif /* WLAN_MDM_CODE_REDUCTION_OPT*/
   
-
     // move the entire BssDescription into the join request.
     palCopyMemory( pMac->hHdd, pBuf, pBssDescription, 
                     pBssDescription->length + sizeof( pBssDescription->length ) );
-
     pBuf += pBssDescription->length + sizeof( pBssDescription->length );   // update to new location
 }
 
-
 /* 
   * The communication between HDD and LIM is thru mailbox (MB).
   * Both sides will access the data structure "tSirSmeJoinReq".
@@ -10934,7 +10464,6 @@
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     tANI_U32 dwTmp;
     tANI_U8 wpaRsnIE[DOT11F_IE_RSN_MAX_LEN];    //RSN MAX is bigger than WPA MAX
-
     do {
         pSession->joinFailStatusCode.statusCode = eSIR_SME_SUCCESS;
         pSession->joinFailStatusCode.reasonCode = 0;
@@ -10949,23 +10478,19 @@
         msgLen = sizeof( tSirSmeJoinReq ) - sizeof( *pBssDescription ) + 
             pBssDescription->length + sizeof( pBssDescription->length ) +
             sizeof( tCsrWpaIe ) + sizeof( tCsrWpaAuthIe ) + sizeof( tANI_U16 ); // add in the size of the WPA IE that we may build.
-
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
         if ( !HAL_STATUS_SUCCESS(status) ) break;
         palZeroMemory(pMac->hHdd, pMsg, msgLen);
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_JOIN_REQ);
         pMsg->length = pal_cpu_to_be16(msgLen);
         pBuf = &pMsg->sessionId;
-
         // sessionId
         *pBuf = (tANI_U8)sessionId;
         pBuf++;
-
         // transactionId
         *pBuf = 0;
         *( pBuf + 1 ) = 0;
         pBuf += sizeof(tANI_U16);
-
         // ssId
         if( pIes->SSID.present && pIes->SSID.num_ssid )
         {
@@ -10980,7 +10505,6 @@
             *pBuf = 0;
             pBuf++;
         }
-
         // selfMacAddr
         palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, &pSession->selfMacAddr, sizeof(tSirMacAddr) );
         pBuf += sizeof(tSirMacAddr);
@@ -10992,23 +10516,24 @@
         // dot11mode
         *pBuf = (tANI_U8)csrTranslateToWNICfgDot11Mode( pMac, pSession->bssParams.uCfgDot11Mode );
         pBuf++;
-
         //Persona
         *pBuf = (tANI_U8)pProfile->csrPersona;
         pBuf++;
+        //CBMode
+        *pBuf = (tANI_U8)pSession->bssParams.cbMode;
+        pBuf++;
 
         VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
-                  FL("CSR PERSONA=%d"), pProfile->csrPersona);
-        
+                  FL("CSR PERSONA=%d CSR CbMode %d"), pProfile->csrPersona, pSession->bssParams.cbMode);
+
         // uapsdPerAcBitmask
         *pBuf = pProfile->uapsd_mask;
         pBuf++;
 
-
+    
     
 #if (WNI_POLARIS_FW_PACKAGE == ADVANCED)        
 #endif /*(WNI_POLARIS_FW_PACKAGE == ADVANCED)*/
-
         status = csrGetRateSet(pMac, pProfile, (eCsrPhyMode)pProfile->phyMode, pBssDescription, pIes, &OpRateSet, &ExRateSet);
         if (HAL_STATUS_SUCCESS(status) ) 
         {
@@ -11030,7 +10555,6 @@
             *pBuf++ = 0;
             *pBuf++ = 0;
         }
-
         // rsnIE
         if ( csrIsProfileWpa( pProfile ) )
         {
@@ -11052,7 +10576,6 @@
                     (tCsrWapiIe *)( wpaRsnIE ) );
         }
 #endif /* FEATURE_WLAN_WAPI */
-
         else
         {
             ieLen = 0;
@@ -11130,7 +10653,6 @@
             *(pBuf + 1) = 0;
             pBuf += 2;
         }
-
 #ifdef FEATURE_WLAN_CCX
         // Never include the cckmIE in an Join Request
         //length is two bytes
@@ -11138,12 +10660,10 @@
         *(pBuf + 1) = 0;
         pBuf += 2;
 #endif 
-
         // addIEScan
         if(pProfile->nAddIEScanLength && pProfile->pAddIEScan)
         {
             ieLen = pProfile->nAddIEScanLength;
-
             if(ieLen > pSession->nAddIEScanLength)
             {
                 if(pSession->pAddIEScan && pSession->nAddIEScanLength)
@@ -11175,12 +10695,10 @@
             *(pBuf + 1) = 0;
             pBuf += 2;
         }
-
         // addIEAssoc
         if(pProfile->nAddIEAssocLength && pProfile->pAddIEAssoc)
         {
             ieLen = pProfile->nAddIEAssocLength;
-
             if(ieLen > pSession->nAddIEAssocLength)
             {
                 if(pSession->pAddIEAssoc && pSession->nAddIEAssocLength)
@@ -11212,15 +10730,12 @@
             *(pBuf + 1) = 0;
             pBuf += 2;
         }
-
         dwTmp = pal_cpu_to_be32( csrTranslateEncryptTypeToEdType( pProfile->negotiatedUCEncryptionType) );
         palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tANI_U32) );
         pBuf += sizeof(tANI_U32);        
-
         dwTmp = pal_cpu_to_be32( csrTranslateEncryptTypeToEdType( pProfile->negotiatedMCEncryptionType) );
         palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tANI_U32) );
         pBuf += sizeof(tANI_U32);        
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
         if (csrIsProfile11r( pProfile ) )
         {
@@ -11237,7 +10752,6 @@
             pBuf += sizeof(tAniBool);        
         }
 #endif
-
 #ifdef FEATURE_WLAN_CCX
         /* A profile can not be both CCX and 11R. But an 802.11R AP
          * may be advertising support for CCX as well. So if we are 
@@ -11276,7 +10790,6 @@
             pBuf += sizeof(tCCXTspecInfo);
         }
 #endif
-
 #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
         // Fill in isFastTransitionEnabled
         if (pMac->roam.configParam.isFastTransitionEnabled
@@ -11296,7 +10809,6 @@
             pBuf += sizeof(tAniBool);        
         }
 #endif
-
 #ifdef FEATURE_WLAN_LFR
         if(csrRoamIsFastRoamEnabled(pMac))
         {
@@ -11315,7 +10827,6 @@
         //BssDesc
         csrPrepareJoinReassocReqBuffer( pMac, pBssDescription, pBuf, 
                 (tANI_U8)pProfile->uapsd_mask);
-
         status = palSendMBMessage(pMac->hHdd, pMsg );    
         if(!HAL_STATUS_SUCCESS(status)) 
         {
@@ -11332,7 +10843,6 @@
     return( status );
 }
 
-
 eHalStatus csrSendSmeReassocReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirBssDescription *pBssDescription, 
                                     tDot11fBeaconIEs *pIes, tCsrRoamProfile *pProfile )
 {
@@ -11346,14 +10856,12 @@
     tSirMacRateSet ExRateSet;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     tANI_U8 wpaRsnIE[DOT11F_IE_RSN_MAX_LEN];    //RSN MAX is bigger than WPA MAX
-
     /* To satisfy klockworks */
     if (pBssDescription == NULL)
     {
         smsLog(pMac, LOGE, FL(" pBssDescription is NULL\n"));
         return eHAL_STATUS_FAILURE;
     }
-
     do {
         // There are a number of variable length fields to consider.  First, the tSirSmeJoinReq
         // includes a single bssDescription.   bssDescription includes a single tANI_U32 for the 
@@ -11400,19 +10908,20 @@
         // dot11mode
         *pBuf = (tANI_U8)csrTranslateToWNICfgDot11Mode( pMac, pSession->bssParams.uCfgDot11Mode );
         pBuf++;
-
         //Persona
         *pBuf = (tANI_U8)pProfile->csrPersona;
         pBuf++;
+        //CBMode
+        *pBuf = (tANI_U8)pSession->bssParams.cbMode;
+        pBuf++;
 
-        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, FL("CSR PERSONA=%d\n"), pProfile->csrPersona);
-        
+        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
+            FL("CSR PERSONA=%d CSR CBMode=%u\n"), pProfile->csrPersona, pSession->bssParams.cbMode);
+
         // uapsdPerAcBitmask
         *pBuf = pProfile->uapsd_mask;
         pBuf++;
 
-
-
         status = csrGetRateSet(pMac, pProfile, (eCsrPhyMode)pProfile->phyMode, 
                         pBssDescription, pIes, &OpRateSet, &ExRateSet);
         if (HAL_STATUS_SUCCESS(status) ) 
@@ -11439,7 +10948,6 @@
             *pBuf++ = 0;
             *pBuf++ = 0;
         }
-
                 // rsnIE
         if ( csrIsProfileWpa( pProfile ) )
                 {
@@ -11473,7 +10981,6 @@
                  smsLog(pMac, LOGE, FL(" WPA RSN IE length :%d is more than DOT11F_IE_RSN_MAX_LEN, resetting to %d\n"), ieLen, DOT11F_IE_RSN_MAX_LEN);
                  ieLen = DOT11F_IE_RSN_MAX_LEN;
              }
-
             //Check whether we need to allocate more memory
             if(ieLen > pSession->nWpaRsnReqIeLength)
             {
@@ -11506,7 +11013,6 @@
             *(pBuf + 1) = 0;
             pBuf += 2;
                 }
-
 #ifdef FEATURE_WLAN_CCX
         // cckmIE
         if( csrIsProfileCCX( pProfile ) )
@@ -11543,12 +11049,10 @@
             pBuf += 2;
         }
 #endif /* FEATURE_WLAN_CCX */
-
         // addIEScan
         if(pProfile->nAddIEScanLength && pProfile->pAddIEScan)
         {
             ieLen = pProfile->nAddIEScanLength;
-
             if(ieLen > pSession->nAddIEScanLength)
             {
                 if(pSession->pAddIEScan && pSession->nAddIEScanLength)
@@ -11580,12 +11084,10 @@
             *(pBuf + 1) = 0;
             pBuf += 2;
         }
-
         // addIEAssoc
         if(pProfile->nAddIEAssocLength && pProfile->pAddIEAssoc)
         {
             ieLen = pProfile->nAddIEAssocLength;
-
             if(ieLen > pSession->nAddIEAssocLength)
             {
                 if(pSession->pAddIEAssoc && pSession->nAddIEAssocLength)
@@ -11617,7 +11119,6 @@
             *(pBuf + 1) = 0;
             pBuf += 2;
         }
-
         //Unmask any AC in reassoc that is ACM-set
         uapsd_mask = (v_U8_t)pProfile->uapsd_mask;
         if( uapsd_mask && ( NULL != pBssDescription ) )
@@ -11642,13 +11143,11 @@
         dwTmp = pal_cpu_to_be32( csrTranslateEncryptTypeToEdType( pProfile->negotiatedMCEncryptionType) );
         palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tANI_U32) );
         pBuf += sizeof(tANI_U32);        
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
         // is11Rconnection;
         dwTmp = csrIsProfile11r( pProfile )?  pal_cpu_to_be32(TRUE) : 0; 
         palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
         pBuf += sizeof(tAniBool);        
-
 #ifdef FEATURE_WLAN_CCX
         //isCCXconnection;
         //CCKM profile, ccxversion ie present, not 11r and ini file has CCX enabled
@@ -11666,7 +11165,6 @@
         pBuf += sizeof(tAniBool);        
 #endif // FEATURE_WLAN_CCX
 #endif // WLAN_FEATURE_VOWIFI_11R
-
 #ifdef FEATURE_WLAN_CCX
         if ((csrIsProfileCCX(pProfile) || 
              ((pIes->CCXVersion.present) 
@@ -11679,13 +11177,11 @@
             && (pMac->roam.configParam.isCcxIniFeatureEnabled))
         {
            tCCXTspecInfo ccxTspec;
-
            // CCX Tspec information
            palZeroMemory(pMac->hHdd, &ccxTspec, sizeof(tCCXTspecInfo));
            ccxTspec.numTspecs = sme_QosCCxRetrieveTspecInfo(pMac, sessionId, (tTspecInfo *) &ccxTspec.tspec[0]);
            *pBuf = ccxTspec.numTspecs;
            pBuf += sizeof(tANI_U8);
-
            // Copy the TSPEC information only if present
            if (ccxTspec.numTspecs) {
                palCopyMemory(pMac->hHdd, pBuf, (void*)&ccxTspec.tspec[0], (ccxTspec.numTspecs*sizeof(tTspecInfo)));
@@ -11704,7 +11200,6 @@
             }
         }
 #endif // FEATURE_WLAN_CCX
-
 #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
         // Fill in isFastTransitionEnabled
         if (pMac->roam.configParam.isFastTransitionEnabled
@@ -11724,7 +11219,6 @@
             pBuf += sizeof(tAniBool);        
         }
 #endif
-
 #ifdef FEATURE_WLAN_LFR
         if(csrRoamIsFastRoamEnabled(pMac))
         {
@@ -11748,12 +11242,9 @@
 #endif
         status = palSendMBMessage( pMac->hHdd, pMsg );
     } while( 0 );
-
     return( status );
-
 }
 
-
 //
 eHalStatus csrSendMBDisassocReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode )
 {
@@ -11766,14 +11257,12 @@
     if (!CSR_IS_SESSION_VALID( pMac, sessionId ))
         return eHAL_STATUS_FAILURE;
 #endif
-
     do {
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDisassocReq ));
         if ( !HAL_STATUS_SUCCESS(status) ) break;
         palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeDisassocReq ));
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_DISASSOC_REQ);
         pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeDisassocReq ));
-
         pBuf = &pMsg->sessionId;
         // sessionId
         *pBuf++ = (tANI_U8)sessionId;
@@ -11790,7 +11279,6 @@
             // Set the bssid address before sending the message to LIM
             status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, pSession->selfMacAddr, sizeof( tSirMacAddr ) );
             pBuf = pBuf + sizeof ( tSirMacAddr );
-
             // Set the peer MAC address before sending the message to LIM
             status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( tSirMacAddr ) ); //perMacAddr is passed as bssId for softAP
             pBuf = pBuf + sizeof ( tSirMacAddr );
@@ -11801,7 +11289,6 @@
             // Set the peer MAC address before sending the message to LIM
             status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( tSirMacAddr ) );
             pBuf = pBuf + sizeof ( tSirMacAddr );
-
             status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( pMsg->bssId ) );
             pBuf = pBuf + sizeof ( tSirMacAddr );
 #ifdef WLAN_SOFTAP_FEATURE
@@ -11812,7 +11299,6 @@
             palFreeMemory(pMac->hHdd, pMsg);
             break;
         }
-
         // reasonCode
         wTmp = pal_cpu_to_be16(reasonCode);
         status = palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof(tANI_U16) );
@@ -11822,7 +11308,6 @@
             break;
         }
         pBuf += sizeof(tANI_U16);
-
         /* The state will be DISASSOC_HANDOFF only when we are doing handoff. 
                     Here we should not send the disassoc over the air to the AP */
         if ( CSR_IS_ROAM_SUBSTATE_DISASSOC_HO(pMac, sessionId)
@@ -11835,19 +11320,15 @@
         }
         pBuf += sizeof(tANI_U8);
         status = palSendMBMessage( pMac->hHdd, pMsg );
-
     } while( 0 );
-
     return( status );
 }
-
 #ifdef WLAN_SOFTAP_FEATURE
 eHalStatus csrSendMBTkipCounterMeasuresReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_BOOLEAN bEnable, tSirMacAddr bssId )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tSirSmeTkipCntrMeasReq *pMsg;
     tANI_U8 *pBuf;
-
     do
     {
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeTkipCntrMeasReq ));
@@ -11855,7 +11336,6 @@
         palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeTkipCntrMeasReq ));
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_TKIP_CNTR_MEAS_REQ);
         pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeTkipCntrMeasReq ));
-
         pBuf = &pMsg->sessionId;
         // sessionId
         *pBuf++ = (tANI_U8)sessionId;
@@ -11873,14 +11353,10 @@
             palFreeMemory(pMac->hHdd, pMsg);
             break;
         }
-
         status = palSendMBMessage( pMac->hHdd, pMsg );
-
     } while( 0 );
-
     return( status );
 }
-
 eHalStatus
 csrSendMBGetAssociatedStasReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId,
                                     VOS_MODULE_ID modId, tSirMacAddr bssId,
@@ -11891,49 +11367,38 @@
     tSirSmeGetAssocSTAsReq *pMsg;
     tANI_U8 *pBuf = NULL, *wTmpBuf = NULL;
     tANI_U32 dwTmp;
-
     do
     {
         status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeGetAssocSTAsReq ) );
         if (!HAL_STATUS_SUCCESS(status)) break;
         palZeroMemory( pMac->hHdd, pMsg, sizeof( tSirSmeGetAssocSTAsReq ) );
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GET_ASSOC_STAS_REQ);
-
         pBuf = (tANI_U8 *)&pMsg->bssId;
         wTmpBuf = pBuf;
-
         // bssId
         palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof(tSirMacAddr) );
         pBuf += sizeof(tSirMacAddr);
-
         // modId 
         dwTmp = pal_cpu_to_be16((tANI_U16)modId);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U16));
         pBuf += sizeof(tANI_U16);
-
         // pUsrContext
         dwTmp = pal_cpu_to_be32((tANI_U32)pUsrContext);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
         pBuf += sizeof(tANI_U32);
-
         // pfnSapEventCallback
         dwTmp = pal_cpu_to_be32((tANI_U32)pfnSapEventCallback);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
         pBuf += sizeof(tANI_U32);
-
         // pAssocStasBuf
         dwTmp = pal_cpu_to_be32((tANI_U32)pAssocStasBuf);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
         pBuf += sizeof(tANI_U32);
-
         pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)));//msg_header + msg
-
         status = palSendMBMessage( pMac->hHdd, pMsg );
     } while( 0 );
-
     return( status );
         }
-
 eHalStatus
 csrSendMBGetWPSPBCSessions( tpAniSirGlobal pMac, tANI_U32 sessionId,
                             tSirMacAddr bssId, void *pUsrContext, void *pfnSapEventCallback,v_MACADDR_t pRemoveMac)
@@ -11942,45 +11407,34 @@
     tSirSmeGetWPSPBCSessionsReq *pMsg;
     tANI_U8 *pBuf = NULL, *wTmpBuf = NULL;
     tANI_U32 dwTmp;
-
     do
         {
         status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof(tSirSmeGetWPSPBCSessionsReq) );
         if (!HAL_STATUS_SUCCESS(status)) break;
         palZeroMemory( pMac->hHdd, pMsg, sizeof( tSirSmeGetWPSPBCSessionsReq ) );
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GET_WPSPBC_SESSION_REQ);
-
         pBuf = (tANI_U8 *)&pMsg->pUsrContext;
         wTmpBuf = pBuf;
-
         // pUsrContext
         dwTmp = pal_cpu_to_be32((tANI_U32)pUsrContext);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
         pBuf += sizeof(tANI_U32);
-
         // pSapEventCallback
         dwTmp = pal_cpu_to_be32((tANI_U32)pfnSapEventCallback);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
         pBuf += sizeof(tANI_U32);
-
         // bssId
         palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof(tSirMacAddr) );
         pBuf += sizeof(tSirMacAddr);
-
         // MAC Address of STA in WPS session
         palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, pRemoveMac.bytes, sizeof(v_MACADDR_t));
         pBuf += sizeof(v_MACADDR_t);
-
         pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)));//msg_header + msg
-
         status = palSendMBMessage( pMac->hHdd, pMsg );
-
     } while( 0 );
-
     return( status );
 }
 #endif
-
 eHalStatus csrSendMBDeauthReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr bssId, tANI_U16 reasonCode )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -11990,7 +11444,6 @@
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     if (!CSR_IS_SESSION_VALID( pMac, sessionId ))
         return eHAL_STATUS_FAILURE;
-
     do {
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDeauthReq ));
         if ( !HAL_STATUS_SUCCESS(status) ) break;
@@ -12005,7 +11458,6 @@
         *pBuf = 0;
         *(pBuf + 1 ) = 0;
         pBuf += sizeof(tANI_U16);
-
         if ((pSession->pCurRoamProfile != NULL)  && (
 #ifdef WLAN_SOFTAP_FEATURE
              (CSR_IS_INFRA_AP(pSession->pCurRoamProfile)) || 
@@ -12020,7 +11472,6 @@
             // Set the BSSID before sending the message to LIM
             status = palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, bssId, sizeof( pMsg->peerMacAddr ) );
             pBuf =  pBuf + sizeof(tSirMacAddr);
-
         }
         if(!HAL_STATUS_SUCCESS(status))
         {
@@ -12043,18 +11494,14 @@
             break;
         }
         status = palSendMBMessage( pMac->hHdd, pMsg );
-
     } while( 0 );
-
     return( status );
 }
 
-
 eHalStatus csrSendMBDisassocCnfMsg( tpAniSirGlobal pMac, tpSirSmeDisassocInd pDisassocInd )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tSirSmeDisassocCnf *pMsg;
-
     do {
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDisassocCnf ));
         if ( !HAL_STATUS_SUCCESS(status) ) break;
@@ -12076,20 +11523,15 @@
             break;
         }
 //To test reconn ends
-
         status = palSendMBMessage( pMac->hHdd, pMsg );
-
     } while( 0 );
-
     return( status );
 }
 
-
 eHalStatus csrSendMBDeauthCnfMsg( tpAniSirGlobal pMac, tpSirSmeDeauthInd pDeauthInd )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tSirSmeDeauthCnf *pMsg;
-
     do {
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeDeauthCnf ));
         if ( !HAL_STATUS_SUCCESS(status) ) break;
@@ -12109,14 +11551,10 @@
             palFreeMemory(pMac->hHdd, pMsg);
             break;
         }
-
         status = palSendMBMessage( pMac->hHdd, pMsg );
-
     } while( 0 );
-
     return( status );
 }
-
 eHalStatus csrSendAssocCnfMsg( tpAniSirGlobal pMac, tpSirSmeAssocInd pAssocInd, eHalStatus Halstatus )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
@@ -12124,14 +11562,12 @@
     tANI_U8 *pBuf;
     tSirResultCodes statusCode;
     tANI_U16 wTmp;
-
     do {
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeAssocCnf ));
         if ( !HAL_STATUS_SUCCESS(status) ) break;
         palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeAssocCnf ));
                 pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_ASSOC_CNF);
                 pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeAssocCnf ));
-
         pBuf = (tANI_U8 *)&pMsg->statusCode;
         if(HAL_STATUS_SUCCESS(Halstatus))
             statusCode = (tSirResultCodes)pal_cpu_to_be32(eSIR_SME_SUCCESS);
@@ -12154,19 +11590,15 @@
         pBuf += sizeof (tSirMacAddr);
         // alternateChannelId
         *pBuf = 11;
-
         status = palSendMBMessage( pMac->hHdd, pMsg );
         if(!HAL_STATUS_SUCCESS(status))
         {
             //pMsg is freed by palSendMBMessage
             break;
         }
-
     } while( 0 );
-
     return( status );
 }
-
 #ifdef WLAN_SOFTAP_FEATURE
 eHalStatus csrSendAssocIndToUpperLayerCnfMsg(   tpAniSirGlobal pMac, 
                                                 tpSirSmeAssocInd pAssocInd, 
@@ -12179,11 +11611,11 @@
     tANI_U8 *pBuf;
     tSirResultCodes statusCode;
     tANI_U16 wTmp;
-
     do {
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, sizeof( tSirSmeAssocIndToUpperLayerCnf ));
         if ( !HAL_STATUS_SUCCESS(status) ) break;
         palZeroMemory(pMac->hHdd, pMsg, sizeof( tSirSmeAssocIndToUpperLayerCnf ));
+
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_UPPER_LAYER_ASSOC_CNF);
         pMsg->length = pal_cpu_to_be16((tANI_U16)sizeof( tSirSmeAssocIndToUpperLayerCnf ));
 
@@ -12212,37 +11644,28 @@
         // alternateChannelId
         *pBuf = 11;
         pBuf += sizeof (tANI_U8);
-
         // Instead of copying roam Info, we just copy only WmmEnabled , RsnIE information
         //Wmm
         *pBuf = pAssocInd->wmmEnabledSta;
         pBuf += sizeof (tANI_U8);
-
         //RSN IE
         status = palCopyMemory(pMac->hHdd, (tSirRSNie *)pBuf, &pAssocInd->rsnIE, sizeof(tSirRSNie));
         pBuf += sizeof (tSirRSNie);
-
         //Additional IE
         status = palCopyMemory(pMac->hHdd, (void *)pBuf, &pAssocInd->addIE, sizeof(tSirAddie));
         pBuf += sizeof (tSirAddie);
-
         //reassocReq
         *pBuf = pAssocInd->reassocReq;
         pBuf += sizeof (tANI_U8);
-
         msgQ.type = eWNI_SME_UPPER_LAYER_ASSOC_CNF;
         msgQ.bodyptr = pMsg;
         msgQ.bodyval = 0;
-
         SysProcessMmhMsg(pMac, &msgQ);
-
     } while( 0 );
-
     return( status );
 }
 #endif
 
-
 eHalStatus csrSendMBSetContextReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId ,
             tSirMacAddr peerMacAddr, tANI_U8 numKeys, tAniEdType edType, 
             tANI_BOOLEAN fUnicast, tAniKeyDirection aniKeyDirection,
@@ -12257,11 +11680,8 @@
     tANI_U8 *pBuf;
     tANI_U8 *p;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     do {
-
         if( ( 1 != numKeys ) && ( 0 != numKeys ) ) break;
-
         // all of these fields appear in every SET_CONTEXT message.  Below we'll add in the size for each 
         // key set. Since we only support upto one key, we always allocate memory for 1 key
         msgLen  = sizeof( tANI_U16) + sizeof( tANI_U16 ) + sizeof( tSirMacAddr ) +
@@ -12274,7 +11694,6 @@
         palZeroMemory(pMac->hHdd, pMsg, msgLen);
                 pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_SETCONTEXT_REQ);
                 pMsg->length = pal_cpu_to_be16(msgLen);
-
         //sessionId
         pBuf = &pMsg->sessionId;
         *pBuf = (tANI_U8)sessionId;
@@ -12296,31 +11715,25 @@
         pBuf += sizeof(tSirMacAddr);
 
         p = pBuf;
-
                 // Set the pMsg->keyMaterial.length field (this length is defined as all data that follows the edType field
                 // in the tSirKeyMaterial keyMaterial; field).
                 //
                 // !!NOTE:  This keyMaterial.length contains the length of a MAX size key, though the keyLength can be 
                 // shorter than this max size.  Is LIM interpreting this ok ?
                 p = pal_set_U16( p, pal_cpu_to_be16((tANI_U16)( sizeof( pMsg->keyMaterial.numKeys ) + ( numKeys * sizeof( pMsg->keyMaterial.key ) ) )) );
-
                 // set pMsg->keyMaterial.edType
         tmpEdType = (tAniEdType)pal_cpu_to_be32(edType);
         palCopyMemory( pMac->hHdd, p, (tANI_U8 *)&tmpEdType, sizeof(tAniEdType) );
         p += sizeof( pMsg->keyMaterial.edType );
-
         // set the pMsg->keyMaterial.numKeys field
         *p = numKeys;
         p += sizeof( pMsg->keyMaterial.numKeys );   
-
         // set pSirKey->keyId = keyId;
         *p = keyId;
         p += sizeof( pMsg->keyMaterial.key[ 0 ].keyId );
-
         // set pSirKey->unicast = (tANI_U8)fUnicast;
         *p = (tANI_U8)fUnicast;
         p += sizeof( pMsg->keyMaterial.key[ 0 ].unicast );
-
                 // set pSirKey->keyDirection = aniKeyDirection;
         tmpDirection = (tAniKeyDirection)pal_cpu_to_be32(aniKeyDirection);
         palCopyMemory( pMac->hHdd, p, (tANI_U8 *)&tmpDirection, sizeof(tAniKeyDirection) );
@@ -12328,14 +11741,11 @@
         //    pSirKey->keyRsc = ;;
         palCopyMemory( pMac->hHdd, p, pKeyRsc, CSR_MAX_RSC_LEN );
         p += sizeof( pMsg->keyMaterial.key[ 0 ].keyRsc );
-
                 // set pSirKey->paeRole
                 *p = paeRole;   // 0 is Supplicant
                 p++;
-
                 // set pSirKey->keyLength = keyLength;
                 p = pal_set_U16( p, pal_cpu_to_be16(keyLength) );
-
         if ( keyLength && pKey ) 
         {   
             palCopyMemory( pMac->hHdd, p, pKey, keyLength ); 
@@ -12347,16 +11757,11 @@
                 pKey[9], pKey[10], pKey[11], pKey[12], pKey[13], pKey[14], pKey[15]);
             }
         }
-
         status = palSendMBMessage(pMac->hHdd, pMsg);
-
     } while( 0 );
-
     return( status );
 }
 
-
-
 eHalStatus csrSendMBStartBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId, eCsrRoamBssType bssType, 
                                     tCsrRoamStartBssParams *pParam, tSirBssDescription *pBssDesc )
 {
@@ -12367,11 +11772,10 @@
     tANI_U16 msgLen, wTmp;
     tANI_U32 dwTmp;
     tSirNwType nwType;
-    tAniCBSecondaryMode cbMode;
+    ePhyChanBondState cbMode;
 #ifdef WLAN_SOFTAP_FEATURE
     tANI_U32 authType;
 #endif
-
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     do {
         pSession->joinFailStatusCode.statusCode = eSIR_SME_SUCCESS;
@@ -12379,14 +11783,10 @@
         msgLen = sizeof(tSirSmeStartBssReq);
         status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
         if ( !HAL_STATUS_SUCCESS(status) ) break;
-
         palZeroMemory(pMac->hHdd, pMsg, msgLen);
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_START_BSS_REQ);
-
         pBuf = &pMsg->sessionId;
-
         wTmpBuf = pBuf;
-
         //sessionId
         *pBuf = (tANI_U8)sessionId;
         pBuf++;
@@ -12394,7 +11794,6 @@
         *pBuf = 0;
         *(pBuf + 1) = 0;
         pBuf += sizeof(tANI_U16);
-
         // bssid 
         palCopyMemory( pMac->hHdd, pBuf, pParam->bssid, sizeof(tSirMacAddr) );
         pBuf += sizeof(tSirMacAddr);
@@ -12416,6 +11815,22 @@
         {
             wTmp = pal_cpu_to_be16( WNI_CFG_BEACON_INTERVAL_STADEF );
         }
+        if(csrIsconcurrentsessionValid (pMac, sessionId, 
+                                   pParam->bssPersona) 
+                                   == eHAL_STATUS_SUCCESS )
+        {    
+           csrValidateBeaconInterval(pMac, pParam->operationChn, &wTmp, sessionId,
+                                      pParam->bssPersona);
+           //Update the beacon Interval 
+           pParam->beaconInterval = wTmp;
+        }
+        else
+        {
+            smsLog( pMac,LOGE, FL("****Start BSS failed persona already exists***\n"));
+            status = eHAL_STATUS_FAILURE;
+            return status;
+        }
+
         palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof( tANI_U16 ) ); 
         pBuf += sizeof(tANI_U16);
         // dot11mode
@@ -12439,14 +11854,13 @@
             *pBuf = 0;
             pBuf++;        
         }
-
         // set the channel Id
         *pBuf = pParam->operationChn;
         pBuf++;
         //What should we really do for the cbmode.
-        cbMode = (tAniCBSecondaryMode)pal_cpu_to_be32(pParam->cbMode);
-        palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&cbMode, sizeof(tAniCBSecondaryMode) );
-        pBuf += sizeof(tAniCBSecondaryMode);
+        cbMode = (ePhyChanBondState)pal_cpu_to_be32(pParam->cbMode);
+        palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&cbMode, sizeof(ePhyChanBondState) );
+        pBuf += sizeof(ePhyChanBondState);
 
 #ifdef WLAN_SOFTAP_FEATURE
         // Set privacy
@@ -12456,47 +11870,39 @@
         //Set Uapsd 
         *pBuf = pParam->ApUapsdEnable;
         pBuf++;
-
         //Set SSID hidden
         *pBuf = pParam->ssidHidden;
         pBuf++;
-
         *pBuf = (tANI_U8)pParam->fwdWPSPBCProbeReq;
         pBuf++;
         
         //Ht protection Enable/Disable
         *pBuf = (tANI_U8)pParam->protEnabled;
         pBuf++;
-
         //Enable Beacons to Receive for OBSS protection Enable/Disable
         *pBuf = (tANI_U8)pParam->obssProtEnabled;
         pBuf++;
-
         //set cfg related to protection
         wTmp = pal_cpu_to_be16( pParam->ht_protection );
         palCopyMemory( pMac->hHdd, pBuf, &wTmp, sizeof( tANI_U16 ) ); 
         pBuf += sizeof(tANI_U16);
-
         // Set Auth type
         authType = pal_cpu_to_be32(pParam->authType);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&authType, sizeof(tANI_U32));
         pBuf += sizeof(tANI_U32);
-
         // Set DTIM
         dwTmp = pal_cpu_to_be32(pParam->dtimPeriod);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&dwTmp, sizeof(tANI_U32));
         pBuf += sizeof(tANI_U32);
-
         // Set wps_state
         *pBuf = pParam->wps_state;
         pBuf++;
-
 #endif
         //Persona
         *pBuf = (tANI_U8)pParam->bssPersona;
         pBuf++;
         
-
+        
         
         // set RSN IE 
         if( pParam->nRSNIELength > sizeof(pMsg->rsnIE.rsnIEdata) )
@@ -12517,10 +11923,8 @@
         nwType = (tSirNwType)pal_cpu_to_be32(pParam->sirNwType);
         palCopyMemory( pMac->hHdd, pBuf, (tANI_U8 *)&nwType, sizeof(tSirNwType) );
         pBuf += sizeof(tSirNwType);
-
         *pBuf = pParam->operationalRateSet.numRates; //tSirMacRateSet->numRates
         pBuf++;
-
         palCopyMemory( pMac->hHdd, pBuf, pParam->operationalRateSet.rate, pParam->operationalRateSet.numRates );
         pBuf += pParam->operationalRateSet.numRates ;
         *pBuf++ = pParam->extendedRateSet.numRates;
@@ -12529,18 +11933,14 @@
             palCopyMemory( pMac->hHdd, pBuf, pParam->extendedRateSet.rate, pParam->extendedRateSet.numRates );
             pBuf += pParam->extendedRateSet.numRates;
         }
-
         msgLen = (tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf)); //msg_header + msg
         pMsg->length = pal_cpu_to_be16(msgLen);
         
         status = palSendMBMessage(pMac->hHdd, pMsg);
-
     } while( 0 );
-
   return( status );
 }
 
-
 eHalStatus csrSendMBStopBssReqMsg( tpAniSirGlobal pMac, tANI_U32 sessionId )
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
@@ -12548,7 +11948,6 @@
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     tANI_U8 *pBuf;
     tANI_U16 msgLen;
-
     do {
         status = palAllocateMemory(pMac, (void **)&pMsg, sizeof(tSirSmeStopBssReq));
         if ( !HAL_STATUS_SUCCESS(status) ) break;
@@ -12577,7 +11976,6 @@
        pBuf += sizeof(tSirMacAddr);
        msgLen = sizeof(tANI_U16) + sizeof(tANI_U16) + 1 + sizeof(tANI_U16) + sizeof(tSirResultCodes) + sizeof(tSirMacAddr);
        pMsg->length =  pal_cpu_to_be16(msgLen);
-
        status =  palSendMBMessage( pMac->hHdd, pMsg );
 #if 0            
         status = palAllocateMemory(pMac, (void **)&pMsg, sizeof(tSirSmeStopBssReq));
@@ -12602,20 +12000,16 @@
                 status = palSendMBMessage( pMac->hHdd, pMsg );
 #endif                
         } while( 0 );
-
     return( status );
 }
 
-
 eHalStatus csrReassoc(tpAniSirGlobal pMac, tANI_U32 sessionId, 
                       tCsrRoamModifyProfileFields *pModProfileFields,
                       tANI_U32 *pRoamId, v_BOOL_t fForce)
 {
-
    eHalStatus status = eHAL_STATUS_FAILURE;
    tANI_U32 roamId = 0;
    tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
    if((csrIsConnStateConnected(pMac, sessionId)) &&
       (fForce || (!palEqualMemory(pMac->hHdd, &pModProfileFields, 
                        &pSession->connectedProfile.modifyProfileFields, 
@@ -12627,34 +12021,27 @@
          *pRoamId = roamId;
       }
 
-
       status = csrRoamIssueReassoc(pMac, sessionId, NULL, pModProfileFields, 
                                    eCsrSmeIssuedReassocToSameAP, roamId, 
                                    eANI_BOOLEAN_FALSE);
-
    }
-
    return status;
 }
-
 static eHalStatus csrRoamSessionOpened(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tCsrRoamInfo roamInfo;
-
     palZeroMemory(pMac->hHdd, &roamInfo, sizeof(tCsrRoamInfo));
     status = csrRoamCallCallback(pMac, sessionId, &roamInfo, 0,
                             eCSR_ROAM_SESSION_OPENED, eCSR_ROAM_RESULT_NONE);
     return (status);
 }
-
 eHalStatus csrProcessAddStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg)
 {
    eHalStatus                         status = eHAL_STATUS_SUCCESS;
    tListElem                          *pEntry = NULL;
    tSmeCmd                            *pCommand = NULL;
    tSirSmeAddStaSelfRsp               *pRsp;
-
    do
    {
       if(pMsg == NULL)
@@ -12663,7 +12050,6 @@
          status = eHAL_STATUS_FAILURE;
          break;
       }
-
       pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
       if(pEntry)
       {
@@ -12673,9 +12059,7 @@
             pRsp = (tSirSmeAddStaSelfRsp*)pMsg;
             smsLog( pMac, LOG1, "Add Sta rsp status = %d\n", pRsp->status );
             //Nothing to be done. May be indicate the self sta addition success by calling session callback (TODO).
-
             csrRoamSessionOpened(pMac, pCommand->sessionId);
-
             //Remove this command out of the active list
             if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, pEntry, LL_ACCESS_LOCK))
             {
@@ -12700,33 +12084,23 @@
          break;
       }
    } while(0);
-
    return status;
-
 }
-
 eHalStatus csrSendMBAddSelfStaReqMsg( tpAniSirGlobal pMac, tSirMacAddr macAddr )
 {
    tSirSmeAddStaSelfReq *pMsg;
    tANI_U16 msgLen;
    eHalStatus status = eHAL_STATUS_FAILURE;
-
    do {
-
       msgLen  = sizeof( tANI_U16 ) + sizeof( tANI_U16 ) + sizeof( tSirMacAddr ) /*+
          sizeof( tSirBssType )*/;
-
       status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
       if ( !HAL_STATUS_SUCCESS(status) ) break;
-
       palZeroMemory(pMac->hHdd, pMsg, msgLen);
-
       pMsg->mesgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_ADD_STA_SELF_REQ);
       pMsg->mesgLen = pal_cpu_to_be16(msgLen);
-
       // self station address
       palCopyMemory( pMac->hHdd, (tANI_U8 *)pMsg->selfMacAddr, (tANI_U8 *)macAddr, sizeof(tSirMacAddr) );
-
         smsLog( pMac, LOGE, FL("selfMac=%02x, %02x, %02x, %02x, %02x, %02x\n"),       
             pMsg->selfMacAddr[0],
             pMsg->selfMacAddr[1],
@@ -12735,17 +12109,13 @@
             pMsg->selfMacAddr[4],
             pMsg->selfMacAddr[5]);
       status = palSendMBMessage(pMac->hHdd, pMsg);
-
    } while( 0 );
-
    return( status );
 }
-
 eHalStatus csrIssueAddStaForSessionReq(tpAniSirGlobal pMac, tANI_U32 sessionId, tSirMacAddr sessionMacAddr)
 {
    eHalStatus status = eHAL_STATUS_SUCCESS;
    tSmeCmd *pCommand;
-
    pCommand = csrGetCommandBuffer(pMac);
    if(NULL == pCommand)
    {
@@ -12756,7 +12126,6 @@
       pCommand->command = eSmeCommandAddStaSession;
       pCommand->sessionId = (tANI_U8)sessionId;
       palCopyMemory( pMac->hHdd, pCommand->u.addStaSessionCmd.selfMacAddr, sessionMacAddr, sizeof( tSirMacAddr ) );
-
       status = csrQueueSmeCommand(pMac, pCommand, TRUE);
       if( !HAL_STATUS_SUCCESS( status ) )
       {
@@ -12764,23 +12133,19 @@
          smsLog( pMac, LOGE, FL(" fail to send message status = %d\n"), status );
       }
    }
-
    return (status);
 }
-
 eHalStatus csrProcessAddStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
    return csrSendMBAddSelfStaReqMsg( pMac, 
          pCommand->u.addStaSessionCmd.selfMacAddr );
 }
-
 eHalStatus csrRoamOpenSession( tpAniSirGlobal pMac, csrRoamCompleteCallback callback, void *pContext,
                           tANI_U8 *pSelfMacAddr, tANI_U8 *pbSessionId )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tANI_U32 i;
     tCsrRoamSession *pSession;
-
     *pbSessionId = CSR_SESSION_ID_INVALID;
     for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
     {
@@ -12794,7 +12159,6 @@
             pSession->pContext = pContext;
             palCopyMemory( pMac->hHdd, &pSession->selfMacAddr, pSelfMacAddr, sizeof(tCsrBssid) );
             *pbSessionId = (tANI_U8)i;
-
             status = palTimerAlloc(pMac->hHdd, &pSession->hTimerRoaming, csrRoamRoamingTimerHandler, 
                                     &pSession->roamingTimerInfo);
             if(!HAL_STATUS_SUCCESS(status))
@@ -12813,7 +12177,6 @@
 #endif
             pSession->ibssJoinTimerInfo.pMac = pMac;
             pSession->ibssJoinTimerInfo.sessionId = CSR_SESSION_ID_INVALID;
-
             status = palTimerAlloc(pMac->hHdd, &pSession->hTimerIbssJoining, csrRoamIbssJoinTimerHandler, 
                                     &pSession->ibssJoinTimerInfo);
             if(!HAL_STATUS_SUCCESS(status))
@@ -12830,17 +12193,14 @@
         //No session is available
         status = eHAL_STATUS_RESOURCES;
     }
-
     return ( status );
 }
-
 eHalStatus csrProcessDelStaSessionRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg)
 {
    eHalStatus                         status = eHAL_STATUS_SUCCESS;
    tListElem                          *pEntry = NULL;
    tSmeCmd                            *pCommand = NULL;
    tSirSmeDelStaSelfRsp               *pRsp;
-
    do
    {
       if(pMsg == NULL)
@@ -12849,7 +12209,6 @@
          status = eHAL_STATUS_FAILURE;
          break;
       }
-
       pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
       if(pEntry)
       {
@@ -12857,13 +12216,10 @@
          if(eSmeCommandDelStaSession == pCommand->command)
          {
             tANI_U8 sessionId = pCommand->sessionId;
-
             pRsp = (tSirSmeDelStaSelfRsp*)pMsg;
             smsLog( pMac, LOG1, "Del Sta rsp status = %d\n", pRsp->status );
-
             //This session is done.
             csrCleanupSession(pMac, sessionId);
-
             if(pCommand->u.delStaSessionCmd.callback)
             {
                  
@@ -12908,40 +12264,28 @@
          break;
       }
    } while(0);
-
    return status;
-
 }
-
 eHalStatus csrSendMBDelSelfStaReqMsg( tpAniSirGlobal pMac, tSirMacAddr macAddr )
 {
    tSirSmeDelStaSelfReq *pMsg;
    tANI_U16 msgLen;
    eHalStatus status = eHAL_STATUS_FAILURE;
-
    do {
-
       msgLen  = sizeof( tANI_U16 ) + sizeof( tANI_U16 ) + sizeof( tSirMacAddr ) /*+
          sizeof( tSirBssType )*/;
-
       status = palAllocateMemory(pMac->hHdd, (void **)&pMsg, msgLen);
       if ( !HAL_STATUS_SUCCESS(status) ) break;
    
       palZeroMemory(pMac->hHdd, pMsg, msgLen);
-
       pMsg->mesgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_DEL_STA_SELF_REQ);
       pMsg->mesgLen = pal_cpu_to_be16(msgLen);
-
       // self station address
       palCopyMemory( pMac->hHdd, (tANI_U8 *)pMsg->selfMacAddr, (tANI_U8 *)macAddr, sizeof(tSirMacAddr) );
-
       status = palSendMBMessage(pMac->hHdd, pMsg);
-
    } while( 0 );
-
    return( status );
 }
-
 eHalStatus csrIssueDelStaForSessionReq(tpAniSirGlobal pMac, tANI_U32 sessionId,
                                        tSirMacAddr sessionMacAddr,
                                        csrRoamSessionCloseCallback callback,
@@ -12949,7 +12293,6 @@
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
    tSmeCmd *pCommand;
-
    pCommand = csrGetCommandBuffer(pMac);
    if(NULL == pCommand)
    {
@@ -12962,7 +12305,6 @@
       pCommand->u.delStaSessionCmd.callback = callback;
       pCommand->u.delStaSessionCmd.pContext = pContext;
       palCopyMemory( pMac->hHdd, pCommand->u.delStaSessionCmd.selfMacAddr, sessionMacAddr, sizeof( tSirMacAddr ) );
-
       status = csrQueueSmeCommand(pMac, pCommand, TRUE);
       if( !HAL_STATUS_SUCCESS( status ) )
       {
@@ -12970,16 +12312,13 @@
          smsLog( pMac, LOGE, FL(" fail to send message status = %d\n"), status );
       }
    }
-
    return (status);
 }
-
 eHalStatus csrProcessDelStaSessionCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
    return csrSendMBDelSelfStaReqMsg( pMac, 
          pCommand->u.delStaSessionCmd.selfMacAddr );
 }
-
 static void purgeCsrSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     tDblLinkList *pList = &pMac->roam.roamCmdPendingList;
@@ -12993,7 +12332,6 @@
         smsLog(pMac, LOGE, FL(" failed to open list"));
         return;
     }
-
     csrLLLock(pList);
     pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK);
     while(pEntry != NULL)
@@ -13019,13 +12357,11 @@
     csrLLClose(&localList);
 }
 
-
 void csrCleanupSession(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     if( CSR_IS_SESSION_VALID( pMac, sessionId ) )
     {
         tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
         csrRoamStop(pMac, sessionId);
         csrFreeConnectBssDesc(pMac, sessionId);
         csrRoamFreeConnectProfile( pMac, &pSession->connectedProfile );
@@ -13041,14 +12377,12 @@
     }
 }
 
-
 eHalStatus csrRoamCloseSession( tpAniSirGlobal pMac, tANI_U32 sessionId,
                                 tANI_BOOLEAN fSync, 
                                 csrRoamSessionCloseCallback callback,
                                 void *pContext )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
-
     if( CSR_IS_SESSION_VALID( pMac, sessionId ) )
     {
         tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
@@ -13068,15 +12402,12 @@
     {
         status = eHAL_STATUS_INVALID_PARAMETER;
     }
-
     return ( status );
 }
 
-
 static void csrInitSession( tpAniSirGlobal pMac, tANI_U32 sessionId )
 {
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     pSession->sessionActive = eANI_BOOLEAN_FALSE;
     pSession->sessionId = CSR_SESSION_ID_INVALID;
     pSession->callback = NULL;
@@ -13116,29 +12447,24 @@
     }
     pSession->nWapiRspIeLength = 0;
 #endif /* FEATURE_WLAN_WAPI */
-
     if(pSession->pAddIEScan)
     {
         palFreeMemory(pMac->hHdd, pSession->pAddIEScan);
         pSession->pAddIEScan = NULL;
     }
     pSession->nAddIEScanLength = 0;
-
     if(pSession->pAddIEAssoc)
     {
         palFreeMemory(pMac->hHdd, pSession->pAddIEAssoc);
         pSession->pAddIEAssoc = NULL;
 }
     pSession->nAddIEAssocLength = 0;
-
 }
 
-
 eHalStatus csrRoamGetSessionIdFromBSSID( tpAniSirGlobal pMac, tCsrBssid *bssid, tANI_U32 *pSessionId )
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
     tANI_U32 i;
-
     for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
     {
         if( CSR_IS_SESSION_VALID( pMac, i ) )
@@ -13152,18 +12478,15 @@
             }
         }
     }
-
     return( status );
 }
 
-
 //This function assumes that we only support one IBSS session. We cannot use BSSID to identify 
 //session because for IBSS, the bssid changes.
 static tANI_U32 csrFindIbssSession( tpAniSirGlobal pMac )
 {
     tANI_U32 i, nRet = CSR_SESSION_ID_INVALID;
     tCsrRoamSession *pSession;
-
     for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
     {
         if( CSR_IS_SESSION_VALID( pMac, i ) )
@@ -13177,55 +12500,43 @@
             }
         }
     }
-
     return (nRet);
 }
-
 static void csrRoamLinkUp(tpAniSirGlobal pMac, tCsrBssid bssid)
 {
    /* Update the current BSS info in ho control block based on connected 
       profile info from pmac global structure                              */
    
-
    smsLog(pMac, LOGW, " csrRoamLinkUp: WLAN link UP with AP= %02x-%02x-%02x-%02x-%02x-%02x\n", 
           bssid[ 0 ], bssid[ 1 ], bssid[ 2 ],
           bssid[ 3 ], bssid[ 4 ], bssid[ 5 ] );
-
    /* Check for user misconfig of RSSI trigger threshold                  */
    pMac->roam.configParam.vccRssiThreshold =
       ( 0 == pMac->roam.configParam.vccRssiThreshold ) ? 
       CSR_VCC_RSSI_THRESHOLD : pMac->roam.configParam.vccRssiThreshold;
    pMac->roam.vccLinkQuality = eCSR_ROAM_LINK_QUAL_POOR_IND;
-
     /* Check for user misconfig of UL MAC Loss trigger threshold           */
    pMac->roam.configParam.vccUlMacLossThreshold =
       ( 0 == pMac->roam.configParam.vccUlMacLossThreshold ) ? 
       CSR_VCC_UL_MAC_LOSS_THRESHOLD : pMac->roam.configParam.vccUlMacLossThreshold;
-
 #if   defined WLAN_FEATURE_NEIGHBOR_ROAMING
     {
         tANI_U32 sessionId = 0;
-
         /* Indicate the neighbor roal algorithm about the connect indication */
         csrRoamGetSessionIdFromBSSID(pMac, (tCsrBssid *)bssid, &sessionId);
         csrNeighborRoamIndicateConnect(pMac, sessionId, VOS_STATUS_SUCCESS);
     }
 #endif
-
 }
 
-
 static void csrRoamLinkDown(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
    tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
    //Only to handle the case for Handover on infra link
    if( eCSR_BSS_TYPE_INFRASTRUCTURE != pSession->connectedProfile.BSSType )
    {
       return;
    }
-
-
    /* deregister the clients requesting stats from PE/TL & also stop the corresponding timers*/
    csrRoamDeregStatisticsReq(pMac);
    pMac->roam.vccLinkQuality = eCSR_ROAM_LINK_QUAL_POOR_IND;
@@ -13234,16 +12545,23 @@
    csrNeighborRoamIndicateDisconnect(pMac, sessionId);
 #endif
    
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+   if(csrIsInfraApStarted( pMac ) &&  pMac->roam.configParam.doBMPSWorkaround)
+   {
+       pMac->roam.configParam.doBMPSWorkaround = 0;
+   }
+#endif
+   
 }
 
-
 void csrRoamTlStatsTimerHandler(void *pv)
 {
    tpAniSirGlobal pMac = PMAC_STRUCT( pv );
    eHalStatus status;
-
    pMac->roam.tlStatsReqInfo.timerRunning = FALSE;
 
+   smsLog(pMac, LOG1, FL(" TL stat timer is no-op. It needs to support multiple stations"));
+
 #if 0
    // TODO Persession .???
    //req TL for stats
@@ -13273,7 +12591,6 @@
       }
    }
 }
-
 void csrRoamPeStatsTimerHandler(void *pv)
 {
    tCsrPeStatsReqInfo *pPeStatsReqListEntry = (tCsrPeStatsReqInfo *)pv;
@@ -13281,7 +12598,6 @@
    tpAniSirGlobal pMac = pPeStatsReqListEntry->pMac;
    VOS_STATUS vosStatus;
    tPmcPowerState powerState;
-
    pPeStatsReqListEntry->timerRunning = FALSE;
    if( pPeStatsReqListEntry->timerStopFailed == TRUE )
    {
@@ -13341,18 +12657,15 @@
             smsLog(pMac, LOGE, FL("csrRoamPeStatsTimerHandler:cannot start hPeStatsTimer timer\n"));
             return;
          }
-
          pPeStatsReqListEntry->timerRunning = TRUE;
 
       }
 
    }
 }
-
 void csrRoamStatsClientTimerHandler(void *pv)
 {
    tCsrStatsClientReqInfo *pStaEntry = (tCsrStatsClientReqInfo *)pv;
-
    if(VOS_TIMER_STATE_STOPPED == vos_timer_getCurrentState(&pStaEntry->timer))
    {
 #if 0
@@ -13363,7 +12676,6 @@
        if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) 
        {
           smsLog(pStaEntry->pMac, LOGE, FL("csrGetStatistics:cannot start StatsClient timer\n"));
-
        }
 #endif       
    }
@@ -13376,7 +12688,6 @@
 
 
 
-
 eHalStatus csrSendMBStatsReqMsg( tpAniSirGlobal pMac, tANI_U32 statsMask, tANI_U8 staId)
 {
    tAniGetPEStatsReq *pMsg;
@@ -13392,17 +12703,13 @@
    pMsg->msgLen = (tANI_U16)sizeof(tAniGetPEStatsReq);
    pMsg->staId = staId;
    pMsg->statsMask = statsMask;
-
    status = palSendMBMessage(pMac->hHdd, pMsg );    
-
    if(!HAL_STATUS_SUCCESS(status))
    {
       smsLog(pMac, LOG1, " csrSendMBStatsReqMsg: failed to send down the stats req \n");
    }
-
    return status;
 }
-
 void csrRoamStatsRspProcessor(tpAniSirGlobal pMac, tSirSmeRsp *pSirMsg)
 {
    tAniGetPEStatsRsp *pSmeStatsRsp;
@@ -13417,23 +12724,19 @@
    v_PVOID_t  pvosGCtx;
    v_S7_t     rssi = 0;
    tANI_U32   *pRssi = NULL;
-
    pSmeStatsRsp = (tAniGetPEStatsRsp *)pSirMsg;
    if(pSmeStatsRsp->rc)
    {
       smsLog( pMac, LOGW, FL("csrRoamStatsRspProcessor:stats rsp from PE shows failure\n"));
       goto post_update;
    }
-
    tempMask = pSmeStatsRsp->statsMask;
    pStats = ((tANI_U8 *)&pSmeStatsRsp->statsMask) + sizeof(pSmeStatsRsp->statsMask);
-
    /* subtract all statistics from this length, and after processing the entire 
     * 'stat' part of the message, if the length is not zero, then rssi is piggy packed 
     * in this 'stats' message.
     */
    length = pSmeStatsRsp->msgLen - sizeof(tAniGetPEStatsRsp);
-
    //new stats info from PE, fill up the stats strucutres in PMAC
    while(tempMask)
    {
@@ -13452,7 +12755,6 @@
             pStats += sizeof(tCsrSummaryStatsInfo);
             length -= sizeof(tCsrSummaryStatsInfo);
             break;
-
          case eCsrGlobalClassAStats:
             smsLog( pMac, LOG1, FL("csrRoamStatsRspProcessor:ClassA stats\n"));
             status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.classAStatsInfo, 
@@ -13464,7 +12766,6 @@
             pStats += sizeof(tCsrGlobalClassAStatsInfo);
             length -= sizeof(tCsrGlobalClassAStatsInfo);
             break;
-
          case eCsrGlobalClassBStats:
             smsLog( pMac, LOG1, FL("csrRoamStatsRspProcessor:ClassB stats\n"));
             status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.classBStatsInfo, 
@@ -13476,7 +12777,6 @@
             pStats += sizeof(tCsrGlobalClassBStatsInfo);
             length -= sizeof(tCsrGlobalClassBStatsInfo);
             break;
-
          case eCsrGlobalClassCStats:
             smsLog( pMac, LOG1, FL("csrRoamStatsRspProcessor:ClassC stats\n"));
             status = palCopyMemory(pMac->hHdd, (tANI_U8 *)&pMac->roam.classCStatsInfo, 
@@ -13488,7 +12788,6 @@
             pStats += sizeof(tCsrGlobalClassCStatsInfo);
             length -= sizeof(tCsrGlobalClassCStatsInfo);
             break;
-
          case eCsrPerStaStats:
             smsLog( pMac, LOG1, FL("csrRoamStatsRspProcessor:PerSta stats\n"));
             if( CSR_MAX_STA > pSmeStatsRsp->staId )
@@ -13509,14 +12808,11 @@
             pStats += sizeof(tCsrPerStaStatsInfo);
             length -= sizeof(tCsrPerStaStatsInfo);
             break;
-
          default:
             smsLog( pMac, LOGW, FL("csrRoamStatsRspProcessor:unknown stats type\n"));
             break;
-
          }
       }
-
       tempMask >>=1;
       counter++;
    }
@@ -13532,7 +12828,6 @@
        rssi = RSSI_HACK_BMPS;
    }
    WDA_UpdateRssiBmps(pvosGCtx, pSmeStatsRsp->staId, rssi);
-
 post_update:   
    //make sure to update the pe stats req list 
    pEntry = csrRoamFindInPeStatsReqList(pMac, pSmeStatsRsp->statsMask);
@@ -13546,9 +12841,7 @@
    pEntry = csrRoamCheckClientReqList(pMac, pSmeStatsRsp->statsMask);
    if(pEntry)
    {
-
       pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrStatsClientReqInfo, link );
-
       if(pTempStaEntry->timerExpired)
       {
          //send up the stats report
@@ -13557,51 +12850,39 @@
          //also remove from the client list
          csrRoamRemoveStatListEntry(pMac, pEntry);
          pTempStaEntry = NULL;
-
       }
    }
-
 }
-
 tListElem * csrRoamFindInPeStatsReqList(tpAniSirGlobal pMac, tANI_U32  statsMask)
 {
    tListElem *pEntry = NULL;
    tCsrPeStatsReqInfo *pTempStaEntry = NULL;
-
    pEntry = csrLLPeekHead( &pMac->roam.peStatsReqList, LL_ACCESS_LOCK );
-
    if(!pEntry)
    {
       //list empty
       smsLog(pMac, LOGW, "csrRoamFindInPeStatsReqList: List empty, no request to PE\n");
       return NULL;
    }
-
    while( pEntry )
    {
       pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrPeStatsReqInfo, link );
-
       if(pTempStaEntry->statsMask == statsMask)
       {
          smsLog(pMac, LOGW, "csrRoamFindInPeStatsReqList: match found\n");
          break;
       }
-
       pEntry = csrLLNext( &pMac->roam.peStatsReqList, pEntry, LL_ACCESS_NOLOCK );
    }
-
    return pEntry;
 }
 
-
 tListElem * csrRoamChecknUpdateClientReqList(tpAniSirGlobal pMac, tCsrStatsClientReqInfo *pStaEntry,
                                              tANI_BOOLEAN update)
 {
    tListElem *pEntry;
    tCsrStatsClientReqInfo *pTempStaEntry;
-
    pEntry = csrLLPeekHead( &pMac->roam.statsClientReqList, LL_ACCESS_LOCK );
-
    if(!pEntry)
    {
       //list empty
@@ -13609,37 +12890,30 @@
              "upper layer client(s)\n");
       return NULL;
    }
-
    while( pEntry )
    {
       pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrStatsClientReqInfo, link );
-
       if((pTempStaEntry->requesterId == pStaEntry->requesterId) && 
          (pTempStaEntry->statsMask == pStaEntry->statsMask))
       {
          smsLog(pMac, LOGW, "csrRoamChecknUpdateClientReqList: match found\n");
          if(update)
          {
-         pTempStaEntry->periodicity = pStaEntry->periodicity;
-         pTempStaEntry->callback = pStaEntry->callback;
-         pTempStaEntry->pContext = pStaEntry->pContext;
+            pTempStaEntry->periodicity = pStaEntry->periodicity;
+            pTempStaEntry->callback = pStaEntry->callback;
+            pTempStaEntry->pContext = pStaEntry->pContext;
          }
          break;
       }
-
       pEntry = csrLLNext( &pMac->roam.statsClientReqList, pEntry, LL_ACCESS_NOLOCK );
    }
-
    return pEntry;
 }
-
 tListElem * csrRoamCheckClientReqList(tpAniSirGlobal pMac, tANI_U32 statsMask)
 {
    tListElem *pEntry;
    tCsrStatsClientReqInfo *pTempStaEntry;
-
    pEntry = csrLLPeekHead( &pMac->roam.statsClientReqList, LL_ACCESS_LOCK );
-
    if(!pEntry)
    {
       //list empty
@@ -13647,25 +12921,18 @@
              "upper layer client(s)\n");
       return NULL;
    }
-
    while( pEntry )
    {
       pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrStatsClientReqInfo, link );
-
       if((pTempStaEntry->statsMask & ~(1 << eCsrGlobalClassDStats))  == statsMask)
       {
          smsLog(pMac, LOGW, "csrRoamCheckClientReqList: match found\n");
-
          break;
       }
-
       pEntry = csrLLNext( &pMac->roam.statsClientReqList, pEntry, LL_ACCESS_NOLOCK );
    }
-
    return pEntry;
 }
-
-
 eHalStatus csrRoamRegisterLinkQualityIndCallback(tpAniSirGlobal pMac,
                                                  csrRoamLinkQualityIndCallback   callback,  
                                                  void                           *pContext)
@@ -13679,32 +12946,25 @@
    else
    {
      smsLog(pMac, LOGW, "csrRoamRegisterLinkQualityIndCallback: indication callback being registered");
-
      /* do we need to invoke the callback to notify client of initial value ??  */
    }
    return eHAL_STATUS_SUCCESS;
 }
-
 void csrRoamVccTrigger(tpAniSirGlobal pMac)
 {
    eCsrRoamLinkQualityInd newVccLinkQuality;
    tANI_U32 ul_mac_loss = 0;
    tANI_U32 ul_mac_loss_trigger_threshold;
-
  /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    /*-------------------------------------------------------------------------
      Link quality is currently binary based on OBIWAN recommended triggers
-
      Check for a change in link quality and notify client if necessary
    -------------------------------------------------------------------------*/
    ul_mac_loss_trigger_threshold = 
       pMac->roam.configParam.vccUlMacLossThreshold;
-
    VOS_ASSERT( ul_mac_loss_trigger_threshold != 0 );
-
    smsLog(pMac, LOGW, "csrRoamVccTrigger: UL_MAC_LOSS_THRESHOLD is %d\n", 
           ul_mac_loss_trigger_threshold );
-
    if(ul_mac_loss_trigger_threshold < ul_mac_loss)
    {
       smsLog(pMac, LOGW, "csrRoamVccTrigger: link quality is POOR \n");
@@ -13715,10 +12975,8 @@
       smsLog(pMac, LOGW, "csrRoamVccTrigger: link quality is GOOD\n");
       newVccLinkQuality = eCSR_ROAM_LINK_QUAL_GOOD_IND;
    }
-
    smsLog(pMac, LOGW, "csrRoamVccTrigger: link qual : *** UL_MAC_LOSS %d *** ",
           ul_mac_loss);
-
    if(newVccLinkQuality != pMac->roam.vccLinkQuality)
    {
       smsLog(pMac, LOGW, "csrRoamVccTrigger: link quality changed: trigger necessary\n");
@@ -13733,12 +12991,9 @@
          //event: EVENT_WLAN_VCC
       }
    }
-
    pMac->roam.vccLinkQuality = newVccLinkQuality;
 
-
 }
-
 VOS_STATUS csrRoamVccTriggerRssiIndCallback(tHalHandle hHal, 
                                             v_U8_t  rssiNotification, 
                                             void * context)
@@ -13750,7 +13005,6 @@
    VOS_STATUS status = VOS_STATUS_SUCCESS;
    /*-------------------------------------------------------------------------
      Link quality is currently binary based on OBIWAN recommended triggers
-
      Check for a change in link quality and notify client if necessary
    -------------------------------------------------------------------------*/
    smsLog(pMac, LOGW, "csrRoamVccTriggerRssiIndCallback: RSSI trigger threshold is %d\n", 
@@ -13760,7 +13014,6 @@
       smsLog(pMac, LOGW, "csrRoamVccTriggerRssiIndCallback: ignoring the indication as we are not connected\n");
       return VOS_STATUS_SUCCESS;
    }
-
    if(WLANTL_HO_THRESHOLD_DOWN == rssiNotification)
    {
       smsLog(pMac, LOGW, "csrRoamVccTriggerRssiIndCallback: link quality is POOR\n");
@@ -13776,11 +13029,9 @@
       smsLog(pMac, LOGW, "csrRoamVccTriggerRssiIndCallback: unknown rssi notification %d\n", rssiNotification);
       //Set to this so the code below won't do anything
       newVccLinkQuality = pMac->roam.vccLinkQuality;    
-
       VOS_ASSERT(0);
    }
 
-
    if(newVccLinkQuality != pMac->roam.vccLinkQuality)
    {
       smsLog(pMac, LOGW, "csrRoamVccTriggerRssiIndCallback: link quality changed: trigger necessary\n");
@@ -13788,28 +13039,21 @@
       {
          smsLog(pMac, LOGW, "csrRoamVccTriggerRssiIndCallback: link quality indication %d\n",
                 newVccLinkQuality);
-
         /* we now invoke the callback once to notify client of initial value   */
         pMac->roam.linkQualityIndInfo.callback( newVccLinkQuality, 
                                                 pMac->roam.linkQualityIndInfo.context );
          //event: EVENT_WLAN_VCC
       }
    }
-
    pMac->roam.vccLinkQuality = newVccLinkQuality;
-
    return status;
 }
-
-
 tCsrStatsClientReqInfo * csrRoamInsertEntryIntoList( tpAniSirGlobal pMac,
                                                      tDblLinkList *pStaList,
                                                      tCsrStatsClientReqInfo *pStaEntry)
 {
    tCsrStatsClientReqInfo *pNewStaEntry = NULL;
-
    eHalStatus  status;
-
    //if same entity requested for same set of stats with different periodicity & 
    // callback update it
    if(NULL == csrRoamChecknUpdateClientReqList(pMac, pStaEntry, TRUE))
@@ -13823,7 +13067,6 @@
          return NULL;
       }
    
-
       pNewStaEntry->callback = pStaEntry->callback;
       pNewStaEntry->pContext = pStaEntry->pContext;
       pNewStaEntry->periodicity = pStaEntry->periodicity;
@@ -13839,15 +13082,12 @@
    return pNewStaEntry;
 }
 
-
 tCsrPeStatsReqInfo * csrRoamInsertEntryIntoPeStatsReqList( tpAniSirGlobal pMac,
                                                            tDblLinkList *pStaList,
                                                            tCsrPeStatsReqInfo *pStaEntry)
 {
    tCsrPeStatsReqInfo *pNewStaEntry = NULL;
-
    eHalStatus  status;
-
    status = palAllocateMemory(pMac->hHdd, (void **)&pNewStaEntry, sizeof(tCsrPeStatsReqInfo));
    if (!HAL_STATUS_SUCCESS(status))
    {
@@ -13856,7 +13096,6 @@
       return NULL;
    }
    
-
    pNewStaEntry->hPeStatsTimer = pStaEntry->hPeStatsTimer;
    pNewStaEntry->numClient = pStaEntry->numClient;
    pNewStaEntry->periodicity = pStaEntry->periodicity;
@@ -13867,11 +13106,8 @@
    pNewStaEntry->rspPending = pStaEntry->rspPending;
    
    csrLLInsertTail( pStaList, &pNewStaEntry->link, LL_ACCESS_LOCK  );
-
    return pNewStaEntry;
 }
-
-
 eHalStatus csrGetRssi(tpAniSirGlobal pMac, 
                             tCsrRssiCallback callback, 
                             tANI_U8 staId, tCsrBssid bssId, void *pContext, void* pVosContext)
@@ -13888,7 +13124,6 @@
       smsLog(pMac, LOGE, " csrGetRssi: failed to allocate mem for req \n");
       return status;
    }
-
    csrRoamGetSessionIdFromBSSID(pMac, (tCsrBssid *)bssId, &sessionId);
 
    pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GET_RSSI_REQ);
@@ -13898,11 +13133,9 @@
    pMsg->rssiCallback = callback;
    pMsg->pDevContext = pContext;
    pMsg->pVosContext = pVosContext;
-
    msg.type = eWNI_SME_GET_RSSI_REQ;
    msg.bodyptr = pMsg;
    msg.reserved = 0;
-
    if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg))
    {
        smsLog(pMac, LOGE, " csrGetRssi failed to post msg to self \n");   
@@ -13912,7 +13145,6 @@
    smsLog(pMac, LOG2, FL("returned"));      
    return status;
 }
-
 eHalStatus csrGetStatistics(tpAniSirGlobal pMac, eCsrStatsRequesterType requesterId, 
                             tANI_U32 statsMask, 
                             tCsrStatsCallback callback, 
@@ -13927,20 +13159,19 @@
    eHalStatus status = eHAL_STATUS_SUCCESS;
    tANI_BOOLEAN insertInClientList = FALSE;
    VOS_STATUS vosStatus;
+   WLANTL_TRANSFER_STA_TYPE *pTlStats;
 
    if( csrIsAllSessionDisconnected(pMac) )
    {
       //smsLog(pMac, LOGW, "csrGetStatistics: wrong state curState(%d) not connected\n", pMac->roam.curState);
       return eHAL_STATUS_FAILURE;
    }
-
    if((!statsMask) && (!callback))
    {
       //msg
       smsLog(pMac, LOGW, "csrGetStatistics: statsMask & callback empty in the request\n");
       return eHAL_STATUS_FAILURE;
    }
-
    //for the search list method for deregister
    staEntry.requesterId = requesterId;
    staEntry.statsMask = statsMask;
@@ -13961,12 +13192,12 @@
          pStaEntry = GET_BASE_ADDR( pEntry, tCsrStatsClientReqInfo, link );
          if(NULL != pStaEntry->pPeStaEntry)
          {
-         pStaEntry->pPeStaEntry->numClient--;
-         //check if we need to delete the entry from peStatsReqList too
-         if(!pStaEntry->pPeStaEntry->numClient)
-         {
-            csrRoamRemoveEntryFromPeStatsReqList(pMac, pStaEntry->pPeStaEntry);
-         }
+            pStaEntry->pPeStaEntry->numClient--;
+            //check if we need to delete the entry from peStatsReqList too
+            if(!pStaEntry->pPeStaEntry->numClient)
+            {
+               csrRoamRemoveEntryFromPeStatsReqList(pMac, pStaEntry->pPeStaEntry);
+            }
          }
 
          //check if we need to stop the tl stats timer too 
@@ -13986,14 +13217,12 @@
             pMac->roam.tlStatsReqInfo.timerRunning = FALSE;
          }
          vos_timer_stop( &pStaEntry->timer );
-
          // Destroy the vos timer...      
          vosStatus = vos_timer_destroy( &pStaEntry->timer );
          if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) )
          {
             smsLog(pMac, LOGE, FL("csrGetStatistics:failed to destroy Client req timer\n"));
          }
-
          csrRoamRemoveStatListEntry(pMac, pEntry);
          pStaEntry = NULL;
          return eHAL_STATUS_SUCCESS;
@@ -14017,7 +13246,6 @@
       staEntry.timerExpired = FALSE;
    
    
-
       //if periodic report requested with non cached result from PE/TL
       if(periodicity)
       {
@@ -14067,19 +13295,27 @@
                
                if(!pMac->roam.tlStatsReqInfo.timerRunning)
                {
-#if 0
-                                   // TODO Session Specific info connectedInfo
-                  //req TL for class D stats
-                  if(WLANTL_GetStatistics(pMac->roam.gVosContext, &tlStats, pMac->roam.connectedInfo.staId))
+                  pTlStats = (WLANTL_TRANSFER_STA_TYPE *)vos_mem_malloc(sizeof(WLANTL_TRANSFER_STA_TYPE));
+                  if(NULL != pTlStats)
                   {
-                     smsLog(pMac, LOGE, FL("csrGetStatistics:couldn't get the stats from TL\n"));
+                     //req TL for class D stats
+                     if(WLANTL_GetStatistics(pMac->roam.gVosContext, pTlStats, staId))
+                     {
+                        smsLog(pMac, LOGE, FL("csrGetStatistics:couldn't get the stats from TL\n"));
+                     }
+                     else
+                     {
+                        //save in SME
+                        csrRoamSaveStatsFromTl(pMac, pTlStats);
+                     }
+                     vos_mem_free(pTlStats);
+                     pTlStats = NULL;
                   }
                   else
                   {
-                     //save in SME
-                     csrRoamSaveStatsFromTl(pMac, tlStats);
+                     smsLog(pMac, LOGE, FL("cannot allocate memory for TL stat"));
                   }
-#endif
+
                   if(pMac->roam.tlStatsReqInfo.periodicity)
                   {
                      //start timer
@@ -14114,23 +13350,29 @@
             //right away
             staEntry.timerExpired = TRUE;
             insertInClientList = TRUE;
-
          }
          if(statsMask & (1 << eCsrGlobalClassDStats))
          {
-#if 0
-                         // TODO : Per Session info connectedInfo
-            //req TL for class D stats
-            if(WLANTL_GetStatistics(pMac->roam.gVosContext, &tlStats, pMac->roam.connectedInfo.staId))
+            pTlStats = (WLANTL_TRANSFER_STA_TYPE *)vos_mem_malloc(sizeof(WLANTL_TRANSFER_STA_TYPE));
+            if(NULL != pTlStats)
             {
-               smsLog(pMac, LOGE, FL("csrGetStatistics:couldn't get the stats from TL\n"));
+               //req TL for class D stats
+               if(!VOS_IS_STATUS_SUCCESS(WLANTL_GetStatistics(pMac->roam.gVosContext, pTlStats, staId)))
+               {
+                  smsLog(pMac, LOGE, FL("csrGetStatistics:couldn't get the stats from TL\n"));
+               }
+               else
+               {
+                  //save in SME
+                  csrRoamSaveStatsFromTl(pMac, pTlStats);
+               }
+               vos_mem_free(pTlStats);
+               pTlStats = NULL;
             }
             else
             {
-               //save in SME
-               csrRoamSaveStatsFromTl(pMac, tlStats);
+               smsLog(pMac, LOGE, FL("cannot allocate memory for TL stat"));
             }
-#endif
 
          }
          //if looking for stats from TL only 
@@ -14139,9 +13381,7 @@
             //return the stats
             csrRoamReportStatistics(pMac, statsMask, callback, staId, pContext);
          }
-
       }
-
       if(insertInClientList)
       {
          pStaEntry = csrRoamInsertEntryIntoList(pMac, &pMac->roam.statsClientReqList, &staEntry); 
@@ -14151,6 +13391,7 @@
             smsLog(pMac, LOGW, "csrGetStatistics: Failed to insert req in statsClientReqList\n");
             return eHAL_STATUS_FAILURE;
          }
+         pStaEntry->periodicity = periodicity;
          //Init & start timer if needed
          if(periodicity)
          {
@@ -14167,16 +13408,12 @@
                smsLog(pMac, LOGE, FL("csrGetStatistics:cannot start StatsClient timer\n"));
                return eHAL_STATUS_FAILURE;
             }
-
          }
-
       }
-
    }
    return eHAL_STATUS_SUCCESS;
 }
 
-
 tCsrPeStatsReqInfo * csrRoamCheckPeStatsReqList(tpAniSirGlobal pMac, tANI_U32  statsMask, 
                                                 tANI_U32 periodicity, tANI_BOOLEAN *pFound, tANI_U8 staId)
 {
@@ -14202,7 +13439,6 @@
       {
          pTempStaEntry->periodicity = periodicity;
       }
-
       pTempStaEntry->numClient++;
          found = TRUE;
    }
@@ -14224,7 +13460,6 @@
          return NULL;
       }
    }
-
    pmcQueryPowerState(pMac, &powerState, NULL, NULL);
    if(ePMC_FULL_POWER == powerState)
    {
@@ -14268,11 +13503,9 @@
                smsLog(pMac, LOGE, FL("csrRoamCheckPeStatsReqList:cannot init hPeStatsTimer timer\n"));
                return NULL;
             }
-
          }
          //start timer
          smsLog(pMac, LOG1, "csrRoamCheckPeStatsReqList:peStatsTimer period %d\n", pTempStaEntry->periodicity);
-
          vosStatus = vos_timer_start( &pTempStaEntry->hPeStatsTimer, pTempStaEntry->periodicity );
          if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) ) 
          {
@@ -14282,12 +13515,10 @@
          pTempStaEntry->timerRunning = TRUE;
       }
    }
-
    *pFound = found;
    return pTempStaEntry;
 }
 
-
 /*
     pStaEntry is no longer invalid upon the return of this function.
 */
@@ -14298,10 +13529,9 @@
         if(csrLLRemoveEntry(&pMac->roam.statsClientReqList, pEntry, LL_ACCESS_LOCK))
         {
             palFreeMemory(pMac->hHdd, GET_BASE_ADDR( pEntry, tCsrStatsClientReqInfo, link ));
+            }
         }
     }
-}
-
 
 void csrRoamRemoveEntryFromPeStatsReqList(tpAniSirGlobal pMac, tCsrPeStatsReqInfo *pPeStaEntry)
 {
@@ -14309,18 +13539,15 @@
    tCsrPeStatsReqInfo *pTempStaEntry;
    VOS_STATUS vosStatus;
    pEntry = csrLLPeekHead( &pMac->roam.peStatsReqList, LL_ACCESS_LOCK );
-
    if(!pEntry)
    {
       //list empty
       smsLog(pMac, LOGW, "csrRoamRemoveEntryFromPeStatsReqList: List empty, no stats req for PE\n");
       return;
    }
-
    while( pEntry )
    {
       pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrPeStatsReqInfo, link );
-
       if( pTempStaEntry && pTempStaEntry->statsMask == pPeStaEntry->statsMask)
       {
          smsLog(pMac, LOGW, "csrRoamRemoveEntryFromPeStatsReqList: match found\n");
@@ -14349,7 +13576,7 @@
                // memory for the PE stat entry in the timer CB.
                pTempStaEntry->timerStopFailed = TRUE;
             }
-         }
+         } 
 
          if(csrLLRemoveEntry(&pMac->roam.peStatsReqList, pEntry, LL_ACCESS_LOCK))
          {
@@ -14365,35 +13592,33 @@
          pEntry = csrLLNext( &pMac->roam.peStatsReqList, pEntry, LL_ACCESS_NOLOCK );
       }
    }
-
    return;
 }
 
 
-void csrRoamSaveStatsFromTl(tpAniSirGlobal pMac, WLANTL_TRANSFER_STA_TYPE tlStats)
+void csrRoamSaveStatsFromTl(tpAniSirGlobal pMac, WLANTL_TRANSFER_STA_TYPE *pTlStats)
 {
 
-   pMac->roam.classDStatsInfo.num_rx_bytes_crc_ok = tlStats.rxBcntCRCok;
-   pMac->roam.classDStatsInfo.rx_bc_byte_cnt = tlStats.rxBCBcnt;
-   pMac->roam.classDStatsInfo.rx_bc_frm_cnt = tlStats.rxBCFcnt;
-   pMac->roam.classDStatsInfo.rx_byte_cnt = tlStats.rxBcnt;
-   pMac->roam.classDStatsInfo.rx_mc_byte_cnt = tlStats.rxMCBcnt;
-   pMac->roam.classDStatsInfo.rx_mc_frm_cnt = tlStats.rxMCFcnt;
-   pMac->roam.classDStatsInfo.rx_rate = tlStats.rxRate;
+   pMac->roam.classDStatsInfo.num_rx_bytes_crc_ok = pTlStats->rxBcntCRCok;
+   pMac->roam.classDStatsInfo.rx_bc_byte_cnt = pTlStats->rxBCBcnt;
+   pMac->roam.classDStatsInfo.rx_bc_frm_cnt = pTlStats->rxBCFcnt;
+   pMac->roam.classDStatsInfo.rx_byte_cnt = pTlStats->rxBcnt;
+   pMac->roam.classDStatsInfo.rx_mc_byte_cnt = pTlStats->rxMCBcnt;
+   pMac->roam.classDStatsInfo.rx_mc_frm_cnt = pTlStats->rxMCFcnt;
+   pMac->roam.classDStatsInfo.rx_rate = pTlStats->rxRate;
    //?? need per AC
-   pMac->roam.classDStatsInfo.rx_uc_byte_cnt[0] = tlStats.rxUCBcnt;
-   pMac->roam.classDStatsInfo.rx_uc_frm_cnt = tlStats.rxUCFcnt;
-   pMac->roam.classDStatsInfo.tx_bc_byte_cnt = tlStats.txBCBcnt;
-   pMac->roam.classDStatsInfo.tx_bc_frm_cnt = tlStats.txBCFcnt;
-   pMac->roam.classDStatsInfo.tx_mc_byte_cnt = tlStats.txMCBcnt;
-   pMac->roam.classDStatsInfo.tx_mc_frm_cnt = tlStats.txMCFcnt;
+   pMac->roam.classDStatsInfo.rx_uc_byte_cnt[0] = pTlStats->rxUCBcnt;
+   pMac->roam.classDStatsInfo.rx_uc_frm_cnt = pTlStats->rxUCFcnt;
+   pMac->roam.classDStatsInfo.tx_bc_byte_cnt = pTlStats->txBCBcnt;
+   pMac->roam.classDStatsInfo.tx_bc_frm_cnt = pTlStats->txBCFcnt;
+   pMac->roam.classDStatsInfo.tx_mc_byte_cnt = pTlStats->txMCBcnt;
+   pMac->roam.classDStatsInfo.tx_mc_frm_cnt = pTlStats->txMCFcnt;
    //?? need per AC
-   pMac->roam.classDStatsInfo.tx_uc_byte_cnt[0] = tlStats.txUCBcnt;
-   pMac->roam.classDStatsInfo.tx_uc_frm_cnt = tlStats.txUCFcnt;
+   pMac->roam.classDStatsInfo.tx_uc_byte_cnt[0] = pTlStats->txUCBcnt;
+   pMac->roam.classDStatsInfo.tx_uc_frm_cnt = pTlStats->txUCFcnt;
 
 }
 
-
 void csrRoamReportStatistics(tpAniSirGlobal pMac, tANI_U32 statsMask, 
                              tCsrStatsCallback callback, tANI_U8 staId, void *pContext)
 {
@@ -14402,7 +13627,6 @@
    tANI_U32 tempMask = 0;
    tANI_U8 counter = 0;
    eHalStatus status = eHAL_STATUS_FAILURE;
-
    if(!callback)
    {
       smsLog(pMac, LOGE, FL("csrRoamReportStatistics:cannot report callback NULL\n"));
@@ -14413,11 +13637,8 @@
       smsLog(pMac, LOGE, FL("csrRoamReportStatistics:cannot report statsMask is 0\n"));
       return;
    }
-
    pStats = stats;
-
    tempMask = statsMask;
-
    while(tempMask)
    {
       if(tempMask & 1)
@@ -14435,7 +13656,6 @@
             }
             pStats += sizeof(tCsrSummaryStatsInfo);
             break;
-
          case eCsrGlobalClassAStats:
             smsLog( pMac, LOG1, FL("csrRoamReportStatistics:ClassA stats\n"));
             status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classAStatsInfo, 
@@ -14445,9 +13665,7 @@
                smsLog( pMac, LOG1, FL("csrRoamReportStatistics:failed to copy ClassA stats\n"));
             }
             pStats += sizeof(tCsrGlobalClassAStatsInfo);
-
             break;
-
          case eCsrGlobalClassBStats:
             smsLog( pMac, LOG1, FL("csrRoamReportStatistics:ClassB stats\n"));
             status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classBStatsInfo, 
@@ -14457,9 +13675,7 @@
                smsLog( pMac, LOG1, FL("csrRoamReportStatistics:failed to copy ClassB stats\n"));
             }
             pStats += sizeof(tCsrGlobalClassBStatsInfo);
-
             break;
-
          case eCsrGlobalClassCStats:
             smsLog( pMac, LOG1, FL("csrRoamReportStatistics:ClassC stats\n"));
             status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classCStatsInfo, 
@@ -14469,9 +13685,7 @@
                smsLog( pMac, LOG1, FL("csrRoamReportStatistics:failed to copy ClassC stats\n"));
             }
             pStats += sizeof(tCsrGlobalClassCStatsInfo);
-
             break;
-
          case eCsrGlobalClassDStats:
             smsLog( pMac, LOG1, FL("csrRoamReportStatistics:ClassD stats\n"));
             status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.classDStatsInfo, 
@@ -14481,9 +13695,7 @@
                smsLog( pMac, LOG1, FL("csrRoamReportStatistics:failed to copy ClassD stats\n"));
             }
             pStats += sizeof(tCsrGlobalClassDStatsInfo);
-
             break;
-
          case eCsrPerStaStats:
             smsLog( pMac, LOG1, FL("csrRoamReportStatistics:PerSta stats\n"));
             status = palCopyMemory(pMac->hHdd, pStats, (tANI_U8 *)&pMac->roam.perStaStatsInfo[staId], 
@@ -14493,26 +13705,18 @@
                smsLog( pMac, LOG1, FL("csrRoamReportStatistics:failed to copy PerSta stats\n"));
             }
             pStats += sizeof(tCsrPerStaStatsInfo);
-
             break;
-
          default:
             smsLog( pMac, LOG1, FL("csrRoamReportStatistics:unknown stats type\n"));
             break;
-
          }
       }
-
       tempMask >>=1;
       counter++;
    }
-
    callback(stats, pContext );
-
 }
 
-
-
 eHalStatus csrRoamDeregStatisticsReq(tpAniSirGlobal pMac)
 {
    tListElem *pEntry = NULL;
@@ -14521,7 +13725,6 @@
    eHalStatus status = eHAL_STATUS_SUCCESS;
    VOS_STATUS vosStatus;
    pEntry = csrLLPeekHead( &pMac->roam.statsClientReqList, LL_ACCESS_LOCK );
-
    if(!pEntry)
    {
       //list empty
@@ -14529,7 +13732,6 @@
              "upper layer client(s)\n");
       return status;
    }
-
    while( pEntry )
    {
       if(pPrevEntry)
@@ -14540,19 +13742,16 @@
                                  pTempStaEntry->staId, pTempStaEntry->pContext);
          csrRoamRemoveStatListEntry(pMac, pPrevEntry);
       }
-
       pTempStaEntry = GET_BASE_ADDR( pEntry, tCsrStatsClientReqInfo, link );
-
       if (pTempStaEntry->pPeStaEntry)  //pPeStaEntry can be NULL
       {
-      pTempStaEntry->pPeStaEntry->numClient--;
-      //check if we need to delete the entry from peStatsReqList too
-      if(!pTempStaEntry->pPeStaEntry->numClient)
-      {
-         csrRoamRemoveEntryFromPeStatsReqList(pMac, pTempStaEntry->pPeStaEntry);
+         pTempStaEntry->pPeStaEntry->numClient--;
+         //check if we need to delete the entry from peStatsReqList too
+         if(!pTempStaEntry->pPeStaEntry->numClient)
+         {
+            csrRoamRemoveEntryFromPeStatsReqList(pMac, pTempStaEntry->pPeStaEntry);
+         }
       }
-      }
-
       //check if we need to stop the tl stats timer too 
       pMac->roam.tlStatsReqInfo.numClient--;
       if(!pMac->roam.tlStatsReqInfo.numClient)
@@ -14569,24 +13768,21 @@
          pMac->roam.tlStatsReqInfo.periodicity = 0;
          pMac->roam.tlStatsReqInfo.timerRunning = FALSE;
       }
-
       if (pTempStaEntry->periodicity)
       {
           //While creating StaEntry in csrGetStatistics,
           //Initializing and starting timer only when periodicity is set. 
           //So Stop and Destroy timer only when periodicity is set.
           
-
-      vos_timer_stop( &pTempStaEntry->timer );
-
-      // Destroy the vos timer...      
-      vosStatus = vos_timer_destroy( &pTempStaEntry->timer );
-      if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) )
-      {
-         smsLog(pMac, LOGE, FL("csrRoamDeregStatisticsReq:failed to destroy Client req timer\n"));
+          vos_timer_stop( &pTempStaEntry->timer );
+          // Destroy the vos timer...      
+          vosStatus = vos_timer_destroy( &pTempStaEntry->timer );
+          if ( !VOS_IS_STATUS_SUCCESS( vosStatus ) )
+          {
+              smsLog(pMac, LOGE, FL("csrRoamDeregStatisticsReq:failed to destroy Client req timer\n"));
+          }
       }
-      }
-
+      
       
       pPrevEntry = pEntry;
       pEntry = csrLLNext( &pMac->roam.statsClientReqList, pEntry, LL_ACCESS_NOLOCK );
@@ -14600,12 +13796,10 @@
                                  pTempStaEntry->staId, pTempStaEntry->pContext);
       csrRoamRemoveStatListEntry(pMac, pPrevEntry);
    }
-
    return status;
    
 }
 
-
 eHalStatus csrIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand, 
                                    tRequestFullPowerReason *pReason,
                                    tANI_BOOLEAN *pfNeedPower )
@@ -14616,7 +13810,6 @@
     eHalStatus status = eHAL_STATUS_SUCCESS;
         // TODO : Session info unavailable
         tANI_U32 sessionId = 0;
-
     if( pfNeedPower )
     {
         *pfNeedPower = eANI_BOOLEAN_FALSE;
@@ -14626,10 +13819,8 @@
         {
                 return eHAL_STATUS_SUCCESS;
         }
-
     //Check PMC state first
     pmcState = pmcGetPmcState( pMac );
-
     switch( pmcState )
     {
     case REQUEST_IMPS:
@@ -14645,7 +13836,6 @@
                 //Internal process, no need for full power
                 fNeedFullPower = eANI_BOOLEAN_FALSE;
                 break;
-
             default:
                 //Other scans are real scan, ask for power
                 fNeedFullPower = eANI_BOOLEAN_TRUE;
@@ -14658,7 +13848,6 @@
             fNeedFullPower = eANI_BOOLEAN_TRUE;
         }
         break;
-
     case REQUEST_BMPS:
     case BMPS:
     case REQUEST_START_UAPSD:
@@ -14671,7 +13860,6 @@
             tScanResultList *pBSSList = (tScanResultList *)pCommand->u.roamCmd.hBSSList;
             tCsrScanResult *pScanResult;
             tListElem *pEntry;
-
             switch ( pCommand->u.roamCmd.roamReason )
             {
             case eCsrForcedDisassoc:
@@ -14685,11 +13873,9 @@
             case eCsrSmeIssuedReassocToSameAP:
                 fNeedFullPower = eANI_BOOLEAN_TRUE;
                 break;
-
             case eCsrCapsChange:
                 fNeedFullPower = eANI_BOOLEAN_TRUE;
                 break;
-
             default:
                 //Check whether the profile is already connected. If so, no need for full power
                 //Note: IBSS is ignored for now because we don't support powersave in IBSS
@@ -14738,7 +13924,6 @@
             reason = eSME_LINK_DISCONNECTED_BY_OTHER;
         }
         break;
-
     case REQUEST_STOP_UAPSD:
     case REQUEST_EXIT_WOWL:
         if( eSmeCommandRoam == pCommand->command )
@@ -14755,7 +13940,6 @@
             }
                 }
         break;
-
     case STOPPED:
     case REQUEST_STANDBY:
     case STANDBY:
@@ -14764,15 +13948,12 @@
         smsLog( pMac, LOGE, FL( "  cannot process because PMC is in stopped/standby state %d\n" ), pmcState );
         status = eHAL_STATUS_FAILURE;
         break;
-
     case FULL_POWER:
     case REQUEST_FULL_POWER:
     default:
         //No need to ask for full power. This has to be FULL_POWER state
         break;
-
     } //switch
-
     if( pReason )
     {
         *pReason = reason;
@@ -14781,41 +13962,32 @@
     {
         *pfNeedPower = fNeedFullPower;
     }
-
     return ( status );
 }
 
-
 static eHalStatus csrRequestFullPower( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tANI_BOOLEAN fNeedFullPower = eANI_BOOLEAN_FALSE;
     tRequestFullPowerReason reason = eSME_REASON_OTHER;
-
     status = csrIsFullPowerNeeded( pMac, pCommand, &reason, &fNeedFullPower );
-
     if( fNeedFullPower && HAL_STATUS_SUCCESS( status ) )
     {
         status = pmcRequestFullPower(pMac, csrFullPowerCallback, pMac, reason);
     }
-
     return ( status );
 }
 
-
 tSmeCmd *csrGetCommandBuffer( tpAniSirGlobal pMac )
 {
     tSmeCmd *pCmd = smeGetCommandBuffer( pMac );
-
     if( pCmd )
     {
         pMac->roam.sPendingCommands++;
     }
-
     return ( pCmd );
 }
 
-
 void csrReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 {
    if (pMac->roam.sPendingCommands > 0)
@@ -14832,12 +14004,10 @@
    }
 }
 
-
 //Return SUCCESS is the command is queued, failed
 eHalStatus csrQueueSmeCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fHighPriority )
 {
     eHalStatus status;
-
     if( (eSmeCommandScan == pCommand->command) && pMac->scan.fDropScanCmd )
     {
         smsLog(pMac, LOGW, FL(" drop scan (scan reason %d) command"),
@@ -14851,7 +14021,6 @@
     if( HAL_STATUS_SUCCESS( status ) )
     {
         tANI_BOOLEAN fNoCmdPending;
-
         //make sure roamCmdPendingList is not empty first
         fNoCmdPending = csrLLIsListEmpty( &pMac->roam.roamCmdPendingList, eANI_BOOLEAN_FALSE );
         if( fNoCmdPending )
@@ -14890,11 +14059,8 @@
         //release the command.
         smsLog( pMac, LOGE, FL( "  cannot queue command %d\n" ), pCommand->command );
     }
-
     return ( status );
-
 }
-
 #ifdef WLAN_SOFTAP_FEATURE
 eHalStatus csrRoamUpdateAPWPSIE( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirAPWPSIEs* pAPWPSIES )
 {
@@ -14909,7 +14075,6 @@
         return eHAL_STATUS_FAILURE;
     }
 
-
     do
     {
         status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof(tSirUpdateAPWPSIEsReq) );
@@ -14919,55 +14084,42 @@
 
         pBuf = (tANI_U8 *)&pMsg->transactionId;
         wTmpBuf = pBuf;
-
         // transactionId
         *pBuf = 0;
         *( pBuf + 1 ) = 0;
         pBuf += sizeof(tANI_U16);
-
         // bssId
         palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, &pSession->selfMacAddr, sizeof(tSirMacAddr) );
         pBuf += sizeof(tSirMacAddr);
-
         //sessionId
         *pBuf++ = (tANI_U8)sessionId;
-
         // APWPSIEs
         palCopyMemory( pMac->hHdd, (tSirAPWPSIEs *)pBuf, pAPWPSIES, sizeof(tSirAPWPSIEs));
         pBuf += sizeof(tSirAPWPSIEs);
-
         pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32) + (pBuf - wTmpBuf))); //msg_header + msg
-
         status = palSendMBMessage(pMac->hHdd, pMsg);
-
     } while( 0 );
-
     return ( status );
 }
-
 eHalStatus csrRoamUpdateWPARSNIEs( tpAniSirGlobal pMac, tANI_U32 sessionId, tSirRSNie * pAPSirRSNie)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tSirUpdateAPWPARSNIEsReq *pMsg;
     tANI_U8 *pBuf = NULL, *wTmpBuf = NULL;
-
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
     if (NULL == pSession)
     {
         smsLog( pMac, LOGE, FL( "  Session does not exist for session id %d" ), sessionId);
         return eHAL_STATUS_FAILURE;
     }
-
     do
     {
         status = palAllocateMemory( pMac->hHdd, (void **)&pMsg, sizeof(tSirUpdateAPWPARSNIEsReq) );
         if (!HAL_STATUS_SUCCESS(status)) break;
         palZeroMemory( pMac->hHdd, pMsg, sizeof( tSirUpdateAPWPARSNIEsReq ) );
         pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_SET_APWPARSNIEs_REQ);
-
         pBuf = (tANI_U8 *)&pMsg->transactionId;
         wTmpBuf = pBuf;
-
         // transactionId
         *pBuf = 0;
         *( pBuf + 1 ) = 0;
@@ -14976,23 +14128,17 @@
         // bssId
         palCopyMemory( pMac->hHdd, (tSirMacAddr *)pBuf, &pSession->selfMacAddr, sizeof(tSirMacAddr) );
         pBuf += sizeof(tSirMacAddr);
-
         // sessionId
         *pBuf++ = (tANI_U8)sessionId;
     
         // APWPARSNIEs
         palCopyMemory( pMac->hHdd, (tSirRSNie *)pBuf, pAPSirRSNie, sizeof(tSirRSNie));
         pBuf += sizeof(tSirRSNie);
-
         pMsg->length = pal_cpu_to_be16((tANI_U16)(sizeof(tANI_U32 ) + (pBuf - wTmpBuf))); //msg_header + msg
-
     status = palSendMBMessage(pMac->hHdd, pMsg);
-
     } while( 0 );
-
     return ( status );
 }
-
 #endif //#ifdef WLAN_SOFTAP_FEATURE
 
 #ifdef WLAN_FEATURE_VOWIFI_11R
@@ -15003,7 +14149,6 @@
     tpSirFTPreAuthReq pftPreAuthReq;
     tANI_U16 auth_req_len = 0;
     tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
-
     auth_req_len = sizeof(tSirFTPreAuthReq);
     pftPreAuthReq = (tpSirFTPreAuthReq)vos_mem_malloc(auth_req_len);
     if (pftPreAuthReq == NULL)
@@ -15011,10 +14156,8 @@
         smsLog(pMac, LOGE, FL("Memory allocation for FT Preauth request failed"));
         return eHAL_STATUS_RESOURCES;
     }
-
     // Save the SME Session ID here. We need it while processing the preauth response
     pMac->ft.ftSmeContext.smeSessionId = sessionId;
-
     vos_mem_zero(pftPreAuthReq, auth_req_len);
 
     pftPreAuthReq->pbssDescription = (tpSirBssDescription)vos_mem_malloc(
@@ -15024,12 +14167,9 @@
 
     pftPreAuthReq->preAuthchannelNum = pBssDescription->channelId;
 
-
     palCopyMemory(pMac->hHdd, (void *)&pftPreAuthReq->currbssId, (void *)pSession->connectedProfile.bssid, sizeof(tSirMacAddr));
-
     palCopyMemory(pMac->hHdd, (void *)&pftPreAuthReq->preAuthbssId, (void *)pBssDescription->bssId, sizeof(tSirMacAddr));  
 
-
 #ifdef WLAN_FEATURE_VOWIFI_11R
     if (csrRoamIs11rAssoc(pMac))
     {
@@ -15042,15 +14182,11 @@
     {
         pftPreAuthReq->ft_ies_length = 0; 
     }
-
     vos_mem_copy(pftPreAuthReq->pbssDescription, pBssDescription, pBssDescription->length);
-
     pftPreAuthReq->length = pal_cpu_to_be16(sizeof(tSirFTPreAuthReq) + sizeof(pBssDescription->length) +
                                                     pBssDescription->length); 
-
     return palSendMBMessage(pMac->hHdd, pftPreAuthReq);
 }
-
 /*--------------------------------------------------------------------------
  * This will receive and process the FT Pre Auth Rsp from the current 
  * associated ap. 
@@ -15069,22 +14205,17 @@
 #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG
     smsLog( pMac, LOGE, FL("Preauth response status code %d"), pFTPreAuthRsp->status); 
 #endif
-
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING    
     csrNeighborRoamPreauthRspHandler(pMac, (VOS_STATUS)pFTPreAuthRsp->status);
 #endif
-
     /* The below function calls/timers should be invoked only if the pre-auth is successful */
     if (VOS_STATUS_SUCCESS != (VOS_STATUS)pFTPreAuthRsp->status)
         return;
-
     // Implies a success
     pMac->ft.ftSmeContext.FTState = eFT_AUTH_COMPLETE;
-
     // Indicate SME QoS module the completion of Preauth success. This will trigger the creation of RIC IEs
     pMac->ft.ftSmeContext.psavedFTPreAuthRsp = pFTPreAuthRsp;
     sme_QosCsrEventInd(pMac, pMac->ft.ftSmeContext.smeSessionId, SME_QOS_CSR_PREAUTH_SUCCESS_IND, NULL);
-
     /* Start the pre-auth reassoc interval timer with a period of 400ms. When this expires, 
      * actual transition from the current to handoff AP is triggered */
     status = palTimerStart(pMac->hHdd, pMac->ft.ftSmeContext.preAuthReassocIntvlTimer,
@@ -15095,7 +14226,6 @@
         smsLog(pMac, LOGE, FL("Preauth reassoc interval timer start failed to start with status %d\n"), status);
         return;
     }
-
     // Save the received response
     palCopyMemory(pMac->hHdd, (void *)&pMac->ft.ftSmeContext.preAuthbssId, (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid));
     if (csrRoamIs11rAssoc(pMac))
@@ -15103,7 +14233,6 @@
                         eCSR_ROAM_FT_RESPONSE, eCSR_ROAM_RESULT_NONE);
 
     // Currently we dont do anything special for CCX connection.
-
 #ifdef FEATURE_WLAN_LFR
     // If Legacy Fast Roaming is enabled, signal the supplicant  
     // So he can send us a PMK-ID for this candidate AP.
@@ -15141,7 +14270,6 @@
         }
     }
 }
-
 eHalStatus csrRoamStartJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId, tANI_U32 interval)
 {
     eHalStatus status = eHAL_STATUS_FAILURE;
@@ -15167,7 +14295,6 @@
     
     return (status);
 }
-
 eHalStatus csrRoamStopJoinRetryTimer(tpAniSirGlobal pMac, tANI_U32 sessionId)
 {
     smsLog(pMac, LOGE, " csrRoamStopJoinRetryTimer \n ");
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index b60c0da..477e635 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -102,6 +102,7 @@
 #ifdef WLAN_AP_STA_CONCURRENCY
 static void csrStaApConcTimerHandler(void *);
 #endif
+tANI_BOOLEAN csrIsSupportedChannel(tpAniSirGlobal pMac, tANI_U8 channelId);
 eHalStatus csrScanChannels( tpAniSirGlobal pMac, tSmeCmd *pCommand );
 void csrSetCfgValidChannelList( tpAniSirGlobal pMac, tANI_U8 *pChannelList, tANI_U8 NumChannels );
 void csrSaveTxPowerToCfg( tpAniSirGlobal pMac, tDblLinkList *pList, tANI_U32 cfgId );
@@ -492,6 +493,42 @@
 }
 #endif
 
+/* ---------------------------------------------------------------------------
+    \fn csrScan2GOnyRequest
+    \brief This function will update the scan request with only 
+           2.4GHz valid cahnnel list.
+    \param pMac
+    \param pScanCmd
+    \param pScanRequest
+    \return None
+  -------------------------------------------------------------------------------*/
+static void csrScan2GOnyRequest(tpAniSirGlobal pMac,tSmeCmd *pScanCmd, 
+                                tCsrScanRequest *pScanRequest)
+{
+    tANI_U8 index, channelId, channelListSize = 0;
+    tANI_U8 channelList2G[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};
+    static tANI_U8 validchannelList[CSR_MAX_2_4_GHZ_SUPPORTED_CHANNELS] = {0};
+
+    VOS_ASSERT(pScanCmd && pScanRequest);
+
+    if (pScanCmd->u.scanCmd.scanID ||
+       (eCSR_SCAN_REQUEST_FULL_SCAN != pScanRequest->requestType))
+           return;
+
+    //Contsruct valid Supported 2.4 GHz Channel List
+    for( index = 0; index < ARRAY_SIZE(channelList2G); index++ )
+    {
+        channelId = channelList2G[index];
+        if ( csrIsSupportedChannel( pMac, channelId ) )
+        {
+            validchannelList[channelListSize++] = channelId;
+        }
+    }
+
+    pScanRequest->ChannelInfo.numOfChannels = channelListSize;
+    pScanRequest->ChannelInfo.ChannelList = validchannelList;
+}
+
 eHalStatus csrScanRequest(tpAniSirGlobal pMac, tANI_U16 sessionId, 
               tCsrScanRequest *pScanRequest, tANI_U32 *pScanRequestID, 
               csrScanCompleteCallback callback, void *pContext)
@@ -623,6 +660,7 @@
                             scanReq.maxChnTime = pMac->roam.configParam.nActiveMaxChnTime;
                             scanReq.minChnTime = pMac->roam.configParam.nActiveMinChnTime;
                         }
+
                         status = csrScanCopyRequest(pMac, &p11dScanCmd->u.scanCmd.u.scanRequest, &scanReq);
                         //Free the channel list
                         palFreeMemory( pMac->hHdd, pChnInfo->ChannelList );
@@ -652,6 +690,15 @@
                         break;
                     }
                 }
+
+                //Scan only 2G Channels if set in ini file
+                //This is mainly to reduce the First Scan duration
+                //Once we turn on Wifi
+                if(pMac->scan.fFirstScanOnly2GChnl)
+                {
+                    csrScan2GOnyRequest(pMac, pScanCmd, pScanRequest);
+                }
+
                 status = csrScanCopyRequest(pMac, &pScanCmd->u.scanCmd.u.scanRequest, pScanRequest);
                 if(HAL_STATUS_SUCCESS(status))
                 {
@@ -2391,6 +2438,14 @@
             }
         }
 
+        else if( csrIs11hSupported( pMac ) && pIesLocal->Country.present && 
+                 !pMac->roam.configParam.fSupplicantCountryCodeHasPriority )
+        {
+             /* If 11h is supported, store the power information received in the Country IE */
+            csrSaveToChannelPower2G_5G( pMac, pIesLocal->Country.num_triplets * sizeof(tSirMacChanInfo), 
+                                        (tSirMacChanInfo *)(&pIesLocal->Country.triplets[0]) );
+        }
+
         // append to main list
         csrScanAddResult(pMac, pBssDescription, pIesLocal);
         if( (pBssDescription->Result.pvIes == NULL) && pIesLocal )
@@ -2513,7 +2568,7 @@
  * Save the channelList into the ultimate storage as the final stage of channel 
  * Input: pCountryInfo -- the country code (e.g. "USI"), channel list, and power limit are all stored inside this data structure
  */
-void csrSaveToChannelPower2G_5G( tpAniSirGlobal pMac, tANI_U32 tableSize, tSirMacChanInfo *channelTable )
+eHalStatus csrSaveToChannelPower2G_5G( tpAniSirGlobal pMac, tANI_U32 tableSize, tSirMacChanInfo *channelTable )
 {
     tANI_U32 i = tableSize / sizeof( tSirMacChanInfo );
     tSirMacChanInfo *pChannelInfo;
@@ -2534,16 +2589,27 @@
             pChannelSet->numChannels = pChannelInfo->numChannels;
 
             // Now set the inter-channel offset based on the frequency band the channel set lies in
-            if( CSR_IS_CHANNEL_24GHZ(pChannelSet->firstChannel) )
+            if( (CSR_IS_CHANNEL_24GHZ(pChannelSet->firstChannel)) &&
+                    ((pChannelSet->firstChannel + pChannelSet->numChannels) <= CSR_MAX_24GHz_CHANNEL_NUMBER) )
+
             {
                 pChannelSet->interChannelOffset = 1;
                 f2GHzInfoFound = TRUE;
             }
-            else
+            else if ( (CSR_IS_CHANNEL_5GHZ(pChannelSet->firstChannel)) &&
+                ((pChannelSet->firstChannel + (pChannelSet->numChannels * 4)) <= CSR_MAX_5GHz_CHANNEL_NUMBER) )
             {
                 pChannelSet->interChannelOffset = 4;
                 f2GHzInfoFound = FALSE;
             }
+            else
+            {
+                smsLog( pMac, LOGW, FL("Invalid Channel Present in Country IE"),
+                        pChannelSet->firstChannel);
+                palFreeMemory(pMac->hHdd, pChannelSet);
+                return eHAL_STATUS_FAILURE;
+            }
+
             pChannelSet->txPower = CSR_ROAM_MIN( pChannelInfo->maxTxPower, pMac->roam.configParam.nTxPowerCap );
 
             if( f2GHzInfoFound )
@@ -2592,7 +2658,7 @@
         pChannelInfo++;                // move to next entry
     }
 
-    return;
+    return eHAL_STATUS_SUCCESS;
 }
 
 
@@ -3256,8 +3322,13 @@
         smsLog(pMac, LOGE, FL("  %d sets each one is %d\n"), pIesLocal->Country.num_triplets, sizeof(tSirMacChanInfo));
         // save the channel/power information from the Channel IE.
         //sizeof(tSirMacChanInfo) has to be 3
-        csrSaveToChannelPower2G_5G( pMac, pIesLocal->Country.num_triplets * sizeof(tSirMacChanInfo), 
-                                        (tSirMacChanInfo *)(&pIesLocal->Country.triplets[0]) );
+        if (eHAL_STATUS_SUCCESS != csrSaveToChannelPower2G_5G( pMac, pIesLocal->Country.num_triplets * sizeof(tSirMacChanInfo),
+                    (tSirMacChanInfo *)(&pIesLocal->Country.triplets[0]) ))
+        {
+            fRet = eANI_BOOLEAN_FALSE;
+            return fRet;
+        }
+
         // set the indicator of the channel where the country IE was found...
         pMac->scan.channelOf11dInfo = pSirBssDesc->channelId;
         // Populate both band channel lists based on what we found in the country information...
@@ -3305,7 +3376,15 @@
 
     // Now check if we gathered any domain/country specific information
     // If so, we should update channel list and apply Tx power settings
-    csrApplyCountryInformation( pMac, FALSE );
+    if( csrIs11dSupported(pMac) )
+    {
+        csrApplyCountryInformation( pMac, FALSE );
+    }
+    else if( csrIs11hSupported(pMac) && !pMac->roam.configParam.fSupplicantCountryCodeHasPriority) 
+    {
+        // If llh is enabled, store the channel + power information gathered  in the cfg
+        csrApplyPower2Current( pMac );
+    }     
 }
 
 
@@ -3759,19 +3838,41 @@
     tANI_BOOLEAN fMatch = FALSE;
     tSirMacCapabilityInfo *pCap1, *pCap2;
     tDot11fBeaconIEs *pIes1 = NULL;
+    tDot11fBeaconIEs *pIesTemp = pIes2;
 
     pCap1 = (tSirMacCapabilityInfo *)&pSirBssDesc1->capabilityInfo;
     pCap2 = (tSirMacCapabilityInfo *)&pSirBssDesc2->capabilityInfo;
     if(pCap1->ess == pCap2->ess)
     {
         if (pCap1->ess && 
-                csrIsMacAddressEqual( pMac, (tCsrBssid *)pSirBssDesc1->bssId, (tCsrBssid *)pSirBssDesc2->bssId))
+                csrIsMacAddressEqual( pMac, (tCsrBssid *)pSirBssDesc1->bssId, (tCsrBssid *)pSirBssDesc2->bssId)&&
+                (pSirBssDesc1->channelId == pSirBssDesc2->channelId))
         {
             fMatch = TRUE;
+            // Check for SSID match, if exists
+            do
+            {
+                if(!HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, pSirBssDesc1, &pIes1)))
+                {
+                    break;
+                }
+                if( NULL == pIesTemp )
+                {
+                    if(!HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, pSirBssDesc2, &pIesTemp)))
+                    {
+                        break;
+                    }
+                }
+                if(pIes1->SSID.present && pIesTemp->SSID.present)
+                {
+                    fMatch = csrIsSsidMatch(pMac, pIes1->SSID.ssid, pIes1->SSID.num_ssid, 
+                                            pIesTemp->SSID.ssid, pIesTemp->SSID.num_ssid, eANI_BOOLEAN_TRUE);
+                } 
+            }while(0);
+
         }
         else if (pCap1->ibss && (pSirBssDesc1->channelId == pSirBssDesc2->channelId))
         {
-            tDot11fBeaconIEs *pIesTemp = pIes2;
 
             do
             {
@@ -3793,11 +3894,6 @@
                                             pIesTemp->SSID.ssid, pIesTemp->SSID.num_ssid, eANI_BOOLEAN_TRUE);
                 }
             }while(0);
-            if( (NULL == pIes2) && pIesTemp )
-            {
-                //locally allocated
-                palFreeMemory(pMac->hHdd, pIesTemp);
-            }
         }
 #if defined WLAN_FEATURE_P2P
         /* In case of P2P devices, ess and ibss will be set to zero */
@@ -3813,6 +3909,12 @@
     {
         palFreeMemory(pMac->hHdd, pIes1);
     }
+    
+    if( (NULL == pIes2) && pIesTemp )
+    {
+        //locally allocated
+        palFreeMemory(pMac->hHdd, pIesTemp);
+    }
 
     return( fMatch );
 }
@@ -3850,6 +3952,12 @@
         case eCSR_DOT11_MODE_11n_ONLY:
             fAllowed = (tANI_BOOLEAN)((eCSR_DOT11_MODE_11n == phyMode) || (eCSR_DOT11_MODE_TAURUS == phyMode));
             break;
+
+#ifdef WLAN_FEATURE_11AC
+         case eCSR_DOT11_MODE_11ac_ONLY:
+             fAllowed = (tANI_BOOLEAN)((eCSR_DOT11_MODE_11ac == phyMode) || (eCSR_DOT11_MODE_TAURUS == phyMode));
+             break;
+#endif
         case eCSR_DOT11_MODE_11b_ONLY:
             fAllowed = (tANI_BOOLEAN)(eCSR_DOT11_MODE_11b == phyMode);
             break;
@@ -3857,6 +3965,9 @@
             fAllowed = (tANI_BOOLEAN)(eCSR_DOT11_MODE_11a == phyMode);
             break;
         case eCSR_DOT11_MODE_11n:
+#ifdef WLAN_FEATURE_11AC
+        case eCSR_DOT11_MODE_11ac:
+#endif
         case eCSR_DOT11_MODE_TAURUS:
         default:
             fAllowed = eANI_BOOLEAN_TRUE;
@@ -4479,6 +4590,7 @@
             }
 #ifdef WLAN_FEATURE_P2P
             pMsg->p2pSearch = pScanReq->p2pSearch;
+            pMsg->skipDfsChnlInP2pSearch = pScanReq->skipDfsChnlInP2pSearch;
 #endif
 
         }while(0);
@@ -4965,6 +5077,7 @@
             }//Allocate memory for SSID List
 #ifdef WLAN_FEATURE_P2P
             pDstReq->p2pSearch = pSrcReq->p2pSearch;
+            pDstReq->skipDfsChnlInP2pSearch = pSrcReq->skipDfsChnlInP2pSearch;
 #endif
 
         }
@@ -5807,7 +5920,7 @@
                 break;
             pScanCmd->u.scanCmd.roamId = roamId;
             pScanCmd->command = eSmeCommandScan;
-            pScanCmd->sessionId = (tANI_U8)sessionId; 
+            pScanCmd->sessionId = (tANI_U8)sessionId;
             pScanCmd->u.scanCmd.callback = NULL;
             pScanCmd->u.scanCmd.pContext = NULL;
             pScanCmd->u.scanCmd.reason = eCsrScanForSsid;
@@ -5817,7 +5930,31 @@
             pScanCmd->u.scanCmd.u.scanRequest.maxChnTime = pMac->roam.configParam.nActiveMaxChnTime;
             pScanCmd->u.scanCmd.u.scanRequest.minChnTime = pMac->roam.configParam.nActiveMinChnTime;
             pScanCmd->u.scanCmd.u.scanRequest.BSSType = pProfile->BSSType;
-            pScanCmd->u.scanCmd.u.scanRequest.uIEFieldLen = 0;
+            // To avoid 11b rate in probe request Set p2pSearch flag as 1 for P2P Client Mode
+            if(VOS_P2P_CLIENT_MODE == pProfile->csrPersona)
+            {
+                pScanCmd->u.scanCmd.u.scanRequest.p2pSearch = 1;
+            }
+            if(pProfile->pAddIEScan)
+            {
+                status = palAllocateMemory(pMac->hHdd,
+                                (void **)&pScanCmd->u.scanCmd.u.scanRequest.pIEField,
+                                pProfile->nAddIEScanLength);
+                palZeroMemory(pMac->hHdd, pScanCmd->u.scanCmd.u.scanRequest.pIEField, pProfile->nAddIEScanLength);
+                if(HAL_STATUS_SUCCESS(status))
+                {
+                    palCopyMemory(pMac->hHdd, pScanCmd->u.scanCmd.u.scanRequest.pIEField, pProfile->pAddIEScan, pProfile->nAddIEScanLength);
+                    pScanCmd->u.scanCmd.u.scanRequest.uIEFieldLen = pProfile->nAddIEScanLength;
+                }
+                else
+                {
+                    smsLog(pMac, LOGE, "No memory for scanning IE fields\n");
+                }
+            } //Allocate memory for IE field
+            else
+            {
+                pScanCmd->u.scanCmd.u.scanRequest.uIEFieldLen = 0;
+            }
             if(pProfile->BSSIDs.numOfBSSIDs == 1)
             {
                 palCopyMemory(pMac->hHdd, pScanCmd->u.scanCmd.u.scanRequest.bssid, pProfile->BSSIDs.bssid, sizeof(tCsrBssid));
@@ -6480,3 +6617,4 @@
 
 
 
+
diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h
index b4e3437..90d6b22 100644
--- a/CORE/SME/src/csr/csrInsideApi.h
+++ b/CORE/SME/src/csr/csrInsideApi.h
@@ -51,6 +51,8 @@
 
 #define CSR_MAX_NUM_SUPPORTED_CHANNELS 55
 
+#define CSR_MAX_2_4_GHZ_SUPPORTED_CHANNELS 14
+
 #define CSR_MAX_BSS_SUPPORT            100
 
 //This number minus 1 means the number of times a channel is scanned before a BSS is remvoed from
@@ -76,7 +78,7 @@
 #define CSR_SCAN_AGING_TIME_CONNECT_NO_PS 150        //150 seconds
 #define CSR_SCAN_AGING_TIME_CONNECT_W_PS 600         //600 seconds
 #define CSR_JOIN_FAILURE_TIMEOUT_DEFAULT ( 3000 )
-#define CSR_JOIN_FAILURE_TIMEOUT_MIN   (300)  //minimal value
+#define CSR_JOIN_FAILURE_TIMEOUT_MIN   (1000)  //minimal value
 //These are going against the signed RSSI (tANI_S8) so it is between -+127
 #define CSR_BEST_RSSI_VALUE         (-30)   //RSSI >= this is in CAT4
 #define CSR_DEFAULT_RSSI_DB_GAP     30 //every 30 dbm for one category
@@ -126,6 +128,7 @@
     eCsrSilentlyStopRoaming,
     eCsrSilentlyStopRoamingSaveState,
     eCsrJoinWdsFailure,
+    eCsrJoinFailureDueToConcurrency,
     
 }eCsrRoamCompleteResult;
 
@@ -351,6 +354,7 @@
 tANI_U32 csrTranslateToWNICfgDot11Mode(tpAniSirGlobal pMac, eCsrCfgDot11Mode csrDot11Mode);
 void csrSaveChannelPowerForBand( tpAniSirGlobal pMac, tANI_BOOLEAN fPopulate5GBand );
 void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannelList, tANI_U8 *countryCode);
+void csrApplyPower2Current( tpAniSirGlobal pMac );
 void csrAssignRssiForCategory(tpAniSirGlobal pMac, tANI_U8 catOffset);
 tANI_BOOLEAN csrIsMacAddressZero( tpAniSirGlobal pMac, tCsrBssid *pMacAddr );
 tANI_BOOLEAN csrIsMacAddressBroadcast( tpAniSirGlobal pMac, tCsrBssid *pMacAddr );
@@ -366,7 +370,7 @@
 #ifdef FEATURE_WLAN_WAPI
 void csrResetBKIDCandidateList( tpAniSirGlobal pMac, tANI_U32 sessionId );
 #endif /* FEATURE_WLAN_WAPI */
-void csrSaveToChannelPower2G_5G( tpAniSirGlobal pMac, tANI_U32 tableSize, tSirMacChanInfo *channelTable );
+eHalStatus csrSaveToChannelPower2G_5G( tpAniSirGlobal pMac, tANI_U32 tableSize, tSirMacChanInfo *channelTable );
 //Get the list of the base channels to scan for passively 11d info
 eHalStatus csrScanGetSupportedChannels( tpAniSirGlobal pMac );
 //To check whether a country code matches the one in the IE
diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c
index c1d710e..e2919d1 100644
--- a/CORE/SME/src/csr/csrNeighborRoam.c
+++ b/CORE/SME/src/csr/csrNeighborRoam.c
@@ -375,7 +375,15 @@
 
     /* Abort any ongoing BG scans */
     if (eANI_BOOLEAN_TRUE == pNeighborRoamInfo->scanRspPending)
+    {
+        if( pMac->roam.neighborRoamInfo.neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_CONNECTED)
+        {
+            smsLog(pMac, LOGE, FL("Connected during scan state and we didn't"
+                                    "transition to state"));
+            VOS_ASSERT(0);
+        }
         csrScanAbortMacScan(pMac);
+    }
 
     pNeighborRoamInfo->scanRspPending = eANI_BOOLEAN_FALSE;
     
@@ -1133,11 +1141,13 @@
     vos_mem_zero(&pNeighborRoamInfo->FTRoamInfo.neighboReportBssInfo, sizeof(tCsrNeighborReportBssInfo) * MAX_BSS_IN_NEIGHBOR_RPT);
 #endif
 
+    /* Transition to CONNECTED state */
+    CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED)
+
     /* Reset all the necessary variables before transitioning to the CONNECTED state */
     csrNeighborRoamResetConnectedStateControlInfo(pMac);
 
-    /* Transition to CONNECTED state */
-    CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED)
+   
     /* Re-register Neighbor Lookup threshold callback with TL */
     NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering DOWN event neighbor lookup callback with TL for RSSI = %d"), pNeighborRoamInfo->currentNeighborLookupThreshold * (-1)); 
     vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1),
@@ -1722,25 +1732,11 @@
         {
             if (pNeighborBssDesc->pNeighborBssDescription->channel)
             {
-                // Make sure to add only if its the same band
-                if ((pNeighborRoamInfo->currAPoperationChannel <= (RF_CHAN_14+1)) &&
-                    (pNeighborBssDesc->pNeighborBssDescription->channel <= (RF_CHAN_14+1)))
-                {
                         VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, 
                                 "%s: [INFOLOG] Adding %d to Neighbor channel list\n", __func__,
                                 pNeighborBssDesc->pNeighborBssDescription->channel);
                         channelList[numChannels] = pNeighborBssDesc->pNeighborBssDescription->channel;
                         numChannels++;
-                }
-                else if ((pNeighborRoamInfo->currAPoperationChannel >= RF_CHAN_128) &&
-                    (pNeighborBssDesc->pNeighborBssDescription->channel >= RF_CHAN_128))
-                {
-                        VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, 
-                                "%s: [INFOLOG] Adding %d to Neighbor channel list\n", __func__,
-                                pNeighborBssDesc->pNeighborBssDescription->channel);
-                        channelList[numChannels] = pNeighborBssDesc->pNeighborBssDescription->channel;
-                        numChannels++;
-                }
             }
         }
             
@@ -1762,27 +1758,12 @@
             {
                 if (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i])
                 {
-                    // Make sure to add only if its the same band
-                    if ((pNeighborRoamInfo->currAPoperationChannel <= (RF_CHAN_14+1)) &&
-                        (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i] <= (RF_CHAN_14+1)))
-                    {
                             VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, 
                                     "%s: [INFOLOG] Adding extra %d to Neighbor channel list\n", __func__,
                             pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i]);
                             channelList[numChannels] = 
                             pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i];
                             numChannels++;
-                    }
-                    if ((pNeighborRoamInfo->currAPoperationChannel >= RF_CHAN_128) &&
-                         (pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i] >= RF_CHAN_128))
-                    {
-                            VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, 
-                                    "%s: [INFOLOG] Adding extra %d to Neighbor channel list\n", __func__,
-                                pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i]);
-                            channelList[numChannels] = 
-                                pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList[i];
-                            numChannels++;
-                    }
                 }
             }
         }
@@ -1961,25 +1942,11 @@
         {
             if (pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i])
             {
-                // Make sure to add only if its the same band
-                if ((pNeighborRoamInfo->currAPoperationChannel <= (RF_CHAN_14+1)) &&
-                    (pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i] <= (RF_CHAN_14+1)))
-                {
                         VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, 
                                 "%s: [INFOLOG] Adding %d to Neighbor channel list\n", __func__,
                                 pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]);
                         channelList[numOfChannels] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i];
                         numOfChannels++;
-                }
-                if ((pNeighborRoamInfo->currAPoperationChannel >= RF_CHAN_128) &&
-                    (pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i] >= RF_CHAN_128))
-                {
-                        VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, 
-                                "%s: [INFOLOG] Adding %d to Neighbor channel list\n", __func__,
-                                pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]);
-                        channelList[numOfChannels] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i];
-                        numOfChannels++;
-                }
             }
         }
 
@@ -2096,12 +2063,13 @@
 
     pNeighborRoamInfo->currentNeighborLookupThreshold = pNeighborRoamInfo->cfgParams.neighborLookupThreshold;
     
-    /* Reset all the neighbor roam info control variables. Free all the allocated memory. It is like we are just associated now */
-    csrNeighborRoamResetConnectedStateControlInfo(pMac);
-
     /* Recheck whether the below check is needed. */
     if (pNeighborRoamInfo->neighborRoamState != eCSR_NEIGHBOR_ROAM_STATE_CONNECTED)
         CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED)
+
+    /* Reset all the neighbor roam info control variables. Free all the allocated memory. It is like we are just associated now */
+    csrNeighborRoamResetConnectedStateControlInfo(pMac);
+
     
     NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering DOWN event neighbor lookup callback with TL. RSSI = %d,"), pNeighborRoamInfo->currentNeighborLookupThreshold * (-1));
     /* Register Neighbor Lookup threshold callback with TL for DOWN event now */
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index 37f3780..079becc 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -44,6 +44,8 @@
 #include "csrInsideApi.h"
 #include "smsDebug.h"
 #include "smeQosInternal.h"
+#include "wlan_qct_wda.h"
+
 #ifdef FEATURE_WLAN_CCX
 #include "vos_utils.h"
 #include "csrCcx.h"
@@ -1166,7 +1168,6 @@
 
 extern const tRfChannelProps rfChannels[NUM_RF_CHANNELS];
 
-
 ////////////////////////////////////////////////////////////////////////
 
 /**
@@ -1374,6 +1375,19 @@
         csrIsConnStateDisconnectedWds( pMac, sessionId ) );
 }
 
+tANI_BOOLEAN csrIsConnStateAp( tpAniSirGlobal pMac,  tANI_U32 sessionId )
+{
+    tCsrRoamSession *pSession;
+    pSession = CSR_GET_SESSION(pMac, sessionId);
+    if (!pSession)
+        return eANI_BOOLEAN_FALSE;
+    if ( CSR_IS_INFRA_AP(&pSession->connectedProfile) )
+    {
+        return eANI_BOOLEAN_TRUE;
+    }
+    return eANI_BOOLEAN_FALSE;
+}
+
 tANI_BOOLEAN csrIsAnySessionInConnectState( tpAniSirGlobal pMac )
 {
     tANI_U32 i;
@@ -1381,8 +1395,10 @@
 
     for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
     {
-        if( CSR_IS_SESSION_VALID( pMac, i ) && 
-            ( csrIsConnStateInfra( pMac, i ) || csrIsConnStateIbss( pMac, i ) ) )
+        if( CSR_IS_SESSION_VALID( pMac, i ) &&
+            ( csrIsConnStateInfra( pMac, i )
+            || csrIsConnStateIbss( pMac, i )
+            || csrIsConnStateAp( pMac, i) ) )
         {
             fRc = eANI_BOOLEAN_TRUE;
             break;
@@ -1550,6 +1566,56 @@
     return ( fRc );
 }
 
+tANI_BOOLEAN csrIsConcurrentSessionRunning( tpAniSirGlobal pMac )
+{
+    tANI_U32 sessionId, noOfCocurrentSession = 0;
+    eCsrConnectState connectState;
+
+    tANI_BOOLEAN fRc = eANI_BOOLEAN_FALSE;
+
+    for( sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++ )
+    {
+        if( CSR_IS_SESSION_VALID( pMac, sessionId ) )
+        {
+           connectState =  pMac->roam.roamSession[sessionId].connectState;
+           if( (eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED == connectState) ||
+               (eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED == connectState) ||
+               (eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTED == connectState) )
+           {
+              ++noOfCocurrentSession;
+           }
+        }
+    }
+
+    // More than one session is Up and Running
+    if(noOfCocurrentSession > 1)
+    {
+        fRc = eANI_BOOLEAN_TRUE;
+    }
+
+    return ( fRc );
+}
+
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+tANI_BOOLEAN csrIsInfraApStarted( tpAniSirGlobal pMac )
+{
+    tANI_U32 sessionId;
+    tANI_BOOLEAN fRc = eANI_BOOLEAN_FALSE;
+
+    for( sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++ )
+    {
+        if( CSR_IS_SESSION_VALID( pMac, sessionId ) && (csrIsConnStateConnectedInfraAp(pMac, sessionId)) )
+        {
+            fRc = eANI_BOOLEAN_TRUE;
+            break;
+        }
+    }
+
+    return ( fRc );
+
+}
+#endif
+
 tANI_BOOLEAN csrIsBTAMP( tpAniSirGlobal pMac, tANI_U32 sessionId )
 {
     return ( csrIsConnStateConnectedWds( pMac, sessionId ) );
@@ -1561,23 +1627,24 @@
     return (eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED == pMac->roam.roamSession[sessionId].connectState);
 }
 
-tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId)
+tANI_BOOLEAN csrIsValidMcConcurrentSession(tpAniSirGlobal pMac, tANI_U32 sessionId,
+                                                  tSirBssDescription *pBssDesc)
 {
     tCsrRoamSession *pSession = NULL;
     tANI_U8 Index = 0, ConnId = 0;
+    eAniBoolean status = eANI_BOOLEAN_FALSE;
+
     tVOS_CON_MODE Mode[CSR_ROAM_SESSION_MAX];
 
     //Check for MCC support
     if (!pMac->roam.configParam.fenableMCCMode)
     {
-        return eANI_BOOLEAN_FALSE;
+        return status;
     }
 
-    for( Index = 0; Index < CSR_ROAM_SESSION_MAX; Index++ ) 
-        Mode[Index] = VOS_MAX_NO_OF_MODE;
- 
     for( Index = 0; Index < CSR_ROAM_SESSION_MAX; Index++ )
     {
+        Mode[Index] = VOS_MAX_NO_OF_MODE;
         if( CSR_IS_SESSION_VALID( pMac, Index ) )
         {
             pSession = CSR_GET_SESSION( pMac, Index );
@@ -1596,7 +1663,8 @@
         switch (Mode[Index+1])
         {
             case VOS_P2P_CLIENT_MODE :
-              return eANI_BOOLEAN_TRUE;
+                status = eANI_BOOLEAN_TRUE;
+                break;
             case VOS_MAX_NO_OF_MODE :
             default :
                  break;
@@ -1607,14 +1675,44 @@
         switch (Mode[Index +1])
         {
             case VOS_STA_MODE :
-                return eANI_BOOLEAN_TRUE;
+                status = eANI_BOOLEAN_TRUE;
+                break;
+
             case VOS_MAX_NO_OF_MODE :
             default :
                 break;
          }
     }
 
-    return eANI_BOOLEAN_FALSE;
+    //Validate BeaconInterval
+    if( CSR_IS_SESSION_VALID( pMac, sessionId ) )
+    {
+        pSession = CSR_GET_SESSION( pMac, sessionId );
+        if (NULL != pSession->pCurRoamProfile)
+        {
+            if(csrIsconcurrentsessionValid (pMac, sessionId, 
+                                       pSession->pCurRoamProfile->csrPersona) 
+                                       == eHAL_STATUS_SUCCESS )
+            {
+                if(csrValidateBeaconInterval( pMac, pBssDesc->channelId, 
+                               &pBssDesc->beaconInterval, sessionId, 
+                               pSession->pCurRoamProfile->csrPersona) 
+                               != eHAL_STATUS_SUCCESS)
+                {
+                    status = eANI_BOOLEAN_FALSE;
+                }
+                else
+                {
+                    status = eANI_BOOLEAN_TRUE;
+                }
+            }
+            else
+            {
+                status = eANI_BOOLEAN_FALSE;
+            }
+         }
+     }
+    return status;
 }
 
 static tSirMacCapabilityInfo csrGetBssCapabilities( tSirBssDescription *pSirBssDesc )
@@ -1985,11 +2083,18 @@
             break;
 
         case eSIR_11N_NW_TYPE:
-        default:
             phyMode = eCSR_DOT11_MODE_11n;
             break;
+#ifdef WLAN_FEATURE_11AC
+        case eSIR_11AC_NW_TYPE:
+        default:
+            phyMode = eCSR_DOT11_MODE_11ac;
+#else
+        default:
+            phyMode = eCSR_DOT11_MODE_11n;
+#endif
+            break;
     }
-
     return( phyMode );
 }
 
@@ -2041,6 +2146,15 @@
        ret = WNI_CFG_DOT11_MODE_11N_ONLY;
        break;
 #endif
+
+#ifdef WLAN_FEATURE_11AC
+     case eCSR_CFG_DOT11_MODE_11AC_ONLY:
+        ret = WNI_CFG_DOT11_MODE_11AC_ONLY;
+        break;
+     case eCSR_CFG_DOT11_MODE_11AC:
+        ret = WNI_CFG_DOT11_MODE_11AC;
+       break;
+#endif
     default:
         smsLog(pMac, LOGW, FL("doesn't expect %d as csrDo11Mode\n"), csrDot11Mode);
         if(eCSR_BAND_24 == pMac->roam.configParam.eBand)
@@ -2081,6 +2195,13 @@
         {
             phyMode = eCSR_DOT11_MODE_11n;
         }
+
+#ifdef WLAN_FEATURE_11AC
+        if ( pIes->VHTCaps.present && (eCSR_DOT11_MODE_TAURUS != phyMode))
+        {
+             phyMode = eCSR_DOT11_MODE_11ac;
+        }
+#endif
         *pPhyMode = phyMode;
     }
 
@@ -2190,9 +2311,19 @@
                 cfgDot11Mode = eCSR_CFG_DOT11_MODE_11A;
                 break;
             case eCSR_DOT11_MODE_11n:
+#ifdef WLAN_FEATURE_11AC
+            case eCSR_DOT11_MODE_11ac:
+#endif
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+                break;
+
             case eCSR_DOT11_MODE_TAURUS:
             default:
+#ifdef WLAN_FEATURE_11AC
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+#else
                 cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+#endif
                 break;
             }
             break;
@@ -2202,9 +2333,44 @@
             {
                 fMatch = TRUE;
                 cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+
+            }
+
+            break;
+#ifdef WLAN_FEATURE_11AC
+        case eCSR_DOT11_MODE_11ac:
+            fMatch = TRUE;
+            switch(bssPhyMode)
+            {
+            case eCSR_DOT11_MODE_11g:
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11G;
+                break;
+            case eCSR_DOT11_MODE_11b:
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11B;
+                break;
+            case eCSR_DOT11_MODE_11a:
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11A;
+                break;
+            case eCSR_DOT11_MODE_11n:
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+                break;
+            case eCSR_DOT11_MODE_11ac:
+            case eCSR_DOT11_MODE_TAURUS:
+            default:
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+                break;
             }
             break;
 
+        case eCSR_DOT11_MODE_11ac_ONLY:
+            if((eCSR_DOT11_MODE_11ac == bssPhyMode) || (eCSR_DOT11_MODE_TAURUS == bssPhyMode))
+            {
+                fMatch = TRUE;
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+            }
+            break;
+#endif
+
         case eCSR_DOT11_MODE_TAURUS:
         default:
             fMatch = TRUE;
@@ -2222,20 +2388,32 @@
             case eCSR_DOT11_MODE_11n:
                 cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
                 break;
+#ifdef WLAN_FEATURE_11AC
+            case eCSR_DOT11_MODE_11ac:
+                cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+                break;
+#endif
             case eCSR_DOT11_MODE_TAURUS:
             default:
                 cfgDot11Mode = eCSR_CFG_DOT11_MODE_TAURUS;
                 break;
             }
             break;
-
     }
 
     if ( fMatch && pCfgDot11ModeToUse )
     {
-        *pCfgDot11ModeToUse = cfgDot11Mode;
+#ifdef WLAN_FEATURE_11AC
+        if(cfgDot11Mode == eCSR_CFG_DOT11_MODE_11AC && !WDA_getFwWlanFeatCaps(DOT11AC))
+        {
+            *pCfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11N;
+        }
+        else
+#endif
+        {
+            *pCfgDot11ModeToUse = cfgDot11Mode;
+        }
     }
-
     return( fMatch );
 }
 
@@ -2270,7 +2448,13 @@
                 }
                 else
                 {
+
+#ifdef WLAN_FEATURE_11AC
+                    phyMode = eCSR_DOT11_MODE_11ac;
+#else
                     phyMode = eCSR_DOT11_MODE_11n;
+#endif
+
                 }
             }
             else
@@ -2324,6 +2508,9 @@
                  */
                 if( (!CSR_IS_11n_ALLOWED( pProfile->negotiatedUCEncryptionType )) &&
                     ((eCSR_CFG_DOT11_MODE_11N == cfgDot11ModeToUse) ||
+#ifdef WLAN_FEATURE_11AC
+                     (eCSR_CFG_DOT11_MODE_11AC == cfgDot11ModeToUse) ||
+#endif
                      (eCSR_CFG_DOT11_MODE_TAURUS == cfgDot11ModeToUse)) )
                 {
                     //We cannot do 11n here
@@ -2350,6 +2537,16 @@
     eCsrCfgDot11Mode cfgDot11ModeToUse;
     eCsrBand eBand = pMac->roam.configParam.eBand;
 
+
+#ifdef WLAN_FEATURE_11AC
+    if ( (0 == phyMode) || (eCSR_DOT11_MODE_AUTO & phyMode) || (eCSR_DOT11_MODE_TAURUS & phyMode)
+       ||(eCSR_DOT11_MODE_11ac & phyMode))
+    {
+        cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11AC;
+    }
+    else
+#endif
+
     if ( (0 == phyMode) || (eCSR_DOT11_MODE_AUTO & phyMode) || (eCSR_DOT11_MODE_TAURUS & phyMode))
     {
         cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11N;
@@ -2490,6 +2687,214 @@
     return( fRSNProfile );
 }
 
+eHalStatus
+csrIsconcurrentsessionValid(tpAniSirGlobal pMac,tANI_U32 cursessionId,
+                                 tVOS_CON_MODE currBssPersona)
+{
+    tANI_U32 sessionId = 0;
+
+    for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++ )
+    {
+        if (cursessionId != sessionId )
+        {
+            if (!CSR_IS_SESSION_VALID( pMac, sessionId ))
+            {
+                continue;
+            }
+
+            switch (currBssPersona)
+            {
+                case VOS_STA_MODE:
+                    if(pMac->roam.roamSession[sessionId].pCurRoamProfile &&
+                      (pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona 
+                                      == VOS_STA_MODE)) //check for P2P client mode
+                    {
+                        smsLog(pMac, LOGE, FL(" ****STA mode already exists ****\n"));
+                        return eHAL_STATUS_FAILURE;
+                    }
+                    break;
+
+                case VOS_STA_SAP_MODE:
+                    if(pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                      == VOS_STA_SAP_MODE)
+                    {
+                        smsLog(pMac, LOGE, FL(" ****SoftAP mode already exists ****\n"));
+                        return eHAL_STATUS_FAILURE;
+                    }
+                    
+                    else if(pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                      == VOS_P2P_GO_MODE)
+                    {
+                        smsLog(pMac, LOGE, FL(" ****Cannot start Multiple Beaconing Role ****\n"));
+                        return eHAL_STATUS_FAILURE;
+                    }
+                    break;
+
+                case VOS_P2P_CLIENT_MODE:
+                    if(pMac->roam.roamSession[sessionId].pCurRoamProfile &&
+                      (pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona 
+                                                  == VOS_P2P_CLIENT_MODE)) //check for P2P client mode
+                    {
+                        smsLog(pMac, LOGE, FL(" ****CLIENT mode already exists ****\n"));
+                        return eHAL_STATUS_FAILURE;
+                    }
+                    break;
+
+                case VOS_P2P_GO_MODE:
+                    if(pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                      == VOS_P2P_GO_MODE)
+                    {
+                        smsLog(pMac, LOGE, FL(" ****P2P GO mode already exists ****\n"));
+                        return eHAL_STATUS_FAILURE;
+                    }
+                    else if(pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                      == VOS_STA_SAP_MODE)
+                    {
+                        smsLog(pMac, LOGE, FL(" ****Cannot start Multiple Beaconing Role ****\n"));
+                        return eHAL_STATUS_FAILURE;
+                    }
+                    break;
+
+                default :
+                    smsLog(pMac, LOGE, FL("***Persona not handled = %d*****\n"),currBssPersona);
+                    break;
+            }
+        }
+    }
+    return eHAL_STATUS_SUCCESS;
+
+}
+
+eHalStatus csrValidateBeaconInterval(tpAniSirGlobal pMac, tANI_U8 channelId, 
+                                     tANI_U16 *beaconInterval, tANI_U32 cursessionId,
+                                     tVOS_CON_MODE currBssPersona)
+{
+    tANI_U32 sessionId = 0;
+
+    //If MCC is not supported just break and return SUCCESS
+    if ( !IS_MCC_SUPPORTED && !pMac->roam.configParam.fenableMCCMode){
+        return eHAL_STATUS_FAILURE;
+    }
+
+    for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++ )
+    {
+        if (cursessionId != sessionId )
+        {
+            if (!CSR_IS_SESSION_VALID( pMac, sessionId ))
+            {
+                continue;
+            }
+
+            switch (currBssPersona)
+            {
+                case VOS_STA_MODE:
+                    if(pMac->roam.roamSession[sessionId].pCurRoamProfile &&
+                      (pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona 
+                                      == VOS_P2P_CLIENT_MODE)) //check for P2P client mode
+                    {
+                        smsLog(pMac, LOG1, FL(" Beacon Interval Validation not required for STA/CLIENT\n"));
+                    }
+                    //IF SAP has started and STA wants to connect on different channel MCC should
+                    //MCC should not be enabled so making it false to enforce on same channel
+                    else if (pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                      == VOS_STA_SAP_MODE)
+                    {
+                        if (pMac->roam.roamSession[sessionId].bssParams.operationChn 
+                                                        != channelId )
+                        {
+                            smsLog(pMac, LOGE, FL("***MCC is not enabled for SAP +STA****\n"));
+                            return eHAL_STATUS_FAILURE;
+                        }
+                    }
+                    else if(pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                      == VOS_P2P_GO_MODE) //Check for P2P go scenario
+                    {
+                        if ((pMac->roam.roamSession[sessionId].bssParams.operationChn 
+                                != channelId ) &&
+                            (pMac->roam.roamSession[sessionId].bssParams.beaconInterval 
+                                != *beaconInterval))
+                        {
+                            smsLog(pMac, LOGE, FL("BeaconInteval is different cannot connect to prefered AP...\n"));
+                            return eHAL_STATUS_FAILURE;
+                        }
+                    }
+                    break;
+
+                case VOS_P2P_CLIENT_MODE:
+                    if(pMac->roam.roamSession[sessionId].pCurRoamProfile &&
+                      (pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona 
+                                                                == VOS_STA_MODE)) //check for P2P client mode
+                    {
+                        smsLog(pMac, LOG1, FL(" Ignore Beacon Interval Validation...\n"));
+                    }
+                    //IF SAP has started and STA wants to connect on different channel MCC should
+                    //MCC should not be enabled so making it false to enforce on same channel
+                    else if (pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                      == VOS_STA_SAP_MODE)
+                    {
+                        if (pMac->roam.roamSession[sessionId].bssParams.operationChn 
+                                                        != channelId )
+                        {
+                            smsLog(pMac, LOGE, FL("***MCC is not enabled for SAP + CLIENT****\n"));
+                            return eHAL_STATUS_FAILURE;
+                        }
+                    }
+                    else if(pMac->roam.roamSession[sessionId].bssParams.bssPersona
+                                    == VOS_P2P_GO_MODE) //Check for P2P go scenario
+                    {
+                        if ((pMac->roam.roamSession[sessionId].bssParams.operationChn 
+                                != channelId ) &&
+                            (pMac->roam.roamSession[sessionId].bssParams.beaconInterval 
+                                != *beaconInterval))
+                        {
+                            smsLog(pMac, LOGE, FL("BeaconInteval is different cannot connect to P2P_GO network ...\n"));
+                            return eHAL_STATUS_FAILURE;
+                        }
+                    }
+                    break;
+
+                case VOS_P2P_GO_MODE :
+                    if(pMac->roam.roamSession[sessionId].pCurRoamProfile  && 
+                      ((pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona 
+                            == VOS_P2P_CLIENT_MODE)
+                     || (pMac->roam.roamSession[sessionId].pCurRoamProfile->csrPersona 
+                            == VOS_STA_MODE))) //check for P2P_client scenario
+                    {
+                        if ((pMac->roam.roamSession[sessionId].connectedProfile.operationChannel 
+                               == 0 )&&
+                           (pMac->roam.roamSession[sessionId].connectedProfile.beaconInterval
+                               == 0))
+                        {
+                            continue;
+                        }
+
+                            
+                        if (csrIsConnStateConnectedInfra(pMac, sessionId) &&
+                           (pMac->roam.roamSession[sessionId].connectedProfile.operationChannel 
+                                != channelId ) &&
+                           (pMac->roam.roamSession[sessionId].connectedProfile.beaconInterval 
+                                != *beaconInterval))
+                        {
+                            /*
+                             * Updated beaconInterval should be used only when we are starting a new BSS 
+                             * not incase of client or STA case
+                             */
+                            *beaconInterval = 
+                                pMac->roam.roamSession[sessionId].connectedProfile.beaconInterval;
+                            return eHAL_STATUS_SUCCESS;
+                         }
+                    }
+                    break;
+
+                default :
+                    smsLog(pMac, LOG1, FL(" Persona not supported : %d\n"),currBssPersona);
+                    return eHAL_STATUS_FAILURE;
+            }
+        }
+    }
+
+    return eHAL_STATUS_SUCCESS;
+}
 
 #ifdef WLAN_FEATURE_VOWIFI_11R
 /* Function to return TRUE if the authtype is 11r */
@@ -5361,6 +5766,22 @@
     case eCSR_DOT11_MODE_AUTO:
         cfgDot11Mode = eCSR_CFG_DOT11_MODE_AUTO;
         break;
+
+#ifdef WLAN_FEATURE_11AC
+    case eCSR_DOT11_MODE_11ac:
+	if (!WDA_getFwWlanFeatCaps(DOT11AC))
+	{
+		cfgDot11Mode = eCSR_CFG_DOT11_MODE_11N;
+	}
+	else
+	{
+		cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC;
+	}
+        break;
+    case eCSR_DOT11_MODE_11ac_ONLY:
+        cfgDot11Mode = eCSR_CFG_DOT11_MODE_11AC_ONLY;
+        break;
+#endif
     default:
         //No need to assign anything here
         break;
@@ -5808,6 +6229,7 @@
    return (0);
 }
 
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
 /* Disconnect all active sessions by sending disassoc. This is mainly used to disconnect the remaining session when we 
  * transition from concurrent sessions to a single session. The use case is Infra STA and wifi direct multiple sessions are up and 
  * P2P session is removed. The Infra STA session remains and should resume BMPS if BMPS is enabled by default. However, there
@@ -5827,3 +6249,4 @@
         }
     }
 }
+#endif
diff --git a/CORE/SME/src/meas/measApi.c b/CORE/SME/src/meas/measApi.c
deleted file mode 100644
index 1e9b029..0000000
--- a/CORE/SME/src/meas/measApi.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
diff --git a/CORE/SME/src/oemData/oemDataApi.c b/CORE/SME/src/oemData/oemDataApi.c
new file mode 100644
index 0000000..1020373
--- /dev/null
+++ b/CORE/SME/src/oemData/oemDataApi.c
@@ -0,0 +1,398 @@
+/*
+ * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef FEATURE_OEM_DATA_SUPPORT
+/** ------------------------------------------------------------------------- * 
+    ------------------------------------------------------------------------- *  
+
+  
+    \file oemDataApi.c
+  
+    Implementation for the OEM DATA REQ/RSP interfaces.
+  
+    Copyright (C) 2010 Qualcomm Incorporated.
+  
+ 
+   ========================================================================== */
+#include "aniGlobal.h"
+#include "oemDataApi.h"
+#include "palApi.h"
+#include "smeInside.h"
+#include "smsDebug.h"
+
+#include "csrSupport.h"
+#include "wlan_qct_tl.h"
+
+#include "vos_diag_core_log.h"
+#include "vos_diag_core_event.h"
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_OemDataReqOpen
+    \brief This function must be called before any API call to (OEM DATA REQ/RSP module)
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+
+eHalStatus oemData_OemDataReqOpen(tHalHandle hHal)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+
+    do
+    {
+        //initialize all the variables to null
+        vos_mem_set(&(pMac->oemData), sizeof(tOemDataStruct), 0);
+        if(!HAL_STATUS_SUCCESS(status))
+        {
+            smsLog(pMac, LOGE, "oemData_OemDataReqOpen: Cannot allocate memory for the timer function\n");
+            break;
+        }
+    } while(0);
+
+    return status;
+}
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_OemDataReqClose
+    \brief This function must be called before closing the csr module
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+
+eHalStatus oemData_OemDataReqClose(tHalHandle hHal)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+
+    do
+    {
+        if(!HAL_STATUS_SUCCESS(status))
+        {
+            smsLog(pMac, LOGE, "oemData_OemDataReqClose: Failed in oemData_OemDataReqClose at StopTimers\n");
+            break;
+        }
+
+        if(pMac->oemData.pOemDataRsp != NULL)
+        {
+            vos_mem_free(pMac->oemData.pOemDataRsp);
+        }
+        
+        //initialize all the variables to null
+        vos_mem_set(&(pMac->oemData), sizeof(tOemDataStruct), 0);
+    } while(0);
+
+    return eHAL_STATUS_SUCCESS;
+}
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_ReleaseOemDataReqCommand
+    \brief This function removes the oemDataCommand from the active list and 
+           and frees up any memory occupied by this
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+void oemData_ReleaseOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pOemDataCmd, eOemDataReqStatus oemDataReqStatus)
+{
+    //Do the callback
+    pOemDataCmd->u.oemDataCmd.callback(pMac, pOemDataCmd->u.oemDataCmd.pContext, pOemDataCmd->u.oemDataCmd.oemDataReqID, oemDataReqStatus);
+
+    //First take this command out of the active list
+    if(csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, &pOemDataCmd->Link, LL_ACCESS_LOCK))
+    {
+        vos_mem_set(&(pOemDataCmd->u.oemDataCmd), sizeof(tOemDataCmd), 0);
+
+        //Now put this command back on the avilable command list
+        smeReleaseCommand(pMac, pOemDataCmd);
+    }
+    else
+    {
+        smsLog(pMac, LOGE, "OEM_DATA: **************** oemData_ReleaseOemDataReqCommand cannot release the command\n");
+    }
+}
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_OemDataReq
+    \brief Request an OEM DATA RSP
+    \param sessionId - Id of session to be used
+    \param pOemDataReqID - pointer to an object to get back the request ID
+    \param callback - a callback function that is called upon finish
+    \param pContext - a pointer passed in for the callback
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus oemData_OemDataReq(tHalHandle hHal, 
+                                tANI_U8 sessionId,
+                                tOemDataReqConfig *oemDataReqConfig, 
+                                tANI_U32 *pOemDataReqID, 
+                                oemData_OemDataReqCompleteCallback callback, 
+                                void *pContext)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
+    tSmeCmd *pOemDataCmd = NULL;
+
+    do 
+    {
+        if( !CSR_IS_SESSION_VALID( pMac, sessionId ) )
+        {
+           status = eHAL_STATUS_FAILURE;
+           break;
+        }
+
+        pMac->oemData.oemDataReqConfig.sessionId = sessionId;
+        pMac->oemData.callback = callback;
+        pMac->oemData.pContext = pContext;
+        pMac->oemData.oemDataReqID = *(pOemDataReqID);
+    
+        vos_mem_copy((v_VOID_t*)(pMac->oemData.oemDataReqConfig.oemDataReq), (v_VOID_t*)(oemDataReqConfig->oemDataReq), OEM_DATA_REQ_SIZE);
+    
+        pMac->oemData.oemDataReqActive = eANI_BOOLEAN_FALSE;
+    
+        pOemDataCmd = smeGetCommandBuffer(pMac);
+    
+        //fill up the command before posting it.
+        if(pOemDataCmd)
+        {
+            pOemDataCmd->command = eSmeCommandOemDataReq;
+            pOemDataCmd->u.oemDataCmd.callback = callback;
+            pOemDataCmd->u.oemDataCmd.pContext = pContext;
+            pOemDataCmd->u.oemDataCmd.oemDataReqID = pMac->oemData.oemDataReqID;
+    
+            //set the oem data request
+            pOemDataCmd->u.oemDataCmd.oemDataReq.sessionId = pMac->oemData.oemDataReqConfig.sessionId;
+            vos_mem_copy((v_VOID_t*)(pOemDataCmd->u.oemDataCmd.oemDataReq.oemDataReq), 
+                                    (v_VOID_t*)(pMac->oemData.oemDataReqConfig.oemDataReq), OEM_DATA_REQ_SIZE);
+        }
+        else
+        {
+            status = eHAL_STATUS_FAILURE;
+            break;
+        }
+    
+        //now queue this command in the sme command queue
+        //Here since this is not interacting with the csr just push the command
+        //into the sme queue. Also push this command with the normal priority
+        smePushCommand(pMac, pOemDataCmd, eANI_BOOLEAN_FALSE);
+
+    } while(0);
+
+    if(!HAL_STATUS_SUCCESS(status) && pOemDataCmd)
+    {
+        oemData_ReleaseOemDataReqCommand(pMac, pOemDataCmd, eOEM_DATA_REQ_FAILURE);
+        pMac->oemData.oemDataReqActive = eANI_BOOLEAN_FALSE;
+    }
+
+    return status;
+}
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_SendMBOemDataReq
+    \brief Request an OEM DATA REQ to be passed down to PE
+    \param pMac:
+    \param pOemDataReq: Pointer to the oem data request
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus oemData_SendMBOemDataReq(tpAniSirGlobal pMac, tOemDataReq *pOemDataReq)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    tSirOemDataReq* pMsg;
+    tANI_U16 msgLen;
+    tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, pOemDataReq->sessionId );
+
+    smsLog(pMac, LOGW, "OEM_DATA: entering Function %s\n", __FUNCTION__);
+    
+    msgLen = (tANI_U16)(sizeof(tSirOemDataReq));
+
+    status = palAllocateMemory(pMac->hHdd, (void**)&pMsg, msgLen);
+    if(HAL_STATUS_SUCCESS(status))
+    {
+        palZeroMemory(pMac->hHdd, pMsg, msgLen);
+        pMsg->messageType = pal_cpu_to_be16((tANI_U16)eWNI_SME_OEM_DATA_REQ);
+        palCopyMemory(pMac->hHdd, pMsg->selfMacAddr, pSession->selfMacAddr, sizeof(tSirMacAddr) );
+        status = palCopyMemory(pMac->hHdd, pMsg->oemDataReq, pOemDataReq->oemDataReq, OEM_DATA_REQ_SIZE);
+        if(HAL_STATUS_SUCCESS(status))
+        {
+            smsLog(pMac, LOGW, "OEM_DATA: sending message to pe%s\n", __FUNCTION__);
+            status = palSendMBMessage(pMac->hHdd, pMsg);
+        }
+        else
+        {
+            palFreeMemory(pMac->hHdd, pMsg);
+        }
+    }
+
+    smsLog(pMac, LOGW, "OEM_DATA: exiting Function %s\n", __FUNCTION__);
+
+    return status;
+}
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_ProcessOemDataReqCommand
+    \brief This function is called by the smeProcessCommand when the case hits
+           eSmeCommandOemDataReq
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus oemData_ProcessOemDataReqCommand(tpAniSirGlobal pMac, tSmeCmd *pOemDataReqCmd)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+
+    //check if the system is in proper mode of operation for 
+    //oem data req/rsp to be functional. Currently, concurrency is not
+    //supported and the driver must be operational only as 
+    //STA for oem data req/rsp to be functional. We return an invalid 
+    //mode flag if it is operational as any one of the following
+    //in any of the active sessions
+    //1. AP Mode
+    //2. IBSS Mode
+    //3. BTAMP Mode ...
+
+    if(eHAL_STATUS_SUCCESS == oemData_IsOemDataReqAllowed(pMac))
+    {
+        smsLog(pMac, LOG1, "%s: OEM_DATA REQ allowed in the current mode\n", __FUNCTION__);
+        pMac->oemData.oemDataReqActive = eANI_BOOLEAN_TRUE;
+        status = oemData_SendMBOemDataReq(pMac, &(pOemDataReqCmd->u.oemDataCmd.oemDataReq));
+    }
+    else
+    {
+        smsLog(pMac, LOG1, "%s: OEM_DATA REQ not allowed in the current mode\n", __FUNCTION__);
+        oemData_ReleaseOemDataReqCommand(pMac, pOemDataReqCmd, eOEM_DATA_REQ_INVALID_MODE);
+        pMac->oemData.oemDataReqActive = eANI_BOOLEAN_FALSE;
+    }
+
+    return status;
+}
+
+/* ---------------------------------------------------------------------------
+    \fn sme_HandleOemDataRsp
+    \brief This function processes the oem data response obtained from the PE
+    \param pMsg - Pointer to the pSirOemDataRsp
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus sme_HandleOemDataRsp(tHalHandle hHal, tANI_U8* pMsg)
+{
+    eHalStatus                         status = eHAL_STATUS_SUCCESS;
+    tpAniSirGlobal                     pMac;
+    tListElem                          *pEntry = NULL;
+    tSmeCmd                            *pCommand = NULL;
+    tSirOemDataRsp*                    pOemDataRsp = NULL;
+    pMac = PMAC_STRUCT(hHal);
+
+    smsLog(pMac, LOG1, "%s: OEM_DATA Entering\n", __FUNCTION__);
+
+    do
+    {
+        if(pMsg == NULL)
+        {
+            smsLog(pMac, LOGE, "in %s msg ptr is NULL\n", __FUNCTION__);
+            status = eHAL_STATUS_FAILURE;
+            break;
+        }
+    
+        pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK );
+        if(pEntry)
+        {
+            pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link );
+            if(eSmeCommandOemDataReq == pCommand->command)
+            {
+                pOemDataRsp = (tSirOemDataRsp*)pMsg;
+
+                //make sure to acquire the lock before modifying the data
+                status = sme_AcquireGlobalLock(&pMac->sme);
+                if(!HAL_STATUS_SUCCESS(status))
+                {
+                    break;
+                }
+
+                if(pMac->oemData.pOemDataRsp != NULL)
+                {
+                    vos_mem_free(pMac->oemData.pOemDataRsp);
+                }
+                pMac->oemData.pOemDataRsp = (tOemDataRsp*)vos_mem_malloc(sizeof(tOemDataRsp));
+
+                if(pMac->oemData.pOemDataRsp == NULL)
+                {
+                    sme_ReleaseGlobalLock(&pMac->sme);
+                    smsLog(pMac, LOGE, "in %s vos_mem_malloc failed for pMac->oemData.pOemDataRsp\n", __FUNCTION__);
+                    status = eHAL_STATUS_FAILURE;
+                    break;
+                }
+
+                smsLog(pMac, LOGE, "Before memory copy\n"); 
+                vos_mem_copy((v_VOID_t*)(pMac->oemData.pOemDataRsp), (v_VOID_t*)(&pOemDataRsp->oemDataRsp), sizeof(tOemDataRsp));
+                smsLog(pMac, LOGE, "after memory copy\n");
+                sme_ReleaseGlobalLock(&pMac->sme);
+            }
+            else
+            {
+                smsLog(pMac, LOGE, "in %s eWNI_SME_OEM_DATA_RSP Received but NO REQs are ACTIVE ...\n",
+                    __FUNCTION__);
+                status = eHAL_STATUS_FAILURE;
+                break;
+            }
+        }
+        else
+        {
+            smsLog(pMac, LOGE, "in %s eWNI_SME_OEM_DATA_RSP Received but NO commands are ACTIVE ...\n", __FUNCTION__);
+            status = eHAL_STATUS_FAILURE;
+            break;
+        }
+
+        oemData_ReleaseOemDataReqCommand(pMac, pCommand, eHAL_STATUS_SUCCESS);
+        pMac->oemData.oemDataReqActive = eANI_BOOLEAN_FALSE;
+
+    } while(0);
+
+    return status;
+}
+
+/* ---------------------------------------------------------------------------
+    \fn oemData_IsOemDataReqAllowed
+    \brief This function checks if OEM DATA REQs can be performed in the 
+           current driver state
+    \return eHalStatus     
+  -------------------------------------------------------------------------------*/
+eHalStatus oemData_IsOemDataReqAllowed(tHalHandle hHal)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    tANI_U32 sessionId;
+
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+
+    for(sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++)
+    {
+        if(CSR_IS_SESSION_VALID(pMac, sessionId))
+        {
+            if(csrIsConnStateIbss(pMac, sessionId) || csrIsBTAMP(pMac, sessionId) 
+#ifdef WLAN_SOFTAP_FEATURE
+               || csrIsConnStateConnectedInfraAp(pMac, sessionId)
+#endif
+               )
+            {
+                //co-exist with IBSS or BT-AMP or Soft-AP mode is not supported
+                smsLog(pMac, LOGW, "OEM DATA REQ is not allowed due to IBSS|BTAMP|SAP exist in session %d\n", sessionId);
+                status = eHAL_STATUS_CSR_WRONG_STATE;
+                break;
+            }
+        }
+    }
+
+    smsLog(pMac, LOG1, "Exiting oemData_IsOemDataReqAllowed with status %d\n", status);
+
+    return (status);
+}
+
+#endif /*FEATURE_OEM_DATA_SUPPORT*/
diff --git a/CORE/SME/src/p2p/p2p_Api.c b/CORE/SME/src/p2p/p2p_Api.c
index 057f013..c0948d1 100644
--- a/CORE/SME/src/p2p/p2p_Api.c
+++ b/CORE/SME/src/p2p/p2p_Api.c
@@ -766,7 +766,7 @@
 }
 
 eHalStatus p2pSendAction(tHalHandle hHal, tANI_U8 sessionId,
-         const tANI_U8 *pBuf, tANI_U32 len)
+         const tANI_U8 *pBuf, tANI_U32 len, tANI_U16 wait, tANI_BOOLEAN noack)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
@@ -783,9 +783,11 @@
         pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_SEND_ACTION_FRAME_IND);
         pMsg->msgLen = pal_cpu_to_be16(msgLen);
         pMsg->sessionId = sessionId;
-        palCopyMemory( pMac->hHdd, pMsg->data, pBuf, len ); 
+        pMsg->noack = noack;
+        pMsg->wait = (tANI_U16)wait;
+        palCopyMemory( pMac->hHdd, pMsg->data, pBuf, len );
         status = palSendMBMessage(pMac->hHdd, pMsg);
-    }                             
+    }
 
     return( status );
 }
diff --git a/CORE/SME/src/pmc/pmc.c b/CORE/SME/src/pmc/pmc.c
index 36b2ad9..56e2d11 100644
--- a/CORE/SME/src/pmc/pmc.c
+++ b/CORE/SME/src/pmc/pmc.c
@@ -23,7 +23,7 @@
 *
 * Name:  pmc.c
 *
-* Description: 
+* Description:
       Power Management Control (PMC) processing routines.
 *
 * Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved.
@@ -329,7 +329,7 @@
             "eWNI_PMC_EXIT_IMPS_REQ\n");
             return eHAL_STATUS_FAILURE;
         }
-        
+
         return eHAL_STATUS_SUCCESS;
 
     /* Tell MAC to have device exit UAPSD mode first */
@@ -478,7 +478,7 @@
         }
     }
 
-    //Vote off RF supplies. Note RF supllies are not voted off if there is a 
+    //Vote off RF supplies. Note RF supllies are not voted off if there is a
     //pending request for full power already
     status = vos_chipVoteOffRFSupply(&callType, NULL, NULL);
     VOS_ASSERT( VOS_IS_STATUS_SUCCESS( status ) );
@@ -510,7 +510,7 @@
 eHalStatus pmcEnterRequestBmpsState (tHalHandle hHal)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-    
+
     smsLog(pMac, LOG2, FL("Entering pmcEnterRequestBmpsState\n"));
 
     /* Can enter Request BMPS State only from Full Power State. */
@@ -691,7 +691,7 @@
             if (!checkRoutine(pPowerSaveCheckEntry->checkContext))
             {
                 smsLog(pMac, LOGE, FL("pmcPowerSaveCheck fail!\n"));
-                bResult = FALSE; 
+                bResult = FALSE;
                 break;
             }
             else
@@ -727,7 +727,7 @@
     tSirPowerSaveCfg powerSaveConfig;
 
     smsLog(pMac, LOG2, FL("Entering pmcSendPowerSaveConfigMessage\n"));
-    
+
     palZeroMemory(pMac->hHdd, &(powerSaveConfig), sizeof(tSirPowerSaveCfg));
 
     switch (pMac->pmc.bmpsConfig.forwardBeacons)
@@ -752,27 +752,27 @@
     }
     powerSaveConfig.fEnablePwrSaveImmediately = pMac->pmc.bmpsConfig.setPmOnLastFrame;
     powerSaveConfig.fPSPoll = pMac->pmc.bmpsConfig.usePsPoll;
-    powerSaveConfig.fEnableBeaconEarlyTermination = 
+    powerSaveConfig.fEnableBeaconEarlyTermination =
         pMac->pmc.bmpsConfig.enableBeaconEarlyTermination;
-    powerSaveConfig.bcnEarlyTermWakeInterval = 
+    powerSaveConfig.bcnEarlyTermWakeInterval =
         pMac->pmc.bmpsConfig.bcnEarlyTermWakeInterval;
 
-    /* setcfg for listenInterval. Make sure CFG is updated because PE reads this 
+    /* setcfg for listenInterval. Make sure CFG is updated because PE reads this
        from CFG at the time of assoc or reassoc */
-    ccmCfgSetInt(pMac, WNI_CFG_LISTEN_INTERVAL, pMac->pmc.bmpsConfig.bmpsPeriod, 
+    ccmCfgSetInt(pMac, WNI_CFG_LISTEN_INTERVAL, pMac->pmc.bmpsConfig.bmpsPeriod,
         NULL, eANI_BOOLEAN_FALSE);
 
     if( pMac->pmc.pmcState == IMPS || pMac->pmc.pmcState == REQUEST_IMPS )
     {
         //Wake up the chip first
-        eHalStatus status = pmcDeferMsg( pMac, eWNI_PMC_PWR_SAVE_CFG, 
+        eHalStatus status = pmcDeferMsg( pMac, eWNI_PMC_PWR_SAVE_CFG,
                                     &powerSaveConfig, sizeof(tSirPowerSaveCfg) );
 
         if( eHAL_STATUS_PMC_PENDING == status )
         {
             return eHAL_STATUS_SUCCESS;
         }
-        else 
+        else
         {
             //either fail or already in full power
             if( !HAL_STATUS_SUCCESS( status ) )
@@ -784,13 +784,13 @@
     }
     /* Send a message so that FW System config is also updated and is in sync with
        the CFG.*/
-    if (pmcSendMessage(hHal, eWNI_PMC_PWR_SAVE_CFG, &powerSaveConfig, sizeof(tSirPowerSaveCfg)) 
+    if (pmcSendMessage(hHal, eWNI_PMC_PWR_SAVE_CFG, &powerSaveConfig, sizeof(tSirPowerSaveCfg))
         != eHAL_STATUS_SUCCESS)
     {
         smsLog(pMac, LOGE, FL("Send of eWNI_PMC_PWR_SAVE_CFG to PE failed\n"));
         return eHAL_STATUS_FAILURE;
     }
-   
+
     return eHAL_STATUS_SUCCESS;
 }
 
@@ -1053,12 +1053,12 @@
         return;
     }
 
-    if (pmcPowerSaveCheck(hHal)) 
+    if (pmcPowerSaveCheck(hHal))
     {
         smsLog(pMac, LOGW, FL("BMPS entry criteria satisfied. Requesting BMPS state"));
-        (void)pmcEnterRequestBmpsState(hHal);    
-    } 
-    else 
+        (void)pmcEnterRequestBmpsState(hHal);
+    }
+    else
     {
         /*Some module voted against Power Save. So timer should be restarted again to retry BMPS */
         smsLog(pMac, LOGE, FL("Power Save check failed. Retry BMPS again later"));
@@ -1150,7 +1150,7 @@
 *
 * Parameters:
 *    hHal - HAL handle for device
-*    callbackStatus - Success or Failure. 
+*    callbackStatus - Success or Failure.
 *
 * Returns:
 *    nothing
@@ -1261,9 +1261,9 @@
             //Not ready for UAPSD at this time, save it first and wake up the chip
             smsLog(pMac, LOGE, " PMC state = %d\n",pMac->pmc.pmcState);
             pMac->pmc.uapsdSessionRequired = TRUE;
-            /* While BTC traffic is going on, STA can be in BMPS 
+            /* While BTC traffic is going on, STA can be in BMPS
              * and need not go to Full Power */
-            //fFullPower = VOS_TRUE; 
+            //fFullPower = VOS_TRUE;
          }
 #endif /* WLAN_MDM_CODE_REDUCTION_OPT*/
          break;
@@ -1344,7 +1344,7 @@
       only way to inform modules if PMC resumed UAPSD power save mode
       on its own after full power mode */
    pmcDoDeviceStateUpdateCallbacks(hHal, UAPSD);
-   
+
    /* If we have a reqeust for full power pending then we have to go
    directly into full power. */
    if (pMac->pmc.requestFullPowerPending)
@@ -1449,7 +1449,7 @@
           (void)pmcStartTrafficTimer(hHal, pMac->pmc.bmpsConfig.trafficMeasurePeriod);
       return eHAL_STATUS_FAILURE;
    }
-   
+
    return eHAL_STATUS_SUCCESS;
 }
 
@@ -1513,7 +1513,7 @@
 * Name:  pmcDoStandbyCallbacks
 *
 * Description:
-*    Call the registered Standby callback routines 
+*    Call the registered Standby callback routines
 *
 * Parameters:
 *    hHal - HAL handle for device
@@ -1526,7 +1526,7 @@
 void pmcDoStandbyCallbacks (tHalHandle hHal, eHalStatus callbackStatus)
 {
    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
- 
+
    smsLog(pMac, LOG2, "PMC: entering pmcDoStandbyCallbacks\n");
 
    /* Call Standby callback routine. */
@@ -1553,7 +1553,7 @@
 tPmcState pmcGetPmcState (tHalHandle hHal)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
-    return pMac->pmc.pmcState; 
+    return pMac->pmc.pmcState;
 }
 
 const char* pmcGetPmcStateStr(tPmcState state)
@@ -1654,7 +1654,7 @@
 
       case REQUEST_BMPS:
          smsLog(pMac, LOGW, "PMC: BMPS transaction going on. WOWL request "
-                    "will be buffered\n");         
+                    "will be buffered\n");
          break;
 
       case BMPS:
@@ -1678,7 +1678,7 @@
 
       case REQUEST_EXIT_WOWL:
          smsLog(pMac, LOGW, "PMC: Exit WOWL transaction going on. New WOWL request "
-                   "will be buffered\n");         
+                   "will be buffered\n");
          break;
 
       default:
@@ -1771,7 +1771,7 @@
 
         case REQUEST_ENTER_WOWL:
             smsLog(pMac, LOGP, "PMC: Rcvd exit WOWL even before enter WOWL was completed\n");
-            return eHAL_STATUS_FAILURE;   
+            return eHAL_STATUS_FAILURE;
 
         default:
             smsLog(pMac, LOGW, "PMC: Got exit WOWL in state %s. Nothing to do as already out of WOWL\n",
@@ -1798,7 +1798,7 @@
 void pmcDoEnterWowlCallbacks (tHalHandle hHal, eHalStatus callbackStatus)
 {
    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
- 
+
    smsLog(pMac, LOG2, "PMC: entering pmcDoWowlCallbacks\n");
 
    /* Call Wowl callback routine. */
@@ -1822,7 +1822,7 @@
         {
         case eWNI_PMC_WOWL_ADD_BCAST_PTRN:
             VOS_ASSERT( pDeferredMsg->size == sizeof(tSirWowlAddBcastPtrn) );
-            if (pmcSendMessage(pMac, eWNI_PMC_WOWL_ADD_BCAST_PTRN, 
+            if (pmcSendMessage(pMac, eWNI_PMC_WOWL_ADD_BCAST_PTRN,
                     &pDeferredMsg->u.wowlAddPattern, sizeof(tSirWowlAddBcastPtrn))
                     != eHAL_STATUS_SUCCESS)
             {
@@ -1832,7 +1832,7 @@
 
         case eWNI_PMC_WOWL_DEL_BCAST_PTRN:
             VOS_ASSERT( pDeferredMsg->size == sizeof(tSirWowlDelBcastPtrn) );
-            if (pmcSendMessage(pMac, eWNI_PMC_WOWL_DEL_BCAST_PTRN, 
+            if (pmcSendMessage(pMac, eWNI_PMC_WOWL_DEL_BCAST_PTRN,
                     &pDeferredMsg->u.wowlDelPattern, sizeof(tSirWowlDelBcastPtrn))
                     != eHAL_STATUS_SUCCESS)
             {
@@ -1842,8 +1842,8 @@
 
         case eWNI_PMC_PWR_SAVE_CFG:
             VOS_ASSERT( pDeferredMsg->size == sizeof(tSirPowerSaveCfg) );
-            if (pmcSendMessage(pMac, eWNI_PMC_PWR_SAVE_CFG, 
-                    &pDeferredMsg->u.powerSaveConfig, sizeof(tSirPowerSaveCfg)) 
+            if (pmcSendMessage(pMac, eWNI_PMC_PWR_SAVE_CFG,
+                    &pDeferredMsg->u.powerSaveConfig, sizeof(tSirPowerSaveCfg))
                 != eHAL_STATUS_SUCCESS)
             {
                 smsLog(pMac, LOGE, FL("Send of eWNI_PMC_PWR_SAVE_CFG to PE failed\n"));
@@ -1875,7 +1875,7 @@
     pDeferredMsg->size = (tANI_U16)size;
     if( pData )
     {
-        if( !HAL_STATUS_SUCCESS( palCopyMemory( pMac->hHdd, &pDeferredMsg->u.data, 
+        if( !HAL_STATUS_SUCCESS( palCopyMemory( pMac->hHdd, &pDeferredMsg->u.data,
                                     pData, size ) ) )
         {
             smsLog(pMac, LOGE, FL("Cannot copy pattern for callback context\n"));
@@ -1884,7 +1884,7 @@
         }
     }
     csrLLInsertTail( &pMac->pmc.deferredMsgList, &pDeferredMsg->link, eANI_BOOLEAN_TRUE );
-    //No callback is needed. The messages are put into deferred queue and be processed first 
+    //No callback is needed. The messages are put into deferred queue and be processed first
     //when enter full power is complete.
     status = pmcRequestFullPower( pMac, NULL, NULL, eSME_REASON_OTHER );
     if( eHAL_STATUS_PMC_PENDING != status )
@@ -1989,7 +1989,7 @@
 
 
 //These commands are not supposed to fail due to out of command buffer,
-//otherwise other commands are not executed and no command is released. It will be deadlock. 
+//otherwise other commands are not executed and no command is released. It will be deadlock.
 #define PMC_IS_COMMAND_CANNOT_FAIL(cmdType)\
     ( (eSmeCommandEnterStandby == (cmdType )) ||\
       (eSmeCommandExitImps == (cmdType )) ||\
@@ -1997,7 +1997,7 @@
       (eSmeCommandExitUapsd == (cmdType )) ||\
       (eSmeCommandExitWowl == (cmdType )) )
 
-eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam, 
+eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam,
                             tANI_U32 size, tSmeCmd **ppCmd )
 {
     eHalStatus status = eHAL_STATUS_RESOURCES;
@@ -2022,7 +2022,7 @@
                 status = palAllocateMemory(pMac->hHdd, (void **)&pCommand, sizeof(tSmeCmd));
                 if(!HAL_STATUS_SUCCESS(status))
                 {
-                    VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, "%s fail to allocate memory for command (0x%X)", 
+                    VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, "%s fail to allocate memory for command (0x%X)",
                         __FUNCTION__, cmdType);
                     pCommand = NULL;
                     break;
@@ -2102,7 +2102,7 @@
 }
 
 
-eHalStatus pmcIssueCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam, 
+eHalStatus pmcIssueCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam,
                             tANI_U32 size, tANI_BOOLEAN fPutToListHead )
 {
     eHalStatus status = eHAL_STATUS_RESOURCES;
@@ -2173,12 +2173,12 @@
                 if ( HAL_STATUS_SUCCESS( status ) )
                 {
                     pMac->pmc.pmcState = REQUEST_FULL_POWER;
-                    smsLog(pMac, LOGW, FL("eWNI_PMC_EXIT_IMPS_REQ sent to PE\n")); 
+                    smsLog(pMac, LOGW, FL("eWNI_PMC_EXIT_IMPS_REQ sent to PE\n"));
                     fRemoveCmd = eANI_BOOLEAN_FALSE;
                 }
                 else
                 {
-                    smsLog(pMac, LOGE, FL("eWNI_PMC_EXIT_IMPS_REQ fail to be sent to PE status %d\n"), status); 
+                    smsLog(pMac, LOGE, FL("eWNI_PMC_EXIT_IMPS_REQ fail to be sent to PE status %d\n"), status);
                     //Callbacks are called with success srarus, do we need to pass in real status??
                     pmcEnterFullPowerState(pMac);
                 }
@@ -2195,7 +2195,7 @@
                     /* Change PMC state */
                     pMac->pmc.pmcState = REQUEST_BMPS;
                     smsLog(pMac, LOGW, "PMC: Enter BMPS req done: Force XO Core ON\n");
-                    vstatus = vos_chipVoteXOCore(NULL, NULL, NULL, VOS_TRUE); 
+                    vstatus = vos_chipVoteXOCore(NULL, NULL, NULL, VOS_TRUE);
                     if ( !VOS_IS_STATUS_SUCCESS(vstatus) )
                     {
                         smsLog(pMac, LOGE, "Could not turn XO Core ON. Can't go to BMPS\n");
@@ -2219,8 +2219,8 @@
                                 smsLog(pMac, LOGE, "Could not cancel XO Core ON vote."
                                                    "Not returning failure."
                                                    "Power consumed will be high\n");
-                            }  
-                            
+                            }
+
                         }
                     }
                 }
@@ -2242,7 +2242,7 @@
             {
                 pMac->pmc.requestFullPowerPending = FALSE;
 
-                status = pmcSendMessage( pMac, eWNI_PMC_EXIT_BMPS_REQ, 
+                status = pmcSendMessage( pMac, eWNI_PMC_EXIT_BMPS_REQ,
                             &pCommand->u.pmcCmd.u.exitBmpsInfo, sizeof(tExitBmpsInfo) );
                 if ( HAL_STATUS_SUCCESS( status ) )
                 {
@@ -2314,7 +2314,7 @@
         case eSmeCommandEnterWowl:
             if( ( BMPS == pMac->pmc.pmcState ) || ( WOWL == pMac->pmc.pmcState ) )
             {
-                status = pmcSendMessage(pMac, eWNI_PMC_ENTER_WOWL_REQ, 
+                status = pmcSendMessage(pMac, eWNI_PMC_ENTER_WOWL_REQ,
                         &pCommand->u.pmcCmd.u.enterWowlInfo, sizeof(tSirSmeWowlEnterParams));
                 if ( HAL_STATUS_SUCCESS( status ) )
                 {
@@ -2357,14 +2357,14 @@
             if( FULL_POWER == pMac->pmc.pmcState )
             {
                //Disallow standby if concurrent sessions are present. Note that CSR would have
-               //caused the STA to disconnect the Infra session (if not already disconnected) because of 
+               //caused the STA to disconnect the Infra session (if not already disconnected) because of
                //standby request. But we are now failing the standby request because of concurrent session.
-               //So was the tearing of infra session wasteful if we were going to fail the standby request ? 
+               //So was the tearing of infra session wasteful if we were going to fail the standby request ?
                //Not really. This is beacuse if and when BT-AMP etc sessions are torn down we will transition
                //to IMPS/standby and still save power.
                if (csrIsIBSSStarted(pMac) || csrIsBTAMPStarted(pMac))
                {
-                  VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, 
+                  VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL,
                       "WLAN: IBSS or BT-AMP session present. Cannot honor standby request");
 
                   pmcDoStandbyCallbacks(pMac, eHAL_STATUS_PMC_NOT_NOW);
@@ -2372,7 +2372,7 @@
                       (void)pmcStartTrafficTimer(pMac, pMac->pmc.bmpsConfig.trafficMeasurePeriod);
                   break;
                }
- 
+
                 // Stop traffic timer. Just making sure timer is not running
                 pmcStopTrafficTimer(pMac);
 
@@ -2418,7 +2418,7 @@
     if( !PMC_IS_READY(pMac) )
     {
         smsLog(pMac, LOGE, FL("Requesting IMPS when PMC not ready\n"));
-        smsLog(pMac, LOGE, FL("pmcReady = %d pmcState = %s\n"), 
+        smsLog(pMac, LOGE, FL("pmcReady = %d pmcState = %s\n"),
             pMac->pmc.pmcReady, pmcGetPmcStateStr(pMac->pmc.pmcState));
         return eHAL_STATUS_FAILURE;
     }
@@ -2451,7 +2451,7 @@
         smsLog(pMac, LOG2, FL("IMPS cannot be entered now\n"));
         return eHAL_STATUS_PMC_NOT_NOW;
     }
-    
+
     /* Check if already in IMPS. */
     if ((pMac->pmc.pmcState == REQUEST_IMPS) || (pMac->pmc.pmcState == IMPS) ||
         (pMac->pmc.pmcState == REQUEST_FULL_POWER))
@@ -2479,7 +2479,7 @@
    if( !PMC_IS_READY(pMac) )
    {
        smsLog(pMac, LOGE, FL("Requesting BMPS when PMC not ready\n"));
-       smsLog(pMac, LOGE, FL("pmcReady = %d pmcState = %s\n"), 
+       smsLog(pMac, LOGE, FL("pmcReady = %d pmcState = %s\n"),
            pMac->pmc.pmcReady, pmcGetPmcStateStr(pMac->pmc.pmcState));
        return eHAL_STATUS_FAILURE;
    }
@@ -2504,24 +2504,28 @@
       return eHAL_STATUS_PMC_NOT_NOW;
    }
 
-   smsLog(pMac, LOG1, FL("concurrency enabled %u\n"), pMac->roam.configParam.concurrencyEnabled);
-   if (pMac->roam.configParam.concurrencyEnabled)
+#ifndef BMPS_WORKAROUND_NOT_NEEDED
+   smsLog(pMac, LOG1, FL("doBMPSWorkaround %u\n"), pMac->roam.configParam.doBMPSWorkaround);
+   if (pMac->roam.configParam.doBMPSWorkaround)
    {
-      pMac->roam.configParam.concurrencyEnabled = 0;
-      smsLog(pMac, LOG1, FL("reset concurrency to disabled %u\n"), pMac->roam.configParam.concurrencyEnabled);
+      pMac->roam.configParam.doBMPSWorkaround = 0;
+      smsLog(pMac, LOG1, FL("reset doBMPSWorkaround to disabled %u\n"), pMac->roam.configParam.doBMPSWorkaround);
       csrDisconnectAllActiveSessions(pMac);
+      smsLog(pMac, LOGE, "PMC: doBMPSWorkaround was enabled. First Disconnect all sessions. pmcState %d\n", pMac->pmc.pmcState);
+      return eHAL_STATUS_FAILURE;
    }
+#endif
    return ( eHAL_STATUS_SUCCESS );
 }
 
 tANI_BOOLEAN pmcShouldBmpsTimerRun( tpAniSirGlobal pMac )
 {
-    /* Check if BMPS is enabled and if Auto BMPS Feature is still enabled 
+    /* Check if BMPS is enabled and if Auto BMPS Feature is still enabled
      * or there is a pending Uapsd request or HDD requested BMPS or there
-     * is a pending request for WoWL. In all these cases BMPS is required. 
+     * is a pending request for WoWL. In all these cases BMPS is required.
      * Otherwise just stop the timer and return.
      */
-    if (!(pMac->pmc.bmpsEnabled && (pMac->pmc.autoBmpsEntryEnabled || 
+    if (!(pMac->pmc.bmpsEnabled && (pMac->pmc.autoBmpsEntryEnabled ||
           pMac->pmc.uapsdSessionRequired || pMac->pmc.bmpsRequestedByHdd ||
           pMac->pmc.wowlModeRequired )))
     {
@@ -2529,7 +2533,16 @@
         return eANI_BOOLEAN_FALSE;
     }
 
-    /* Check if there is an Infra session. BMPS is possible only if there is 
+    if ((vos_concurrent_sessions_running()) &&
+        ((csrIsConcurrentInfraConnected( pMac ) ||
+        (vos_get_concurrency_mode()& VOS_SAP) ||
+        (vos_get_concurrency_mode()& VOS_P2P_GO))))
+    {
+        smsLog(pMac, LOG1, FL("Multiple Sessions/GO/SAP sessions . BMPS should not be started"));
+        return eANI_BOOLEAN_FALSE;
+    }
+
+    /* Check if there is an Infra session. BMPS is possible only if there is
      * an Infra session */
     if (!csrIsInfraConnected(pMac))
     {
@@ -2540,7 +2553,7 @@
 }
 
 
-#ifdef FEATURE_WLAN_DIAG_SUPPORT 
+#ifdef FEATURE_WLAN_DIAG_SUPPORT
 
 #define PMC_DIAG_EVT_TIMER_INTERVAL ( 5000 )
 
diff --git a/CORE/SME/src/pmc/pmcApi.c b/CORE/SME/src/pmc/pmcApi.c
index ac4a73e..a8fe6f6 100644
--- a/CORE/SME/src/pmc/pmcApi.c
+++ b/CORE/SME/src/pmc/pmcApi.c
@@ -1624,8 +1624,10 @@
       smsLog(pMac, LOGW, "PMC: BT-AMP exists. BMPS cannot be entered\n");
       return eANI_BOOLEAN_FALSE;
    }
-   if ((vos_concurrent_sessions_running()) && 
-        csrIsConcurrentInfraConnected( pMac ))
+   if ((vos_concurrent_sessions_running()) &&
+       (csrIsConcurrentInfraConnected( pMac ) ||
+       (vos_get_concurrency_mode()& VOS_SAP) ||
+       (vos_get_concurrency_mode()& VOS_P2P_GO)))
    {
       smsLog(pMac, LOGW, "PMC: Multiple active sessions exists. BMPS cannot be entered\n");
       return eANI_BOOLEAN_FALSE;
@@ -2426,10 +2428,21 @@
             eHAL_STATUS_FAILURE  Cannot set the offload.
             eHAL_STATUS_SUCCESS  Request accepted. 
   ---------------------------------------------------------------------------*/
-eHalStatus pmcSetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest)
+eHalStatus pmcSetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 *bssId)
 {
     tpSirHostOffloadReq pRequestBuf;
     vos_msg_t msg;
+    tpPESession     psessionEntry;
+    tANI_U8   sessionId;
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+
+    if((psessionEntry = peFindSessionByBssid( pMac, bssId,&sessionId)) == NULL )
+    {
+        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Unable to find"
+        "the psessionEntry for bssid : 0x%x:0x%x:0x%x:0x%x:0x%x:0x%x", 
+        __FUNCTION__,bssId[5],bssId[4],bssId[3],bssId[2],bssId[1],bssId[0]);
+        return eHAL_STATUS_FAILURE;
+    }
 
     VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: IP address = %d.%d.%d.%d", __FUNCTION__,
         pRequest->params.hostIpv4Addr[0], pRequest->params.hostIpv4Addr[1],
@@ -2443,6 +2456,8 @@
     }
     vos_mem_copy(pRequestBuf, pRequest, sizeof(tSirHostOffloadReq));
 
+    pRequestBuf->bssIdx = psessionEntry->bssIdx;
+
     msg.type = WDA_SET_HOST_OFFLOAD;
     msg.reserved = 0;
     msg.bodyptr = pRequestBuf;
@@ -2465,10 +2480,20 @@
             eHAL_STATUS_FAILURE  Cannot set the keepalive.
             eHAL_STATUS_SUCCESS  Request accepted. 
   ---------------------------------------------------------------------------*/
-eHalStatus pmcSetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest)
+eHalStatus pmcSetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest, tANI_U8 *bssId)
 {
     tpSirKeepAliveReq pRequestBuf;
     vos_msg_t msg;
+    tpPESession     psessionEntry;
+    tANI_U8   sessionId;
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+    if((psessionEntry = peFindSessionByBssid( pMac, bssId,&sessionId)) == NULL )
+    {
+        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Unable to find"
+        "the psessionEntry for bssid : 0x%x:0x%x:0x%x:0x%x:0x%x:0x%x", 
+        __FUNCTION__,bssId[5],bssId[4],bssId[3],bssId[2],bssId[1],bssId[0]);
+        return eHAL_STATUS_FAILURE;
+    }
 
     VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_LOW, "%s: "
                   "WDA_SET_KEEP_ALIVE message", __FUNCTION__);
@@ -2482,7 +2507,9 @@
         return eHAL_STATUS_FAILED_ALLOC;
     }
     vos_mem_copy(pRequestBuf, pRequest, sizeof(tSirKeepAliveReq));
-    
+
+    pRequestBuf->bssIdx = psessionEntry->bssIdx;
+
     VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_LOW, "buff TP %d "
               "input TP %d ", pRequestBuf->timePeriod, pRequest->timePeriod);
 
@@ -2513,11 +2540,21 @@
             eHAL_STATUS_FAILURE  Cannot set the offload.
             eHAL_STATUS_SUCCESS  Request accepted. 
   ---------------------------------------------------------------------------*/
-eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest)
+eHalStatus pmcSetNSOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest, tANI_U8 *bssId)
 {
     tpSirHostOffloadReq pRequestBuf;
     vos_msg_t msg;
     int i;
+    tpPESession     psessionEntry;
+    tANI_U8   sessionId;
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+    if((psessionEntry = peFindSessionByBssid( pMac, bssId,&sessionId)) == NULL )
+    {
+        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Unable to find"
+        "the psessionEntry for bssid : 0x%x:0x%x:0x%x:0x%x:0x%x:0x%x", 
+        __FUNCTION__,bssId[5],bssId[4],bssId[3],bssId[2],bssId[1],bssId[0]);
+        return eHAL_STATUS_FAILURE;
+    }
 
     pRequestBuf = vos_mem_malloc(sizeof(tSirHostOffloadReq));
     if (NULL == pRequestBuf)
@@ -2527,6 +2564,8 @@
     }
     vos_mem_copy(pRequestBuf, pRequest, sizeof(tSirHostOffloadReq));
 
+    pRequestBuf->bssIdx = psessionEntry->bssIdx;
+
     msg.type = WDA_SET_NS_OFFLOAD;
     msg.reserved = 0;
     msg.bodyptr = pRequestBuf;
@@ -2737,7 +2776,7 @@
     
     if (IS_DOT11_MODE_HT(dot11mode))
     {
-       PopulateDot11fHTCaps( pMac, &pr.HTCaps );
+       PopulateDot11fHTCaps( pMac, NULL, &pr.HTCaps );
     }
     
     // That's it-- now we pack it.  First, how much space are we going to
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index e34b4e1..2dac130 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -398,6 +398,11 @@
         fFullPowerNeeded = ( ( eSmeCommandAddTs == pCommand->command ) ||
                     ( eSmeCommandDelTs ==  pCommand->command ) );
         if( fFullPowerNeeded ) break;
+#ifdef FEATURE_OEM_DATA_SUPPORT
+        fFullPowerNeeded = (pmcState == IMPS && 
+                                       eSmeCommandOemDataReq == pCommand->command);
+        if(fFullPowerNeeded) break;
+#endif
 #ifdef WLAN_FEATURE_P2P
         fFullPowerNeeded = (pmcState == IMPS && 
                             eSmeCommandRemainOnChannel == pCommand->command);
@@ -619,6 +624,12 @@
                             csrProcessDelStaSessionCommand( pMac, pCommand );
                             break;
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+                        case eSmeCommandOemDataReq:
+                            csrLLUnlock(&pMac->sme.smeCmdActiveList);
+                            oemData_ProcessOemDataReqCommand(pMac, pCommand);
+                            break;
+#endif
 #if defined WLAN_FEATURE_P2P
                         case eSmeCommandRemainOnChannel:
                             csrLLUnlock(&pMac->sme.smeCmdActiveList);
@@ -871,6 +882,14 @@
          break;
       }
 #endif
+#ifdef FEATURE_OEM_DATA_SUPPORT
+      status = oemData_OemDataReqOpen(pMac);
+      if ( ! HAL_STATUS_SUCCESS( status ) ) {
+         smsLog(pMac, LOGE,
+                "oemData_OemDataReqOpen failed during initialization with status=%d", status );
+         break;
+      }
+#endif
 
       if(!HAL_STATUS_SUCCESS((status = initSmeCmdList(pMac))))
           break;
@@ -1447,6 +1466,21 @@
              break;
 #endif
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+          //Handle the eWNI_SME_OEM_DATA_RSP:
+          case eWNI_SME_OEM_DATA_RSP:
+                if(pMsg->bodyptr)
+                {
+                        status = sme_HandleOemDataRsp(pMac, pMsg->bodyptr);
+                        vos_mem_free(pMsg->bodyptr);
+                }
+                else
+                {
+                        smsLog( pMac, LOGE, "Empty rsp message for oemData_ (eWNI_SME_OEM_DATA_RSP), nothing to process\n");
+                }
+                smeProcessPendingQueue( pMac );
+                break;
+#endif
 
           case eWNI_SME_ADD_STA_SELF_RSP:
                 if(pMsg->bodyptr)
@@ -1471,7 +1505,6 @@
                 }
                 break;
 #ifdef WLAN_FEATURE_P2P
-          //Handle the eWNI_SME_INNAV_MEAS_RSP:
           case eWNI_SME_REMAIN_ON_CHN_RSP:
                 if(pMsg->bodyptr)
                 {
@@ -1787,6 +1820,14 @@
       fail_status = status;
    }
 #endif
+#ifdef FEATURE_OEM_DATA_SUPPORT
+   status = oemData_OemDataReqClose(hHal);
+   if ( ! HAL_STATUS_SUCCESS( status ) ) {
+       smsLog( pMac, LOGE, "OEM DATA REQ close failed during sme close with status=%d\n", 
+              status );
+      fail_status = status;
+   }
+#endif
 
    status = ccmClose(hHal);
          if ( ! HAL_STATUS_SUCCESS( status ) ) {
@@ -4698,6 +4739,99 @@
 }
 #endif /* FEATURE_WLAN_WAPI */
 
+#ifdef FEATURE_OEM_DATA_SUPPORT
+
+/*****************************************************************************
+ OEM DATA related modifications and function additions
+ *****************************************************************************/
+
+/* ---------------------------------------------------------------------------
+    \fn sme_getOemDataRsp
+    \brief a wrapper function to obtain the OEM DATA RSP
+    \param pOemDataRsp - A pointer to the response object
+    \param pContext - a pointer passed in for the callback
+    \return eHalStatus     
+  ---------------------------------------------------------------------------*/
+eHalStatus sme_getOemDataRsp(tHalHandle hHal, 
+        tOemDataRsp **pOemDataRsp)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+
+    do
+    {
+        //acquire the lock for the sme object
+        status = sme_AcquireGlobalLock(&pMac->sme);
+
+        if(!HAL_STATUS_SUCCESS(status))
+        {
+            break;
+        }
+
+        if(pMac->oemData.pOemDataRsp != NULL)
+        {
+            *pOemDataRsp = pMac->oemData.pOemDataRsp;
+        }
+        else
+        {
+            status = eHAL_STATUS_FAILURE;
+        }
+
+        //release the lock for the sme object
+        sme_ReleaseGlobalLock( &pMac->sme );
+
+    } while(0);
+
+    return status;
+}
+
+/* ---------------------------------------------------------------------------
+    \fn sme_OemDataReq
+    \brief a wrapper function for OEM DATA REQ
+    \param sessionId - session id to be used.
+    \param pOemDataReqId - pointer to an object to get back the request ID
+    \param callback - a callback function that is called upon finish
+    \param pContext - a pointer passed in for the callback
+    \return eHalStatus     
+  ---------------------------------------------------------------------------*/
+eHalStatus sme_OemDataReq(tHalHandle hHal, 
+        tANI_U8 sessionId,
+        tOemDataReqConfig *pOemDataReqConfig, 
+        tANI_U32 *pOemDataReqID, 
+        oemData_OemDataReqCompleteCallback callback, 
+        void *pContext)
+{
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+
+    do
+    {
+        //acquire the lock for the sme object
+        status = sme_AcquireGlobalLock(&pMac->sme);
+        if(HAL_STATUS_SUCCESS(status))
+        {
+            tANI_U32 lOemDataReqId = pMac->oemData.oemDataReqID++; //let it wrap around
+
+            if(pOemDataReqID)
+            {
+               *pOemDataReqID = lOemDataReqId;
+            }
+            else
+               return eHAL_STATUS_FAILURE;
+
+            status = oemData_OemDataReq(hHal, sessionId, pOemDataReqConfig, pOemDataReqID, callback, pContext);
+
+            //release the lock for the sme object
+            sme_ReleaseGlobalLock( &pMac->sme );
+        }
+    } while(0);
+
+    smsLog(pMac, LOGW, "exiting function %s\n", __FUNCTION__);
+
+    return(status);
+}
+
+#endif /*FEATURE_OEM_DATA_SUPPORT*/
 
 /*--------------------------------------------------------------------------
 
@@ -4901,22 +5035,31 @@
     \param  pRequest -  Pointer to the offload request.
     \return eHalStatus
   ---------------------------------------------------------------------------*/
-eHalStatus sme_SetHostOffload (tHalHandle hHal, tpSirHostOffloadReq pRequest)
+eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId, 
+                                    tpSirHostOffloadReq pRequest)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
-    eHalStatus status;
+    eHalStatus status = eHAL_STATUS_FAILURE;
+    tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
+
+    if(pSession == NULL )
+    {
+        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: "
+           "Unable to find the csrSession", __FUNCTION__);
+        return status;
+    }
 
     if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) )
     {
 #ifdef WLAN_NS_OFFLOAD
         if(SIR_IPV6_NS_OFFLOAD == pRequest->offloadType)
         {
-            status = pmcSetNSOffload( hHal, pRequest );
+            status = pmcSetNSOffload( hHal, pRequest ,pSession->connectedProfile.bssid);
         }
         else
 #endif //WLAN_NS_OFFLOAD
         {
-            status = pmcSetHostOffload (hHal, pRequest);
+            status = pmcSetHostOffload (hHal, pRequest, pSession->connectedProfile.bssid);
         }
         sme_ReleaseGlobalLock( &pMac->sme );
     }
@@ -4975,18 +5118,26 @@
     \param  pRequest -  Pointer to the Keep Alive request.
     \return eHalStatus
   ---------------------------------------------------------------------------*/
-eHalStatus sme_SetKeepAlive (tHalHandle hHal, tpSirKeepAliveReq pRequest)
+eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, 
+                                 tpSirKeepAliveReq pRequest)
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     eHalStatus status;
+    tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId );
 
     VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: "
            "setting Keep alive in SME TP %d", __FUNCTION__,pRequest->timePeriod);
 
+    if(pSession == NULL )
+    {
+		VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: "
+           " Session not Found", __FUNCTION__);
+        return eHAL_STATUS_FAILURE;
+    }
 
     if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) )
     {
-        status = pmcSetKeepAlive (hHal, pRequest);
+        status = pmcSetKeepAlive (hHal, pRequest, pSession->connectedProfile.bssid);
         sme_ReleaseGlobalLock( &pMac->sme );
     }
 
@@ -5324,7 +5475,8 @@
   ---------------------------------------------------------------------------*/
 
 eHalStatus sme_sendAction(tHalHandle hHal, tANI_U8 sessionId,
-                          const tANI_U8 *pBuf, tANI_U32 len)
+                          const tANI_U8 *pBuf, tANI_U32 len,
+                          tANI_U16 wait, tANI_BOOLEAN noack)
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
     tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
@@ -5333,7 +5485,7 @@
     status = sme_AcquireGlobalLock(&pMac->sme);
     if(HAL_STATUS_SUCCESS(status))
     {
-        p2pSendAction(hHal, sessionId, pBuf, len);
+        p2pSendAction(hHal, sessionId, pBuf, len, wait, noack);
         //release the lock for the sme object
         sme_ReleaseGlobalLock( &pMac->sme );
     }
@@ -5850,12 +6002,34 @@
 {
     tpSirRcvFltMcAddrList   pRequestBuf;
     vos_msg_t               msg;
+    tpAniSirGlobal          pMac = PMAC_STRUCT(hHal);
+    tANI_U8                 sessionId = 0;
+    tCsrRoamSession         *pSession = NULL;
 
     VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: "
                "ulMulticastAddrCnt=%d, multicastAddr[0]=%d", __FUNCTION__,
                pMulticastAddrs->ulMulticastAddrCnt,
                pMulticastAddrs->multicastAddr[0]);
-  
+
+    /*
+     *Find the connected Infra / P2P_client connected session
+     */
+     for( sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++ )
+     {
+         if( CSR_IS_SESSION_VALID( pMac, sessionId ) && 
+           ( csrIsConnStateInfra( pMac, sessionId )) )
+         {
+            pSession = CSR_GET_SESSION( pMac, sessionId );
+         }
+     }
+
+    if(pSession == NULL )
+    {
+        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Unable to find "
+            "the right session", __FUNCTION__);
+        return eHAL_STATUS_FAILURE;
+    }
+    
     pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList));
     if (NULL == pRequestBuf)
     {
@@ -5865,6 +6039,10 @@
     }
     vos_mem_copy(pRequestBuf, pMulticastAddrs, sizeof(tSirRcvFltMcAddrList));
 
+    vos_mem_copy(pRequestBuf->selfMacAddr, pSession->selfMacAddr, sizeof(tSirMacAddr));
+    vos_mem_copy(pRequestBuf->bssId, pSession->connectedProfile.bssid, 
+                 sizeof(tSirMacAddr));
+
     msg.type = WDA_8023_MULTICAST_LIST_REQ;
     msg.reserved = 0;
     msg.bodyptr = pRequestBuf;
@@ -5879,12 +6057,14 @@
     return eHAL_STATUS_SUCCESS;
 }
 
-eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg)
+eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg, 
+                                           tANI_U8 sessionId)
 {
     tpSirRcvPktFilterCfgType    pRequestBuf;
     v_SINT_t                allocSize;
     vos_msg_t               msg;
-    /*tpAniSirGlobal          pMac = PMAC_STRUCT(hHal);*/
+    tpAniSirGlobal          pMac = PMAC_STRUCT(hHal);
+    tCsrRoamSession         *pSession = CSR_GET_SESSION( pMac, sessionId );
     v_U8_t   idx=0;
 
     VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: filterType=%d, "
@@ -5895,7 +6075,7 @@
                       ((pRcvPktFilterCfg->numFieldParams - 1) * 
                       sizeof(tSirRcvPktFilterFieldParams));
     pRequestBuf = vos_mem_malloc(allocSize);
-    if (NULL == pRequestBuf)
+    if ((NULL == pRequestBuf) || (NULL == pSession))
     {
         VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Not able to "
             "allocate memory for Receive Filter Set Filter request", __FUNCTION__);
@@ -5903,6 +6083,10 @@
     }
     vos_mem_copy(pRequestBuf, pRcvPktFilterCfg, allocSize);
 
+    vos_mem_copy( pRequestBuf->selfMacAddr, pSession->selfMacAddr, sizeof(tSirMacAddr));
+    vos_mem_copy( pRequestBuf->bssId, pSession->connectedProfile.bssid, 
+                          sizeof(tSirMacAddr));
+
     msg.type = WDA_RECEIVE_FILTER_SET_FILTER_REQ;
     msg.reserved = 0;
     msg.bodyptr = pRequestBuf;
@@ -5979,16 +6163,19 @@
     return (status);
 }
 
-eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam)
+eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam, 
+                                             tANI_U8 sessionId)
 {
     tpSirRcvFltPktClearParam pRequestBuf;
     vos_msg_t               msg;
+    tpAniSirGlobal          pMac = PMAC_STRUCT(hHal);
+    tCsrRoamSession         *pSession = CSR_GET_SESSION( pMac, sessionId );
 
     VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: filterId = %d", __FUNCTION__,
                pRcvFltPktClearParam->filterId);
   
     pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltPktClearParam));
-    if (NULL == pRequestBuf)
+    if ((NULL == pRequestBuf) || (NULL == pSession))
     {
         VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,
             "%s: Not able to allocate memory for Receive Filter "
@@ -5997,6 +6184,10 @@
     }
     vos_mem_copy(pRequestBuf, pRcvFltPktClearParam, sizeof(tSirRcvFltPktClearParam));
 
+    vos_mem_copy( pRequestBuf->selfMacAddr, pSession->selfMacAddr, sizeof(tSirMacAddr));
+    vos_mem_copy( pRequestBuf->bssId, pSession->connectedProfile.bssid, 
+                          sizeof(tSirMacAddr));
+
     msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ;
     msg.reserved = 0;
     msg.bodyptr = pRequestBuf;