prima: WLAN Driver Release 3.1.7.11

Incorporate Driver Releases 3.1.7.10 and 3.1.7.11

Release 3.1.7.10

Integrate the following CLs from Perforce:

633566: Do not drop beacons or probe response ever when in scan mode
If beacons or probe response is dropped for an AP, it can take upto 10
seconds to connect to an AP as the AP will not be discovered until
next scan cycle.  There was logic to throttle/drop incomming frames
even during scan and not overhwhelm PE and VOSS Message wrappers which
was done in Gen6 days. With the new MSMs, faster processing power and
and removal of SDIO, host should be able to handle and process all
frames fast enough.  Therefore do not ever drop beacons or probe
response frames when we are in scan mode.  (CR 368500)

633567: Fix BMPS issues which prevent disconnect after missed beacon
1. In missed beacon scenario, BMPS request from PMC must not be
allowed by PE. This is because DUT has exited BMPS to probe the AP and
if probe has not completed, BMPS must not be allowed.
2. When ENTER BMPS is rejected or ENTER BMPS fails, make sure
heartbeat timer is always running. This is just a fail safe check to
ensure we do not ever land in a situation where DUT is out of BMPS and
also out of AP's range but heartbeat timer is deactivated for some
reason. If that happens, link will never be torn down and device will
always keep trying to enter BMPS unsuccessfully.
3. Introduce a new eSIR_SME_BMPS_REQ_REJECT which implies that request
is rejected by PE.  eSIR_SME_BMPS_REQ_FAILED now implies that request
was denied by Riva. This will help us in debugging.  (CR 367659)

633809: Change value of MAX_SCAN_SSID
While doing cfg80211 interface registeration with kernel, we are
filling wiphy->max_scan_ssids parameter with MAX_SCAN_SSID value
(MAX_SCAN_SSID =2). So During combo scan wpa_supplicant is not able to
send more then 2 profile to host driver. As host driver supporting 9
max ssid. MAX_SCAN_SSID has value set to 9 while registering the
cfg80211 interface.  (CR 365219)

634012, 634018, 634021, 634163: Legacy Fast Roaming Feature (CR 362782)

634148: Fix SSR race condition in cfg80211 APIs and BTAMP
cfg80211 APIs are blocked when SSR is going on; there could be various
race conditions in WLAN driver if these APIs are not blocked during
SSR. Some of them are already SSR protected, adding protection to the
missing ones. Also fixing a BTAMP race condition during SSR in softap
mode.  (CR 370064)

634185: Fuzzing Fix - Vos Packet is Freed Twice
Fix issue seen in fuzzing test case #48518 for malformed data packet -
There is a bug where if WLANTL_GetEtherType fails, the vos packet is
returned twice.  (CR 369987)

634238: Fix for Timer Leak
While unloading host driver it is showing timer leak. In rrmClose
function, it is not destroying neighborRspWaitTimer. Same way it is
not destroying txSleepTimer in hddDevTmUnregisterNotifyCallback
function. this change is going to fix both timer leak issue.  (CR
369951)

634272: Fix of kernel Panic in P2P mode after including DXE TX ring empty fi
DXE TX ring is taking more than 3 seconds in some secarios to get
cleared and becasue of this after getting DEL BSS response sessionId
is getting changed and as a side effect of this dev is comign as Null
and any access to it is leading to Kernel Panic.  (CR 370441)

634397: SME Close Session wait timeout should be more than WDI timeout
SME Close Session is timing out before getting the call back from
WDI. Increased the WLAN_WAIT_TIME_SESSIONOPENCLOSE to 15 seconds which
is more than WDI timeout (10 seconds).  (CR 368821)

634422: Port config80211 softap interfaces to Kernel 3.4
The softap config80211 interfaces are changed in Kernel 3.4, some of
the interfaces are renamed; and also a new data structures is
introduced for softap interface. So the existing WLAN driver APIs are
modified to accomadate these changes.  (CR 371516)

634858: Fix typo in sirWrapper.h Copyright
Fix typo that was uncovered during Open Source legal scan

Release 3.1.7.11

Integrate the following CLs from Perforce:

634522: Make changeCountryCode ioctl completly synchronous
Implemented completion routine and callback function to make
changeCountryCode Ioctl completely Synchronous (CR 365094)

634543: Fix typo in WCNSS version log message

634791: Do not allow the second interface for the same type.
Currently two concurrent sessions of same type are not supported. The
new additional session is causing problems to existing session. Seeing
errors like sme_OpenSession() failure, disconnecting and reconnect the
existing session, but data transfer failure etc., As two P2P sessions
are currently not supported, restrict this, at HDD level. This can be
removed once concurrent P2P CLI sessions have to be supported.

634824: Set ERP protection bit when SoftAP overlaps with 11b AP.
SoftAP is not setting ERP protection bit when 11b AP operates in same
channel as that of SoftAP. Added this 11b OBSS overlap support. After
turning off 11b AP, ERP protection bit is cleared but not "OBSS non-HT
STA" persent bit. HT protection also remained "01". We need to disable
this HT protection also while disabling ERP protection.  (CR 368189)

634825: Fix for Memory Leak
While sending scan response from LIM to SME, it allocate memory of
8000 byte length for pSirSmeScanRsp. In case where scan results are
empty (bssCount=0) LIM send eWNI_SME_SCAN_RSP message with
statusCode. After posting message it is not freeing memroy which is
allocated previously which result into memory leak for 8000 byte when
we unload driver. Now After posting message we will check if
pSirSmeScanRsp is not NULL then free allocate memory.  (CR 371901)

634850: Fix for setband and country commands which occasionally enable dualb
Added a fix to check the INI settings for band (CR 368987)

634876: Max tx power value from ini is not reflected during initial assoc
check is added to pick up the lowest of regmax, ap and ini value  (CR 367780

635070: Fix issue with iwconfig for p2p session when concurrency is enabled

635072: Fix for leting device go to IMPS when p2p_client is disconnected
In case where p2p_client is the last session to be
deleted/disconnected, what happens is that csrScanTriggerIdleScan()
fails at vos_concurrent_sessions_running(). We add further check to
see if any session is in connect state. In case there are no sessions
in connect state, it is okie to go into IMPS.

635216: Fix SoftP and P2P porting issues on Kernel 3.4
When registering with config80211 interface, Kernel 3.4 expects to
announce the capability for "remain on channel" interface. So add this
flag when WLAN driver register with cfg80211. For SoftAP when cfg80211
new station interface is invoked, Kernel 3.4 expects an additional
flag in station info, to indicate that it has filled association
request IES.
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index 8efaaf8..64a3481 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -651,7 +651,14 @@
 #define CFG_CCX_FEATURE_ENABLED_DEFAULT                     (0) //disabled
 #endif // FEATURE_WLAN_CCX
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#ifdef FEATURE_WLAN_LFR
+#define CFG_LFR_FEATURE_ENABLED_NAME                       "FastRoamEnabled"
+#define CFG_LFR_FEATURE_ENABLED_MIN                         (0)
+#define CFG_LFR_FEATURE_ENABLED_MAX                         (1)
+#define CFG_LFR_FEATURE_ENABLED_DEFAULT                     (0) //disabled
+#endif // FEATURE_WLAN_LFR
+
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
 #define CFG_FT_RSSI_FILTER_PERIOD_NAME                     "FTRssiFilterPeriod"
 #define CFG_FT_RSSI_FILTER_PERIOD_MIN                      WNI_CFG_FT_RSSI_FILTER_PERIOD_STAMIN
 #define CFG_FT_RSSI_FILTER_PERIOD_MAX                      WNI_CFG_FT_RSSI_FILTER_PERIOD_STAMAX
@@ -1323,11 +1330,14 @@
    v_U32_t                      InfraUapsdBeSuspIntv;
    v_U32_t                      InfraUapsdBkSrvIntv;
    v_U32_t                      InfraUapsdBkSuspIntv;
+#ifdef FEATURE_WLAN_LFR
+   v_BOOL_t                     isFastRoamIniFeatureEnabled;
+#endif
 #ifdef FEATURE_WLAN_CCX
    v_U32_t                      InfraInactivityInterval;
    v_BOOL_t                     isCcxIniFeatureEnabled;
 #endif
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    v_U8_t                       FTRssiFilterPeriod;
    v_BOOL_t                     isFastTransitionEnabled;
 #endif
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index 597111b..fc0ef47 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -73,6 +73,13 @@
 struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_db( hdd_adapter_t *pAdapter,
                                       tCsrRoamInfo *pRoamInfo
                                       );
+
+#ifdef FEATURE_WLAN_LFR
+int wlan_hdd_cfg80211_pmksa_candidate_notify(
+                    hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo,
+                    int index, bool preauth );
+#endif
+
 #ifdef FEATURE_WLAN_WAPI
 void wlan_hdd_cfg80211_set_key_wapi(hdd_adapter_t* pAdapter,
               u8 key_index, const u8 *mac_addr, u8 *key , int key_Len);
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 59609a4..ff544e5 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -91,7 +91,10 @@
 #define WLAN_WAIT_TIME_DISCONNECT  500
 #define WLAN_WAIT_TIME_STATS       800
 #define WLAN_WAIT_TIME_POWER       800
-#define WLAN_WAIT_TIME_SESSIONOPENCLOSE  2000
+/* Amount of time to wait for sme close session callback.
+   This value should be larger than the timeout used by WDI to wait for
+   a response from WCNSS */
+#define WLAN_WAIT_TIME_SESSIONOPENCLOSE  15000
 #define WLAN_WAIT_TIME_ABORTSCAN  2000
 
 /* Scan Req Timeout */
@@ -424,7 +427,7 @@
 
    v_BOOL_t bSendDisconnect;
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    int     ft_carrier_on;
 #endif
 };
@@ -613,6 +616,9 @@
    /** completion variable for disconnect callback */
    struct completion disconnect_comp_var;
 
+   /** Completion of change country code */
+   struct completion change_country_code;
+
    /* completion variable for Linkup Event */
    struct completion linkup_event_var;
 
diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c
index c988db1..eca08bb 100644
--- a/CORE/HDD/src/wlan_hdd_assoc.c
+++ b/CORE/HDD/src/wlan_hdd_assoc.c
@@ -641,6 +641,15 @@
     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);
+
+    // Sanity check
+    if(dev == NULL)
+    {
+        hddLog(VOS_TRACE_LEVEL_INFO_HIGH, 
+          "%s: net_dev is released return", __func__);
+        return eHAL_STATUS_FAILURE;
+    }
+
     // notify apps that we can't pass traffic anymore
     netif_tx_disable(dev);
     netif_carrier_off(dev);
@@ -898,7 +907,7 @@
    return( vosStatus );
 }
 
-#ifdef FEATURE_WLAN_CCX
+#if  defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
 static void hdd_SendReAssocEvent(struct net_device *dev, hdd_adapter_t *pAdapter,
     tCsrRoamInfo *pCsrRoamInfo, v_U8_t *reqRsnIe, tANI_U32 reqRsnLength)
 {
@@ -946,7 +955,7 @@
     hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter);
     hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
     VOS_STATUS vosStatus;
-#ifdef FEATURE_WLAN_CCX
+#if  defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     int ft_carrier_on = FALSE;
 #endif
     int status;
@@ -982,7 +991,7 @@
            kernel. we have registered net device notifier for device change notification. With this we will come to 
            know that the device is getting activated properly.
            */
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         if (pHddStaCtx->ft_carrier_on == FALSE)
         {
 #endif
@@ -1005,11 +1014,11 @@
 
             // Disable Linkup Event Servicing - no more service required from the net device notifier call
             pAdapter->isLinkUpSvcNeeded = FALSE;
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         }
         else { 
             pHddStaCtx->ft_carrier_on = FALSE;
-#ifdef FEATURE_WLAN_CCX
+#if  defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
             ft_carrier_on = TRUE;
 #endif /* FEATURE_WLAN_CCX */
         }
@@ -1046,7 +1055,7 @@
                     pAdapter->sessionId,
                     &rspRsnLength,
                     rspRsnIe);
-#ifdef FEATURE_WLAN_CCX
+#if  defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
             if(ft_carrier_on)
                     hdd_SendReAssocEvent(dev, pAdapter, pRoamInfo, reqRsnIe, reqRsnLength);
             else
@@ -1530,6 +1539,15 @@
     VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH,
             "CSR Callback: status= %d result= %d roamID=%ld", 
                     roamStatus, roamResult, roamId ); 
+
+    /*Sanity check*/
+    if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)
+    {
+       VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+          "pAdapter has invalid magic return"); 
+       return eHAL_STATUS_FAILURE;
+    }
+
     switch( roamStatus )
     {
         case eCSR_ROAM_SESSION_OPENED:
@@ -1540,7 +1558,7 @@
             }
             break;
             
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
             /* We did pre-auth,then we attempted a 11r or ccx reassoc.
              * reassoc failed due to failure, timeout, reject from ap
              * in any case tell the OS, our carrier is off and mark 
@@ -1585,12 +1603,12 @@
                 hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
                 // notify apps that we can't pass traffic anymore
                 netif_tx_disable(dev);
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
                 if (pHddStaCtx->ft_carrier_on == FALSE)
                 {
 #endif
                     netif_carrier_off(dev);
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
                 }
 #endif
 
@@ -1704,6 +1722,12 @@
             hdd_SendFTEvent(pAdapter);
             break;
 #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);
+           break;
+#endif
 
 #ifdef WLAN_FEATURE_P2P
         case eCSR_ROAM_INDICATE_MGMT_FRAME:
diff --git a/CORE/HDD/src/wlan_hdd_cfg.c b/CORE/HDD/src/wlan_hdd_cfg.c
index f921155..3ceffae 100644
--- a/CORE/HDD/src/wlan_hdd_cfg.c
+++ b/CORE/HDD/src/wlan_hdd_cfg.c
@@ -796,7 +796,17 @@
                  CFG_CCX_FEATURE_ENABLED_MAX),
 #endif // FEATURE_WLAN_CCX
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#ifdef FEATURE_WLAN_LFR
+   // flag to turn ON/OFF Legacy Fast Roaming
+   REG_VARIABLE( CFG_LFR_FEATURE_ENABLED_NAME, WLAN_PARAM_Integer,
+                 hdd_config_t, isFastRoamIniFeatureEnabled, 
+                 VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, 
+                 CFG_LFR_FEATURE_ENABLED_DEFAULT, 
+                 CFG_LFR_FEATURE_ENABLED_MIN, 
+                 CFG_LFR_FEATURE_ENABLED_MAX),
+#endif // FEATURE_WLAN_LFR
+
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    REG_VARIABLE( CFG_FT_RSSI_FILTER_PERIOD_NAME, WLAN_PARAM_Integer,
                  hdd_config_t, FTRssiFilterPeriod,
                  VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, 
@@ -1730,6 +1740,9 @@
   VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [FastTransitionEnabled] Value = [%lu] ",pHddCtx->cfg_ini->isFastTransitionEnabled);
   VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [gTxPowerCap] Value = [%lu] dBm ",pHddCtx->cfg_ini->nTxPowerCap);
 #endif 
+#ifdef FEATURE_WLAN_LFR
+  VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, "Name = [FastRoamEnabled] Value = [%lu] ",pHddCtx->cfg_ini->isFastRoamIniFeatureEnabled);
+#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);
@@ -2487,7 +2500,7 @@
       hddLog(LOGE, "Could not pass on WNI_CFG_RSSI_FILTER_PERIOD to CCM\n");
    }
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    if (ccmCfgSetInt(pHddCtx->hHal, WNI_CFG_FT_RSSI_FILTER_PERIOD, pConfig->FTRssiFilterPeriod,
          NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE)
    {
@@ -2847,10 +2860,13 @@
 #ifdef WLAN_FEATURE_VOWIFI_11R   
    smeConfig.csrConfig.csr11rConfig.IsFTResourceReqSupported = pConfig->fFTResourceReqSupported;
 #endif
+#ifdef FEATURE_WLAN_LFR
+   smeConfig.csrConfig.isFastRoamIniFeatureEnabled = pConfig->isFastRoamIniFeatureEnabled;
+#endif
 #ifdef FEATURE_WLAN_CCX
    smeConfig.csrConfig.isCcxIniFeatureEnabled = pConfig->isCcxIniFeatureEnabled;
 #endif
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
    smeConfig.csrConfig.isFastTransitionEnabled = pConfig->isFastTransitionEnabled;
 #endif
 
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index dc8f4c5..33f9bb6 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -85,7 +85,7 @@
 #define a_mode_rates_size (8)
 #define FREQ_BASE_80211G          (2407)
 #define FREQ_BAND_DIFF_80211G     (5)
-#define MAX_SCAN_SSID 2
+#define MAX_SCAN_SSID 9
 #define GET_IE_LEN_IN_BSS_DESC(lenInBss) ( lenInBss + sizeof(lenInBss) - \
         ((int) OFFSET_OF( tSirBssDescription, ieFields)))
 
@@ -447,6 +447,10 @@
                     | WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD
                     | WIPHY_FLAG_CUSTOM_REGULATORY;
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+    wiphy->flags |=   WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
+#endif
+
     wiphy->max_scan_ssids = MAX_SCAN_SSID; 
     
     wiphy->max_scan_ie_len = 200 ; //TODO: define a macro
@@ -660,6 +664,12 @@
 int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, 
                                        beacon_data_t **ppBeacon,
                                        struct beacon_parameters *params)
+#else
+int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, 
+                                       beacon_data_t **ppBeacon,
+                                       struct cfg80211_beacon_data *params,
+                                       int dtim_period)
+#endif
 {    
     int size;
     beacon_data_t *beacon = NULL;
@@ -700,10 +710,17 @@
     if( beacon == NULL )
         return -ENOMEM;
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
     if(params->dtim_period || !old )
         beacon->dtim_period = params->dtim_period;
     else
         beacon->dtim_period = old->dtim_period;
+#else
+    if(dtim_period || !old )
+        beacon->dtim_period = dtim_period;
+    else
+        beacon->dtim_period = old->dtim_period;
+#endif
  
     beacon->head = ((u8 *) beacon) + sizeof(beacon_data_t);
     beacon->tail = beacon->head + head_len;
@@ -733,7 +750,6 @@
     return 0;
 
 }
-#endif //LINUX_VERSION_CODE
 
 v_U8_t* wlan_hdd_cfg80211_get_ie_ptr(v_U8_t *pIes, int length, v_U8_t eid)
 {
@@ -764,7 +780,6 @@
     return NULL;
 }
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
 /* Check if rate is 11g rate or not */
 static int wlan_hdd_rate_is_11g(u8 rate)
 {
@@ -854,8 +869,13 @@
     }
 }
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
 static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter,
                             struct beacon_parameters *params)
+#else
+static int wlan_hdd_cfg80211_update_apies(hdd_adapter_t* pHostapdAdapter,
+                                     struct cfg80211_beacon_data *params)
+#endif
 {
     v_U8_t *genie;
     v_U8_t total_ielen = 0, ielen = 0;
@@ -1102,7 +1122,6 @@
     vos_mem_free(genie);
     return 0;
 }
-#endif //LINUX_VERSION_CODE
 
 /* 
  * FUNCTION: wlan_hdd_validate_operation_channel
@@ -1147,9 +1166,16 @@
          
 }
 
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
 static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
                             struct beacon_parameters *params)
+#else
+static int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter,
+                                       struct cfg80211_beacon_data *params,
+                                       const u8 *ssid, size_t ssid_len,
+                                       enum nl80211_hidden_ssid hidden_ssid)
+#endif
 {
     tsap_Config_t *pConfig;
     beacon_data_t *pBeacon = NULL;
@@ -1339,6 +1365,7 @@
 
     pConfig->SSIDinfo.ssidHidden = VOS_FALSE;
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
     if (params->ssid != NULL)
     {
         memcpy(pConfig->SSIDinfo.ssid.ssId, params->ssid, params->ssid_len);
@@ -1346,6 +1373,16 @@
         if (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE)
             pConfig->SSIDinfo.ssidHidden = VOS_TRUE;
     }
+#else
+    if (ssid != NULL)
+    {
+        memcpy(pConfig->SSIDinfo.ssid.ssId, ssid, ssid_len);
+        pConfig->SSIDinfo.ssid.length = ssid_len;
+        if (hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE)
+            pConfig->SSIDinfo.ssidHidden = VOS_TRUE;
+    }
+#endif
+
     vos_mem_copy(pConfig->self_macaddr.bytes, 
                pHostapdAdapter->macAddressCurrent.bytes, sizeof(v_MACADDR_t));
     
@@ -1478,6 +1515,7 @@
    return 0;
 }
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
 static int wlan_hdd_cfg80211_add_beacon(struct wiphy *wiphy, 
                                         struct net_device *dev, 
                                         struct beacon_parameters *params)
@@ -1489,6 +1527,13 @@
 
     hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "device mode=%d\n",pAdapter->device_mode);
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     if ( (pAdapter->device_mode == WLAN_HDD_SOFTAP) 
 #ifdef WLAN_FEATURE_P2P
       || (pAdapter->device_mode == WLAN_HDD_P2P_GO)
@@ -1532,6 +1577,13 @@
     hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d\n",
                                 __func__,pAdapter->device_mode);
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) 
 #ifdef WLAN_FEATURE_P2P
      || (pAdapter->device_mode == WLAN_HDD_P2P_GO)
@@ -1562,8 +1614,15 @@
     return status;
 }
 
+#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
 static int wlan_hdd_cfg80211_del_beacon(struct wiphy *wiphy,
                                         struct net_device *dev)
+#else
+static int wlan_hdd_cfg80211_stop_ap (struct wiphy *wiphy,
+                                      struct net_device *dev)
+#endif
 {
     hdd_adapter_t *pAdapter =  WLAN_HDD_GET_PRIV_PTR(dev);
     hdd_context_t *pHddCtx;
@@ -1657,7 +1716,95 @@
     EXIT();
     return status;
 }
-#endif //LINUX_VERSION_CODE
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(3,3,0))
+
+static int wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy, 
+                                      struct net_device *dev, 
+                                      struct cfg80211_ap_settings *params)
+{
+    hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
+    int            status = VOS_STATUS_SUCCESS; 
+
+    ENTER();
+
+    hddLog(VOS_TRACE_LEVEL_INFO_HIGH, "device mode=%d\n", pAdapter->device_mode);
+
+    if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) 
+#ifdef WLAN_FEATURE_P2P
+      || (pAdapter->device_mode == WLAN_HDD_P2P_GO)
+#endif
+       )
+    {
+        beacon_data_t  *old,*new;
+
+        old = pAdapter->sessionCtx.ap.beacon;
+   
+        if (old)
+            return -EALREADY;
+
+        status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, &params->beacon, params->dtim_period);
+
+        if(status != VOS_STATUS_SUCCESS) 
+        {
+             hddLog(VOS_TRACE_LEVEL_FATAL,
+                   "%s:Error!!! Allocating the new beacon\n",__func__);
+             return -EINVAL;
+        }
+        pAdapter->sessionCtx.ap.beacon = new;
+        status = wlan_hdd_cfg80211_start_bss(pAdapter, &params->beacon, params->ssid,
+                                             params->ssid_len, params->hidden_ssid);
+    }
+
+    EXIT();
+    return status;
+}
+
+
+static int wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy, 
+                                        struct net_device *dev,
+                                        struct cfg80211_beacon_data *params)
+{
+    hdd_adapter_t *pAdapter =  WLAN_HDD_GET_PRIV_PTR(dev); 
+    int status=VOS_STATUS_SUCCESS;
+
+    ENTER();
+
+    hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d\n",
+                                __func__, pAdapter->device_mode);
+
+    if ((pAdapter->device_mode == WLAN_HDD_SOFTAP) 
+#ifdef WLAN_FEATURE_P2P
+     || (pAdapter->device_mode == WLAN_HDD_P2P_GO)
+#endif
+       ) 
+    {
+        beacon_data_t *old,*new;
+                
+        old = pAdapter->sessionCtx.ap.beacon;
+        
+        if (!old)
+            return -ENOENT;
+
+        status = wlan_hdd_cfg80211_alloc_new_beacon(pAdapter, &new, params, 0);
+
+        if(status != VOS_STATUS_SUCCESS) {
+            hddLog(VOS_TRACE_LEVEL_FATAL, 
+                   "%s: Error!!! Allocating the new beacon\n",__func__);
+            return -EINVAL;
+       }
+
+       pAdapter->sessionCtx.ap.beacon = new;
+
+       status = wlan_hdd_cfg80211_start_bss(pAdapter, params, NULL, 0, 0);
+    }
+
+    EXIT();
+    return status;
+}
+
+#endif //(LINUX_VERSION_CODE > KERNEL_VERSION(3,3,0))
+
 
 static int wlan_hdd_cfg80211_change_bss (struct wiphy *wiphy,
                                       struct net_device *dev,
@@ -1935,6 +2082,13 @@
     hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR( dev );
     v_MACADDR_t STAMacAddress;
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     vos_mem_copy(STAMacAddress.bytes, mac, sizeof(v_MACADDR_t));
 
     if ( ( pAdapter->device_mode == WLAN_HDD_SOFTAP )
@@ -2012,6 +2166,13 @@
 
     ENTER();
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d\n",
             __func__,pAdapter->device_mode);
 
@@ -2586,6 +2747,12 @@
         return -EINVAL;
     }
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
     
     if ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION)
 #ifdef WLAN_FEATURE_P2P
@@ -3047,6 +3214,74 @@
     return 0; 
 }
 
+void
+hddPrintMacAddr(tCsrBssid macAddr, tANI_U8 logLevel)
+{
+    VOS_TRACE(VOS_MODULE_ID_HDD, logLevel, 
+           "%X:%X:%X:%X:%X:%X\n",
+           macAddr[0], macAddr[1], macAddr[2], macAddr[3], macAddr[4],
+           macAddr[5]);
+} /****** end hddPrintMacAddr() ******/
+
+void
+hddPrintPmkId(tCsrBssid pmkId, tANI_U8 logLevel)
+{
+    VOS_TRACE(VOS_MODULE_ID_HDD, logLevel, 
+           "%X:%X:%X:%X:%X:%X:%X:%X:%X:%X:%X:%X:%X:%X:%X:%X\n",
+           pmkId[0], pmkId[1], pmkId[2], pmkId[3], pmkId[4],
+           pmkId[5], pmkId[6], pmkId[7], pmkId[8], pmkId[9],
+           pmkId[10], pmkId[11], pmkId[12], pmkId[13], pmkId[14],
+           pmkId[15]);
+} /****** end hddPrintPmkId() ******/
+
+//hddPrintMacAddr(tCsrBssid macAddr, tANI_U8 logLevel);
+//hddPrintMacAddr(macAddr, VOS_TRACE_LEVEL_FATAL);
+
+//void sirDumpBuf(tpAniSirGlobal pMac, tANI_U8 modId, tANI_U32 level, tANI_U8 *buf, tANI_U32 size);
+//sirDumpBuf(pMac, VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, pmkid, 16);
+
+#define dump_bssid(bssid) \
+    { \
+        hddLog(VOS_TRACE_LEVEL_FATAL, "BSSID (MAC) address:\t"); \
+        hddPrintMacAddr(bssid, VOS_TRACE_LEVEL_FATAL);\
+        hddLog(VOS_TRACE_LEVEL_FATAL, "\n"); \
+    }
+
+#define dump_pmkid(pMac, pmkid) \
+    { \
+        hddLog(VOS_TRACE_LEVEL_FATAL, "PMKSA-ID:\t"); \
+        hddPrintPmkId(pmkid, VOS_TRACE_LEVEL_FATAL);\
+        hddLog(VOS_TRACE_LEVEL_FATAL, "\n"); \
+    }
+
+#ifdef FEATURE_WLAN_LFR
+/*
+ * FUNCTION: wlan_hdd_cfg80211_pmksa_candidate_notify
+ * This function is used to notify the supplicant of a new PMKSA candidate.
+ */
+int wlan_hdd_cfg80211_pmksa_candidate_notify(
+                    hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, 
+                    int index, bool preauth )
+{
+    struct net_device *dev = pAdapter->dev;
+
+    ENTER();
+    printk("%s is going to notify supplicant of:", __func__);
+
+    if( NULL == pRoamInfo )
+    {
+        hddLog(VOS_TRACE_LEVEL_FATAL, "%s: pRoamInfo is NULL\n", __func__);
+        return -EINVAL;
+    }
+
+    dump_bssid(pRoamInfo->bssid);
+    cfg80211_pmksa_candidate_notify(dev, index,
+                                    pRoamInfo->bssid, preauth, GFP_KERNEL);
+
+    return 0; 
+}
+#endif //FEATURE_WLAN_LFR
+
 /*
  * FUNCTION: hdd_cfg80211_scan_done_callback
  * scanning callback function, called after finishing scan
@@ -4484,6 +4719,13 @@
 
     ENTER();
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     hddLog(VOS_TRACE_LEVEL_INFO, "%s: device_mode = %d\n",__func__,pAdapter->device_mode);
     if (NULL == pWextState)
     {
@@ -4523,6 +4765,13 @@
 
     ENTER();
 
+    if ( pHddCtx->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     if (changed & WIPHY_PARAM_RTS_THRESHOLD)
     {
         u16 rts_threshold = (wiphy->rts_threshold == -1) ?
@@ -4657,6 +4906,13 @@
         return -EIO;
     }
 
+    if ( pHddCtx->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     hddLog(VOS_TRACE_LEVEL_INFO_MED, "%s: set tx power level %d dbm", __func__,
             dbm);
 
@@ -4703,6 +4959,13 @@
         return -ENOENT;
     }
 
+    if ( pHddCtx->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     pAdapter = hdd_get_adapter(pHddCtx, WLAN_HDD_INFRA_STATION);
     if (NULL == pAdapter)
     {
@@ -4751,6 +5014,13 @@
         return 0;
     }
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     wlan_hdd_get_rssi(pAdapter, &sinfo->signal);
     sinfo->filled |= STATION_INFO_SIGNAL;
 
@@ -4964,6 +5234,12 @@
         hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Adapter is NULL\n", __func__);
         return -ENODEV;
     }
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
 
     /**The get power cmd from the supplicant gets updated by the nl only
      *on successful execution of the function call
@@ -5021,6 +5297,13 @@
          return -EBUSY;
     }
 
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
     if ( (WLAN_HDD_SOFTAP == pAdapter->device_mode)
 #ifdef WLAN_FEATURE_P2P
        || (WLAN_HDD_P2P_GO == pAdapter->device_mode)
@@ -5069,6 +5352,110 @@
     return 0;
 }
 
+
+#ifdef FEATURE_WLAN_LFR
+static int wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
+				struct cfg80211_pmksa *pmksa)
+{
+#define MAX_PMKSAIDS_IN_CACHE 8
+    static tPmkidCacheInfo PMKIDCache[MAX_PMKSAIDS_IN_CACHE]; // HDD Local cache
+    static tANI_U32 i = 0; // HDD Local Cache index 
+    tANI_U32 j=0;  
+    hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev);
+    tHalHandle halHandle;
+    eHalStatus result; 
+    tANI_U8  BSSIDMatched = 0;
+   
+    // Validate pAdapter  
+    if ( NULL == pAdapter || NULL == pAdapter->pHddCtx)
+    {
+        hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Invalid Adapter or HDD Context " ,__func__);
+        return -EINVAL;
+    }
+
+    if (((hdd_context_t*)pAdapter->pHddCtx)->isLoadUnloadInProgress)
+    {
+         hddLog( LOGE,
+                 "%s: Wlan Load/Unload is in progress", __func__);
+         return -EBUSY;
+    }
+
+    if ( (WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress )
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                "%s:LOGP in Progress. Ignore!!!", __func__);
+        return -EAGAIN;
+    }
+
+    // Retrieve halHandle  
+    halHandle = WLAN_HDD_GET_HAL_CTX(pAdapter);
+
+    for (j = 0; j < i; j++)
+    {
+        if(vos_mem_compare(PMKIDCache[j].BSSID, 
+                    pmksa->bssid, WNI_CFG_BSSID_LEN))
+        {
+            /* BSSID matched previous entry.  Overwrite it. */
+            BSSIDMatched = 1;
+            vos_mem_copy(PMKIDCache[j].BSSID, 
+                    pmksa->bssid, WNI_CFG_BSSID_LEN);
+            vos_mem_copy(PMKIDCache[j].PMKID, 
+                    pmksa->pmkid,   
+                    CSR_RSN_PMKID_SIZE);
+            hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Reusing cache entry %d.", 
+                    __FUNCTION__, j );
+            dump_bssid(pmksa->bssid);
+            dump_pmkid(halHandle, pmksa->pmkid);
+            break;
+        }
+    }
+
+    if (!BSSIDMatched)
+    { 
+        // Now, we DON'T have a BSSID match, so take a new entry in the cache.  
+        vos_mem_copy(PMKIDCache[i].BSSID, 
+                pmksa->bssid, ETHER_ADDR_LEN); 
+        vos_mem_copy(PMKIDCache[i].PMKID, 
+                pmksa->pmkid,   
+                CSR_RSN_PMKID_SIZE);
+        hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Adding a new cache entry %d.", 
+                __FUNCTION__, i );
+        dump_bssid(pmksa->bssid);
+        dump_pmkid(halHandle, pmksa->pmkid);
+        // Increment the HDD Local Cache index 
+        // The "i=0" doesn't work for the call to sme_RoamSetPMKIDCache() - LFR FIXME
+        if (i<=(MAX_PMKSAIDS_IN_CACHE-1)) i++; else i=0; 
+    }
+
+
+    // Calling csrRoamSetPMKIDCache to configure the PMKIDs into the cache
+    //hddLog(LOG1, FL("%s: Calling csrRoamSetPMKIDCache with %d cache entries."), 
+    //        __FUNCTION__, i );
+    hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Calling csrRoamSetPMKIDCache with %d cache entries.", 
+            __FUNCTION__, i );
+    // Finally set the PMKSA ID Cache in CSR
+    result = sme_RoamSetPMKIDCache(halHandle,pAdapter->sessionId, 
+                                    PMKIDCache, 
+                                    i );
+    return 0;
+}
+
+
+static int wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+				struct cfg80211_pmksa *pmksa)
+{
+    // TODO: Implement this later.
+    return 0;
+}
+
+static int wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
+{
+    // TODO: Implement this later.
+    return 0;
+}
+#endif
+
+
 /* cfg80211_ops */
 static struct cfg80211_ops wlan_hdd_cfg80211_ops = 
 {
@@ -5080,6 +5467,10 @@
     .add_beacon = wlan_hdd_cfg80211_add_beacon,
     .del_beacon = wlan_hdd_cfg80211_del_beacon,
     .set_beacon = wlan_hdd_cfg80211_set_beacon,
+#else
+    .start_ap = wlan_hdd_cfg80211_start_ap,
+    .change_beacon = wlan_hdd_cfg80211_change_beacon,
+    .stop_ap = wlan_hdd_cfg80211_stop_ap,
 #endif
     .change_bss = wlan_hdd_cfg80211_change_bss,
     .add_key = wlan_hdd_cfg80211_add_key,
@@ -5108,7 +5499,12 @@
      .get_station = wlan_hdd_cfg80211_get_station,
      .set_power_mgmt = wlan_hdd_cfg80211_set_power_mgmt,
      .del_station  = wlan_hdd_cfg80211_del_station,
-     .add_station  = wlan_hdd_cfg80211_add_station
+     .add_station  = wlan_hdd_cfg80211_add_station,
+#ifdef FEATURE_WLAN_LFR
+     .set_pmksa = wlan_hdd_cfg80211_set_pmksa,
+     .del_pmksa = wlan_hdd_cfg80211_del_pmksa,
+     .flush_pmksa = wlan_hdd_cfg80211_flush_pmksa,
+#endif
 };
 
 #endif // CONFIG_CFG80211
diff --git a/CORE/HDD/src/wlan_hdd_dev_pwr.c b/CORE/HDD/src/wlan_hdd_dev_pwr.c
index db68ac9..f22999c 100644
--- a/CORE/HDD/src/wlan_hdd_dev_pwr.c
+++ b/CORE/HDD/src/wlan_hdd_dev_pwr.c
@@ -539,7 +539,29 @@
 ----------------------------------------------------------------------------*/
 VOS_STATUS hddDevTmUnregisterNotifyCallback(hdd_context_t *pHddCtx)
 {
+   VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
+
    wcnss_unregister_thermal_mitigation(hddDevTmLevelChangedHandler);
+
+   if(VOS_TIMER_STATE_RUNNING ==
+           vos_timer_getCurrentState(&pHddCtx->tmInfo.txSleepTimer))
+   {
+       vosStatus = vos_timer_stop(&pHddCtx->tmInfo.txSleepTimer);
+       if(!VOS_IS_STATUS_SUCCESS(vosStatus))
+       {
+           VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                                "%s: Timer stop fail", __func__);
+       }
+   }
+
+   // Destroy the vos timer...
+   vosStatus = vos_timer_destroy(&pHddCtx->tmInfo.txSleepTimer);
+   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
+   {
+       VOS_TRACE(VOS_MODULE_ID_HDD,VOS_TRACE_LEVEL_ERROR,
+                            "%s: Fail to destroy timer", __func__);
+   }
+
    return VOS_STATUS_SUCCESS;
 }
 
diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c
index 585dc9b..410b09c 100644
--- a/CORE/HDD/src/wlan_hdd_hostapd.c
+++ b/CORE/HDD/src/wlan_hdd_hostapd.c
@@ -546,6 +546,9 @@
                     staInfo.assoc_req_ies =
                         (const u8 *)&pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.ies[0];
                     staInfo.assoc_req_ies_len = iesLen;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+                    staInfo.filled |= STATION_INFO_ASSOC_REQ_IES;
+#endif
                     cfg80211_new_sta(dev,
                                  (const u8 *)&pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.staMac.bytes[0],
                                  &staInfo, GFP_KERNEL);
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 53397a0..9e64d20 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -249,8 +249,11 @@
         {
            //a state m/c implementation in PAL is TBD to avoid this delay
            msleep(500);
-           pHddCtx->isAmpAllowed = VOS_FALSE;
-           WLANBAP_DeregisterFromHCI();
+           if ( pHddCtx->isAmpAllowed )
+           {
+                WLANBAP_DeregisterFromHCI();
+                pHddCtx->isAmpAllowed = VOS_FALSE;
+           }
         }
 #endif //WLAN_BTAMP_FEATURE
         break;
@@ -3574,7 +3577,7 @@
           (versionCompiled.version != versionReported.version) ||
           (versionCompiled.revision != versionReported.revision))
       {
-         pr_err("%s: WCNSS WlAN Version %u.%u.%u.%u, "
+         pr_err("%s: WCNSS WLAN Version %u.%u.%u.%u, "
                 "Host expected %u.%u.%u.%u\n",
                 WLAN_MODULE_NAME,
                 (int)versionReported.major,
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c
index 4ca922c..1b4f23b 100644
--- a/CORE/HDD/src/wlan_hdd_p2p.c
+++ b/CORE/HDD/src/wlan_hdd_p2p.c
@@ -914,6 +914,13 @@
 
     ENTER();
 
+    if(hdd_get_adapter(pHddCtx, wlan_hdd_get_session_type(type)) != NULL)
+    {
+	  hddLog(VOS_TRACE_LEVEL_ERROR,"%s: Interface type %d already exists. Two"
+                     "interfaces of same type are not supported currently.",__func__, type);
+	  return NULL;
+    }
+
     if ( pHddCtx->cfg_ini->isP2pDeviceAddrAdministrated )
     {
         if( (NL80211_IFTYPE_P2P_GO == type) || 
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index 4dc3cc7..2c782d9 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -1097,7 +1097,7 @@
 
    if( pHddStaCtx->conn_info.connState== eConnectionState_Associated )
    {
-       if (sme_GetOperationChannel(hHal, &channel) != eHAL_STATUS_SUCCESS)
+       if (sme_GetOperationChannel(hHal, &channel, pAdapter->sessionId) != eHAL_STATUS_SUCCESS)
        {
            return -EIO;
        }
@@ -2242,6 +2242,17 @@
    return vos_Status;
 }
 
+
+void* wlan_hdd_change_country_code_callback(void *pAdapter)
+{
+
+    hdd_adapter_t *call_back_pAdapter = pAdapter;
+  
+    complete(&call_back_pAdapter->change_country_code);
+
+    return NULL;
+}
+
 static int iw_set_priv(struct net_device *dev,
                        struct iw_request_info *info,
                        union iwreq_data *wrqu, char *extra)
@@ -2337,19 +2348,33 @@
     }
     else if( strncasecmp(cmd, "COUNTRY", 7) == 0 ) {
         char *country_code;
+        long lrc;
 
         country_code =  cmd + 8;
 
+        init_completion(&pAdapter->change_country_code);
+
         status = (int)sme_ChangeCountryCode(pHddCtx->hHal,
-                                            NULL,
+                                            (void *)(tSmeChangeCountryCallback)wlan_hdd_change_country_code_callback,
                                             country_code,
                                             pAdapter,
                                             pHddCtx->pvosContext);
+
+        /* Wait for completion */
+        lrc = wait_for_completion_interruptible_timeout(&pAdapter->change_country_code,
+                                    msecs_to_jiffies(WLAN_WAIT_TIME_STATS));
+
+        if (lrc <= 0)
+        {
+            hddLog(VOS_TRACE_LEVEL_ERROR,"%s: SME %s while setting country code ",
+                 __FUNCTION__, "Timed out");
+        }
+
         if( 0 != status )
         {
-             VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
-                        "%s: SME Change Country code fail \n",__func__);
-             return VOS_STATUS_E_FAILURE;
+            VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+                       "%s: SME Change Country code fail \n",__func__);
+            return VOS_STATUS_E_FAILURE;
         }
     }
     else if( strncasecmp(cmd, "rssi", 4) == 0 )
@@ -5255,6 +5280,16 @@
         return -EIO;
     }
 
+    if ( (band == eCSR_BAND_24 && pHddCtx->cfg_ini->nBandCapability==2) || 
+         (band == eCSR_BAND_5G && pHddCtx->cfg_ini->nBandCapability==1) || 
+         (band == eCSR_BAND_ALL && pHddCtx->cfg_ini->nBandCapability!=0)) 
+    {       
+         VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL,
+             "%s: band value %u violate INI settings %u", __FUNCTION__,
+             band, pHddCtx->cfg_ini->nBandCapability);
+         return -EIO;
+    }
+
     if (eHAL_STATUS_SUCCESS != sme_GetFreqBand(hHal, &currBand))
     {
          VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h
index 5e3c6bc..669a3a4 100644
--- a/CORE/MAC/inc/qwlan_version.h
+++ b/CORE/MAC/inc/qwlan_version.h
@@ -40,8 +40,8 @@
 #define QWLAN_VERSION_MINOR            1
 #define QWLAN_VERSION_PATCH            7
 #define QWLAN_VERSION_EXTRA            ""
-#define QWLAN_VERSION_BUILD            9
+#define QWLAN_VERSION_BUILD            11
 
-#define QWLAN_VERSIONSTR               "3.1.7.9"
+#define QWLAN_VERSIONSTR               "3.1.7.11"
 
 #endif /* QWLAN_VERSION_H */
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 0daad70..7a4e750 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -299,6 +299,7 @@
     eSIR_SME_CANNOT_ENTER_IMPS,
     eSIR_SME_IMPS_REQ_FAILED,
     eSIR_SME_BMPS_REQ_FAILED,
+    eSIR_SME_BMPS_REQ_REJECT,
     eSIR_SME_UAPSD_REQ_FAILED,
     eSIR_SME_WOWL_ENTER_REQ_FAILED,
     eSIR_SME_WOWL_EXIT_REQ_FAILED,
@@ -1282,7 +1283,7 @@
     tCCXTspecInfo       ccxTspecInfo;
 #endif
     
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     tAniBool            isFastTransitionEnabled;
 #endif
     
@@ -1485,7 +1486,7 @@
     tAniBool            isCCXconnection;
     tCCXTspecInfo       ccxTspecInfo;
 #endif
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     tAniBool            isFastTransitionEnabled;
 #endif
 
@@ -2986,7 +2987,7 @@
     tSirDeltsReqInfo        rsp;
 } tSirDeltsRsp, *tpSirDeltsRsp;
 
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
 
 #define SIR_QOS_NUM_TSPEC_MAX 2
 #define SIR_QOS_NUM_AC_MAX 4
diff --git a/CORE/MAC/src/cfg/cfgUtil/cfg.txt b/CORE/MAC/src/cfg/cfgUtil/cfg.txt
index 1c72f98..36bf2c5 100644
--- a/CORE/MAC/src/cfg/cfgUtil/cfg.txt
+++ b/CORE/MAC/src/cfg/cfgUtil/cfg.txt
@@ -1,24 +1,41 @@
-/*
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
- *
- * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
- *
- *
- * Permission to use, copy, modify, and/or distribute this software for
- * any purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
+* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
+*
+* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+*
+*
+* Permission to use, copy, modify, and/or distribute this software for
+* any purpose with or without fee is hereby granted, provided that the
+* above copyright notice and this permission notice appear in all
+* copies.
+*
+* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+* PERFORMANCE OF THIS SOFTWARE.
 
+*
+* Woodside Networks, Inc proprietary. All rights reserved.
+* This is the data definition file for the CFG module.
+* Author:         Kevin Nguyen
+* Date:           03/18/02
+* History:-
+* 03/18/02        Created.
+* 08/10/05  ww: add maoe channels to have a complete channel listing: (see WNI_CFG_VALID_CHANNEL_LIST)
+* 08/10/05 ww: WNI_CFG_SCAN_CONTROL_LIST has a new contents
+* --------------------------------------------------------------------
+
+**********************************************************************
+*
+* This file contains the descriptions of all configuration parameters
+* for both STA and AP.
+*
+* OUTPUT:
+* -------
+* The output files are:
 *    wniCfgSta.h     - C header file for STA mode only
 *    wniCfgAp.h      - C header file for both STA and AP
 *    wniCfgSta.bin   - Control and default values for STA system
diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h
index 8412849..681e79d 100644
--- a/CORE/MAC/src/pe/include/limSession.h
+++ b/CORE/MAC/src/pe/include/limSession.h
@@ -257,7 +257,7 @@
     tAniBool            isCCXconnection;
     tCcxPEContext       ccxContext;
 #endif
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     tAniBool            isFastTransitionEnabled;
 #endif
 #ifdef WLAN_FEATURE_P2P
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index 9bc6c19..7b4fac0 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -2684,10 +2684,7 @@
         }
         if (limIsSystemInScanState(pMac))
         {
-            if( WDA_IS_RX_IN_SCAN(pRxPacketInfo) )
-                return eMGMT_DROP_NO_DROP;
-            else
-                return eMGMT_DROP_NON_SCAN_MODE_FRAME;
+            return eMGMT_DROP_NO_DROP;
         }
         else if (WDA_IS_RX_IN_SCAN(pRxPacketInfo))
         {
diff --git a/CORE/MAC/src/pe/lim/limFT.c b/CORE/MAC/src/pe/lim/limFT.c
index 37cf607..aa0c239 100644
--- a/CORE/MAC/src/pe/lim/limFT.c
+++ b/CORE/MAC/src/pe/lim/limFT.c
@@ -316,7 +316,7 @@
         // receive Auth2.
         authFrame.authAlgoNumber = eSIR_FT_AUTH; // Set the auth type to FT
     }
-#if defined FEATURE_WLAN_CCX
+#if defined FEATURE_WLAN_CCX || defined FEATURE_WLAN_LFR
     else
     {
         // Will need to make isCCXconnection a enum may be for further
@@ -575,7 +575,7 @@
         return NULL;
     }
         
-#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     limPrintMacAddr(pMac, pbssDescription->bssId, LOGE);
 #endif
 
@@ -617,7 +617,7 @@
     // Self Mac
     sirCopyMacAddr(pftSessionEntry->selfMacAddr, psessionEntry->selfMacAddr);
     sirCopyMacAddr(pftSessionEntry->limReAssocbssId, pbssDescription->bssId);
-#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     limPrintMacAddr(pMac, pftSessionEntry->limReAssocbssId, LOGE);
 #endif
 
@@ -709,7 +709,7 @@
 #ifdef FEATURE_WLAN_CCX
         pftSessionEntry->isCCXconnection = psessionEntry->isCCXconnection;
 #endif
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
         pftSessionEntry->isFastTransitionEnabled = psessionEntry->isFastTransitionEnabled;
 #endif
         limFTPrepareAddBssReq( pMac, FALSE, pftSessionEntry, 
diff --git a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
index 954ff1e..3a87a02 100644
--- a/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessAssocRspFrame.c
@@ -314,7 +314,7 @@
          (psessionEntry->limMlmState != eLIM_MLM_WT_ASSOC_RSP_STATE)) ||
         ((subType == LIM_REASSOC) &&
          ((psessionEntry->limMlmState != eLIM_MLM_WT_REASSOC_RSP_STATE) 
-#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
          && (psessionEntry->limMlmState != eLIM_MLM_WT_FT_REASSOC_RSP_STATE)
 #endif
          )))
@@ -613,7 +613,7 @@
             goto assocReject;
         }
 
-#if defined(WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if defined(WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         if (psessionEntry->limMlmState == eLIM_MLM_WT_FT_REASSOC_RSP_STATE)
         {
 #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
index 70d3b57..6793ced 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
@@ -3122,7 +3122,7 @@
     }
     if( eHAL_STATUS_SUCCESS == pAddBssParams->status )
     {
-#if defined(WLAN_FEATURE_VOWIFI_11R) || defined(FEATURE_WLAN_CCX)
+#if defined(WLAN_FEATURE_VOWIFI_11R) || defined(FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         if( eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE == psessionEntry->limMlmState )
         {
 #ifdef WLAN_FEATURE_VOWIFI_11R_DEBUG
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 4523e68..e0b71d5 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -1458,7 +1458,7 @@
 #ifdef FEATURE_WLAN_CCX
             psessionEntry->isCCXconnection = pSmeJoinReq->isCCXconnection;
 #endif
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
             psessionEntry->isFastTransitionEnabled = pSmeJoinReq->isFastTransitionEnabled;
 #endif
             
@@ -1591,7 +1591,7 @@
                , &localPowerConstraint
                ); 
 #ifdef FEATURE_WLAN_CCX
-            psessionEntry->maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint);
+            psessionEntry->maxTxPower = limGetMaxTxPower(regMax, localPowerConstraint, pMac->roam.configParam.nTxPowerCap);
 #else
             psessionEntry->maxTxPower = VOS_MIN( regMax , (localPowerConstraint) );
 #endif
@@ -1692,10 +1692,11 @@
 
 
 #ifdef FEATURE_WLAN_CCX
-tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower)
+tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower, tPowerdBm iniTxPower)
 {
     tANI_U8 maxTxPower = 0;
     tANI_U8 txPower = VOS_MIN( regMax , (apTxPower) );
+    txPower = VOS_MIN(txPower, iniTxPower);
     if((txPower >= MIN_TX_PWR_CAP) && (txPower <= MAX_TX_PWR_CAP))
         maxTxPower =  txPower;
     else if (txPower < MIN_TX_PWR_CAP)
@@ -1938,7 +1939,7 @@
 
     if (psessionEntry->limSmeState != eLIM_SME_LINK_EST_STATE)
     {
-#if defined(WLAN_FEATURE_VOWIFI_11R) || defined(FEATURE_WLAN_CCX)
+#if defined(WLAN_FEATURE_VOWIFI_11R) || defined(FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         if (psessionEntry->limSmeState == eLIM_SME_WT_REASSOC_STATE)
         {
             // May be from 11r FT pre-auth. So lets check it before we bail out
diff --git a/CORE/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
index 3ecffb2..b20fc67 100644
--- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c
+++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
@@ -2528,8 +2528,7 @@
 } // End limSendAssocReqMgmtFrame
 
 
-
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
 /*------------------------------------------------------------------------------------
  *
  * Send Reassoc Req with FTIEs.
@@ -2555,7 +2554,7 @@
     tANI_U8               *pBody;
     tANI_U16              nAddIELen; 
     tANI_U8               *pAddIE;
-#ifdef FEATURE_WLAN_CCX
+#if defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     tANI_U8               *wpsIe = NULL;
 #endif
     tANI_U8               txFlag = 0;
@@ -2666,7 +2665,7 @@
     // for rsnie and fties. Instead we just add
     // the rsnie and fties at the end of the pack routine for 11r.
     // This should ideally! be fixed.
-#ifdef FEATURE_WLAN_CCX
+#if defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     //
     // The join request *should* contain zero or one of the WPA and RSN
     // IEs.  The payload send along with the request is a
@@ -2702,20 +2701,24 @@
                     &frm.WPAOpaque );
         }
 
+#ifdef FEATURE_WLAN_CCX
         if(psessionEntry->pLimReAssocReq->cckmIE.length)
         {
             PopulateDot11fCCXCckmOpaque( pMac, &( psessionEntry->pLimReAssocReq->cckmIE ),
                     &frm.CCXCckmOpaque );
         }
+#endif //FEATURE_WLAN_CCX
     }
 
+#ifdef FEATURE_WLAN_CCX
     // For CCX Associations fill the CCX IEs
     if (psessionEntry->isCCXconnection)
     {
         PopulateDot11fCCXRadMgmtCap(&frm.CCXRadMgmtCap);
         PopulateDot11fCCXVersion(&frm.CCXVersion);
     }
-#endif
+#endif //FEATURE_WLAN_CCX 
+#endif //FEATURE_WLAN_CCX || FEATURE_WLAN_LFR
 
     // include WME EDCA IE as well
     if ( fWmeEnabled )
@@ -2808,7 +2811,7 @@
     // Paranoia:
     palZeroMemory( pMac->hHdd, pFrame, nBytes + ft_ies_length);
 
-#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R_DEBUG || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE);
 #endif
     // Next, we fill out the buffer descriptor:
diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
index a77d8ff..15b8c80 100644
--- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
@@ -729,6 +729,11 @@
     if(0 == bssCount)
     {
        limPostSmeScanRspMessage(pMac, length, resultCode, smesessionId, smetranscationId);
+       if (NULL != pSirSmeScanRsp)
+       {
+           palFreeMemory( pMac->hHdd, pSirSmeScanRsp);
+           pSirSmeScanRsp = NULL;
+       }
     }
     else
     {
diff --git a/CORE/MAC/src/pe/lim/limSerDesUtils.c b/CORE/MAC/src/pe/lim/limSerDesUtils.c
index b663bea..ecec71f 100644
--- a/CORE/MAC/src/pe/lim/limSerDesUtils.c
+++ b/CORE/MAC/src/pe/lim/limSerDesUtils.c
@@ -1964,7 +1964,7 @@
         return eSIR_FAILURE;
 #endif
     
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
     //isFastTransitionEnabled;
     pJoinReq->isFastTransitionEnabled = (tAniBool)limGetU32(pBuf);
     pBuf += sizeof(tAniBool);
diff --git a/CORE/MAC/src/pe/lim/limSession.c b/CORE/MAC/src/pe/lim/limSession.c
index e3d665f..36dc4bf 100644
--- a/CORE/MAC/src/pe/lim/limSession.c
+++ b/CORE/MAC/src/pe/lim/limSession.c
@@ -144,7 +144,7 @@
             pMac->lim.gpSession[i].isCCXconnection = FALSE;
 #endif
 
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
             pMac->lim.gpSession[i].isFastTransitionEnabled = FALSE;
 #endif
             *sessionId = i;
diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c
index 976eb3a..ea634e9 100644
--- a/CORE/MAC/src/pe/lim/limUtils.c
+++ b/CORE/MAC/src/pe/lim/limUtils.c
@@ -4462,7 +4462,7 @@
                                 psessionEntry->gLimOverlapNonGfParams.protectionEnabled))
                     {
                         //Check if there is a need to change HT OP mode.
-                        if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == pMac->lim.gHTOperMode)
+                        if(eSIR_HT_OP_MODE_OVERLAP_LEGACY == psessionEntry->htOperMode)
                         {
                             limEnableHtRifsProtection(pMac, false, overlap, pBeaconParams,psessionEntry);
                             limEnableHtOBSSProtection(pMac,  false, overlap, pBeaconParams,psessionEntry);            
diff --git a/CORE/MAC/src/pe/lim/limUtils.h b/CORE/MAC/src/pe/lim/limUtils.h
index 548370a..1aa6355 100644
--- a/CORE/MAC/src/pe/lim/limUtils.h
+++ b/CORE/MAC/src/pe/lim/limUtils.h
@@ -96,7 +96,7 @@
 extern tSirRetStatus limSendSetMaxTxPowerReq ( tpAniSirGlobal pMac, 
                                   tPowerdBm txPower, 
                                   tpPESession pSessionEntry );
-extern tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower);
+extern tANI_U8 limGetMaxTxPower(tPowerdBm regMax, tPowerdBm apTxPower, tPowerdBm iniTxPower);
 #endif
 
 tANI_U32            limPostMsgApiNoWait(tpAniSirGlobal, tSirMsgQ *);
diff --git a/CORE/MAC/src/pe/pmm/pmmApi.c b/CORE/MAC/src/pe/pmm/pmmApi.c
index 6dcc86a..f98db2a 100644
--- a/CORE/MAC/src/pe/pmm/pmmApi.c
+++ b/CORE/MAC/src/pe/pmm/pmmApi.c
@@ -208,6 +208,7 @@
 
     tPmmState nextState = pMac->pmm.gPmmState;
     tSirResultCodes retStatus = eSIR_SME_SUCCESS;
+    tpPESession     psessionEntry;
 
     /* we need to process all the deferred messages enqueued since
      * the initiating the SIR_HAL_ENTER_BMPS_REQ.
@@ -265,6 +266,18 @@
     return;
 
 failure:
+    psessionEntry = peGetValidPowerSaveSession(pMac);
+    if(psessionEntry != NULL)
+    {
+       if (pMac->lim.gLimTimersCreated && pMac->lim.limTimers.gLimHeartBeatTimer.pMac)
+       {
+           if(VOS_TRUE != tx_timer_running(&pMac->lim.limTimers.gLimHeartBeatTimer))
+           {
+               PELOGE(pmmLog(pMac, LOGE, FL("Unexpected heartbeat timer not running"));)
+               limReactivateHeartBeatTimer(pMac, psessionEntry);
+           }
+       }
+    }
 
     //Generate an error response back to PMC
     pMac->pmm.gPmmState = nextState;
@@ -304,7 +317,7 @@
 
     if (NULL == pExitBmpsInfo)
     {
-        respStatus = eSIR_SME_BMPS_REQ_FAILED;
+        respStatus = eSIR_SME_BMPS_REQ_REJECT;
         PELOGW(pmmLog(pMac, LOGW, FL("pmmBmps: Rcvd EXIT_BMPS with NULL body\n"));)
         goto failure;
     }
@@ -342,7 +355,7 @@
         if(pmmSendChangePowerSaveMsg(pMac) !=  eSIR_SUCCESS)
         {
             /* Wakeup request failed */
-            respStatus = eSIR_SME_BMPS_REQ_FAILED;
+            respStatus = eSIR_SME_BMPS_REQ_REJECT;
             pmmBmpsUpdateHalReqFailureCnt(pMac);
             goto failure;
         }
@@ -405,7 +418,7 @@
 
     if((psessionEntry = peGetValidPowerSaveSession(pMac))== NULL)
     {
-        respStatus = eSIR_SME_BMPS_REQ_FAILED;
+        respStatus = eSIR_SME_BMPS_REQ_REJECT;
         goto failure;
     }
 #ifdef FEATURE_WLAN_DIAG_SUPPORT 
@@ -427,6 +440,20 @@
         goto failure;
     }
 
+    //If we are in a missed beacon scenario, we should not be attempting to enter BMPS as heartbeat probe is going on
+    if(pMac->pmm.inMissedBeaconScenario)
+    {
+       if (pMac->lim.gLimTimersCreated && pMac->lim.limTimers.gLimHeartBeatTimer.pMac)
+       {
+           if(VOS_TRUE != tx_timer_running(&pMac->lim.limTimers.gLimHeartBeatTimer))
+           {
+               PELOGE(pmmLog(pMac, LOGE, FL("Unexpected heartbeat timer not running"));)
+               limReactivateHeartBeatTimer(pMac, psessionEntry);
+           }
+       }
+       respStatus = eSIR_SME_BMPS_REQ_REJECT;
+       goto failure;
+    }
 
     /* At this point, device is associated and PMM is not in BMPS_SLEEP state. 
      * Heartbeat timer not running is an indication that PE have detected a
@@ -457,7 +484,7 @@
             FL("pmmBmps: Init Power Save Request Failed: Sending Response: %d\n"), 
             retStatus);)
 
-        respStatus = eSIR_SME_BMPS_REQ_FAILED;
+        respStatus = eSIR_SME_BMPS_REQ_REJECT;
         pmmBmpsUpdateHalReqFailureCnt(pMac);
         goto failure;
     }
@@ -603,7 +630,7 @@
     pBmpsParams->bRssiFilterEnable = bRssiFilterEnable;
 
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     // If there is a CCX assoc or 11r assoc we need to pick up the rssiFilterPeriod from the
     // FT config value.
     for(i =0; i < pMac->lim.maxBssId; i++)
diff --git a/CORE/MAC/src/pe/sch/schBeaconProcess.c b/CORE/MAC/src/pe/sch/schBeaconProcess.c
index 6d85c12..2a9a1e3 100644
--- a/CORE/MAC/src/pe/sch/schBeaconProcess.c
+++ b/CORE/MAC/src/pe/sch/schBeaconProcess.c
@@ -150,12 +150,15 @@
         }        
         // handling the case when HT AP has overlapping legacy BSS.
         else if(psessionEntry->htCapabality)
-        {
+        {             
             if (pBcnStruct->channelNumber == psessionEntry->currentOperChannel)
             {
-              if (pBcnStruct->erpPresent &&
-                    (pBcnStruct->erpIEInfo.useProtection ||
-                    pBcnStruct->erpIEInfo.nonErpPresent))
+              if (((!(pBcnStruct->erpPresent)) && 
+                    !(pBcnStruct->HTInfo.present))|| 
+                  //if erp not present then  11B AP overlapping
+                  (pBcnStruct->erpPresent &&
+                  (pBcnStruct->erpIEInfo.useProtection ||
+                  pBcnStruct->erpIEInfo.nonErpPresent)))
               {
 #ifdef FEATURE_WLAN_CCX
                   if( psessionEntry->isCCXconnection )
@@ -510,7 +513,7 @@
            {
               localConstraint = pBeacon->ccxTxPwr.power_limit;
               regMax = cfgGetRegulatoryMaxTransmitPower( pMac, psessionEntry->currentOperChannel ); 
-              maxTxPower = limGetMaxTxPower(regMax, localConstraint);
+              maxTxPower = limGetMaxTxPower(regMax, localConstraint, pMac->roam.configParam.nTxPowerCap);
 
               //If maxTxPower is increased or decreased
              if( maxTxPower != psessionEntry->maxTxPower )
diff --git a/CORE/SME/inc/csrApi.h b/CORE/SME/inc/csrApi.h
index 60d9da9..b2beaf7 100644
--- a/CORE/SME/inc/csrApi.h
+++ b/CORE/SME/inc/csrApi.h
@@ -410,6 +410,9 @@
     //this mean error happens before association_start or roaming_start is called.
     eCSR_ROAM_SESSION_OPENED,
     eCSR_ROAM_FT_REASSOC_FAILED,
+#ifdef FEATURE_WLAN_LFR
+    eCSR_ROAM_PMK_NOTIFY,
+#endif
 }eRoamCmdStatus;
 
 
@@ -949,8 +952,11 @@
 #ifdef FEATURE_WLAN_CCX
     tANI_U8   isCcxIniFeatureEnabled;
 #endif
+#ifdef FEATURE_WLAN_LFR
+    tANI_U8   isFastRoamIniFeatureEnabled;
+#endif
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     tANI_U8   isFastTransitionEnabled;
 #endif
 
diff --git a/CORE/SME/inc/csrInternal.h b/CORE/SME/inc/csrInternal.h
index 9fc423d..ac548bb 100644
--- a/CORE/SME/inc/csrInternal.h
+++ b/CORE/SME/inc/csrInternal.h
@@ -539,11 +539,15 @@
     tCsr11rConfig csr11rConfig;
 #endif
 
+#ifdef FEATURE_WLAN_LFR
+    tANI_U8   isFastRoamIniFeatureEnabled;
+#endif
+
 #ifdef FEATURE_WLAN_CCX
     tANI_U8   isCcxIniFeatureEnabled;
 #endif
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     tANI_U8   isFastTransitionEnabled;
 #endif
 
@@ -852,6 +856,9 @@
 #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING    
     tCsrNeighborRoamControlInfo neighborRoamInfo;
 #endif
+#ifdef FEATURE_WLAN_LFR
+    tANI_U8   isFastRoamIniFeatureEnabled;
+#endif
 #ifdef FEATURE_WLAN_CCX
     tANI_U8   isCcxIniFeatureEnabled;
 #endif
@@ -1174,4 +1181,10 @@
 tANI_BOOLEAN csrRoamIsCCXAssoc(tpAniSirGlobal pMac);
 #endif
 
+
 void csrDisconnectAllActiveSessions(tpAniSirGlobal pMac);
+#ifdef FEATURE_WLAN_LFR
+//Returns whether "Legacy Fast Roaming" is enabled...or not
+tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac);
+#endif
+
diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h
index b5f535b..0eef2b8 100644
--- a/CORE/SME/inc/csrNeighborRoam.h
+++ b/CORE/SME/inc/csrNeighborRoam.h
@@ -87,7 +87,7 @@
 #define CSR_NEIGHBOR_ROAM_REPORT_QUERY_TIMEOUT  1000    //in milliseconds
 #define CSR_NEIGHBOR_ROAM_PREAUTH_RSP_WAIT_MULTIPLIER   5     //in milliseconds
 #define MAX_NUM_PREAUTH_FAIL_LIST_ADDRESS       10 //Max number of MAC addresses with which the pre-auth was failed
-#define MAX_BSS_IN_NEIGHBOR_RPT                 4
+#define MAX_BSS_IN_NEIGHBOR_RPT                 15
 #define CSR_NEIGHBOR_ROAM_MAX_NUM_PREAUTH_RETRIES 3
 
 /* Black listed APs. List of MAC Addresses with which the Preauthentication was failed. */
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index c14d3f9..c3e6216 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -81,13 +81,16 @@
 #if defined WLAN_FEATURE_VOWIFI
    tRrmConfigParam  rrmConfig;
 #endif
+#if defined FEATURE_WLAN_LFR
+    tANI_U8   isFastRoamIniFeatureEnabled;
+#endif
 #if defined FEATURE_WLAN_CCX
     tANI_U8   isCcxIniFeatureEnabled;
 #endif
 #if defined WLAN_FEATURE_P2P_INTERNAL
    tP2PConfigParam  p2pConfig;
 #endif
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     tANI_U8   isFastTransitionEnabled;
 #endif
 } tSmeConfigParams, *tpSmeConfigParams;
@@ -1630,11 +1633,11 @@
    \fn sme_GetOperationChannel
    \brief API to get current channel on which STA is parked
    this function gives channel information only of infra station or IBSS station.
-   \param hHal and poiter to memory location 
+   \param hHal, pointer to memory location and sessionId 
    \returns eHAL_STATUS_SUCCESS
             eHAL_STATUS_FAILURE
 -------------------------------------------------------------------------------*/
-eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel);
+eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId);
 
 #ifdef WLAN_FEATURE_P2P
 /* ---------------------------------------------------------------------------
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index e1c81a0..22f9721 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -1217,10 +1217,14 @@
         smsLog( pMac, LOG1, "IsFTResourceReqSupp = %d\n", pMac->roam.configParam.csr11rConfig.IsFTResourceReqSupported); 
 #endif
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         pMac->roam.configParam.isFastTransitionEnabled = pParam->isFastTransitionEnabled;
 #endif
 
+#ifdef FEATURE_WLAN_LFR 
+        pMac->roam.configParam.isFastRoamIniFeatureEnabled = pParam->isFastRoamIniFeatureEnabled;
+#endif
+
 #ifdef FEATURE_WLAN_CCX 
         pMac->roam.configParam.isCcxIniFeatureEnabled = pParam->isCcxIniFeatureEnabled;
 #endif
@@ -4355,6 +4359,14 @@
 }
 #endif
 
+#ifdef FEATURE_WLAN_LFR
+//Returns whether "Legacy Fast Roaming" is currently enabled...or not
+tANI_BOOLEAN csrRoamIsFastRoamEnabled(tpAniSirGlobal pMac)
+{
+    return pMac->roam.configParam.isFastRoamIniFeatureEnabled;
+}
+#endif
+
 //Return true means the command can be release, else not
 static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pCommand,
                                        eCsrRoamCompleteResult Result, void *Context )
@@ -6174,7 +6186,15 @@
     }
 #endif
 #ifdef FEATURE_WLAN_CCX
-    if ((csrIsProfileCCX(pProfile) || ((pIesTemp->CCXVersion.present) && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)))) && (!(csrIsProfile11r( pProfile ))) && (pMac->roam.configParam.isCcxIniFeatureEnabled))
+    if ((csrIsProfileCCX(pProfile) || 
+         ((pIesTemp->CCXVersion.present) 
+          && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) 
+              || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA) 
+              || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA_PSK) 
+              || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN) 
+              || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN_PSK)))) 
+        && (!(csrIsProfile11r( pProfile ))) 
+        && (pMac->roam.configParam.isCcxIniFeatureEnabled))
     {
         pConnectProfile->isCCXAssoc = 1;
     }
@@ -6692,6 +6712,15 @@
                         }
                         else
 #endif
+#ifdef FEATURE_WLAN_LFR
+                        if (csrRoamIsHandoffInProgress(pMac) && 
+                                                csrRoamIsFastRoamEnabled(pMac))
+                        {
+                            // Now serialize the reassoc command.
+                            status = csrRoamIssueReassociateCmd(pMac, sessionId);
+                        }
+                        else
+#endif
                         // else we are not connected and attempting to Join.  Issue the
                         // Join request.
                         {
@@ -8089,6 +8118,12 @@
                     csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
                 }
 #endif
+#ifdef FEATURE_WLAN_LFR
+                if (csrRoamIsFastRoamEnabled(pMac) && (csrNeighborRoamStatePreauthDone(pMac)))
+                {
+                    csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
+                }
+#endif
                 pSession = CSR_GET_SESSION( pMac, sessionId );
 
                 if ( csrIsConnStateInfra( pMac, sessionId ) )
@@ -8143,6 +8178,12 @@
                     csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
                 }
 #endif
+#ifdef FEATURE_WLAN_LFR
+                if (csrRoamIsFastRoamEnabled(pMac) && (csrNeighborRoamStatePreauthDone(pMac)))
+                {
+                    csrNeighborRoamTranistionPreauthDoneToDisconnected(pMac);
+                }
+#endif
                 pSession = CSR_GET_SESSION( pMac, sessionId );
 
                 if ( csrIsConnStateInfra( pMac, sessionId ) )
@@ -11202,7 +11243,15 @@
          * If we are associating explictly 11R only then we will get
          * 11R.
          */
-        if ((csrIsProfileCCX(pProfile) || ((pIes->CCXVersion.present) && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)))) && (!(csrIsProfile11r( pProfile ))) && (pMac->roam.configParam.isCcxIniFeatureEnabled))
+        if ((csrIsProfileCCX(pProfile) || 
+             ((pIes->CCXVersion.present) 
+              && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) 
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA) 
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA_PSK) 
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN) 
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN_PSK)))) 
+            && (!(csrIsProfile11r( pProfile ))) 
+            && (pMac->roam.configParam.isCcxIniFeatureEnabled))
         {
             // isCCXconnection;
             dwTmp = pal_cpu_to_be32(TRUE); 
@@ -11226,9 +11275,13 @@
         }
 #endif
 
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
         // Fill in isFastTransitionEnabled
-        if (pMac->roam.configParam.isFastTransitionEnabled)
+        if (pMac->roam.configParam.isFastTransitionEnabled
+#ifdef FEATURE_WLAN_LFR
+        || csrRoamIsFastRoamEnabled(pMac)
+#endif
+        )
         {
             dwTmp = pal_cpu_to_be32(TRUE); 
             palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
@@ -11582,14 +11635,31 @@
 #ifdef FEATURE_WLAN_CCX
         //isCCXconnection;
         //CCKM profile, ccxversion ie present, not 11r and ini file has CCX enabled
-        dwTmp = ((csrIsProfileCCX(pProfile) || ((pIes->CCXVersion.present) && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)))) && (!(csrIsProfile11r( pProfile ))) && (pMac->roam.configParam.isCcxIniFeatureEnabled)) ? pal_cpu_to_be32(TRUE) : 0;
+        dwTmp = ( ((csrIsProfileCCX(pProfile) || 
+                  ((pIes->CCXVersion.present) 
+                   && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) 
+                       || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)
+                       || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA_PSK)
+                       || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN)
+                       || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN_PSK)))) 
+                 && (!(csrIsProfile11r( pProfile ))) 
+                 && (pMac->roam.configParam.isCcxIniFeatureEnabled)) 
+                ? pal_cpu_to_be32(TRUE) : 0);
         palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
         pBuf += sizeof(tAniBool);        
 #endif // FEATURE_WLAN_CCX
 #endif // WLAN_FEATURE_VOWIFI_11R
 
 #ifdef FEATURE_WLAN_CCX
-        if ((csrIsProfileCCX(pProfile) || ((pIes->CCXVersion.present) && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)))) && (!(csrIsProfile11r( pProfile ))) && (pMac->roam.configParam.isCcxIniFeatureEnabled))
+        if ((csrIsProfileCCX(pProfile) || 
+             ((pIes->CCXVersion.present) 
+              && ((pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_OPEN_SYSTEM) 
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA)
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_WPA_PSK)
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN)
+                  || (pProfile->negotiatedAuthType == eCSR_AUTH_TYPE_RSN_PSK)))) 
+            && (!(csrIsProfile11r( pProfile ))) 
+            && (pMac->roam.configParam.isCcxIniFeatureEnabled))
         {
            tCCXTspecInfo ccxTspec;
 
@@ -11618,9 +11688,13 @@
         }
 #endif // FEATURE_WLAN_CCX
 
-#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX
+#if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR)
         // Fill in isFastTransitionEnabled
-        if (pMac->roam.configParam.isFastTransitionEnabled)
+        if (pMac->roam.configParam.isFastTransitionEnabled
+#ifdef FEATURE_WLAN_LFR
+         || csrRoamIsFastRoamEnabled(pMac)
+#endif
+         )
         {
             dwTmp = pal_cpu_to_be32(TRUE); 
             palCopyMemory( pMac->hHdd, pBuf, &dwTmp, sizeof(tAniBool) );
@@ -14952,6 +15026,9 @@
 {
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     eHalStatus  status = eHAL_STATUS_SUCCESS;
+#ifdef FEATURE_WLAN_LFR
+    tCsrRoamInfo roamInfo;
+#endif
 
 #if defined WLAN_FEATURE_VOWIFI_11R_DEBUG
     smsLog( pMac, LOGE, FL("Preauth response status code %d"), pFTPreAuthRsp->status); 
@@ -14990,7 +15067,18 @@
                         eCSR_ROAM_FT_RESPONSE, eCSR_ROAM_RESULT_NONE);
 
     // Currently we dont do anything special for CCX connection.
-    
+
+#ifdef FEATURE_WLAN_LFR
+    // If Legacy Fast Roaming is enabled, signal the supplicant  
+    // So he can send us a PMK-ID for this candidate AP.
+    if (csrRoamIsFastRoamEnabled(pMac))
+    {
+        // Save the bssid from the received response 
+        palCopyMemory(pMac->hHdd, (void *)&roamInfo.bssid, (void *)pFTPreAuthRsp->preAuthbssId, sizeof(tCsrBssid));
+        csrRoamCallCallback(pMac, pFTPreAuthRsp->smeSessionId, &roamInfo, 0, eCSR_ROAM_PMK_NOTIFY, 0);
+    }
+
+#endif
 
     // Done with it, init it.
     pMac->ft.ftSmeContext.psavedFTPreAuthRsp = NULL;
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 3241cb4..3e4c472 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -117,6 +117,7 @@
 eHalStatus csrSetBGScanChannelList( tpAniSirGlobal pMac, tANI_U8 *pAdjustChannels, tANI_U8 NumAdjustChannels);
 void csrReleaseCmdSingle(tpAniSirGlobal pMac, tSmeCmd *pCommand);
 tANI_BOOLEAN csrRoamIsValidChannel( tpAniSirGlobal pMac, tANI_U8 channel );
+void csrPruneChannelListForMode( tpAniSirGlobal pMac, tCsrChannel *pChannelList );
 
 //pResult is invalid calling this function.
 void csrFreeScanResultEntry( tpAniSirGlobal pMac, tCsrScanResult *pResult )
@@ -2703,6 +2704,10 @@
         {
             pMac->scan.curScanType = eSIR_PASSIVE_SCAN;
         }
+
+        csrPruneChannelListForMode(pMac, &pMac->scan.baseChannels);
+        csrPruneChannelListForMode(pMac, &pMac->scan.base20MHzChannels);
+
         csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_FALSE);
         csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE);
         // ... and apply the channel list, power settings, and the country code.
@@ -5369,8 +5374,11 @@
     eHalStatus status = eHAL_STATUS_CSR_WRONG_STATE;
 
     //Do not trigger IMPS in case of concurrency
-    if (vos_concurrent_sessions_running())
+    if (vos_concurrent_sessions_running() && csrIsAnySessionInConnectState(pMac))
+    {
+        smsLog( pMac, LOGW, FL("Cannot request IMPS because Concurrent Sessions Running\n") );
         return (status);
+    }
 
     if(pTimeInterval)
     {
diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c
index 9ae1066..bc79a22 100644
--- a/CORE/SME/src/csr/csrNeighborRoam.c
+++ b/CORE/SME/src/csr/csrNeighborRoam.c
@@ -304,6 +304,21 @@
     }
     else
 #endif
+#ifdef FEATURE_WLAN_LFR
+    if (csrRoamIsFastRoamEnabled(pMac))
+    {
+        if (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState)
+        {
+            csrNeighborRoamIssuePreauthReq(pMac);
+        }
+        else
+        {
+            smsLog(pMac, LOGE, FL("LFR Reassoc indication received in unexpected state %d"), pNeighborRoamInfo->neighborRoamState);
+            VOS_ASSERT(0);
+        }
+    }
+    else
+#endif
     {
         if (eCSR_NEIGHBOR_ROAM_STATE_CFG_CHAN_LIST_SCAN == pNeighborRoamInfo->neighborRoamState)
         {
@@ -405,7 +420,7 @@
     vos_mem_set(pNeighborRoamInfo->currAPbssid, sizeof(tCsrBssid), 0);
     pNeighborRoamInfo->neighborScanTimerInfo.pMac = pMac;
     pNeighborRoamInfo->neighborScanTimerInfo.sessionId = CSR_SESSION_ID_INVALID;
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     pNeighborRoamInfo->is11rAssoc = eANI_BOOLEAN_FALSE;
     pNeighborRoamInfo->FTRoamInfo.preAuthRspWaitTimerInfo.pMac = pMac;
     pNeighborRoamInfo->FTRoamInfo.preAuthRspWaitTimerInfo.sessionId = CSR_SESSION_ID_INVALID;
@@ -887,21 +902,23 @@
                         pScanResult->BssDescriptor.bssId[4],
                         pScanResult->BssDescriptor.bssId[5]);
 
-        if (VOS_TRUE == vos_mem_compare(pScanResult->BssDescriptor.bssId, 
+       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
             continue;
         }
 
-        if (abs(pNeighborRoamInfo->cfgParams.neighborReassocThreshold) < abs(pScanResult->BssDescriptor.rssi))
-        {
+#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;
-        }        
+                 "%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
 
 #ifdef WLAN_FEATURE_VOWIFI_11R
         if (pNeighborRoamInfo->is11rAssoc)
@@ -962,6 +979,19 @@
         }
 #endif /* FEATURE_WLAN_CCX */
 
+#ifdef FEATURE_WLAN_LFR
+        // If we are supporting legacy roaming, and 
+        // if the candidate is on the "pre-auth failed" list, ignore it. 
+        if (csrRoamIsFastRoamEnabled(pMac))
+        {
+            if (!csrNeighborRoamIsPreauthCandidate(pMac, pScanResult->BssDescriptor.bssId))
+            {
+                smsLog(pMac, LOGE, FL("BSSID present in pre-auth fail list.. Ignoring"));
+                continue;
+            }
+        }
+#endif /* FEATURE_WLAN_LFR */
+
         /* If the received timestamp in BSS description is earlier than the scan request timestamp, skip 
          * this result */
         if (pNeighborRoamInfo->scanRequestTimeStamp >= pScanResult->BssDescriptor.nReceivedTime)
@@ -1126,7 +1156,7 @@
         NEIGHBOR_ROAM_DEBUG(pMac, LOGW, FL("Channel list scan completed. Current chan index = %d"), currentChanIndex);
         VOS_ASSERT(pNeighborRoamInfo->roamChannelInfo.currentChanIndex == 0);
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
         /* If the state is REPORT_SCAN, then this must be the scan after the REPORT_QUERY state. So, we 
            should use the BSSID filter made out of neighbor reports */
         if (eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN == pNeighborRoamInfo->neighborRoamState)
@@ -1181,6 +1211,16 @@
                     }
                     else
 #endif
+#ifdef FEATURE_WLAN_LFR
+                    /* If LFR is enabled, then we can register the reassoc callback here as we have some 
+                                        APs in the roamable AP list */
+                    if (csrRoamIsFastRoamEnabled(pMac))
+                    {
+                        /* Valid APs are found after scan. Now we can initiate pre-authentication */
+                        CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN)
+                    }
+                    else
+#endif
                     {
                        
                         NEIGHBOR_ROAM_DEBUG(pMac, LOGE, FL("Completed scanning of CFG CHAN LIST in non-11r association. Registering reassoc callback"));
@@ -1837,10 +1877,10 @@
     int numOfChannels = 0;
     tANI_U8   channelList[MAX_BSS_IN_NEIGHBOR_RPT];
 
-    if (
+    if ( 
 #ifdef FEATURE_WLAN_CCX
         ((pNeighborRoamInfo->isCCXAssoc) && 
-        (pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived == eANI_BOOLEAN_FALSE)) ||
+                    (pNeighborRoamInfo->roamChannelInfo.IAPPNeighborListReceived == eANI_BOOLEAN_FALSE)) ||
         (pNeighborRoamInfo->isCCXAssoc == eANI_BOOLEAN_FALSE) || 
 #endif // CCX
         pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo.numOfChannels == 0)
@@ -2260,7 +2300,7 @@
 {
     tpCsrNeighborRoamControlInfo    pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
     eHalStatus  status = eHAL_STATUS_SUCCESS;
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
     int  init_ft_flag = FALSE;
 #endif
 
@@ -2289,7 +2329,7 @@
             pNeighborRoamInfo->neighborScanTimerInfo.pMac = pMac;
             pNeighborRoamInfo->neighborScanTimerInfo.sessionId = sessionId;
             
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
             /* Now we can clear the preauthDone that was saved as we are connected afresh */
             csrNeighborRoamFreeRoamableBSSList(pMac, &pMac->roam.neighborRoamInfo.FTRoamInfo.preAuthDoneList);
 #endif
@@ -2323,7 +2363,15 @@
                             
 #endif
 
-#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX)
+#ifdef FEATURE_WLAN_LFR
+            // If "Legacy Fast Roaming" is enabled 
+            if (csrRoamIsFastRoamEnabled(pMac))
+            {
+                init_ft_flag = TRUE;
+            }
+#endif
+
+#if  defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
             if ( init_ft_flag == TRUE )
             {
                 /* Initialize all the data structures needed for the 11r FT Preauth */
@@ -2791,6 +2839,15 @@
     }
     else
 #endif
+#ifdef FEATURE_WLAN_LFR
+    if (csrRoamIsFastRoamEnabled(pMac))
+    {
+        /* Always the BSS info in the head is the handoff candidate */
+        pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->FTRoamInfo.preAuthDoneList, NULL);
+        NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Number of Handoff candidates = %d"), csrLLCount(&pNeighborRoamInfo->FTRoamInfo.preAuthDoneList));
+    }
+    else
+#endif
     {
         pBssNode = csrNeighborRoamGetRoamableAPListNextEntry(pMac, &pNeighborRoamInfo->roamableAPList, NULL);
         NEIGHBOR_ROAM_DEBUG(pMac, LOG1, FL("Number of Handoff candidates = %d"), csrLLCount(&pNeighborRoamInfo->roamableAPList));
diff --git a/CORE/SME/src/csr/csrUtil.c b/CORE/SME/src/csr/csrUtil.c
index 5910069..8c1a3cf 100644
--- a/CORE/SME/src/csr/csrUtil.c
+++ b/CORE/SME/src/csr/csrUtil.c
@@ -3124,6 +3124,8 @@
     tANI_U8 PMKId[CSR_RSN_PMKID_SIZE];
     tDot11fBeaconIEs *pIesLocal = pIes;
 
+    smsLog(pMac, LOGW, "%s called...", __FUNCTION__);
+
     do
     {
         if ( !csrIsProfileRSN( pProfile ) ) break;
@@ -3808,8 +3810,18 @@
     do
     {
         if ( !csrIsProfileRSN( pProfile ) ) break;
+#ifdef FEATURE_WLAN_LFR
+        if (csrRoamIsFastRoamEnabled(pMac))
+        {
+            // If "Legacy Fast Roaming" is enabled ALWAYS rebuild the RSN IE from 
+            // scratch. So it contains the current PMK-IDs
+            cbRsnIe = csrConstructRSNIe(pMac, sessionId, pProfile, pSirBssDesc, pIes, pRsnIe);
+        }
+        else 
+#endif
         if(pProfile->nRSNReqIELength && pProfile->pRSNReqIE)
         {
+            // If you have one started away, re-use it. 
             if(SIR_MAC_WPA_IE_MAX_LENGTH >= pProfile->nRSNReqIELength)
             {
                 cbRsnIe = (tANI_U8)pProfile->nRSNReqIELength;
diff --git a/CORE/SME/src/rrm/sme_rrm.c b/CORE/SME/src/rrm/sme_rrm.c
index 3ce9c0f..7e9d91c 100644
--- a/CORE/SME/src/rrm/sme_rrm.c
+++ b/CORE/SME/src/rrm/sme_rrm.c
@@ -1134,20 +1134,38 @@
    {
       vosStatus = vos_timer_stop( &pSmeRrmContext->IterMeasTimer );
       if(!VOS_IS_STATUS_SUCCESS(vosStatus))
-      { 
+      {
          VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("Timer stop fail") );
       }
-   } 
+   }
 
-   vosStatus = vos_timer_destroy( &pSmeRrmContext->IterMeasTimer ); 
-   if (!VOS_IS_STATUS_SUCCESS(vosStatus)) {
+   vosStatus = vos_timer_destroy( &pSmeRrmContext->IterMeasTimer );
+   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
+   {
 
        VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, FL("Fail to destroy timer") );
 
    }
 
+   if( VOS_TIMER_STATE_RUNNING ==
+          vos_timer_getCurrentState( &pSmeRrmContext->neighborReqControlInfo.neighborRspWaitTimer ) )
+   {
+      vosStatus = vos_timer_stop( &pSmeRrmContext->neighborReqControlInfo.neighborRspWaitTimer );
+      if(!VOS_IS_STATUS_SUCCESS(vosStatus))
+      {
+         VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, FL("Timer stop fail") );
+      }
+   }
+
+   vosStatus = vos_timer_destroy( &pSmeRrmContext->neighborReqControlInfo.neighborRspWaitTimer );
+   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
+   {
+       VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, FL("Fail to destroy timer") );
+
+   }
+
    rrmLLPurgeNeighborCache(pMac, &pSmeRrmContext->neighborReportCache);
-      
+
    csrLLClose(&pSmeRrmContext->neighborReportCache);
 
    return vosStatus;
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 642e8f0..0fca4d3 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -5073,29 +5073,28 @@
         \fn sme_GetOperationChannel
         \brief API to get current channel on which STA is parked
         this function gives channel information only of infra station or IBSS station
-        \param hHal and poiter to memory location
+        \param hHal, pointer to memory location and sessionId
         \returns eHAL_STATUS_SUCCESS
                 eHAL_STATUS_FAILURE
 -------------------------------------------------------------------------------*/
-eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel)
+eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId)
 {
-    tANI_U32 sessionId;
     tpAniSirGlobal pMac = PMAC_STRUCT( hHal );
     tCsrRoamSession *pSession;
 
-    for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX ; sessionId++)
+    if (CSR_IS_SESSION_VALID( pMac, sessionId ))
     {
-       if (CSR_IS_SESSION_VALID( pMac, sessionId ))
-       {
-          pSession = CSR_GET_SESSION( pMac, sessionId );
+       pSession = CSR_GET_SESSION( pMac, sessionId );
 
-          if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || 
-             ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) ||
-             ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS ))
-          {
-              *pChannel =pSession->connectedProfile.operationChannel;
-              return eHAL_STATUS_SUCCESS;
-          }
+       if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || 
+          ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) ||
+#ifdef WLAN_SOFTAP_FEATURE	  
+          ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRA_AP ) ||
+#endif
+          ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS ))
+       {
+           *pChannel =pSession->connectedProfile.operationChannel;
+           return eHAL_STATUS_SUCCESS;
        }
     }
     return eHAL_STATUS_FAILURE;
diff --git a/CORE/TL/src/wlan_qct_tl.c b/CORE/TL/src/wlan_qct_tl.c
index 1295f80..7b883a1 100644
--- a/CORE/TL/src/wlan_qct_tl.c
+++ b/CORE/TL/src/wlan_qct_tl.c
@@ -6726,11 +6726,9 @@
     else //could not extract EtherType - this should not happen
     {
       TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR,
-                 "WLAN TL:Could not extract EtherType -dropping frame"));
-      /* Drop packet */
-      vos_pkt_return_packet(vosDataBuff); 
+                 "WLAN TL:Could not extract EtherType"));
+      //Packet is already freed
       return vosStatus; //returning failure
-        
     }
   }
 #endif /* FEATURE_WLAN_WAPI */
@@ -6756,7 +6754,7 @@
                          ucMPDUHLen, usMPDULen );
     if(NULL == vosDataBuff)
     {
-       //Packet is alrady freed
+       //Packet is already freed
        return VOS_STATUS_SUCCESS;
     }
   }
diff --git a/CORE/WDA/src/wlan_qct_wda.c b/CORE/WDA/src/wlan_qct_wda.c
index b448680..02fab02 100644
--- a/CORE/WDA/src/wlan_qct_wda.c
+++ b/CORE/WDA/src/wlan_qct_wda.c
@@ -141,9 +141,9 @@
 #define WDA_TX_COMPLETE_TIME_OUT_VALUE 1000
   
 
-#define WDA_MAX_RETRIES_TILL_RING_EMPTY  100   /* MAX 1000msec wait */
+#define WDA_MAX_RETRIES_TILL_RING_EMPTY  1000   /* MAX 10000 msec = 10 seconds wait */
 
-#define WDA_WAIT_MSEC_TILL_RING_EMPTY    100    /* 100 msec wait per cycle */
+#define WDA_WAIT_MSEC_TILL_RING_EMPTY    10    /* 10 msec wait per cycle */
 /* extern declarations */
 extern void vos_WDAComplete_cback(v_PVOID_t pVosContext);
 
@@ -10033,7 +10033,7 @@
          wpt_uint8  staIdx;
          wpt_uint8  bssIdx = ((tDeleteBssParams *)pMsg->bodyptr)->bssIdx;
          wpt_uint8  reservedResourceBySta;
-         wpt_uint8  waitLoop = 0;
+         wpt_uint16  waitLoop = 0;
 
          if (WDI_DS_GetStaIdxFromBssIdx(pWDA->pWdiContext, bssIdx, &staIdx))
          {
@@ -10072,7 +10072,7 @@
       {
          tDeleteStaParams *delSta = (tDeleteStaParams *)pMsg->bodyptr;
          wpt_uint8 reservedResourceBySta;
-         wpt_uint8  waitLoop = 0;
+         wpt_uint16  waitLoop = 0;
 
          while (1) 
          {
diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini
index 100ec5d..f2910ec 100644
--- a/firmware_bin/WCNSS_qcom_cfg.ini
+++ b/firmware_bin/WCNSS_qcom_cfg.ini
@@ -109,6 +109,11 @@
 gNeighborScanChannelMaxTime=30
 gMaxNeighborReqTries=3
 
+# Legacy (non-CCX, non-802.11r) Fast Roaming Support
+# To enable, set FastRoamEnabled=1, gEnableFWRssiMonitoring=1, FastTransitionEnabled=1
+# To disable, set FastRoamEnabled=0, gEnableFWRssiMonitoring=0, FastTransitionEnabled=0
+FastRoamEnabled=0
+
 # SAP Country code
 # Default Country Code is 2 bytes, 3rd byte is optional indoor or out door.
 # Example