prima: WLAN Driver Release 3.2.0.2

Integrate the following CLs from Perforce:

636735: Insure PMK candidate notify event only sent up to supplicant for RSN
Insure that PMK candidate notify even only sent up to supplicant for
RSN associations (CR 362782)

636761,
636770,
636789: Feature for supporting roaming to an AP with better RSSI
This feature takes care of the station to roam to a new AP only if the
roamable/new AP has a better RSSI than current AP.  A new ini item has
been added named RoamRssiDiff using which we can configure how better
in terms of Rssi, the new AP that we want to roam should be. On
providing a value of Zero, the feature is disabled and the check for
an AP with better RSSI does not happen while roaming. (CR 366355)

636834: Set rssi filter period to FT value
if CCX is disable and LFR is enabled, rssi filter period was set to 20
(default value) because of which RSSI monitoring was not effective,
changes added to set rssi filter period to FT rssi value (5) even for
LFR enabled case also. (CR 372303)

636843: isFastRoamingEnabled passed during reassoc (CR 372303)

636970: Implemented getwlandbg for SoftAP
SoftAP does not have an ioctl to print the log levels and log
info. Implemented getwlandbg for SoftAP.  (CR 374467)

636989 & 636992: Remove hard tabs and DOS line endings

637100: Fix of WDA Stop timeout kernel panic issue.
WDA stop timeout should never happen. Increasing WDA stop timeout
after considering 1 pending request and cleaning up WDI pending queues
once driver unload is trigerred.  (CR 367261)

637246: Fixed WLAN_BAPReset() to avoid sending Disassoc on STA interface.
Due to some reason(Seen just after driver load and whenever
hdd_netdev_notifier_call get called with netdevice state
NETDEV_GOING_DOWN where we call WLANBAP_DeregisterFromHCI())
WLAN_BAPReset was getting called through BSL_Write -> bslWriteFinish.
Even If the BT-AMP session is not opened(in this case
btampHandle->sessionId will be zero(default value) and if
WLAN_BAPReset is called, BAP was issueing sme_RoamDisconnect with
sessionId 0 which is station interface which results in Disassoc of
STA with AP.  Fixed the issue by checking BT-AMP session is opened or
not. (btampContext->isBapSessionOpen). If its opened then only call
sme_RoamDisconnect.

637340: SAP does not beacon on Country code to which STA is associated
(CR 368474)

637497: completed tx statistic reporting functionality
(CR 370923)

637687: Support for MC/BC & hostARPOffload with ini to work instead of ioctl
Fixes MC frames are still passed to host driver although
McastBcastFilter=1, hostArpOffload=0 (CR 363707)

637850: Fix for SAP Auto Channel Selection feature
For SAP auto channel selection, WLAN host driver do scan to find less
noise channel. While performaing scan do not check for Active session
in CSR module and change CSR roam state to eCSR_ROAMING_STATE_SCANNING
state for scan command irrespective of session is active or not.  (CR
375829)

638022: Fix for CCX-STA to connect to CCKM-RSN AP
because of the incorrect if-else-if authentication type overwritten to
255 (CR 376930)

638142-638147: Fix compilation warnings caused by GCC -Wenum-compare
Recent versions of the GCC compiler include an "enum-compare" warning
which will emit a warning when an enum of one type is compared with an
enum of a different type.  The compiler has found occurrences of this
issue in the WLAN code.  Fix those issues such that enum comparisons
are restricted to enums of the same enumerated type.

638253: Implemented getAutoChannel ioctl for SoftAP
SoftAP does not have an ioctl to get auto channel. Implemented
getAutoChannel for SoftAP and fixed getchannel ioctl for softap (CR
369147)

638267: Fix GCC 4.6 compile failure in WDI due to inlining failure
WDI_GET_PAL_CTX() was defined to be an inline function, but the
function body was not available to the compilation units that refer to
it.  Other versions of the compiler have silently ignored this, but
GCC-4.6 is emitting an error "sorry, unimplemented: inlining failed in
call to 'WDI_GET_PAL_CTX': function body not available".  So we remove
the unnecessary "inline" directive from the definition of
WDI_GET_PAL_CTX().

638291: Fix WLAN suspended flag
If WLAN driver suspend fails becuase of a TX, RX or MC thread suspend
timeout, the suspended flag is not reset. So set the suspended flag
only after all three threads are suspended successfully.  (CR 375230)

638703: Disabling AMP flag
Disabling AMP flag from config file, so that we don't register with
HCI any more as BT AMP is not PORed (CR 375826)
diff --git a/CORE/BAP/src/bapApiHCBB.c b/CORE/BAP/src/bapApiHCBB.c
index 8bc54ae..c0c777c 100644
--- a/CORE/BAP/src/bapApiHCBB.c
+++ b/CORE/BAP/src/bapApiHCBB.c
@@ -163,11 +163,15 @@
     }
 
     //csrRoamDisconnect();
-    sme_RoamDisconnect(hHal,
+    /* To avoid sending Disassoc on STA interface */
+    if( TRUE == btampContext->isBapSessionOpen )
+    {
+        sme_RoamDisconnect(hHal,
                        btampContext->sessionId,
                        // Danlin, where are the richer reason codes?
                        // I want to be able to convey everything 802.11 supports...
                        eCSR_DISCONNECT_REASON_UNSPECIFIED);
+    }
 
     /* Need to reset the timers as well*/
     /* Connection Accept Timer interval*/
diff --git a/CORE/HDD/inc/qc_sap_ioctl.h b/CORE/HDD/inc/qc_sap_ioctl.h
index 0f5e3dc..1bb8b65 100644
--- a/CORE/HDD/inc/qc_sap_ioctl.h
+++ b/CORE/HDD/inc/qc_sap_ioctl.h
@@ -237,10 +237,12 @@
 
 enum { 
     QCSAP_PARAM_MAX_ASSOC = 1,
+    QCSAP_PARAM_GET_WLAN_DBG = 4,
     QCSAP_PARAM_MODULE_DOWN_IND = 5,
     QCSAP_PARAM_CLR_ACL = 6,
     QCSAP_PARAM_ACL_MODE = 7,
     QCSAP_PARAM_HIDE_SSID = 8,
+    QCSAP_PARAM_AUTO_CHANNEL = 9,
 };
 
 int iw_softap_get_channel_list(struct net_device *dev, 
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index b3d2c42..50a450e 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -674,7 +674,18 @@
 #define CFG_FAST_TRANSITION_ENABLED_NAME_MIN                (0)
 #define CFG_FAST_TRANSITION_ENABLED_NAME_MAX                (1)
 #define CFG_FAST_TRANSITION_ENABLED_NAME_DEFAULT            (0) //disabled
-#endif
+
+/* This parameter is used to decide whether to Roam or not.
+ * AP1 is the currently associated AP and AP2 is chosen for roaming.
+ * The Roaming will happen only if AP2 has better Signal Quality and it has a RSSI better than AP1
+ * in terms of RoamRssiDiff,and RoamRssiDiff is the number of units (typically measured in dB) AP2
+ * is better than AP1. 
+ * This check is not done if the value is Zero */
+#define CFG_ROAM_RSSI_DIFF_NAME                             "RoamRssiDiff"
+#define CFG_ROAM_RSSI_DIFF_MIN                              (0)
+#define CFG_ROAM_RSSI_DIFF_MAX                              (125)
+#define CFG_ROAM_RSSI_DIFF_DEFAULT                          (0)
+#endif /* (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) */
 
 #define CFG_QOS_WMM_PKT_CLASSIFY_BASIS_NAME                "PktClassificationBasis" // DSCP or 802.1Q
 #define CFG_QOS_WMM_PKT_CLASSIFY_BASIS_MIN                  (0)
@@ -1349,6 +1360,7 @@
 #if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    v_U8_t                       FTRssiFilterPeriod;
    v_BOOL_t                     isFastTransitionEnabled;
+   v_U8_t                       RoamRssiDiff;
 #endif
 
    hdd_wmm_classification_t     PktClassificationBasis; // DSCP or 802.1Q
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index fa86bef..526218c 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -638,7 +638,7 @@
                                             eCsrRoamResult roamResult )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
-
+    VOS_STATUS vstatus;
     struct net_device *dev = pAdapter->dev;
     hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
     hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
@@ -718,8 +718,8 @@
     
 
     //We should clear all sta register with TL, for now, only one.
-    status = hdd_roamDeregisterSTA( pAdapter, pHddStaCtx->conn_info.staId [0] );
-    if ( !VOS_IS_STATUS_SUCCESS(status ) )
+    vstatus = hdd_roamDeregisterSTA( pAdapter, pHddStaCtx->conn_info.staId [0] );
+    if ( !VOS_IS_STATUS_SUCCESS(vstatus ) )
     {
         VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_WARN,
                   "hdd_roamDeregisterSTA() failed to for staID %d.  "
@@ -1699,8 +1699,11 @@
 #endif
 #ifdef FEATURE_WLAN_LFR
         case eCSR_ROAM_PMK_NOTIFY:
-           /* Notify the supplicant of a new candidate */
-           halStatus = wlan_hdd_cfg80211_pmksa_candidate_notify(pAdapter, pRoamInfo, 1, false);
+           if (eCSR_AUTH_TYPE_RSN == pHddStaCtx->conn_info.authType) 
+           {
+               /* Notify the supplicant of a new candidate */
+               halStatus = wlan_hdd_cfg80211_pmksa_candidate_notify(pAdapter, pRoamInfo, 1, false);
+           }
            break;
 #endif
 
@@ -2100,7 +2103,7 @@
                 ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) 
                  == IW_AUTH_KEY_MGMT_802_1X)) {
                pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_FT_RSN;   
-            }
+            }else
             if ((RSNAuthType == eCSR_AUTH_TYPE_FT_RSN_PSK) && 
                 ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_PSK)
                  == IW_AUTH_KEY_MGMT_PSK)) {
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index 7f8c774..83e3788 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -822,6 +822,15 @@
                  CFG_FAST_TRANSITION_ENABLED_NAME_DEFAULT, 
                  CFG_FAST_TRANSITION_ENABLED_NAME_MIN, 
                  CFG_FAST_TRANSITION_ENABLED_NAME_MAX),
+
+   /* Variable to specify the delta/difference between the RSSI of current AP 
+    * and roamable AP while roaming */
+   REG_VARIABLE( CFG_ROAM_RSSI_DIFF_NAME, WLAN_PARAM_Integer,
+                 hdd_config_t, RoamRssiDiff, 
+                 VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, 
+                 CFG_ROAM_RSSI_DIFF_DEFAULT, 
+                 CFG_ROAM_RSSI_DIFF_MIN, 
+                 CFG_ROAM_RSSI_DIFF_MAX),
 #endif
 
    REG_VARIABLE( CFG_QOS_WMM_PKT_CLASSIFY_BASIS_NAME , WLAN_PARAM_Integer,
@@ -1750,6 +1759,9 @@
 #ifdef FEATURE_WLAN_LFR
   VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [FastRoamEnabled] Value = [%lu] ",pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled);
 #endif 
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
+  VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [RoamRssiDiff] Value = [%lu] ",pHddCtx->cfg_ini->RoamRssiDiff);
+#endif
   VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [InfraDirAcVo] Value = [%u] ",pHddCtx->cfg_ini->InfraDirAcVo);
   VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [InfraNomMsduSizeAcVo] Value = [0x%x] ",pHddCtx->cfg_ini->InfraNomMsduSizeAcVo);
   VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [InfraMeanDataRateAcVo] Value = [0x%lx] ",pHddCtx->cfg_ini->InfraMeanDataRateAcVo);
@@ -2883,6 +2895,7 @@
 #endif
 #if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    smeConfig.csrConfig.isFastTransitionEnabled = pConfig->isFastTransitionEnabled;
+   smeConfig.csrConfig.RoamRssiDiff = pConfig->RoamRssiDiff;
 #endif
 
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
diff --git a/CORE/HDD/src/wlan_hdd_dev_pwr.c b/CORE/HDD/src/wlan_hdd_dev_pwr.c
index f22999c..da53ff3 100644
--- a/CORE/HDD/src/wlan_hdd_dev_pwr.c
+++ b/CORE/HDD/src/wlan_hdd_dev_pwr.c
@@ -115,9 +115,6 @@
        return -1;
    }
 
-   /* Set the Station state as Suspended */
-   pHddCtx->isWlanSuspended = TRUE;
-
    /*
      Suspending MC Thread, Rx Thread and Tx Thread as the platform driver is going to Suspend.     
    */
diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c
index 762aa59..47ea1d6 100644
--- a/CORE/HDD/src/wlan_hdd_early_suspend.c
+++ b/CORE/HDD/src/wlan_hdd_early_suspend.c
@@ -769,6 +769,7 @@
                                  hdd_adapter_t *pAdapter)
 {
     eHalStatus halStatus = eHAL_STATUS_FAILURE;
+    VOS_STATUS vstatus;
     tpSirWlanSuspendParam wlanSuspendParam =
       vos_mem_malloc(sizeof(tSirWlanSuspendParam));
 
@@ -788,29 +789,76 @@
            (eConnectionState_Associated == 
             (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState)) 
         {
-            halStatus = hdd_conf_hostarpoffload(pHddCtx, TRUE);
-            if (!VOS_IS_STATUS_SUCCESS(halStatus))
+            vstatus = hdd_conf_hostarpoffload(pHddCtx, TRUE);
+            if (!VOS_IS_STATUS_SUCCESS(vstatus))
             {
+                if(pHddCtx->dynamic_mcbc_filter.enableCfg)
+                {
+                   wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                               pHddCtx->dynamic_mcbc_filter.mcastBcastFilterSetting;
+                }
+                else
+                {
+                  wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                             pHddCtx->cfg_ini->mcastBcastFilterSetting;
+                }
                 hddLog(VOS_TRACE_LEVEL_INFO,
                        "%s:Failed to enable ARPOFFLOAD Feature %d\n",
-                       __func__, halStatus);
+                       __func__, vstatus);
             }
-        }
-
-        if(pHddCtx->dynamic_mcbc_filter.enableCfg)
-        {
-            wlanSuspendParam->configuredMcstBcstFilterSetting = 
-                         pHddCtx->dynamic_mcbc_filter.mcastBcastFilterSetting;
-            pHddCtx->dynamic_mcbc_filter.enableSuspend = TRUE;
-            pHddCtx->dynamic_mcbc_filter.mcBcFilterSuspend = 
-                         wlanSuspendParam->configuredMcstBcstFilterSetting;
+            else
+            {
+               if (((pHddCtx->dynamic_mcbc_filter.enableCfg) && 
+                    (HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST_BROADCAST == 
+                    pHddCtx->dynamic_mcbc_filter.mcastBcastFilterSetting)) ||
+                    (HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST_BROADCAST == 
+                    pHddCtx->cfg_ini->mcastBcastFilterSetting))
+               {
+                 wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                                 HDD_MCASTBCASTFILTER_FILTER_ALL_MULTICAST;
+               }
+               else if(((pHddCtx->dynamic_mcbc_filter.enableCfg) &&
+                        (HDD_MCASTBCASTFILTER_FILTER_ALL_BROADCAST == 
+                        pHddCtx->dynamic_mcbc_filter.mcastBcastFilterSetting)) ||
+                        (HDD_MCASTBCASTFILTER_FILTER_ALL_BROADCAST == 
+                        pHddCtx->cfg_ini->mcastBcastFilterSetting))
+               {
+                 wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                                         HDD_MCASTBCASTFILTER_FILTER_NONE;
+               }
+               else
+               {
+                 if(pHddCtx->dynamic_mcbc_filter.enableCfg) 
+                 {
+                   wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                               pHddCtx->dynamic_mcbc_filter.mcastBcastFilterSetting;
+                 }
+                 else
+                 {
+                   wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                             pHddCtx->cfg_ini->mcastBcastFilterSetting;
+                 }
+               }
+           }
         }
         else
         {
-            pHddCtx->dynamic_mcbc_filter.enableSuspend = FALSE;
-            wlanSuspendParam->configuredMcstBcstFilterSetting = 
-                                    pHddCtx->cfg_ini->mcastBcastFilterSetting;
+           if(pHddCtx->dynamic_mcbc_filter.enableCfg)
+           {
+              wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                      pHddCtx->dynamic_mcbc_filter.mcastBcastFilterSetting;
+           }
+           else
+           {
+             wlanSuspendParam->configuredMcstBcstFilterSetting = 
+                             pHddCtx->cfg_ini->mcastBcastFilterSetting;
+           }
         }
+        
+        pHddCtx->dynamic_mcbc_filter.enableSuspend = TRUE;
+        pHddCtx->dynamic_mcbc_filter.mcBcFilterSuspend = 
+                        wlanSuspendParam->configuredMcstBcstFilterSetting;
+
 
 #ifdef WLAN_FEATURE_PACKET_FILTERING
         if (pHddCtx->cfg_ini->isMcAddrListFilter)
@@ -838,7 +886,7 @@
 
 static void hdd_conf_resume_ind(hdd_context_t* pHddCtx)
 {
-    eHalStatus halStatus = eHAL_STATUS_FAILURE;
+    VOS_STATUS vstatus;
     tpSirWlanResumeParam wlanResumeParam =
       vos_mem_malloc(sizeof(tSirWlanResumeParam));
 
@@ -854,11 +902,11 @@
 
     if(pHddCtx->cfg_ini->fhostArpOffload)
     {
-        halStatus = hdd_conf_hostarpoffload(pHddCtx, FALSE);
-        if (!VOS_IS_STATUS_SUCCESS(halStatus))
+        vstatus = hdd_conf_hostarpoffload(pHddCtx, FALSE);
+        if (!VOS_IS_STATUS_SUCCESS(vstatus))
         {
             hddLog(VOS_TRACE_LEVEL_INFO, "%s:Failed to disable ARPOFFLOAD "
-                  "Feature %d\n", __func__, halStatus);
+                  "Feature %d\n", __func__, vstatus);
         }
     }
     if (pHddCtx->dynamic_mcbc_filter.enableSuspend)
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 410b09c..83b5eb6 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -405,7 +405,7 @@
             //Check if there is any group key pending to set.
             if( pHddApCtx->groupKey.keyLength )
             {
-                 if( eHAL_STATUS_SUCCESS !=  WLANSAP_SetKeySta( 
+                 if( VOS_STATUS_SUCCESS !=  WLANSAP_SetKeySta( 
                                (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext,
                                &pHddApCtx->groupKey ) )
                  {
@@ -419,7 +419,7 @@
                 int i=0;
                 for ( i = 0; i < CSR_MAX_NUM_KEY; i++ ) 
                 {
-                    if( eHAL_STATUS_SUCCESS !=  WLANSAP_SetKeySta(
+                    if( VOS_STATUS_SUCCESS !=  WLANSAP_SetKeySta(
                                 (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext,
                                 &pHddApCtx->wepKey[i] ) )
                     {   
@@ -464,7 +464,7 @@
             msg.src_addr.sa_family = ARPHRD_ETHER;
             memcpy(msg.src_addr.sa_data, &pSapEvent->sapevt.sapStationMICFailureEvent.staMac, sizeof(msg.src_addr.sa_data));
             hddLog(LOG1, "MIC MAC "MAC_ADDRESS_STR"\n", MAC_ADDR_ARRAY(msg.src_addr.sa_data));
-            if(pSapEvent->sapevt.sapStationMICFailureEvent.multicast == eCSR_ROAM_RESULT_MIC_ERROR_GROUP)
+            if(pSapEvent->sapevt.sapStationMICFailureEvent.multicast == eSAP_TRUE)
              msg.flags = IW_MICFAILURE_GROUP;
             else 
              msg.flags = IW_MICFAILURE_PAIRWISE;
@@ -478,7 +478,7 @@
         cfg80211_michael_mic_failure(dev, 
                                      pSapEvent->sapevt.
                                      sapStationMICFailureEvent.staMac.bytes,
-                                     ((pSapEvent->sapevt.sapStationMICFailureEvent.multicast == eSIR_TRUE) ? 
+                                     ((pSapEvent->sapevt.sapStationMICFailureEvent.multicast == eSAP_TRUE) ? 
                                       NL80211_KEYTYPE_GROUP :
                                       NL80211_KEYTYPE_PAIRWISE),
                                      pSapEvent->sapevt.sapStationMICFailureEvent.keyId, 
@@ -854,7 +854,7 @@
     {
 
         case QCSAP_PARAM_CLR_ACL:
-            if ( eHAL_STATUS_SUCCESS != WLANSAP_ClearACL( pVosContext ))
+            if ( VOS_STATUS_SUCCESS != WLANSAP_ClearACL( pVosContext ))
             {
                ret = -EIO;            
             }
@@ -947,7 +947,7 @@
         break;
         
     case QCSAP_PARAM_CLR_ACL:
-        if ( eHAL_STATUS_SUCCESS != WLANSAP_ClearACL( pVosContext ))
+        if ( VOS_STATUS_SUCCESS != WLANSAP_ClearACL( pVosContext ))
         {
                ret = -EIO;            
         }               
@@ -966,8 +966,21 @@
 #endif            
             *value = 0;
             break;
-         }
-    
+        }
+
+    case QCSAP_PARAM_GET_WLAN_DBG:
+        {
+            vos_trace_display();
+            *value = 0;
+            break;
+        }
+
+    case QCSAP_PARAM_AUTO_CHANNEL:
+        {
+            *value = (WLAN_HDD_GET_CTX(pHostapdAdapter))->cfg_ini->apAutoChannelSelection;
+             break;
+        }
+
     default:
         hddLog(LOGE, FL("Invalid getparam command %d"), sub_cmd);
         ret = -EINVAL;
@@ -1038,10 +1051,9 @@
 {
     hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
 
-    *(v_U32_t *)(wrqu->data.pointer) = (WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->operatingChannel;
+    int *value = (int *)extra;
 
-    wrqu->data.length = sizeof((WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->operatingChannel);
-
+    *value = (WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter))->operatingChannel;
     return 0;
 }
 
@@ -1387,7 +1399,7 @@
     int startChannel = value[0];
     int endChannel = value[1];
     int band = value[2];
-    eHalStatus status;
+    VOS_STATUS status;
     int ret = 0; /* success */
 
     status = WLANSAP_SetChannelRange(hHal,startChannel,endChannel,band);
@@ -1572,7 +1584,8 @@
     hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
     v_CONTEXT_t pVosContext = (WLAN_HDD_GET_CTX(pHostapdAdapter))->pvosContext;    
     hdd_ap_ctx_t *pHddApCtx = WLAN_HDD_GET_AP_CTX_PTR(pHostapdAdapter);
-    eHalStatus halStatus= eHAL_STATUS_SUCCESS;
+    int retval = 0;
+    VOS_STATUS vstatus;
     struct iw_encode_ext *ext = (struct iw_encode_ext*)extra;
     v_U8_t groupmacaddr[WNI_CFG_BSSID_LEN] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
     int key_index;
@@ -1580,6 +1593,7 @@
     tCsrRoamSetKey  setKey;   
 //    tCsrRoamRemoveKey RemoveKey;
     int i;
+
     ENTER();    
    
     key_index = encoding->flags & IW_ENCODE_INDEX;
@@ -1614,7 +1628,7 @@
               break;
            case IW_ENCODE_ALG_TKIP:
               RemoveKey.encType = eCSR_ENCRYPT_TYPE_TKIP;
-           break;
+              break;
            case IW_ENCODE_ALG_CCMP:
               RemoveKey.encType = eCSR_ENCRYPT_TYPE_AES;
               break;
@@ -1627,16 +1641,17 @@
          VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: Peer Mac = "MAC_ADDRESS_STR"\n",
                     __FUNCTION__, MAC_ADDR_ARRAY(RemoveKey.peerMac));
           );
-         halStatus = WLANSAP_DelKeySta( pVosContext, &RemoveKey);
-         if ( halStatus != eHAL_STATUS_SUCCESS )
+         vstatus = WLANSAP_DelKeySta( pVosContext, &RemoveKey);
+         if ( vstatus != VOS_STATUS_SUCCESS )
          {
              VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "[%4d] WLANSAP_DeleteKeysSta returned ERROR status= %d",
-                        __LINE__, halStatus );
+                        __LINE__, vstatus );
+             retval = -EINVAL;
          }
-#endif         
-         return halStatus;
+#endif
+         return retval;
 
-    }   
+    }
     
     vos_mem_zero(&setKey,sizeof(tCsrRoamSetKey));
    
@@ -1730,16 +1745,19 @@
           ("%02x"), setKey.Key[i]);    
     VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
           ("\n"));
-    halStatus = WLANSAP_SetKeySta( pVosContext, &setKey);
-    
-    if ( halStatus != eHAL_STATUS_SUCCESS )
+
+    vstatus = WLANSAP_SetKeySta( pVosContext, &setKey);
+    if ( vstatus != VOS_STATUS_SUCCESS )
     {
        VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
-                   "[%4d] WLANSAP_SetKeySta returned ERROR status= %d", __LINE__, halStatus );
-    }   
+                   "[%4d] WLANSAP_SetKeySta returned ERROR status= %d", __LINE__, vstatus );
+       retval = -EINVAL;
+    }
    
-   return halStatus;
+   return retval;
 }
+
+
 static int iw_set_ap_mlme(struct net_device *dev,
                        struct iw_request_info *info,
                        union iwreq_data *wrqu,
@@ -2427,6 +2445,10 @@
       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,    "" },
   { QCSAP_PARAM_MAX_ASSOC, 0,
       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,    "getMaxAssoc" },
+  { QCSAP_PARAM_GET_WLAN_DBG, 0,
+      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,    "getwlandbg" },
+  { QCSAP_PARAM_AUTO_CHANNEL, 0,
+      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,    "getAutoChannel" },
   { QCSAP_PARAM_MODULE_DOWN_IND, 0,
       IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,    "moduleDownInd" },
   { QCSAP_PARAM_CLR_ACL, 0,
@@ -2448,7 +2470,7 @@
   { QCSAP_IOCTL_GET_WPS_PBC_PROBE_REQ_IES,
       IW_PRIV_TYPE_BYTE | sizeof(sQcSapreq_WPSPBCProbeReqIES_t) | IW_PRIV_SIZE_FIXED | 1, 0, "getProbeReqIEs" },
   { QCSAP_IOCTL_GET_CHANNEL, 0,
-      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | sizeof(signed long int), "getchannel" },
+      IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "getchannel" },
   { QCSAP_IOCTL_ASSOC_STA_MACADDR, 0,
       IW_PRIV_TYPE_BYTE | /*((WLAN_MAX_STA_COUNT*6)+100)*/1 , "get_assoc_stamac" },
     { QCSAP_IOCTL_DISASSOC_STA,
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c
index 8cc6d47..5a08e10 100644
--- a/CORE/HDD/src/wlan_hdd_p2p.c
+++ b/CORE/HDD/src/wlan_hdd_p2p.c
@@ -244,7 +244,7 @@
             )
     {
         //call sme API to start remain on channel.
-        if (eHAL_STATUS_SUCCESS != WLANSAP_RemainOnChannel(
+        if (VOS_STATUS_SUCCESS != WLANSAP_RemainOnChannel(
                           (WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
                           chan->hw_value, duration,
                           wlan_hdd_remain_on_channel_callback, pAdapter ))
@@ -258,7 +258,7 @@
         }
 
 
-        if (eHAL_STATUS_SUCCESS != WLANSAP_RegisterMgmtFrame(
+        if (VOS_STATUS_SUCCESS != WLANSAP_RegisterMgmtFrame(
                     (WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
                     (SIR_MAC_MGMT_FRAME << 2) | ( SIR_MAC_MGMT_PROBE_REQ << 4),
                     NULL, 0 ))
@@ -580,7 +580,7 @@
               ( WLAN_HDD_P2P_GO == pAdapter->device_mode )
             )
      {
-        if( eHAL_STATUS_SUCCESS !=
+        if( VOS_STATUS_SUCCESS !=
              WLANSAP_SendAction( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
                                   buf, len ) )
         {
diff --git a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
index a4a5509..4ba1d4a 100644
--- a/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_softap_tx_rx.c
@@ -1497,7 +1497,7 @@
 
     vosStatus = hdd_softap_Deregister_BC_STA( pAdapter);
 
-    if (!HAL_STATUS_SUCCESS(vosStatus))
+    if (!VOS_IS_STATUS_SUCCESS(vosStatus))
     {
         VOS_TRACE( VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_ERROR,
                    "%s: Failed to deregister BC sta Id %d", __FUNCTION__, (WLAN_HDD_GET_AP_CTX_PTR(pAdapter))->uBCStaId);
@@ -1508,7 +1508,7 @@
         if (pAdapter->aStaInfo[staId].isUsed)// This excludes BC sta as it is already deregistered
             vosStatus = hdd_softap_DeregisterSTA( pAdapter, staId);
 
-        if (!HAL_STATUS_SUCCESS(vosStatus))
+        if (!VOS_IS_STATUS_SUCCESS(vosStatus))
         {
             VOS_TRACE( VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_ERROR,
                        "%s: Failed to deregister sta Id %d", __FUNCTION__, staId);
@@ -1546,7 +1546,7 @@
         return VOS_STATUS_E_FAILURE;
     }
 #else
-    if (eHAL_STATUS_SUCCESS != hdd_softap_GetStaId(pAdapter, pDestMacAddress, &ucSTAId))
+    if (VOS_STATUS_SUCCESS != hdd_softap_GetStaId(pAdapter, pDestMacAddress, &ucSTAId))
     {
         VOS_TRACE( VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_ERROR,
                     "%s: Failed to find right station", __FUNCTION__);
@@ -1565,7 +1565,7 @@
     VOS_TRACE( VOS_MODULE_ID_HDD_SOFTAP, VOS_TRACE_LEVEL_INFO,
                    "%s: change station to state %d succeed", __FUNCTION__, state);
 
-    if (eHAL_STATUS_SUCCESS == vosStatus)
+    if (VOS_STATUS_SUCCESS == vosStatus)
     {
        pAdapter->aStaInfo[ucSTAId].tlSTAState = WLANTL_STA_AUTHENTICATED;
     }
diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c
index d48df9d..9b5c6ec 100644
--- a/CORE/HDD/src/wlan_hdd_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_tx_rx.c
@@ -317,7 +317,7 @@
    VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
       "%s: Sending action frame to SAP to TX, Len %d", __func__, skb->len);
 
-   if (eHAL_STATUS_SUCCESS != 
+   if (VOS_STATUS_SUCCESS != 
       WLANSAP_SendAction( (WLAN_HDD_GET_CTX(pAdapter))->pvosContext,
                            skb->data, skb->len) )
    {
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 2c782d9..2624093 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -2062,7 +2062,7 @@
                                         int endChannel,
                                         int band)
 {
-    eHalStatus status;
+    VOS_STATUS status;
     int ret = 0;
     hdd_adapter_t *pHostapdAdapter = (netdev_priv(dev));
     tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter);
@@ -2601,7 +2601,7 @@
        {
            INIT_COMPLETION(pAdapter->disconnect_comp_var);
            status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED );
-           if(VOS_STATUS_SUCCESS == status)
+           if(eHAL_STATUS_SUCCESS == status)
                  wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var,
                      msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
        }
@@ -3074,7 +3074,7 @@
                 INIT_COMPLETION(pAdapter->disconnect_comp_var);
                 status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), pAdapter->sessionId,reason);
 
-                if(VOS_STATUS_SUCCESS == status)
+                if(eHAL_STATUS_SUCCESS == status)
                     wait_for_completion_interruptible_timeout(&pAdapter->disconnect_comp_var,
                         msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT));
                 else
@@ -5327,7 +5327,7 @@
              status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter),
              pAdapter->sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED);
 
-             if ( VOS_STATUS_SUCCESS != status)
+             if ( eHAL_STATUS_SUCCESS != status)
              {
                  hddLog(VOS_TRACE_LEVEL_ERROR,
                          "%s csrRoamDisconnect failure, returned %d \n",
diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h
index 447872b..ecfd822 100644
--- a/CORE/MAC/inc/qwlan_version.h
+++ b/CORE/MAC/inc/qwlan_version.h
@@ -40,8 +40,8 @@
 #define QWLAN_VERSION_MINOR            2
 #define QWLAN_VERSION_PATCH            0
 #define QWLAN_VERSION_EXTRA            ""
-#define QWLAN_VERSION_BUILD            1
+#define QWLAN_VERSION_BUILD            2
 
-#define QWLAN_VERSIONSTR               "3.2.0.1"
+#define QWLAN_VERSIONSTR               "3.2.0.2"
 
 #endif /* QWLAN_VERSION_H */
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 7a4e750..8402917 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -1286,6 +1286,9 @@
 #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     tAniBool            isFastTransitionEnabled;
 #endif
+#ifdef FEATURE_WLAN_LFR
+    tAniBool            isFastRoamIniFeatureEnabled;
+#endif
     
 #if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
     tAniBool            bpIndicator;
@@ -1489,6 +1492,9 @@
 #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     tAniBool            isFastTransitionEnabled;
 #endif
+#ifdef FEATURE_WLAN_LFR
+    tAniBool            isFastRoamIniFeatureEnabled;
+#endif
 
 #if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && (WNI_POLARIS_FW_PRODUCT == AP)
     tAniBool             bpIndicator;
diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h
index 681e79d..5f72af4 100644
--- a/CORE/MAC/src/pe/include/limSession.h
+++ b/CORE/MAC/src/pe/include/limSession.h
@@ -260,6 +260,9 @@
 #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     tAniBool            isFastTransitionEnabled;
 #endif
+#ifdef FEATURE_WLAN_LFR
+    tAniBool            isFastRoamIniFeatureEnabled;
+#endif
 #ifdef WLAN_FEATURE_P2P
     tSirNoAParam p2pNoA;
     tSirP2PNoaAttr p2pGoPsUpdate;
diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c
index aa0c239..26d04f4 100644
--- a/CORE/MAC/src/pe/lim/limFT.c
+++ b/CORE/MAC/src/pe/lim/limFT.c
@@ -712,6 +712,10 @@
 #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
         pftSessionEntry->isFastTransitionEnabled = psessionEntry->isFastTransitionEnabled;
 #endif
+
+#ifdef FEATURE_WLAN_LFR
+        pftSessionEntry->isFastRoamIniFeatureEnabled = psessionEntry->isFastRoamIniFeatureEnabled; 
+#endif
         limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, 
             pMac->ft.ftPEContext.pFTPreAuthReq->pbssDescription );
         pMac->ft.ftPEContext.pftSessionEntry = pftSessionEntry;
@@ -1409,6 +1413,9 @@
 #ifdef FEATURE_WLAN_CCX
            || (pMac->lim.gpSession[sessionId].isCCXconnection)
 #endif
+#ifdef FEATURE_WLAN_LFR
+           || (pMac->lim.gpSession[sessionId].isFastRoamIniFeatureEnabled)
+#endif
            )&& 
             pMac->lim.gpSession[sessionId].isFastTransitionEnabled))
         {
diff --git a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
index 3a87a02..b76995a 100644
--- a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
@@ -418,7 +418,7 @@
         palFreeMemory(pMac->hHdd, psessionEntry->assocRsp);
         psessionEntry->assocRsp = NULL;
     }
-    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocRsp, frameLen)) != eSIR_SUCCESS)
+    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocRsp, frameLen)) != eHAL_STATUS_SUCCESS)
     {
         PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response, len = %d"), frameLen);)
     }
@@ -438,7 +438,7 @@
     if(pAssocRsp->ricPresent)
     {
         psessionEntry->RICDataLen = pAssocRsp->num_RICData * sizeof(tDot11fIERICDataDesc);
-        if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->ricData, psessionEntry->RICDataLen)) != eSIR_SUCCESS)
+        if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->ricData, psessionEntry->RICDataLen)) != eHAL_STATUS_SUCCESS)
         {
             PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response"));)
             psessionEntry->RICDataLen = 0; 
@@ -464,7 +464,7 @@
     if(pAssocRsp->tspecPresent)
     {
         psessionEntry->tspecLen = pAssocRsp->num_tspecs * sizeof(tDot11fIEWMMTSPEC);
-        if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->tspecIes, psessionEntry->tspecLen)) != eSIR_SUCCESS)
+        if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->tspecIes, psessionEntry->tspecLen)) != eHAL_STATUS_SUCCESS)
         {
             PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc response"));)
             psessionEntry->tspecLen = 0; 
diff --git a/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c b/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
index 0fdd30d..e797901 100644
--- a/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessBeaconFrame.c
@@ -159,7 +159,7 @@
                 psessionEntry->beacon = NULL;
              }
              psessionEntry->bcnLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
-             if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->beacon, psessionEntry->bcnLen)) != eSIR_SUCCESS)
+             if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->beacon, psessionEntry->bcnLen)) != eHAL_STATUS_SUCCESS)
              {
                 PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store beacon"));)
               }
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
index ade531d..10c27f1 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmReqMessages.c
@@ -1401,7 +1401,7 @@
     }
 
 #ifdef WLAN_SOFTAP_FEATURE  
-    if( wlan_cfgGetInt ( pMac, WNI_CFG_SHORT_SLOT_TIME, &val ) != eSIR_SME_SUCCESS)
+    if( wlan_cfgGetInt ( pMac, WNI_CFG_SHORT_SLOT_TIME, &val ) != eSIR_SUCCESS)
     {
         limLog ( pMac, LOGP, FL(" Error : unable to fetch the WNI_CFG_SHORT_SLOT_TIME\n"));
         palFreeMemory(pMac->hHdd,(void *)pAddBssParams);
@@ -1656,7 +1656,7 @@
 {
     int i;
 
-    if(pMac->lim.gLimMlmState != eLIM_SME_IDLE_STATE)
+    if(pMac->lim.gLimMlmState != eLIM_MLM_IDLE_STATE)
     {
         return FALSE;
     }
@@ -2890,7 +2890,7 @@
     limSendDeauthMgmtFrame(pMac, pMlmDeauthReq->reasonCode,
                            pMlmDeauthReq->peerMacAddr,psessionEntry);
 
-    if( (psessionEntry->limSystemRole == eSYSTEM_AP_ROLE))
+    if( (psessionEntry->limSystemRole == eLIM_AP_ROLE))
     {
       // Delay DEL STA for 300ms such that unicast deauth is 
       // delivered at TIM(100 for normal or 300ms for dynamic) 
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
index 6793ced..8bd6a01 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
@@ -2083,6 +2083,7 @@
 void limProcessBtAmpApMlmDelBssRsp( tpAniSirGlobal pMac, tpSirMsgQ limMsgQ,tpPESession psessionEntry)
 {
     tSirResultCodes rc = eSIR_SME_SUCCESS;
+    tSirRetStatus status;
     tpDeleteBssParams pDelBss = (tpDeleteBssParams) limMsgQ->bodyptr;
     tSirMacAddr             nullBssid = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
@@ -2101,10 +2102,11 @@
     pMac->lim.gLimMlmState = eLIM_MLM_IDLE_STATE;
     if( eLIM_MLM_WT_DEL_BSS_RSP_STATE != psessionEntry->limMlmState)
     {
-            limLog( pMac, LOGE,
-                        FL( "Received unexpected WDA_DEL_BSS_RSP in state %X\n" ),psessionEntry->limMlmState);
-            rc = eSIR_SME_REFUSED;
-           goto end;
+        limLog(pMac, LOGE,
+               FL( "Received unexpected WDA_DEL_BSS_RSP in state %X" ),
+               psessionEntry->limMlmState);
+        rc = eSIR_SME_REFUSED;
+        goto end;
     }
     if (pDelBss->status != eHAL_STATUS_SUCCESS)
     {
@@ -2113,10 +2115,13 @@
         rc = eSIR_SME_STOP_BSS_FAILURE;
         goto end;
     }
-    rc = limSetLinkState(pMac, eSIR_LINK_IDLE_STATE, nullBssid,
+    status = limSetLinkState(pMac, eSIR_LINK_IDLE_STATE, nullBssid,
            psessionEntry->selfMacAddr, NULL, NULL);
-    if( rc != eSIR_SUCCESS )
+    if (status != eSIR_SUCCESS)
+    {
+        rc = eSIR_SME_REFUSED;
         goto end;
+    }
     /** Softmac may send all the buffered packets right after resuming the transmission hence
      * to occupy the medium during non channel occupancy period. So resume the transmission after
      * HAL gives back the response.
@@ -4296,12 +4301,12 @@
     PELOGE(limLog( pMac, LOGE,
         FL( "Received unexpected ADDBA CNF when STA BA state is %d\n" ),
         curBaState );)
-      palFreeMemory( pMac->hHdd, (void *) pMsgBuf );
+    palFreeMemory( pMac->hHdd, (void *) pMsgBuf );
     return;
   }
   // Restore STA BA state
   LIM_SET_STA_BA_STATE(pSta, pMlmAddBACnf->baTID, eLIM_BA_STATE_IDLE);
-  if( eSIR_SUCCESS == pMlmAddBACnf->addBAResultCode )
+  if( eSIR_MAC_SUCCESS_STATUS == pMlmAddBACnf->addBAResultCode )
   {
     // Update LIM internal cache...
     if( eBA_RECIPIENT == pMlmAddBACnf->baDirection )
diff --git a/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c b/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c
index f7949ea..6df50de 100644
--- a/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessProbeRspFrame.c
@@ -171,23 +171,27 @@
         else if (psessionEntry->limMlmState ==
                                      eLIM_MLM_WT_JOIN_BEACON_STATE)
         {
-            if( psessionEntry->beacon != NULL ) //Either Beacon/probe response is required. Hence store it in same buffer.
+            if( psessionEntry->beacon != NULL )//Either Beacon/probe response is required. Hence store it in same buffer.
             {
                 palFreeMemory(pMac->hHdd, psessionEntry->beacon);
                 psessionEntry->beacon = NULL;
-             }
-             psessionEntry->bcnLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
-             if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->beacon, psessionEntry->bcnLen)) != eSIR_SUCCESS)
-             {
-                PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store beacon"));)
-              }
-              else
-              {
+            }
+            psessionEntry->bcnLen = WDA_GET_RX_PAYLOAD_LEN(pRxPacketInfo);
+            if ((palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->beacon,
+                                   psessionEntry->bcnLen))
+                != eHAL_STATUS_SUCCESS)
+            {
+                PELOGE(limLog(pMac, LOGE,
+                              FL("Unable to allocate memory to store beacon"));)
+            }
+            else
+            {
                 //Store the Beacon/ProbeRsp. This is sent to csr/hdd in join cnf response. 
-                palCopyMemory(pMac->hHdd, psessionEntry->beacon, WDA_GET_RX_MPDU_DATA(pRxPacketInfo), psessionEntry->bcnLen);
-               }
-             
-        
+                palCopyMemory(pMac->hHdd, psessionEntry->beacon,
+                              WDA_GET_RX_MPDU_DATA(pRxPacketInfo),
+                              psessionEntry->bcnLen);
+            }
+
             // STA in WT_JOIN_BEACON_STATE
             limCheckAndAnnounceJoinSuccess(pMac, &probeRsp, pHdr,psessionEntry);
         }
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 47993f4..9f1a1bf 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -1462,6 +1462,9 @@
             psessionEntry->isFastTransitionEnabled = pSmeJoinReq->isFastTransitionEnabled;
 #endif
             
+#ifdef FEATURE_WLAN_LFR
+            psessionEntry->isFastRoamIniFeatureEnabled = pSmeJoinReq->isFastRoamIniFeatureEnabled;
+#endif
             if(psessionEntry->bssType == eSIR_INFRASTRUCTURE_MODE)
             {
                 psessionEntry->limSystemRole = eLIM_STA_ROLE;
@@ -2202,6 +2205,7 @@
     tANI_U16                disassocTrigger, reasonCode;
     tLimMlmDisassocReq      *pMlmDisassocReq;
     tSirResultCodes         retCode = eSIR_SME_SUCCESS;
+    tSirRetStatus           status;
     tSirSmeDisassocReq      smeDisassocReq;
     tpPESession             psessionEntry = NULL; 
     tANI_U8                 sessionId;
@@ -2210,17 +2214,18 @@
 
     PELOG1(limLog(pMac, LOG1,FL("received DISASSOC_REQ message\n"));)
     
-    if(pMsgBuf == NULL)
+    if (pMsgBuf == NULL)
     {
-        limLog(pMac, LOGE,FL("Buffer is Pointing to NULL\n"));
+        limLog(pMac, LOGE, FL("Buffer is Pointing to NULL\n"));
         return;
     }
 
-    limGetSessionInfo(pMac,(tANI_U8 *)pMsgBuf,&smesessionId,&smetransactionId);
+    limGetSessionInfo(pMac, (tANI_U8 *)pMsgBuf,&smesessionId, &smetransactionId);
 
-    retCode = limDisassocReqSerDes(pMac, &smeDisassocReq, (tANI_U8 *) pMsgBuf);
+    status = limDisassocReqSerDes(pMac, &smeDisassocReq, (tANI_U8 *) pMsgBuf);
     
-    if ( (retCode == eSIR_FAILURE) ||(!limIsSmeDisassocReqValid(pMac, &smeDisassocReq, psessionEntry)) )
+    if ( (eSIR_FAILURE == status) ||
+         (!limIsSmeDisassocReqValid(pMac, &smeDisassocReq, psessionEntry)) )
     {
         PELOGE(limLog(pMac, LOGE,
                FL("received invalid SME_DISASSOC_REQ message\n"));)
diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
index b20fc67..131ff49 100644
--- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c
+++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
@@ -411,7 +411,7 @@
         }
 
         if( (palAllocateMemory(pMac->hHdd, (void**)&tempbuf,
-             left)) != eSIR_SUCCESS)
+             left)) != eHAL_STATUS_SUCCESS)
         {
             PELOGE(limLog(pMac, LOGE,
                  FL("Unable to allocate memory to store addn IE"));)
@@ -668,7 +668,7 @@
     if (addnIEPresent)
     {
         if( (palAllocateMemory(pMac->hHdd, (void**)&addIE, 
-             WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN*3 )) != eSIR_SUCCESS)
+             WNI_CFG_PROBE_RSP_ADDNIE_DATA1_LEN*3 )) != eHAL_STATUS_SUCCESS)
         {
             PELOGE(limLog(pMac, LOGE,
                  FL("Unable to allocate memory to store addn IE"));)
@@ -845,7 +845,7 @@
     if ( addnIEPresent )
     {
         if (palCopyMemory ( pMac->hHdd, pFrame+sizeof(tSirMacMgmtHdr)+nPayload,
-             &addIE[0], totalAddnIeLen) != eSIR_SUCCESS)
+             &addIE[0], totalAddnIeLen) != eHAL_STATUS_SUCCESS)
         {
             limLog(pMac, LOGP, FL("Additional Probe Rp IE request failed while Appending: %x"),halstatus);
             palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
@@ -861,7 +861,7 @@
     if (noaLen != 0)
     {
         if (palCopyMemory ( pMac->hHdd, &pFrame[nBytes - (total_noaLen)],
-                                       &noaIe[0], total_noaLen) != eSIR_SUCCESS)
+                            &noaIe[0], total_noaLen) != eHAL_STATUS_SUCCESS)
         {
             limLog(pMac, LOGE,
                   FL("Not able to insert NoA because of length constraint"));
@@ -1686,7 +1686,7 @@
     if ( addnIEPresent )
     {
         if (palCopyMemory ( pMac->hHdd, pFrame+sizeof(tSirMacMgmtHdr)+nPayload,
-                           &addIE[0], addnIELen ) != eSIR_SUCCESS)
+                           &addIE[0], addnIELen ) != eHAL_STATUS_SUCCESS)
         {
             limLog(pMac, LOGP, FL("Additional Assoc IEs request failed while Appending: %x\n"),halstatus);
             palPktFree( pMac->hHdd, HAL_TXRX_FRM_802_11_MGMT,
@@ -2488,7 +2488,8 @@
         nPayload += nAddIELen;
     }
 
-    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocReq, nPayload)) != eSIR_SUCCESS)
+    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocReq,
+                           nPayload)) != eHAL_STATUS_SUCCESS)
     {
         PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));)
     }
@@ -2863,16 +2864,17 @@
         nPayload += nAddIELen;
     }
 
-    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocReq, nPayload)) != eSIR_SUCCESS)
+    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocReq,
+                           nPayload)) != eHAL_STATUS_SUCCESS)
     {
         PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));)
-     }
-     else
-     {
+    }
+    else
+    {
         //Store the Assoc request. This is sent to csr/hdd in join cnf response. 
         palCopyMemory(pMac->hHdd, psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload);
         psessionEntry->assocReqLen = nPayload;
-     }
+    }
 
     if (psessionEntry->is11Rconnection)
     {
@@ -3176,16 +3178,17 @@
         nPayload += nAddIELen;
     }
 
-    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocReq, nPayload)) != eSIR_SUCCESS)
+    if( (palAllocateMemory(pMac->hHdd, (void**)&psessionEntry->assocReq,
+                           nPayload)) != eHAL_STATUS_SUCCESS)
     {
         PELOGE(limLog(pMac, LOGE, FL("Unable to allocate memory to store assoc request"));)
-     }
-     else
-     {
+    }
+    else
+    {
         //Store the Assoc request. This is sent to csr/hdd in join cnf response. 
         palCopyMemory(pMac->hHdd, psessionEntry->assocReq, pFrame + sizeof(tSirMacMgmtHdr), nPayload);
         psessionEntry->assocReqLen = nPayload;
-     }
+    }
 
     if( ( SIR_BAND_5_GHZ == limGetRFBand(psessionEntry->currentOperChannel))
 #ifdef WLAN_FEATURE_P2P
diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
index 15b8c80..1d1ccd0 100644
--- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
@@ -2225,7 +2225,7 @@
     tSirMsgQ                  mmhMsg;
     tSmeIbssPeerInd *pNewPeerInd;
     
-    if(eSIR_SUCCESS !=
+    if(eHAL_STATUS_SUCCESS !=
         palAllocateMemory(pMac->hHdd,(void * *) &pNewPeerInd,(sizeof(tSmeIbssPeerInd) + beaconLen)))
     {
         PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
@@ -2424,7 +2424,7 @@
     tSirMsgQ         mmhMsg;
     tSmeMaxAssocInd *pSmeMaxAssocInd;
 
-    if(eSIR_SUCCESS !=
+    if(eHAL_STATUS_SUCCESS !=
             palAllocateMemory(pMac->hHdd,(void **)&pSmeMaxAssocInd, sizeof(tSmeMaxAssocInd)))
     {
         PELOGE(limLog(pMac, LOGE, FL("Failed to allocate memory"));)
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c
index ecec71f..456f9d6 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.c
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c
@@ -1973,7 +1973,15 @@
         return eSIR_FAILURE;    
 #endif
 
-    
+#ifdef FEATURE_WLAN_LFR
+    //isFastRoamIniFeatureEnabled;
+    pJoinReq->isFastRoamIniFeatureEnabled = (tAniBool)limGetU32(pBuf);
+    pBuf += sizeof(tAniBool);
+    len -= sizeof(tAniBool);
+    if (limCheckRemainingLength(pMac, len) == eSIR_FAILURE)
+        return eSIR_FAILURE;    
+#endif
+
 #if (WNI_POLARIS_FW_PACKAGE == ADVANCED) && defined(ANI_PRODUCT_TYPE_AP)
     // Extract BP Indicator
     pJoinReq->bpIndicator = (tAniBool) limGetU32(pBuf);
diff --git a/CORE/MAC/src/pe/lim/limSession.c b/CORE/MAC/src/pe/lim/limSession.c
index 36dc4bf..3d3a553 100644
--- a/CORE/MAC/src/pe/lim/limSession.c
+++ b/CORE/MAC/src/pe/lim/limSession.c
@@ -147,6 +147,9 @@
 #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
             pMac->lim.gpSession[i].isFastTransitionEnabled = FALSE;
 #endif
+#ifdef FEATURE_WLAN_LFR
+            pMac->lim.gpSession[i].isFastRoamIniFeatureEnabled = FALSE;
+#endif
             *sessionId = i;
 
             pMac->lim.gpSession[i].gLimPhyMode = WNI_CFG_PHY_MODE_11G; //TODO :Check with the team what should be default mode 
diff --git a/CORE/MAC/src/pe/pmm/pmmApi.c b/CORE/MAC/src/pe/pmm/pmmApi.c
index f98db2a..2070549 100644
--- a/CORE/MAC/src/pe/pmm/pmmApi.c
+++ b/CORE/MAC/src/pe/pmm/pmmApi.c
@@ -1852,7 +1852,7 @@
         return;
     }
 
-    if(pUapsdRspMsg->status == eSIR_SUCCESS)
+    if(pUapsdRspMsg->status == eHAL_STATUS_SUCCESS)
     {
         PELOGW(pmmLog(pMac, LOGW,
             FL("pmmUapsd: Received successful response from HAL to enter UAPSD mode \n"));)
diff --git a/CORE/MAC/src/pe/sch/schBeaconProcess.c b/CORE/MAC/src/pe/sch/schBeaconProcess.c
index 2a9a1e3..abcfd62 100644
--- a/CORE/MAC/src/pe/sch/schBeaconProcess.c
+++ b/CORE/MAC/src/pe/sch/schBeaconProcess.c
@@ -549,7 +549,7 @@
               limLog( pMac, LOGE, "Regulatory max = %d, local power constraint = %d, max tx = %d", regMax, localConstraint, maxTxPower );
               limLog( pMac, LOGE, "Local power constraint change..updating mew maxTx power to HAL");
 #endif
-              if( rrmSendSetMaxTxPowerReq ( pMac, maxTxPower, psessionEntry ) == eHAL_STATUS_SUCCESS )
+              if( rrmSendSetMaxTxPowerReq ( pMac, maxTxPower, psessionEntry ) == eSIR_SUCCESS )
                  psessionEntry->maxTxPower = maxTxPower;
 
            }
diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c
index 13afccb..9f0aecf 100644
--- a/CORE/SAP/src/sapFsm.c
+++ b/CORE/SAP/src/sapFsm.c
@@ -158,7 +158,7 @@
 )
 {
     /* Initiate a SCAN request */
-    eSapStatus sapStatus = eSAP_STATUS_SUCCESS;
+    eHalStatus halStatus;
     tCsrScanRequest scanRequest;/* To be initialised if scan is required */
     v_U32_t    scanRequestID = 0;
     VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
@@ -231,15 +231,15 @@
 
         VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "In %s, calling sme_ScanRequest", __FUNCTION__);
 
-        sapStatus = sme_ScanRequest(hHal,
+        halStatus = sme_ScanRequest(hHal,
                             0,//Not used in csrScanRequest
                             &scanRequest,
                             &scanRequestID,//, when ID == 0 11D scan/active scan with callback, min-maxChntime set in csrScanRequest()?
                             &WLANSAP_ScanCallback,//csrScanCompleteCallback callback,
                             sapContext);//void * pContext scanRequestID filled up
-        if (!VOS_IS_STATUS_SUCCESS(sapStatus))
+        if (eHAL_STATUS_SUCCESS != halStatus)
         {
-            VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "%s:sme_ScanRequest  fail %d!!!", __FUNCTION__, sapStatus);
+            VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, "%s:sme_ScanRequest  fail %d!!!", __FUNCTION__, halStatus);
             VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH, "SoftAP Configuring for default channel, Ch= %d", sapContext->channel);
             /* In case of error, switch to default channel */
             sapContext->channel = SAP_DEFAULT_CHANNEL;
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index b2beaf7..6856670 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -958,6 +958,7 @@
 
 #if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     tANI_U8   isFastTransitionEnabled;
+    tANI_U8   RoamRssiDiff;
 #endif
 
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index ac548bb..09468f9 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -549,6 +549,7 @@
 
 #if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     tANI_U8   isFastTransitionEnabled;
+    tANI_U8   RoamRssiDiff;
 #endif
 
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING
@@ -862,6 +863,9 @@
 #ifdef FEATURE_WLAN_CCX
     tANI_U8   isCcxIniFeatureEnabled;
 #endif
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
+    tANI_U8   RoamRssiDiff;
+#endif
 }tCsrRoamStruct;
 
 
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index 1d36af1..eed1638 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -92,6 +92,7 @@
 #endif
 #if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     tANI_U8   isFastTransitionEnabled;
+    tANI_U8   RoamRssiDiff;
 #endif
 } tSmeConfigParams, *tpSmeConfigParams;
 
diff --git a/CORE/SME/src/QoS/sme_Qos.c b/CORE/SME/src/QoS/sme_Qos.c
index 7729594..a3a2091 100644
--- a/CORE/SME/src/QoS/sme_Qos.c
+++ b/CORE/SME/src/QoS/sme_Qos.c
@@ -1093,7 +1093,7 @@
       case SME_QOS_CSR_PREAUTH_SUCCESS_IND:
          status = sme_QosProcessPreauthSuccessInd(pMac, sessionId, pEvent_info);
          break;
-#ifdef FEATURE_WLAN_CCX
+#if defined(FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
       case SME_QOS_CSR_SET_KEY_SUCCESS_IND:
          status = sme_QosProcessSetKeySuccessInd(pMac, sessionId, pEvent_info);
          break;
@@ -2955,7 +2955,7 @@
    return status;
 }
 
-#ifdef FEATURE_WLAN_CCX
+#if defined(FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
 /* This is a dummy function now. But the purpose of me adding this was to 
  * delay the TSPEC processing till SET_KEY completes. This function can be 
  * used to do any SME_QOS processing after the SET_KEY. As of now, it is 
@@ -2965,10 +2965,12 @@
 eHalStatus sme_QosProcessSetKeySuccessInd(tpAniSirGlobal pMac, v_U8_t sessionId, void * pEvent_info)
 {
     VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, 
-            "########### CCX Set Key Complete #############");
+            "########### Set Key Complete #############");
     return eHAL_STATUS_SUCCESS;
 }
+#endif
 
+#ifdef FEATURE_WLAN_CCX
 /*--------------------------------------------------------------------------
   \brief sme_QosCCXSaveTspecResponse() - This function saves the TSPEC
          parameters that came along in the TSPEC IE in the reassoc response
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 8ee4449..c2c6059 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -1219,6 +1219,7 @@
 
 #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 
@@ -1758,7 +1759,8 @@
                     eCsrHddIssued == pCommand->u.roamCmd.roamReason))) 
                 ||
             //below the pCommand is NULL
-            ( (sessionId == pDupCommand->sessionId) && (eCsrRoamCommandRoam == pDupCommand->command) &&
+            ( (sessionId == pDupCommand->sessionId) &&
+              (eSmeCommandRoam == pDupCommand->command) &&
                  ((eCsrForcedDisassoc == eRoamReason) ||
                     (eCsrHddIssued == eRoamReason))
                )
@@ -8651,7 +8653,7 @@
                                 csrRoamLinkUp(pMac, pSession->connectedProfile.bssid);
                             }
                         }
-                        if( eSIR_SUCCESS == pRsp->statusCode )
+                        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
@@ -8748,7 +8750,7 @@
                         }
 #endif //FEATURE_WLAN_DIAG_SUPPORT_CSR
 
-                        if( eSIR_SUCCESS == pRsp->statusCode )
+                        if( eSIR_SME_SUCCESS == pRsp->statusCode )
                         {
                             palCopyMemory( pMac, &roamInfo.peerMac, &pRsp->peerMacAddr, sizeof(tCsrBssid) );
                             result = eCSR_ROAM_RESULT_NONE;
@@ -11295,6 +11297,21 @@
         }
 #endif
 
+#ifdef FEATURE_WLAN_LFR
+        if(csrRoamIsFastRoamEnabled(pMac))
+        {
+            //legacy fast roaming enabled
+            dwTmp = pal_cpu_to_be32(TRUE); 
+            palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
+            pBuf += sizeof(tAniBool);        
+        }
+        else
+        {
+            dwTmp = pal_cpu_to_be32(FALSE); 
+            palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
+            pBuf += sizeof(tAniBool);        
+        }
+#endif
         //BssDesc
         csrPrepareJoinReassocReqBuffer( pMac, pBssDescription, pBuf, 
                 (tANI_U8)pProfile->uapsd_mask);
@@ -11708,6 +11725,21 @@
         }
 #endif
 
+#ifdef FEATURE_WLAN_LFR
+        if(csrRoamIsFastRoamEnabled(pMac))
+        {
+            //legacy fast roaming enabled
+            dwTmp = pal_cpu_to_be32(TRUE); 
+            palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
+            pBuf += sizeof(tAniBool);        
+        }
+        else
+        {
+            dwTmp = pal_cpu_to_be32(FALSE); 
+            palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
+            pBuf += sizeof(tAniBool);        
+        }
+#endif
         csrPrepareJoinReassocReqBuffer( pMac, pBssDescription, pBuf, uapsd_mask);
         
 #ifndef WLAN_MDM_CODE_REDUCTION_OPT
@@ -13929,12 +13961,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 
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 3e4c472..b60c0da 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -2730,7 +2730,8 @@
     //Use the Country code and domain from EEPROM
     palCopyMemory(pMac->hHdd, pMac->scan.countryCodeCurrent, pMac->scan.countryCodeDefault, WNI_CFG_COUNTRY_CODE_LEN);
     csrSetRegulatoryDomain(pMac, pMac->scan.domainIdCurrent, &fRestart);
-    if(eANI_BOOLEAN_FALSE == fRestart || (pfRestartNeeded == NULL))
+    if( ((eANI_BOOLEAN_FALSE == fRestart) || (pfRestartNeeded == NULL) )
+          && !csrIsInfraConnected(pMac))
     {
         //Only reset the country info if we don't need to restart
         csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE);
@@ -4622,11 +4623,8 @@
     // Transition to Scanning state...
     for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
     {
-       if(CSR_IS_SESSION_VALID(pMac, i))
-       {
       pCommand->u.scanCmd.lastRoamState[i] = csrRoamStateChange( pMac, eCSR_ROAMING_STATE_SCANNING, i);
       smsLog( pMac, LOG3, "starting SCAN command from %d state.... reason is %d\n", pCommand->u.scanCmd.lastRoamState[i], pCommand->u.scanCmd.reason );
-       }
     }
 
     switch(pCommand->u.scanCmd.reason)
@@ -5653,8 +5651,7 @@
     tANI_U32 i;
     for( i = 0; i < CSR_ROAM_SESSION_MAX; i++ )
     {
-       if(CSR_IS_SESSION_VALID(pMac, i))
-           csrRoamStateChange( pMac, pCommand->u.scanCmd.lastRoamState[i], i);
+         csrRoamStateChange( pMac, pCommand->u.scanCmd.lastRoamState[i], i);
     }
 
         csrScanCallCallback(pMac, pCommand, scanStatus);
diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c
index bc79a22..c1d710e 100644
--- a/CORE/SME/src/csr/csrNeighborRoam.c
+++ b/CORE/SME/src/csr/csrNeighborRoam.c
@@ -865,6 +865,37 @@
     return eHAL_STATUS_SUCCESS;
 }
 
+tANI_U32 csrGetCurrentAPRssi(tpAniSirGlobal pMac, tScanResultHandle *pScanResultList)
+{
+        tCsrScanResultInfo *pScanResult;
+        tpCsrNeighborRoamControlInfo    pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
+        tANI_U32 CurrAPRssi = -125; /* We are setting this as default value to make sure we return this value,
+                                       when we do not see this AP in the scan result for some reason.However,it is 
+                                       less likely that we are associated to an AP and do not see it in the scan list*/
+
+        while (NULL != (pScanResult = csrScanResultGetNext(pMac, *pScanResultList)))
+        {
+
+                if (VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId,
+                                                pNeighborRoamInfo->currAPbssid, sizeof(tSirMacAddr)))
+                {
+                        /* We got a match with the currently associated AP.
+                         * Capture the RSSI value and complete the while loop.
+                         * The while loop is completed in order to make the current entry go back to NULL,
+                         * and in the next while loop, it properly starts searching from the head of the list.
+                         * TODO: Can also try setting the current entry directly to NULL as soon as we find the new AP*/
+
+                         CurrAPRssi = (int)pScanResult->BssDescriptor.rssi * (-1) ;
+
+                } else {
+                        continue;
+                }
+        }
+
+        return CurrAPRssi;
+
+}
+
 /* ---------------------------------------------------------------------------
 
     \fn csrNeighborRoamProcessScanResults
@@ -884,6 +915,16 @@
     tCsrScanResultInfo *pScanResult;
     tpCsrNeighborRoamControlInfo    pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
     tpCsrNeighborRoamBSSInfo    pBssInfo;
+    tANI_U32 CurrAPRssi;
+    tANI_U8 RoamRssiDiff = pMac->roam.configParam.RoamRssiDiff;
+
+    /***************************************************************
+     * Find out the Current AP RSSI and keep it handy to check if
+     * it is better than the RSSI of the AP which we are
+     * going to roam.If so, we are going to continue with the
+     * current AP.
+     ***************************************************************/
+    CurrAPRssi = csrGetCurrentAPRssi(pMac, pScanResultList);
 
     /* Expecting the scan result already to be in the sorted order based on the RSSI */
     /* Based on the previous state we need to check whether the list should be sorted again taking neighbor score into consideration */
@@ -905,20 +946,37 @@
        if (VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, 
                        pNeighborRoamInfo->currAPbssid, sizeof(tSirMacAddr)))
         {
-            //currently associated AP. Do not have this in the roamable AP list
+            /* currently associated AP. Do not have this in the roamable AP list */
             continue;
         }
 
-#if 0
-    if (abs(pNeighborRoamInfo->cfgParams.neighborReassocThreshold) < abs(pScanResult->BssDescriptor.rssi))
-    {
-            VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
-                 "%s: [INFOLOG]Current reassoc threshold %d new ap rssi worse=%d\n", __func__,
-                     (int)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1),
-                     (int)pScanResult->BssDescriptor.rssi * (-1) );
-        continue;
-    }        
-#endif //0
+       /* This condition is to ensure to roam to an AP with better RSSI. if the value of RoamRssiDiff is Zero, this feature
+        * is disabled and we continue to roam without any check*/
+       if(RoamRssiDiff > 0)
+       {
+               if (abs(CurrAPRssi) < abs(pScanResult->BssDescriptor.rssi))
+               {
+                       /*Do not roam to an AP with worse RSSI than the current*/
+                       VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
+                                 "%s: [INFOLOG]Current AP rssi=%d new ap rssi worse=%d\n", __func__,
+                                 CurrAPRssi,
+                                 (int)pScanResult->BssDescriptor.rssi * (-1) );
+                       continue;
+               } else {
+                       /*Do not roam to an AP which is having better RSSI than the current AP, but still less than the
+                        * margin that is provided by user from the ini file (RoamRssiDiff)*/
+                       if (abs(abs(CurrAPRssi) - abs(pScanResult->BssDescriptor.rssi)) < RoamRssiDiff)
+                       {
+                          continue;
+                       }
+                       else {
+                                 VOS_TRACE (VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO,
+                                            "%s: [INFOLOG]Current AP rssi=%d new ap rssi better=%d\n", __func__,
+                                            CurrAPRssi,
+                                            (int)pScanResult->BssDescriptor.rssi * (-1) );
+                       }
+               }
+       }
 
 #ifdef WLAN_FEATURE_VOWIFI_11R
         if (pNeighborRoamInfo->is11rAssoc)
@@ -1123,6 +1181,7 @@
     tCsrScanResultFilter    scanFilter;
     tScanResultHandle       scanResult;
     tANI_U32                tempVal = 0;
+    eHalStatus              hstatus;
 
     pMac->roam.neighborRoamInfo.scanRspPending = eANI_BOOLEAN_FALSE;
     
@@ -1161,23 +1220,23 @@
            should use the BSSID filter made out of neighbor reports */
         if (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState)
         {
-            status = csrNeighborRoamBssIdScanFilter(pMac, &scanFilter);
-            NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R or CCX Association: Prepare scan filter status  with neighbor AP = %d"), status);
+            hstatus = csrNeighborRoamBssIdScanFilter(pMac, &scanFilter);
+            NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R or CCX Association: Prepare scan filter status  with neighbor AP = %d"), hstatus);
             tempVal = 1;
         }
         else
 #endif
         {
-            status = csrNeighborRoamPrepareScanProfileFilter(pMac, &scanFilter);
-            NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R/CCX/Other Association: Prepare scan to find neighbor AP filter status  = %d"), status);
+            hstatus = csrNeighborRoamPrepareScanProfileFilter(pMac, &scanFilter);
+            NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("11R/CCX/Other Association: Prepare scan to find neighbor AP filter status  = %d"), hstatus);
         }
-        if (eHAL_STATUS_SUCCESS != status)
+        if (eHAL_STATUS_SUCCESS != hstatus)
         {
             smsLog(pMac, LOGE, FL("Scan Filter preparation failed for Assoc type %d.. Bailing out.."), tempVal);
             return eHAL_STATUS_FAILURE;
         }
-        status = csrScanGetResult(pMac, &scanFilter, &scanResult);
-        NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Get Scan Result status code %d"), status);
+        hstatus = csrScanGetResult(pMac, &scanFilter, &scanResult);
+        NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Get Scan Result status code %d"), hstatus);
         /* Process the scan results and update roamable AP list */
         csrNeighborRoamProcessScanResults(pMac, &scanResult);
 
@@ -1273,9 +1332,9 @@
                 smsLog(pMac, LOGE, FL("Neighbor results refresh timer failed to start, status = %d"), status);
                 vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList);
                 pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL;
-                return VOS_STATUS_E_FAILURE;
+                return eHAL_STATUS_FAILURE;
             }
-            
+
             NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering DOWN event Reassoc callback with TL. RSSI = %d"), pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1));
             /* Register a reassoc Indication callback */
             vosStatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->cfgParams.neighborReassocThreshold * (-1),
@@ -1295,17 +1354,17 @@
     {
 
         /* Restart the timer for the next scan sequence as scanning is not over */
-        status = palTimerStart(pMac->hHdd, pNeighborRoamInfo->neighborScanTimer, 
+        hstatus = palTimerStart(pMac->hHdd, pNeighborRoamInfo->neighborScanTimer, 
                     pNeighborRoamInfo->cfgParams.neighborScanPeriod * PAL_TIMER_TO_MS_UNIT, 
                     eANI_BOOLEAN_FALSE);
     
-        if (eHAL_STATUS_SUCCESS != status)
+        if (eHAL_STATUS_SUCCESS != hstatus)
         {
             /* Timer start failed.. Should we ASSERT here??? */
             smsLog(pMac, LOGE, FL("Neighbor scan PAL Timer start failed, status = %d, Ignoring state transition"), status);
             vos_mem_free(pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList);
             pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.ChannelList = NULL;
-            return VOS_STATUS_E_FAILURE;
+            return eHAL_STATUS_FAILURE;
         }
     }
     return eHAL_STATUS_SUCCESS;
@@ -2300,6 +2359,8 @@
 {
     tpCsrNeighborRoamControlInfo    pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
     eHalStatus  status = eHAL_STATUS_SUCCESS;
+    VOS_STATUS  vstatus;
+
 #if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     int  init_ft_flag = FALSE;
 #endif
@@ -2382,20 +2443,19 @@
 
                 NEIGHBOR_ROAM_DEBUG(pMac, LOG2, FL("Registering neighbor lookup DOWN event with TL, RSSI = %d"), pNeighborRoamInfo->currentNeighborLookupThreshold);
                 /* Register Neighbor Lookup threshold callback with TL for DOWN event only */
-                status = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1),
+                vstatus = WLANTL_RegRSSIIndicationCB(pMac->roam.gVosContext, (v_S7_t)pNeighborRoamInfo->currentNeighborLookupThreshold * (-1),
                                             WLANTL_HO_THRESHOLD_DOWN, 
                                             csrNeighborRoamNeighborLookupDOWNCallback, 
                                             VOS_MODULE_ID_SME, pMac);
             
-                if(!VOS_IS_STATUS_SUCCESS( status))
+                if(!VOS_IS_STATUS_SUCCESS(vstatus))
                 {
                    //err msg
-                   smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d\n"), status);
+                   smsLog(pMac, LOGW, FL(" Couldn't register csrNeighborRoamNeighborLookupDOWNCallback with TL: Status = %d\n"), vstatus);
+                   status = eHAL_STATUS_FAILURE;
                 }
             }
 #endif
-
-            
             break;
         default:
             smsLog(pMac, LOGE, FL("Connect event received in invalid state %d..Ignoring..."), pNeighborRoamInfo->neighborRoamState);
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index 8c1a3cf..37f3780 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -5405,35 +5405,6 @@
     return (pMac->scan.domainIdCurrent);
 }
 
-#if 0
-eHalStatus csrGetRegulatoryDomainForCountry(tpAniSirGlobal pMac, tANI_U8 *pCountry, eRegDomainId *pDomainId)
-{
-    eHalStatus status = eHAL_STATUS_SUCCESS;
-    tANI_U32 i, count = sizeof( gCsrCountryInfo ) / sizeof( gCsrCountryInfo[0] );
-
-    if(pCountry)
-    {
-        for(i = 0; i < count; i++)
-        {
-            if(palEqualMemory(pMac->hHdd, gCsrCountryInfo[i].countryCode, pCountry, 2))
-            {
-                if( pDomainId )
-                {
-                    *pDomainId = gCsrCountryInfo[i].domainId;
-                }
-                break;
-            }
-        }
-        if(i == count)
-        {
-            smsLog(pMac, LOGW, FL("  doesn't match country %c%c\n"), pCountry[0], pCountry[1]);
-            status = eHAL_STATUS_INVALID_PARAMETER;
-        }
-    }
-
-    return (status);
-}
-#endif
 
 eHalStatus csrGetRegulatoryDomainForCountry(tpAniSirGlobal pMac, tANI_U8 *pCountry, v_REGDOMAIN_t *pDomainId)
 {
@@ -5474,7 +5445,7 @@
 tANI_BOOLEAN csrMatchCountryCode( tpAniSirGlobal pMac, tANI_U8 *pCountry, tDot11fBeaconIEs *pIes )
 {
     tANI_BOOLEAN fRet = eANI_BOOLEAN_TRUE;
-    v_REGDOMAIN_t domainId = NUM_REG_DOMAINS;   //This is init to invalid value
+    v_REGDOMAIN_t domainId = REGDOMAIN_COUNT;   //This is init to invalid value
     eHalStatus status;
 
     do
@@ -5491,7 +5462,7 @@
         //Make sure this country is recognizable
         if( pIes->Country.present )
         {
-            status = csrGetRegulatoryDomainForCountry( pMac, pIes->Country.country,(v_REGDOMAIN_t *) &domainId );
+            status = csrGetRegulatoryDomainForCountry( pMac, pIes->Country.country, &domainId );
             if( !HAL_STATUS_SUCCESS( status ) )
             {
                 fRet = eANI_BOOLEAN_FALSE;
@@ -5509,7 +5480,7 @@
         }
         if( pMac->roam.configParam.fEnforceCountryCodeMatch )
         {
-            if( domainId >= NUM_REG_DOMAINS )
+            if( domainId >= REGDOMAIN_COUNT )
             {
                 fRet = eANI_BOOLEAN_FALSE;
                 break;
diff --git a/CORE/SME/src/pmc/pmc.c b/CORE/SME/src/pmc/pmc.c
index 5afc0db..36b2ad9 100644
--- a/CORE/SME/src/pmc/pmc.c
+++ b/CORE/SME/src/pmc/pmc.c
@@ -2122,6 +2122,7 @@
 tANI_BOOLEAN pmcProcessCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand )
 {
     eHalStatus status = eHAL_STATUS_SUCCESS;
+    VOS_STATUS vstatus;
     tANI_BOOLEAN fRemoveCmd = eANI_BOOLEAN_TRUE;
 
     do
@@ -2194,8 +2195,8 @@
                     /* Change PMC state */
                     pMac->pmc.pmcState = REQUEST_BMPS;
                     smsLog(pMac, LOGW, "PMC: Enter BMPS req done: Force XO Core ON\n");
-                    status = vos_chipVoteXOCore(NULL, NULL, NULL, VOS_TRUE); 
-                    if ( !VOS_IS_STATUS_SUCCESS(status) )
+                    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");
                     }
diff --git a/CORE/SYS/legacy/src/system/src/macInitApi.c b/CORE/SYS/legacy/src/system/src/macInitApi.c
index dd1648a..6946036 100644
--- a/CORE/SYS/legacy/src/system/src/macInitApi.c
+++ b/CORE/SYS/legacy/src/system/src/macInitApi.c
@@ -340,7 +340,7 @@
 
     {
         /* Call various PE (and other layer init here) */
-        if( eHAL_STATUS_SUCCESS != logInit(pMac))
+        if( eSIR_SUCCESS != logInit(pMac))
            return eSIR_FAILURE;
             
         /* Call routine to initialize CFG data structures */
diff --git a/CORE/SYS/legacy/src/utils/src/logDump.c b/CORE/SYS/legacy/src/utils/src/logDump.c
index af10944..4dcc38e 100644
--- a/CORE/SYS/legacy/src/utils/src/logDump.c
+++ b/CORE/SYS/legacy/src/utils/src/logDump.c
@@ -336,7 +336,7 @@
         tANI_U32  val;
 
         // Get integer parameter
-        if (wlan_cfgGetInt(pMac, (tANI_U16)cfgId, &val) != eHAL_STATUS_SUCCESS)
+        if (wlan_cfgGetInt(pMac, (tANI_U16)cfgId, &val) != eSIR_SUCCESS)
         {
             sysLog(pMac, LOGE, FL("Get cfgId 0x%x failed\n"), cfgId);
         }
@@ -371,7 +371,7 @@
     sysLog(pMac, LOGE, FL("Set %s(0x%x) to value 0x%x\n"),
            gCfgParamName[cfgId], cfgId, val);
 
-    if (cfgSetInt(pMac, (tANI_U16)cfgId, val) != eHAL_STATUS_SUCCESS)
+    if (cfgSetInt(pMac, (tANI_U16)cfgId, val) != eSIR_SUCCESS)
         sysLog(pMac, LOGE, FL("setting cfgId 0x%x to value 0x%x failed \n"),
                cfgId, val);
      return;
diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c
index cc5a3cc..9d247a3 100644
--- a/CORE/VOSS/src/vos_nvitem.c
+++ b/CORE/VOSS/src/vos_nvitem.c
@@ -903,11 +903,12 @@
    v_U32_t lastNvValidityBitmap;
    v_U32_t newNvValidityBitmap;
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+
    // check if the current NV type is valid
-   if (VNV_TYPE_COUNT < type)
+   if (VNV_TYPE_COUNT <= type)
    {
       VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
-            ("vos_nv_setValidity: invalid type=%d\r\n"), type );
+                 ("%s: invalid type=%d"), __FUNCTION__, type );
       return VOS_STATUS_E_INVAL;
    }
    // read the validity bitmap
@@ -957,10 +958,10 @@
 {
    v_U32_t nvValidityBitmap = gnvEFSTable->nvValidityBitmap;
    // check if the current NV type is valid
-   if (NUM_NV_TABLE_IDS < type)
+   if (VNV_TYPE_COUNT <= type)
    {
       VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
-            ("vos_nv_getValidity: invalid type=%d\r\n"), type );
+                 ("%s: invalid type=%d"), __FUNCTION__, type );
       return VOS_STATUS_E_INVAL;
    }
    *pItemIsValid = (v_BOOL_t)((nvValidityBitmap >> type) & 1);
@@ -993,10 +994,10 @@
     v_BOOL_t itemIsValid = VOS_TRUE;
 
     // sanity check
-    if (VNV_TYPE_COUNT < type)
+    if (VNV_TYPE_COUNT <= type)
     {
        VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
-             ("vos_nv_setValidity: invalid type=%d\r\n"), type );
+                 ("%s: invalid type=%d"), __FUNCTION__, type );
        return VOS_STATUS_E_INVAL;
     }
     if (NULL == outputVoidBuffer)
@@ -1226,11 +1227,12 @@
 {
     VOS_STATUS status = VOS_STATUS_SUCCESS;
     v_SIZE_t itemSize;
-        // sanity check
-    if (NUM_NV_TABLE_IDS < type)
+
+    // sanity check
+    if (VNV_TYPE_COUNT <= type)
     {
        VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
-             ("vos_nv_setValidity: invalid type=%d\r\n"), type );
+                  ("%s: invalid type=%d"), __FUNCTION__, type );
        return VOS_STATUS_E_INVAL;
     }
     if (NULL == inputVoidBuffer)
diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h
index 4a0fa59..836e4bf 100644
--- a/CORE/WDA/inc/wlan_qct_wda.h
+++ b/CORE/WDA/inc/wlan_qct_wda.h
@@ -300,8 +300,8 @@
 
 #define WDA_TX_PACKET_FREED      0X0
 
-/* Approximate amount of time to wait for WDA to stop WDI */
-#define WDA_STOP_TIMEOUT (WDI_RESPONSE_TIMEOUT + WDI_SET_POWER_STATE_TIMEOUT + 5)
+/* Approximate amount of time to wait for WDA to stop WDI considering 1 pendig req too*/
+#define WDA_STOP_TIMEOUT ( (WDI_RESPONSE_TIMEOUT * 2) + WDI_SET_POWER_STATE_TIMEOUT + 5)
 /*--------------------------------------------------------------------------
   Functions
  --------------------------------------------------------------------------*/
diff --git a/CORE/WDA/src/wlan_qct_wda.c b/CORE/WDA/src/wlan_qct_wda.c
index 7d2cfaa..c0ba3e2 100644
--- a/CORE/WDA/src/wlan_qct_wda.c
+++ b/CORE/WDA/src/wlan_qct_wda.c
@@ -399,7 +399,7 @@
 
    /* Notify WDA_start that WDI_Start has completed */
    status = vos_event_set(&wdaContext->wdaWdiEvent);
-   if (WDI_STATUS_SUCCESS != status)
+   if (VOS_STATUS_SUCCESS != status)
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL,
                  "%s: Unable to unblock WDA_start", __FUNCTION__ );
@@ -1595,7 +1595,9 @@
  */ 
 VOS_STATUS WDA_close(v_PVOID_t pVosContext)
 {
-   WDI_Status status = WDI_STATUS_SUCCESS;
+   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
+   VOS_STATUS vstatus;
    tWDA_CbContext *wdaContext= (tWDA_CbContext *)VOS_GET_WDA_CTXT(pVosContext);
 
    if (NULL == wdaContext)
@@ -1612,8 +1614,8 @@
    }
 
    /*call WDI close*/
-   status = WDI_Close();
-   if ( status != WDI_STATUS_SUCCESS )
+   wstatus = WDI_Close();
+   if ( wstatus != WDI_STATUS_SUCCESS )
    {
       status = VOS_STATUS_E_FAILURE;
    }
@@ -1621,29 +1623,29 @@
    wdaContext->wdaState = WDA_CLOSE_STATE;
 
    /* Destroy the events */
-   status = vos_event_destroy(&wdaContext->wdaWdiEvent);
-   if(!VOS_IS_STATUS_SUCCESS(status)) 
+   vstatus = vos_event_destroy(&wdaContext->wdaWdiEvent);
+   if(!VOS_IS_STATUS_SUCCESS(vstatus)) 
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                 "WDI Sync Event destroy failed - status = %d\n", status);
       status = VOS_STATUS_E_FAILURE;
    }
 
-   status = vos_event_destroy(&wdaContext->txFrameEvent);
+   vstatus = vos_event_destroy(&wdaContext->txFrameEvent);
    if(!VOS_IS_STATUS_SUCCESS(status))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                   "VOS Event destroy failed - status = %d\n", status);
       status = VOS_STATUS_E_FAILURE;
    }
-   status = vos_event_destroy(&wdaContext->suspendDataTxEvent);
+   vstatus = vos_event_destroy(&wdaContext->suspendDataTxEvent);
    if(!VOS_IS_STATUS_SUCCESS(status))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                   "VOS Event destroy failed - status = %d\n", status);
       status = VOS_STATUS_E_FAILURE;
    }
-   status = vos_event_destroy(&wdaContext->waitOnWdiIndicationCallBack);
+   vstatus = vos_event_destroy(&wdaContext->waitOnWdiIndicationCallBack);
    if(!VOS_IS_STATUS_SUCCESS(status))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
@@ -1652,7 +1654,7 @@
    }
 
    /* free WDA context */
-   status = vos_free_context(pVosContext, VOS_MODULE_ID_WDA, wdaContext);
+   vstatus = vos_free_context(pVosContext, VOS_MODULE_ID_WDA, wdaContext);
    if ( !VOS_IS_STATUS_SUCCESS(status) )
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
@@ -3597,6 +3599,7 @@
 VOS_STATUS WDA_ProcessAddStaSelfReq( tWDA_CbContext *pWDA, tpAddStaSelfParams pAddStaSelfReq)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_AddSTASelfReqParamsType *wdiAddStaSelfReq = 
       (WDI_AddSTASelfReqParamsType *)vos_mem_malloc(
          sizeof(WDI_AddSTASelfReqParamsType)) ;
@@ -3632,20 +3635,21 @@
    pWdaParams->wdaMsgParam = pAddStaSelfReq;
    pWdaParams->wdaWdiApiMsgParam = wdiAddStaSelfReq; 
 
-   status = WDI_AddSTASelfReq( wdiAddStaSelfReq, WDA_ProcessAddStaSelfRsp, pWdaParams);
+   wstatus = WDI_AddSTASelfReq( wdiAddStaSelfReq, WDA_ProcessAddStaSelfRsp, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                "Failure in Add Self Sta Request API, free all the memory status = %d", 
-                                                                status );
+                                                                wstatus );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams) ;
       pAddStaSelfReq->status = eSIR_FAILURE ;
       WDA_SendMsg( pWDA, WDA_ADD_STA_SELF_RSP, (void *)pAddStaSelfReq, 0) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 }
 
 /*
@@ -3731,6 +3735,7 @@
                                     tDelStaSelfParams* pDelStaSelfReqParam)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    tWDA_ReqParams *pWdaParams = NULL; 
    WDI_DelSTASelfReqParamsType *wdiDelStaSelfReq = 
                 (WDI_DelSTASelfReqParamsType *)vos_mem_malloc(
@@ -3769,21 +3774,22 @@
     wdiDelStaSelfReq->wdiReqStatusCB = WDA_DelSTASelfReqCallback;
     wdiDelStaSelfReq->pUserData = pWdaParams;
 
-   status = WDI_DelSTASelfReq(wdiDelStaSelfReq, 
+   wstatus = WDI_DelSTASelfReq(wdiDelStaSelfReq, 
                       (WDI_DelSTASelfRspCb)WDA_DelSTASelfRespCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_FATAL,
               "Failure in Del Sta Self REQ WDI API, free all the memory " );
       VOS_ASSERT(0);
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams) ;
       pDelStaSelfReqParam->status = eSIR_FAILURE ;
       WDA_SendMsg(pWDA, WDA_DEL_STA_SELF_RSP, (void *)pDelStaSelfReqParam, 0) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 }
 
 
@@ -3896,7 +3902,7 @@
 
       if(wdaBssParams->extSetStaKeyParam.encType != eSIR_ED_NONE)
       {
-         if( (wdiBssParams->wdiExtSetKeyParam.wdiWEPType == eSIR_WEP_STATIC) && 
+         if( (wdiBssParams->wdiExtSetKeyParam.wdiWEPType == WDI_WEP_STATIC) && 
              (WDA_INVALID_KEY_INDEX == wdaBssParams->extSetStaKeyParam.defWEPIdx) &&
              (eSYSTEM_AP_ROLE != pWDA->wdaGlobalSystemRole))
          {
@@ -4674,7 +4680,7 @@
 
    if(setStaKeyParams->encType != eSIR_ED_NONE)
    {
-      if( (wdiSetStaKeyParam->wdiKeyInfo.wdiWEPType == eSIR_WEP_STATIC) && 
+      if( (wdiSetStaKeyParam->wdiKeyInfo.wdiWEPType == WDI_WEP_STATIC) && 
                     (WDA_INVALID_KEY_INDEX == setStaKeyParams->defWEPIdx) &&
                     (eSYSTEM_AP_ROLE != pWDA->wdaGlobalSystemRole))
       {
@@ -5440,6 +5446,7 @@
 VOS_STATUS WDA_ProcessAddBAReq(tWDA_CbContext *pWDA, VOS_STATUS status,
            tANI_U16 baSessionID, tANI_U8 staIdx, tAddBAParams *pAddBAReqParams)
 {
+   WDI_Status wstatus;
    WDI_AddBAReqParamsType *wdiAddBAReqParam = 
                      (WDI_AddBAReqParamsType *)vos_mem_malloc(
                                              sizeof(WDI_AddBAReqParamsType)) ;
@@ -5481,20 +5488,21 @@
    pWdaParams->wdaWdiApiMsgParam = (void *)wdiAddBAReqParam ;
    pWdaParams->wdaMsgParam = pAddBAReqParams;
 
-   status = WDI_AddBAReq(wdiAddBAReqParam, 
-                                 (WDI_AddBARspCb)WDA_AddBAReqCallback, pWdaParams);
+   wstatus = WDI_AddBAReq(wdiAddBAReqParam, 
+                          (WDI_AddBARspCb)WDA_AddBAReqCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
-              "Failure in ADD BA REQ Params WDI API, free all the memory " );
-      vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ;
+              "Failure in ADD BA REQ Params WDI API, free all the memory" );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
+      vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams);
       pAddBAReqParams->status = eSIR_FAILURE;
       WDA_SendMsg(pWDA, WDA_ADDBA_RSP, (void *)pAddBAReqParams , 0) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }
 
@@ -7583,6 +7591,7 @@
                                     tUpdateUapsdParams* pUpdateUapsdInfo)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_UpdateUapsdReqParamsType *wdiUpdateUapsdParams = 
       (WDI_UpdateUapsdReqParamsType *)vos_mem_malloc(
          sizeof(WDI_UpdateUapsdReqParamsType)) ;
@@ -7617,20 +7626,21 @@
    /* store Params pass it to WDI */
    pWDA->wdaWdiApiMsgParam = (void *)wdiUpdateUapsdParams;
 
-   status = WDI_UpdateUapsdParamsReq(wdiUpdateUapsdParams, 
-                                     (WDI_UpdateUapsdParamsCb)WDA_UpdateUapsdParamsReqCallback, pWDA);
+   wstatus = WDI_UpdateUapsdParamsReq(wdiUpdateUapsdParams, 
+                                      (WDI_UpdateUapsdParamsCb)WDA_UpdateUapsdParamsReqCallback, pWDA);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Set UAPSD params REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWDA->wdaWdiApiMsgParam) ;
       vos_mem_free(pWDA->wdaMsgParam);
       pWDA->wdaWdiApiMsgParam = NULL;
       pWDA->wdaMsgParam = NULL;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 }
 
 /*
@@ -7671,8 +7681,8 @@
 VOS_STATUS WDA_ProcessConfigureRxpFilterReq(tWDA_CbContext *pWDA, 
                           tSirWlanSetRxpFilters *pWlanSuspendParam)
 {
-   
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_ConfigureRxpFilterReqParamsType *wdiRxpFilterParams = 
       (WDI_ConfigureRxpFilterReqParamsType *)vos_mem_malloc(
          sizeof(WDI_ConfigureRxpFilterReqParamsType)) ;
@@ -7711,20 +7721,21 @@
    pWdaParams->wdaMsgParam = pWlanSuspendParam;
    pWdaParams->wdaWdiApiMsgParam = (void *)wdiRxpFilterParams;
 
-   status = WDI_ConfigureRxpFilterReq(wdiRxpFilterParams, 
+   wstatus = WDI_ConfigureRxpFilterReq(wdiRxpFilterParams, 
                       (WDI_ConfigureRxpFilterCb)WDA_ConfigureRxpFilterCallback,
                       pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in configure RXP filter REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ;
       vos_mem_free(pWdaParams->wdaMsgParam);
       vos_mem_free(pWdaParams);
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 }
 
 /*
@@ -8018,6 +8029,7 @@
                                   tRemBeaconFilterMsg* pBeaconFilterInfo)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_RemBeaconFilterReqParamsType *wdiBeaconFilterInfo = 
       (WDI_RemBeaconFilterReqParamsType *)vos_mem_malloc(
          sizeof(WDI_RemBeaconFilterReqParamsType) + pBeaconFilterInfo->ucIeCount) ;
@@ -8057,20 +8069,21 @@
    /* store Params pass it to WDI */
    pWDA->wdaWdiApiMsgParam = (void *)wdiBeaconFilterInfo;
 
-   status = WDI_RemBeaconFilterReq(wdiBeaconFilterInfo, 
+   wstatus = WDI_RemBeaconFilterReq(wdiBeaconFilterInfo, 
                                    (WDI_RemBeaconFilterCb)WDA_RemBeaconFilterReqCallback, pWDA);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Remove Beacon Filter REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWDA->wdaWdiApiMsgParam) ;
       vos_mem_free(pWDA->wdaMsgParam);
       pWDA->wdaWdiApiMsgParam = NULL;
       pWDA->wdaMsgParam = NULL;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 }
 
 /*
@@ -8106,6 +8119,7 @@
 VOS_STATUS WDA_SetRSSIThresholdsReq(tpAniSirGlobal pMac, tSirRSSIThresholds *pBmpsThresholds)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    tWDA_CbContext *pWDA = NULL ;
    v_PVOID_t pVosContext = NULL; 
    WDI_SetRSSIThresholdsReqParamsType *wdiRSSIThresholdsInfo = 
@@ -8159,18 +8173,19 @@
    pWdaParams->pWdaContext = pWDA;
    pWdaParams->wdaMsgParam = pBmpsThresholds;
 
-   status = WDI_SetRSSIThresholdsReq(wdiRSSIThresholdsInfo, 
+   wstatus = WDI_SetRSSIThresholdsReq(wdiRSSIThresholdsInfo, 
                                      (WDI_SetRSSIThresholdsCb)WDA_SetRSSIThresholdsReqCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Set RSSI thresholds REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }/*WDA_SetRSSIThresholdsReq*/
 
@@ -8213,6 +8228,7 @@
                                      tSirHostOffloadReq *pHostOffloadParams)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_HostOffloadReqParamsType *wdiHostOffloadInfo = 
       (WDI_HostOffloadReqParamsType *)vos_mem_malloc(
          sizeof(WDI_HostOffloadReqParamsType)) ;
@@ -8334,19 +8350,20 @@
    pWdaParams->pWdaContext = pWDA;
    pWdaParams->wdaMsgParam = pHostOffloadParams;
 
-   status = WDI_HostOffloadReq(wdiHostOffloadInfo, 
+   wstatus = WDI_HostOffloadReq(wdiHostOffloadInfo, 
                                (WDI_HostOffloadCb)WDA_HostOffloadReqCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in host offload REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams->wdaMsgParam);
       vos_mem_free(pWdaParams) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }/*WDA_HostOffloadReq*/
 
@@ -8383,6 +8400,7 @@
                                    tSirKeepAliveReq *pKeepAliveParams)
 {
     VOS_STATUS status = VOS_STATUS_SUCCESS;
+    WDI_Status wstatus;
     WDI_KeepAliveReqParamsType *wdiKeepAliveInfo = 
       (WDI_KeepAliveReqParamsType *)vos_mem_malloc(
          sizeof(WDI_KeepAliveReqParamsType)) ;
@@ -8468,20 +8486,21 @@
               wdiKeepAliveInfo->wdiKeepAliveInfo.ucTimePeriod,
               wdiKeepAliveInfo->wdiKeepAliveInfo.ucPacketType); 
 
-    status = WDI_KeepAliveReq(wdiKeepAliveInfo, 
+    wstatus = WDI_KeepAliveReq(wdiKeepAliveInfo, 
                              (WDI_KeepAliveCb)WDA_KeepAliveReqCallback, pWDA);
 
-    if(IS_WDI_STATUS_FAILURE(status))
+    if(IS_WDI_STATUS_FAILURE(wstatus))
     {
         VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
                    "Failure in Keep Alive REQ WDI API, free all the memory " );
+        status = CONVERT_WDI2VOS_STATUS(wstatus);
         vos_mem_free(pWDA->wdaWdiApiMsgParam) ;
         vos_mem_free(pWDA->wdaMsgParam);
         pWDA->wdaWdiApiMsgParam = NULL;
         pWDA->wdaMsgParam = NULL;
     }
 
-    return CONVERT_WDI2VOS_STATUS(status) ;
+    return status;
 
 }/*WDA_KeepAliveReq*/
 
@@ -8519,6 +8538,7 @@
                                        tSirWowlAddBcastPtrn *pWowlAddBcPtrnParams)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_WowlAddBcPtrnReqParamsType *wdiWowlAddBcPtrnInfo = 
       (WDI_WowlAddBcPtrnReqParamsType *)vos_mem_malloc(
          sizeof(WDI_WowlAddBcPtrnReqParamsType)) ;
@@ -8587,19 +8607,20 @@
    pWdaParams->pWdaContext = pWDA;
    pWdaParams->wdaMsgParam = pWowlAddBcPtrnParams;
 
-   status = WDI_WowlAddBcPtrnReq(wdiWowlAddBcPtrnInfo, 
+   wstatus = WDI_WowlAddBcPtrnReq(wdiWowlAddBcPtrnInfo, 
                                  (WDI_WowlAddBcPtrnCb)WDA_WowlAddBcPtrnReqCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Wowl add Bcast ptrn REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaMsgParam) ;
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }/*WDA_ProcessWowlAddBcPtrnReq*/
 
@@ -8637,6 +8658,7 @@
                                        tSirWowlDelBcastPtrn *pWowlDelBcPtrnParams)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_WowlDelBcPtrnReqParamsType *wdiWowlDelBcPtrnInfo = 
       (WDI_WowlDelBcPtrnReqParamsType *)vos_mem_malloc(
          sizeof(WDI_WowlDelBcPtrnReqParamsType)) ;
@@ -8673,19 +8695,20 @@
    pWdaParams->pWdaContext = pWDA;
    pWdaParams->wdaMsgParam = pWowlDelBcPtrnParams;
 
-   status = WDI_WowlDelBcPtrnReq(wdiWowlDelBcPtrnInfo, 
+   wstatus = WDI_WowlDelBcPtrnReq(wdiWowlDelBcPtrnInfo, 
                                  (WDI_WowlDelBcPtrnCb)WDA_WowlDelBcPtrnReqCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Wowl delete Bcast ptrn REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaMsgParam) ;
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }/*WDA_ProcessWowlDelBcPtrnReq*/
 
@@ -8733,6 +8756,7 @@
                                    tSirHalWowlEnterParams *pWowlEnterParams)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_WowlEnterReqParamsType *wdiWowlEnterInfo = 
       (WDI_WowlEnterReqParamsType *)vos_mem_malloc(
          sizeof(WDI_WowlEnterReqParamsType)) ;
@@ -8811,19 +8835,20 @@
    pWdaParams->pWdaContext = pWDA;
    pWdaParams->wdaMsgParam = pWowlEnterParams;
 
-   status = WDI_WowlEnterReq(wdiWowlEnterInfo, 
+   wstatus = WDI_WowlEnterReq(wdiWowlEnterInfo, 
                              (WDI_WowlEnterReqCb)WDA_WowlEnterReqCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Wowl enter REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaMsgParam) ;
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }/*WDA_ProcessWowlEnterReq*/
 
@@ -8850,23 +8875,25 @@
 VOS_STATUS WDA_ProcessWowlExitReq(tWDA_CbContext *pWDA)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
 
    VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
                                           "------> %s " ,__FUNCTION__);
 
-   status = WDI_WowlExitReq((WDI_WowlExitReqCb)WDA_WowlExitReqCallback, pWDA);
+   wstatus = WDI_WowlExitReq((WDI_WowlExitReqCb)WDA_WowlExitReqCallback, pWDA);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Wowl exit REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWDA->wdaWdiApiMsgParam) ;
       vos_mem_free(pWDA->wdaMsgParam);
       pWDA->wdaWdiApiMsgParam = NULL;
       pWDA->wdaMsgParam = NULL;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }/*WDA_ProcessWowlExitReq*/
 
@@ -9436,6 +9463,7 @@
 VOS_STATUS WDA_ProcessSetTxPerTrackingReq(tWDA_CbContext *pWDA, tSirTxPerTrackingParam *pTxPerTrackingParams)
 {
    VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status wstatus;
    WDI_SetTxPerTrackingReqParamsType *pwdiSetTxPerTrackingReqParams = 
       (WDI_SetTxPerTrackingReqParamsType *)vos_mem_malloc(
          sizeof(WDI_SetTxPerTrackingReqParamsType)) ;
@@ -9481,19 +9509,20 @@
    pWdaParams->pWdaContext = pWDA;
    pWdaParams->wdaMsgParam = pTxPerTrackingParams;
 
-   status = WDI_SetTxPerTrackingReq(pwdiSetTxPerTrackingReqParams, 
+   wstatus = WDI_SetTxPerTrackingReq(pwdiSetTxPerTrackingReqParams, 
                                     (WDI_SetTxPerTrackingRspCb)WDA_SetTxPerTrackingReqCallback, pWdaParams);
 
-   if(IS_WDI_STATUS_FAILURE(status))
+   if(IS_WDI_STATUS_FAILURE(wstatus))
    {
       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
               "Failure in Set Tx PER REQ WDI API, free all the memory " );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
       vos_mem_free(pWdaParams->wdaMsgParam) ;
       vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
       vos_mem_free(pWdaParams) ;
    }
 
-   return CONVERT_WDI2VOS_STATUS(status) ;
+   return status;
 
 }/*WDA_ProcessSetTxPerTrackingReq*/
 
@@ -10728,25 +10757,6 @@
                                   "Received WDI_FATAL_ERROR_IND from WDI ");
          break ;
       }
-      case WDA_BEACON_PRE_IND:
-      {
-         tBeaconGenParams *pBeaconGenParams = 
-            (tBeaconGenParams *)vos_mem_malloc(
-                                             sizeof(tBeaconGenParams)) ;
-         if(NULL == pBeaconGenParams)
-         {
-            VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
-                    "%s: VOS MEM Alloc Failure - pBeaconGenParams", __FUNCTION__);
-            break;
-         }
-         VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
-                                  "Received WDA_BEACON_PRE_IND from WDI ");
-
-         /* TODO: fill the pBeaconGenParams strucutre */
-         WDA_SendMsg(pWDA, SIR_LIM_BEACON_GEN_IND, 
-                                       (void *)pBeaconGenParams , 0) ;
-         break;
-      }
       case WDI_DEL_STA_IND:
       {
 
@@ -11527,7 +11537,7 @@
 VOS_STATUS WDA_ProcessSetPrefNetworkReq(tWDA_CbContext *pWDA, 
                                        tSirPNOScanReq *pPNOScanReqParams)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    WDI_PNOScanReqParamsType *pwdiPNOScanReqInfo = 
       (WDI_PNOScanReqParamsType *)vos_mem_malloc(sizeof(WDI_PNOScanReqParamsType)) ;
    tWDA_ReqParams *pWdaParams ;
@@ -11654,7 +11664,7 @@
 VOS_STATUS WDA_ProcessSetRssiFilterReq(tWDA_CbContext *pWDA, 
                                         tSirSetRSSIFilterReq* pRssiFilterParams)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    WDI_SetRssiFilterReqParamsType *pwdiSetRssiFilterReqInfo = 
       (WDI_SetRssiFilterReqParamsType *)vos_mem_malloc(sizeof(WDI_SetRssiFilterReqParamsType)) ;
    tWDA_ReqParams *pWdaParams ;
@@ -11724,7 +11734,7 @@
 VOS_STATUS WDA_ProcessUpdateScanParams(tWDA_CbContext *pWDA, 
                                        tSirUpdateScanParams *pUpdateScanParams)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    WDI_UpdateScanParamsInfoType *wdiUpdateScanParamsInfoType = 
       (WDI_UpdateScanParamsInfoType *)vos_mem_malloc(
          sizeof(WDI_UpdateScanParamsInfoType)) ;
@@ -11884,7 +11894,7 @@
 VOS_STATUS WDA_Process8023MulticastListReq (tWDA_CbContext *pWDA, 
                                        tSirRcvFltMcAddrList *pRcvFltMcAddrList)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    WDI_RcvFltPktSetMcListReqParamsType *pwdiFltPktSetMcListReqParamsType = NULL;
    tWDA_ReqParams *pWdaParams ;
    tANI_U8         i;
@@ -12001,7 +12011,7 @@
 VOS_STATUS WDA_ProcessReceiveFilterSetFilterReq (tWDA_CbContext *pWDA, 
                                        tSirRcvPktFilterCfgType *pRcvPktFilterCfg)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    v_SIZE_t   allocSize = sizeof(WDI_SetRcvPktFilterReqParamsType) + 
       ((pRcvPktFilterCfg->numFieldParams - 1) * sizeof(tSirRcvPktFilterFieldParams));
    WDI_SetRcvPktFilterReqParamsType *pwdiSetRcvPktFilterReqParamsType = 
@@ -12184,7 +12194,7 @@
  */ 
 VOS_STATUS WDA_ProcessPacketFilterMatchCountReq (tWDA_CbContext *pWDA, tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    WDI_RcvFltPktMatchCntReqParamsType *pwdiRcvFltPktMatchCntReqParamsType = 
       (WDI_RcvFltPktMatchCntReqParamsType *)vos_mem_malloc(sizeof(WDI_RcvFltPktMatchCntReqParamsType));
    tWDA_ReqParams *pWdaParams ;
@@ -12285,7 +12295,7 @@
 VOS_STATUS WDA_ProcessReceiveFilterClearFilterReq (tWDA_CbContext *pWDA,
                                        tSirRcvFltPktClearParam *pRcvFltPktClearParam)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    WDI_RcvFltPktClearReqParamsType *pwdiRcvFltPktClearReqParamsType =
       (WDI_RcvFltPktClearReqParamsType *)vos_mem_malloc(sizeof(WDI_RcvFltPktClearReqParamsType));
    tWDA_ReqParams *pWdaParams ;
@@ -12345,7 +12355,7 @@
 VOS_STATUS WDA_ProcessSetPowerParamsReq(tWDA_CbContext *pWDA, 
                                         tSirSetPowerParamsReq *pPowerParams)
 {
-   VOS_STATUS status = VOS_STATUS_SUCCESS;
+   WDI_Status status;
    WDI_SetPowerParamsReqParamsType *pwdiSetPowerParamsReqInfo = 
       (WDI_SetPowerParamsReqParamsType *)vos_mem_malloc(sizeof(WDI_SetPowerParamsReqParamsType)) ;
 
diff --git a/CORE/WDA/src/wlan_qct_wda_legacy.c b/CORE/WDA/src/wlan_qct_wda_legacy.c
index 42367d2..eb585c2 100644
--- a/CORE/WDA/src/wlan_qct_wda_legacy.c
+++ b/CORE/WDA/src/wlan_qct_wda_legacy.c
@@ -289,7 +289,8 @@
              msg.type));
 
       // Release the memory.
-      if (palFreeMemory( pMac->hHdd, (void*)(msg.bodyptr)) != eSIR_SUCCESS)
+      if (palFreeMemory( pMac->hHdd, (void*)(msg.bodyptr))
+            != eHAL_STATUS_SUCCESS)
       {
          WDALOGE( wdaLog(pMac, LOGE, FL("Buffer Allocation failed!\n")));
          return eSIR_FAILURE;
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi_i.h b/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
index 264c907..8ac7fba 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
@@ -1156,7 +1156,7 @@
  @see
  @return pointer to the context 
 */
-WPT_INLINE void* WDI_GET_PAL_CTX( void );
+void* WDI_GET_PAL_CTX( void );
 
 /*---------------------------------------------------------------------------
                     MAIN DAL FSM Function Declarations
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi.c b/CORE/WDI/CP/src/wlan_qct_wdi.c
index 919f828..7d10de1 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi.c
@@ -1347,6 +1347,7 @@
 )
 {
   WDI_EventInfoType      wdiEventData;
+  WDI_ControlBlockType*  pWDICtx = &gWDICb;
   /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
   /*------------------------------------------------------------------------
@@ -1360,6 +1361,15 @@
     return WDI_STATUS_E_NOT_ALLOWED; 
   }
 
+  /*Access to the global state must be locked before cleaning */
+  wpalMutexAcquire(&pWDICtx->wptMutex);
+
+  /*Clear all pending request*/
+  WDI_ClearPendingRequests(pWDICtx);
+
+  /*We have completed cleaning unlock now*/
+  wpalMutexRelease(&pWDICtx->wptMutex);
+
   /* Free the global variables */
   wpalMemoryFree(gpHostWlanFeatCaps);
   wpalMemoryFree(gpFwWlanFeatCaps);
@@ -6303,7 +6313,7 @@
   wpt_uint8*             pSendBuffer         = NULL; 
   wpt_uint16             usDataOffset        = 0;
   wpt_uint16             usSendSize          = 0;
-
+  wpt_status             status;
   tHalMacStopReqMsg      halStopReq; 
   /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
@@ -6356,7 +6366,8 @@
      WDI_STATableStop(pWDICtx);
 
      /* Reset the event to be not signalled */
-     if(WDI_STATUS_SUCCESS != wpalEventReset(&pWDICtx->setPowerStateEvent) )
+     status = wpalEventReset(&pWDICtx->setPowerStateEvent);
+     if (eWLAN_PAL_STATUS_SUCCESS != status)
      {
         WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                   "WDI Init failed to reset power state event");
@@ -6369,8 +6380,9 @@
      /*
       * Wait for the event to be set once the ACK comes back from DXE 
       */
-     if(WDI_STATUS_SUCCESS != wpalEventWait(&pWDICtx->setPowerStateEvent, 
-                                            WDI_SET_POWER_STATE_TIMEOUT))
+     status = wpalEventWait(&pWDICtx->setPowerStateEvent, 
+                            WDI_SET_POWER_STATE_TIMEOUT);
+     if (eWLAN_PAL_STATUS_SUCCESS != status)
      {
         WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                   "WDI Init failed to wait on an event");
@@ -11399,6 +11411,7 @@
   WDI_EventInfoType*     pEventData
 )
 {
+   wpt_status               wptStatus; 
    WDI_EnterImpsRspCb       wdiEnterImpsRspCb = NULL;
    wpt_uint8*               pSendBuffer         = NULL; 
    wpt_uint16               usDataOffset        = 0;
@@ -11434,7 +11447,8 @@
    }
 
    /* Reset the event to be not signalled */
-   if(WDI_STATUS_SUCCESS != wpalEventReset(&pWDICtx->setPowerStateEvent) )
+   wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
+   if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) 
    {
       WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                 "WDI Init failed to reset an event");
@@ -11449,8 +11463,9 @@
    /*
     * Wait for the event to be set once the ACK comes back from DXE 
     */
-   if(WDI_STATUS_SUCCESS != wpalEventWait(&pWDICtx->setPowerStateEvent, 
-                                          WDI_SET_POWER_STATE_TIMEOUT))
+   wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, 
+                             WDI_SET_POWER_STATE_TIMEOUT);
+   if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus ) 
    {
       WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                 "WDI Init failed to wait on an event");
@@ -11547,6 +11562,8 @@
    wpt_uint16               usDataOffset        = 0;
    wpt_uint16               usSendSize          = 0;
    tHalEnterBmpsReqParams   enterBmpsReq;
+   wpt_status               wptStatus; 
+
    /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
   /*-------------------------------------------------------------------------
@@ -11579,7 +11596,8 @@
    }
 
    /* Reset the event to be not signalled */
-   if(WDI_STATUS_SUCCESS != wpalEventReset(&pWDICtx->setPowerStateEvent) )
+   wptStatus = wpalEventReset(&pWDICtx->setPowerStateEvent);
+   if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
    {
       WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                 "WDI Init failed to reset an event");
@@ -11594,8 +11612,9 @@
 /*
     * Wait for the event to be set once the ACK comes back from DXE 
     */
-   if(WDI_STATUS_SUCCESS != wpalEventWait(&pWDICtx->setPowerStateEvent, 
-                                          WDI_SET_POWER_STATE_TIMEOUT))
+   wptStatus = wpalEventWait(&pWDICtx->setPowerStateEvent, 
+                             WDI_SET_POWER_STATE_TIMEOUT);
+   if ( eWLAN_PAL_STATUS_SUCCESS != wptStatus )
    {
       WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
                 "WDI Init failed to wait on an event");
@@ -14980,7 +14999,7 @@
 
   wdiBASessionRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halBASessionRsp.status);
 
-  if ( eHAL_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
+  if ( WDI_STATUS_SUCCESS == wdiBASessionRsp.wdiStatus )
   {
     wdiBASessionRsp.ucBaDialogToken = halBASessionRsp.baDialogToken;
     wdiBASessionRsp.ucBaTID = halBASessionRsp.baTID;
@@ -15898,7 +15917,7 @@
 
   wdiAddBARsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halAddBARsp.status);
 
-  if ( eHAL_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
+  if ( WDI_STATUS_SUCCESS == wdiAddBARsp.wdiStatus )
   {
     wdiAddBARsp.ucBaDialogToken = halAddBARsp.baDialogToken;
   }
diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini
index f2910ec..4a867da 100644
--- a/firmware_bin/WCNSS_qcom_cfg.ini
+++ b/firmware_bin/WCNSS_qcom_cfg.ini
@@ -114,6 +114,11 @@
 # To disable, set FastRoamEnabled=0, gEnableFWRssiMonitoring=0, FastTransitionEnabled=0
 FastRoamEnabled=0
 
+#Check if the AP to which we are roaming is better than current AP in terms of RSSI.
+#Checking is disabled if set to Zero.Otherwise it will use this value as to how better 
+#the RSSI of the new/roamable AP should be for roaming
+RoamRssiDiff=0
+
 # SAP Country code
 # Default Country Code is 2 bytes, 3rd byte is optional indoor or out door.
 # Example
@@ -165,7 +170,7 @@
 beaconEarlyTerminationWakeInterval=3
 
 #Bluetooth Alternate Mac Phy (1 = enable the BT AMP feature, 0 = disable)
-gEnableBtAmp=1
+gEnableBtAmp=0
 
 #SOFTAP Channel Range selection 
 gAPChannelSelectStartChannel=1
diff --git a/riva/inc/pttFrameGen.h b/riva/inc/pttFrameGen.h
index d0a14df..abff9d8 100644
--- a/riva/inc/pttFrameGen.h
+++ b/riva/inc/pttFrameGen.h
@@ -80,12 +80,12 @@
 typedef PACKED_PRE struct PACKED_POST {
    tANI_U32 legacy;             //11g OFDM preamble
    tANI_U32 gfSimo20;           //greenfield preamble
-   tANI_U32 gfMimo20;           //greenfield preamble
    tANI_U32 mmSimo20;           //mixed mode preamble
-   tANI_U32 mmMimo20;           //mixed mode preamble
-   tANI_U32 txbShort;
-   tANI_U32 txbLong;
-   tANI_U32 txbSlr;
+   tANI_U32 gfSimo40;           //greenfield preamble
+   tANI_U32 mmSimo40;           //mixed mode preamble
+   tANI_U32 txbShort;           //11b short
+   tANI_U32 txbLong;	        //11b long
+   tANI_U32 acSimo204080;       //11ac SIMO 20,40,80
    tANI_U32 total;
 } sTxFrameCounters;