Merge "wlan: Fix for VOS_ASSERT in Handling of Action frame"
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 245e63d..b84d4e3 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -136,6 +136,7 @@
 #define CRDA_WAIT_TIME 300
 #endif
 
+#define WAIT_TIME_FW_LOGS 2000
 /* Scan Req Timeout */
 #define WLAN_WAIT_TIME_SCAN_REQ 100
 
@@ -1263,7 +1264,6 @@
 #else
    struct completion driver_crda_req;
 #endif
-
    /* Completion variable to indicate updation of channel */
    struct completion wiphy_channel_update_event;
 
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 006791f..5f90428 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -1915,11 +1915,6 @@
         return -EINVAL;
     }
 
-    pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_VO] = 0;
-    pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_VI] = 0;
-    pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_BE] = 0;
-    pAdapter->hdd_stats.hddTxRxStats.txMcast[WLANTL_AC_BK] = 0;
-
     if (eHAL_STATUS_SUCCESS != sme_LLStatsSetReq( pHddCtx->hHal,
                                             &linkLayerStatsSetReq))
     {
diff --git a/CORE/HDD/src/wlan_hdd_ftm.c b/CORE/HDD/src/wlan_hdd_ftm.c
index d7d2914..9174bbf 100644
--- a/CORE/HDD/src/wlan_hdd_ftm.c
+++ b/CORE/HDD/src/wlan_hdd_ftm.c
@@ -627,6 +627,15 @@
       goto err_probe_event;
    }
 
+   if(vos_event_init(&(gpVosContext->fwLogsComplete)) != VOS_STATUS_SUCCESS )
+   {
+      VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+                "%s: Unable to init fwLogsComplete",__func__);
+      VOS_ASSERT(0);
+
+      goto err_wda_complete_event;
+   }
+
    /* Initialize the free message queue */
    vStatus = vos_mq_init(&gpVosContext->freeVosMq);
    if (! VOS_IS_STATUS_SUCCESS(vStatus))
@@ -636,7 +645,7 @@
                 "%s: Failed to initialize VOS free message queue %d",
                  __func__, vStatus);
       VOS_ASSERT(0);
-      goto err_wda_complete_event;
+      goto err_fw_logs_complete_event;
    }
 
    for (iter = 0; iter < VOS_CORE_MAX_MESSAGES; iter++)
@@ -758,6 +767,9 @@
 err_msg_queue:
    vos_mq_deinit(&gpVosContext->freeVosMq);
 
+err_fw_logs_complete_event:
+   vos_event_destroy(&gpVosContext->fwLogsComplete);
+
 err_wda_complete_event:
    vos_event_destroy(&gpVosContext->wdaCompleteEvent);
 
@@ -848,6 +860,14 @@
      VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
   }
 
+  vosStatus = vos_event_destroy(&gpVosContext->fwLogsComplete);
+  if (!VOS_IS_STATUS_SUCCESS(vosStatus))
+  {
+     VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+         "%s: Failed to destroy fwLogsComplete %d", __func__, vosStatus);
+     VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
+  }
+
   return VOS_STATUS_SUCCESS;
 }
 
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c
index 39593d8..322e4e1 100644
--- a/CORE/HDD/src/wlan_hdd_p2p.c
+++ b/CORE/HDD/src/wlan_hdd_p2p.c
@@ -402,12 +402,14 @@
     hdd_adapter_t *pAdapter = (hdd_adapter_t *)data;
     hdd_remain_on_chan_ctx_t *pRemainChanCtx;
     hdd_cfg80211_state_t *cfgState;
+    hdd_context_t *pHddCtx;
 
     if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic))
     {
         hddLog( LOGE, FL("pAdapter is invalid %p !!!"), pAdapter);
         return;
     }
+    pHddCtx = WLAN_HDD_GET_CTX( pAdapter );
     cfgState = WLAN_HDD_GET_CFG_STATE_PTR( pAdapter );
     pRemainChanCtx = cfgState->remain_on_chan_ctx;
     if (NULL == pRemainChanCtx)
@@ -415,13 +417,16 @@
         hddLog( LOGE, FL("No Remain on channel is pending"));
         return;
     }
+    mutex_lock(&pHddCtx->roc_lock);
     if ( TRUE == pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress )
     {
+        mutex_unlock(&pHddCtx->roc_lock);
         hddLog( LOGE, FL("Cancellation already in progress"));
         return;
     }
 
     pRemainChanCtx->hdd_remain_on_chan_cancel_in_progress = TRUE;
+    mutex_unlock(&pHddCtx->roc_lock);
     INIT_COMPLETION(pAdapter->cancel_rem_on_chan_var);
     hddLog( LOG1,"%s: Cancel Remain on Channel on timeout", __func__);
     if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) ||
diff --git a/CORE/HDD/src/wlan_hdd_trace.c b/CORE/HDD/src/wlan_hdd_trace.c
index fb109f6..766431e 100644
--- a/CORE/HDD/src/wlan_hdd_trace.c
+++ b/CORE/HDD/src/wlan_hdd_trace.c
@@ -77,6 +77,12 @@
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SCAN);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SCHED_SCAN_START);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SCHED_SCAN_STOP);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_CHANNEL);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_ADD_BEACON);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_BEACON);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_CHANGE_IFACE);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CHANGE_STATION);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_UPDATE_BSS);
            CASE_RETURN_STRING(TRACE_CODE_HDD_REMAIN_ON_CHANNEL);
            CASE_RETURN_STRING(TRACE_CODE_HDD_REMAINCHANREADYHANDLER);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_CANCEL_REMAIN_ON_CHANNEL);
@@ -90,6 +96,8 @@
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_DEL_PMKSA);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_TDLS_MGMT);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_TDLS_OPER);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_REKEY_DATA);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_RESUME_WLAN);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SUSPEND_WLAN);
            CASE_RETURN_STRING(TRACE_CODE_HDD_CFG80211_SET_MAC_ACL);
@@ -98,6 +106,9 @@
            CASE_RETURN_STRING(TRACE_CODE_HDD_UNSUPPORTED_IOCTL);
            CASE_RETURN_STRING(TRACE_CODE_HDD_SETROAMSCANCHANNELMINTIME_IOCTL);
            CASE_RETURN_STRING(TRACE_CODE_HDD_GETROAMSCANCHANNELMINTIME_IOCTL);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_STOP_NETDEV);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_WAKE_NETDEV);
+           CASE_RETURN_STRING(TRACE_CODE_HDD_FLUSH_TX_QUEUES);
            default:
                return ("UNKNOWN");
                break;
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index adcdae0..f28dc8e 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -240,6 +240,7 @@
 #define WE_STOP_OBSS_SCAN    11
 #define WE_DUMP_ROAM_TIMER_LOG     12
 #define WE_RESET_ROAM_TIMER_LOG    13
+#define WE_GET_FW_LOGS             14
 
 /* Private ioctls and their sub-ioctls */
 #define WLAN_PRIV_SET_VAR_INT_GET_NONE   (SIOCIWFIRSTPRIV + 7)
@@ -982,6 +983,7 @@
    return VOS_STATUS_SUCCESS;
 }
 
+
 VOS_STATUS wlan_hdd_get_snr(hdd_adapter_t *pAdapter, v_S7_t *snr)
 {
    struct statsContext context;
@@ -7002,6 +7004,14 @@
             vos_reset_roam_timer_log();
             break;
         }
+        case WE_GET_FW_LOGS:
+        {
+            vos_fatal_event_logs_req(WLAN_LOG_TYPE_NON_FATAL,
+                     WLAN_LOG_INDICATOR_IOCTL,
+                     WLAN_LOG_REASON_CODE_UNUSED,
+                     TRUE);
+            break;
+        }
         default:
         {
             hddLog(LOGE, "%s: unknown ioctl %d", __func__, sub_cmd);
@@ -10434,12 +10444,19 @@
         0,
         0,
         "resetRoamDelay" },
+    {
+        WE_GET_FW_LOGS,
+        0,
+        0,
+        "getFwLogs" },
     /* handlers for main ioctl */
     {   WLAN_PRIV_SET_VAR_INT_GET_NONE,
         IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
         0,
         "" },
 
+
+
     /* handlers for sub-ioctl */
     {   WE_LOG_DUMP_CMD,
         IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h
index 4b14650..cc57479 100644
--- a/CORE/MAC/inc/sirApi.h
+++ b/CORE/MAC/inc/sirApi.h
@@ -3745,6 +3745,11 @@
     void                   *fwlogInitCbContext;
 }tSirFWLoggingInitParam,*tpSirFWLoggingInitParam;
 
+typedef struct sSirFatalEventLogsReqParam
+{
+    tANI_U32 reason_code;
+}tSirFatalEventLogsReqParam, *tpSirFatalEventLogsReqParam;
+
 #ifdef FEATURE_WLAN_SCAN_PNO
 //
 // PNO Messages
diff --git a/CORE/MAC/inc/wniApi.h b/CORE/MAC/inc/wniApi.h
index f76249c..340196e 100644
--- a/CORE/MAC/inc/wniApi.h
+++ b/CORE/MAC/inc/wniApi.h
@@ -94,8 +94,7 @@
 #define AGN1223AR_02      8
 #define AGN_EEP_PRODUCT_ID_MAX   8
 
-
-
+#define SIR_SME_MODULE_ID 0x16
 
 /// Start of Sirius/Host message types
 #define WNI_HOST_MSG_START             0x1500
diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h
index 2fa32dd..fd5fadc 100644
--- a/CORE/MAC/src/include/sirParams.h
+++ b/CORE/MAC/src/include/sirParams.h
@@ -625,7 +625,6 @@
 #define SIR_HAL_DHCP_STOP_IND              (SIR_HAL_ITC_MSG_TYPES_BEGIN + 205)
 #define SIR_HAL_IBSS_PEER_INACTIVITY_IND   (SIR_HAL_ITC_MSG_TYPES_BEGIN + 206)
 
-#define SIR_HAL_LPHB_CONF_IND              (SIR_HAL_ITC_MSG_TYPES_BEGIN + 206)
 #define SIR_HAL_LPHB_WAIT_EXPIRE_IND       (SIR_HAL_ITC_MSG_TYPES_BEGIN + 207)
 
 #define SIR_HAL_ADD_PERIODIC_TX_PTRN_IND   (SIR_HAL_ITC_MSG_TYPES_BEGIN + 208)
@@ -712,6 +711,9 @@
 #define SIR_HAL_SET_RTS_CTS_HTVHT            (SIR_HAL_ITC_MSG_TYPES_BEGIN + 268)
 #define SIR_HAL_MON_START_REQ               (SIR_HAL_ITC_MSG_TYPES_BEGIN + 269)
 #define SIR_HAL_MON_STOP_REQ                (SIR_HAL_ITC_MSG_TYPES_BEGIN + 270)
+#define SIR_HAL_FATAL_EVENT_LOGS_REQ         (SIR_HAL_ITC_MSG_TYPES_BEGIN + 271)
+
+#define SIR_HAL_LPHB_CONF_IND              (SIR_HAL_ITC_MSG_TYPES_BEGIN + 272)
 
 #define SIR_HAL_MSG_TYPES_END              (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
 // CFG message types
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index 3829ea5..6f75040 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -2242,7 +2242,7 @@
     mmhMsg.type = eWNI_SME_MIC_FAILURE_IND;
     mmhMsg.bodyptr = pSirSmeMicFailureInd;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
     return;
 }
diff --git a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
index 70b4983..47323eb 100644
--- a/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
+++ b/CORE/MAC/src/pe/lim/limProcessMessageQueue.c
@@ -1287,17 +1287,29 @@
       limMsgStr(limMsg->type), limSmeStateStr(pMac->lim.gLimSmeState),
       limMlmStateStr(pMac->lim.gLimMlmState));)
 
-   /* Omitting below message types as these are too frequent and when crash
-    * happens we loose critical trace logs if these are also logged
+   /*
+    * MTRACE logs not captured for events received from SME
+    * SME enums (eWNI_SME_START_REQ) starts with 0x16xx.
+    * Compare received SME events with SIR_SME_MODULE_ID
     */
-   if (limMsg->type != SIR_LIM_MAX_CHANNEL_TIMEOUT &&
-       limMsg->type != SIR_LIM_MIN_CHANNEL_TIMEOUT &&
-       limMsg->type != SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT &&
-       limMsg->type != SIR_CFG_PARAM_UPDATE_IND &&
-       limMsg->type != SIR_BB_XPORT_MGMT_MSG)
-          MTRACE(macTraceMsgRx(pMac, NO_SESSION,
-                 LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
 
+    if (SIR_SME_MODULE_ID == (tANI_U8)MAC_TRACE_GET_MODULE_ID(limMsg->type))
+    {
+       MTRACE(macTrace(pMac, TRACE_CODE_RX_SME_MSG, NO_SESSION, limMsg->type));
+    }
+    else
+    {
+       /* Omitting below message types as these are too frequent and when crash
+        * happens we loose critical trace logs if these are also logged
+        */
+       if (limMsg->type != SIR_LIM_MAX_CHANNEL_TIMEOUT &&
+           limMsg->type != SIR_LIM_MIN_CHANNEL_TIMEOUT &&
+           limMsg->type != SIR_LIM_PERIODIC_PROBE_REQ_TIMEOUT &&
+           limMsg->type != SIR_CFG_PARAM_UPDATE_IND &&
+           limMsg->type != SIR_BB_XPORT_MGMT_MSG)
+              MTRACE(macTraceMsgRx(pMac, NO_SESSION,
+                      LIM_TRACE_MAKE_RXMSG(limMsg->type, LIM_MSG_PROCESSED));)
+    }
     switch (limMsg->type)
     {
 
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
index d9a0f5d..042faff 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
@@ -1073,7 +1073,7 @@
     msgQ.type = eWNI_SME_REASSOC_IND;
     msgQ.bodyptr = pSirSmeReassocInd;
     msgQ.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId, msgQ.type));
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
     limDiagEventReport(pMac, WLAN_PE_DIAG_REASSOC_IND_EVENT, psessionEntry, 0, 0);
 #endif //FEATURE_WLAN_DIAG_SUPPORT
@@ -1138,7 +1138,7 @@
     msgQ.type = eWNI_SME_AUTH_IND;
     msgQ.bodyptr = pSirSmeAuthInd;
     msgQ.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, msgQ.type));
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
     limDiagEventReport(pMac, WLAN_PE_DIAG_AUTH_IND_EVENT, NULL, 0, 0);
 #endif //FEATURE_WLAN_DIAG_SUPPORT
@@ -1274,7 +1274,8 @@
     }
     pSirSmeAssocInd->staId = pStaDs->staIndex;
    pSirSmeAssocInd->reassocReq = pStaDs->mlmStaContext.subType;
-    MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type));
+   MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId,
+                                                             msgQ.type));
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT
     limDiagEventReport(pMac, WLAN_PE_DIAG_ASSOC_IND_EVENT, psessionEntry, 0, 0);
 #endif //FEATURE_WLAN_DIAG_SUPPORT
@@ -4293,6 +4294,8 @@
     {
         case eLIM_HAL_FINISH_SCAN_WAIT_STATE:
             pMac->lim.gLimHalScanState = eLIM_HAL_IDLE_SCAN_STATE;
+            if (pMac->lim.abortScan)
+                pMac->lim.abortScan = 0;
             limCompleteMlmScan(pMac, eSIR_SME_SUCCESS);
             if (limIsChanSwitchRunning(pMac))
             {
diff --git a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c
index f1cd362..81b112e 100644
--- a/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessProbeReqFrame.c
@@ -550,7 +550,8 @@
                         pSirSmeProbeReq->sessionId = psessionEntry->smeSessionId;
                         vos_mem_copy(pSirSmeProbeReq->peerMacAddr, pHdr->sa, sizeof(tSirMacAddr));
                         pSirSmeProbeReq->devicePasswdId = probeReq.probeReqWscIeInfo.DevicePasswordID.id;
-                        MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type));
+                        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG,
+                            psessionEntry->peSessionId, msgQ.type));
                        if (limSysProcessMmhMsgApi(pMac, &msgQ,  ePROT) != eSIR_SUCCESS){
                             PELOG3(limLog(pMac, LOG3, FL("couldnt send the probe req to wsm "));)
                         }
@@ -795,7 +796,8 @@
     vos_mem_copy(pSirSmeProbeReqInd->bssId, psessionEntry->bssId, sizeof(tSirMacAddr));
     vos_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.peerMacAddr, peerMacAddr, sizeof(tSirMacAddr));
 
-    MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, msgQ.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId,
+                                                               msgQ.type));
     pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIELen = (tANI_U16)ProbeReqIELen;
     vos_mem_copy(pSirSmeProbeReqInd->WPSPBCProbeReq.probeReqIE, pProbeReqIE, ProbeReqIELen);
     
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 093eca3..9754107 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -3479,7 +3479,7 @@
     mmhMsg.bodyval = 0;
   
     pMac->lim.gLimRspReqd = false;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg,  ePROT);
 }
 
diff --git a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
index 05ad181..d6eef57 100644
--- a/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limSendSmeRspMessages.c
@@ -116,7 +116,7 @@
     mmhMsg.type = msgType;
     mmhMsg.bodyptr = pSirSmeRsp;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type));
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
    {
@@ -194,7 +194,7 @@
     mmhMsg.type = pSirSmeJoinRsp->messageType;
     mmhMsg.bodyptr = pSirSmeJoinRsp;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg,  ePROT);
 }
 
@@ -673,11 +673,12 @@
     mmhMsg.bodyval = 0;
     if(psessionEntry == NULL)
     {
-        MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     }
     else
     {
-        MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG,
+                  psessionEntry->peSessionId, mmhMsg.type));
     }
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
     limDiagEventReport(pMac, WLAN_PE_DIAG_START_BSS_RSP_EVENT, psessionEntry, (tANI_U16)resultCode, 0);
@@ -782,7 +783,8 @@
                 pSirSmeScanRsp->length      = curMsgLen;
                 mmhMsg.bodyptr = pSirSmeScanRsp;
                 mmhMsg.bodyval = 0;
-                MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+                MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION,
+                                                           mmhMsg.type));
                 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
                 pSirSmeScanRsp = vos_mem_malloc(allocLength);
                 if ( NULL == pSirSmeScanRsp )
@@ -842,7 +844,6 @@
         mmhMsg.type = eWNI_SME_SCAN_RSP;
         mmhMsg.bodyptr = pSirSmeScanRsp;
         mmhMsg.bodyval = 0;
-        MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
         limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
         limLog(pMac, LOG1, FL("statusCode : eSIR_SME_SUCCESS"));
     }
@@ -944,7 +945,8 @@
                 pSirSmeScanRsp->length      = curMsgLen;
                 mmhMsg.bodyptr = pSirSmeScanRsp;
                 mmhMsg.bodyval = 0;
-                MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+                MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION,
+                                                         mmhMsg.type));
                 limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
                 pSirSmeScanRsp = vos_mem_malloc(allocLength);
                 if ( NULL == pSirSmeScanRsp )
@@ -1004,7 +1006,7 @@
         mmhMsg.type = eWNI_SME_SCAN_RSP;
         mmhMsg.bodyptr = pSirSmeScanRsp;
         mmhMsg.bodyval = 0;
-        MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
         limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
         PELOG2(limLog(pMac, LOG2, FL("statusCode : eSIR_SME_SUCCESS\n"));)
     }
@@ -1069,7 +1071,7 @@
     mmhMsg.bodyptr = pSirSmeScanRsp;
     mmhMsg.bodyval = 0;
 
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
     limDiagEventReport(pMac, WLAN_PE_DIAG_SCAN_RSP_EVENT, NULL, (tANI_U16)resultCode, 0);
 #endif //FEATURE_WLAN_DIAG_SUPPORT
@@ -1237,7 +1239,7 @@
     mmhMsg.bodyptr = pMsg;
     mmhMsg.bodyval = 0;
 
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
 
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 }
@@ -1452,7 +1454,8 @@
     mmhMsg.bodyptr = pSirSmeDisassocInd;
     mmhMsg.bodyval = 0;
 
-    MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId,
+                                                            mmhMsg.type));
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
     limDiagEventReport(pMac, WLAN_PE_DIAG_DISASSOC_IND_EVENT, psessionEntry, 0, (tANI_U16)pStaDs->mlmStaContext.disassocReason); 
 #endif //FEATURE_WLAN_DIAG_SUPPORT
@@ -1897,7 +1900,7 @@
     }
 
 
-    MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type));
     if (eSIR_SUCCESS != limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT))
     {
         vos_mem_free(pSirSmeWmStatusChangeNtf);
@@ -1973,11 +1976,13 @@
     mmhMsg.bodyval = 0;
     if(NULL == psessionEntry)
     {
-        MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+          MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION,
+                                                  mmhMsg.type));
     }
     else
     {
-        MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
+          MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG,
+                     psessionEntry->peSessionId, mmhMsg.type));
     }
 
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
@@ -2055,11 +2060,12 @@
     mmhMsg.bodyval = 0;
     if(NULL == psessionEntry)
     {
-        MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     }
     else
     {
-        MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG,
+                   psessionEntry->peSessionId, mmhMsg.type));
     }
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 } /*** end limSendSmeSetContextRsp() ***/
@@ -2195,7 +2201,7 @@
     msgQ.type = eWNI_SME_NEIGHBOR_BSS_IND;
     msgQ.bodyptr = pNewBssInd;
     msgQ.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, msgQ.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, msgQ.type));
     limSysProcessMmhMsgApi(pMac, &msgQ, ePROT);
 } /*** end limSendSmeNeighborBssInd() ***/
 
@@ -2241,11 +2247,12 @@
     mmhMsg.bodyval = 0;
     if(NULL == psessionEntry)
     {
-        MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     }
     else
     {
-        MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG,
+                 psessionEntry->peSessionId, mmhMsg.type));
     }
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
     limDiagEventReport(pMac, WLAN_PE_DIAG_ADDTS_RSP_EVENT, psessionEntry, 0, 0);
@@ -2330,11 +2337,12 @@
     mmhMsg.bodyval = 0;
     if(NULL == psessionEntry)
     {
-        MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     }
     else
     {
-        MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
+        MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG,
+                   psessionEntry->peSessionId, mmhMsg.type));
     }
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
     limDiagEventReport(pMac, WLAN_PE_DIAG_DELTS_RSP_EVENT, psessionEntry, (tANI_U16)status, 0);
@@ -2439,7 +2447,7 @@
 
     mmhMsg.bodyptr = stats;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);                                                  
 
     return;
@@ -2498,7 +2506,7 @@
 
     mmhMsg.bodyptr = stats;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);                                                  
 
     return;
@@ -2557,7 +2565,7 @@
 
     mmhMsg.bodyptr = stats;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 
     return;
@@ -2614,7 +2622,7 @@
     mmhMsg.type = eWNI_SME_GET_TSM_STATS_RSP;
     mmhMsg.bodyptr = pStats;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 
     return;
@@ -2665,7 +2673,7 @@
     mmhMsg.type    = msgType;
 //    mmhMsg.bodyval = (tANI_U32) pNewPeerInd;
     mmhMsg.bodyptr = pNewPeerInd;
-    MTRACE(macTraceMsgTx(pMac, sessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, sessionId, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
     
 }
@@ -2707,7 +2715,7 @@
     mmhMsg.bodyval = 0;
   
     limLog(pMac, LOG1, FL("Sending eWNI_PMC_EXIT_BMPS_IND to SME. "));
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM //FEATURE_WLAN_DIAG_SUPPORT 
     limDiagEventReport(pMac, WLAN_PE_DIAG_EXIT_BMPS_IND_EVENT, peGetValidPowerSaveSession(pMac), 0, (tANI_U16)reasonCode);
 #endif //FEATURE_WLAN_DIAG_SUPPORT
@@ -2773,7 +2781,7 @@
     mmhMsg.type = eWNI_SME_FT_AGGR_QOS_RSP;
     mmhMsg.bodyptr = aggrQosRsp;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 
     return;
@@ -2798,7 +2806,7 @@
     mmhMsg.type = eWNI_SME_PRE_SWITCH_CHL_IND;
     mmhMsg.bodyptr = NULL;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 
     return;
@@ -2822,7 +2830,7 @@
     mmhMsg.type = eWNI_SME_POST_SWITCH_CHL_IND;
     mmhMsg.bodyptr = NULL;
     mmhMsg.bodyval = 0;
-    MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 
     return;
@@ -2850,7 +2858,7 @@
     mmhMsg.bodyptr = pSmeMaxAssocInd;
     limLog(pMac, LOG1, FL("msgType %s peerMacAddr "MAC_ADDRESS_STR
                   " sme session id %d"), "eWNI_SME_MAX_ASSOC_EXCEEDED", MAC_ADDR_ARRAY(peerMacAddr),smesessionId);
-    MTRACE(macTraceMsgTx(pMac, smesessionId, mmhMsg.type));
+    MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, smesessionId, mmhMsg.type));
     limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 
     return;
diff --git a/CORE/MAC/src/pe/lim/limTrace.c b/CORE/MAC/src/pe/lim/limTrace.c
index 5ccaae6..b7ed07e 100644
--- a/CORE/MAC/src/pe/lim/limTrace.c
+++ b/CORE/MAC/src/pe/lim/limTrace.c
@@ -408,6 +408,11 @@
         CASE_RETURN_STRING( eLIM_MLM_WT_REMOVE_BSS_KEY_STATE);
         CASE_RETURN_STRING( eLIM_MLM_WT_REMOVE_STA_KEY_STATE);
         CASE_RETURN_STRING( eLIM_MLM_WT_SET_MIMOPS_STATE);
+#if defined WLAN_FEATURE_VOWIFI_11R
+        CASE_RETURN_STRING(eLIM_MLM_WT_ADD_BSS_RSP_FT_REASSOC_STATE);
+        CASE_RETURN_STRING(eLIM_MLM_WT_FT_REASSOC_RSP_STATE);
+#endif
+        CASE_RETURN_STRING(eLIM_MLM_P2P_LISTEN_STATE);
         default:
             return( "UNKNOWN" );
             break;
diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c
index c641240..6fb0a00 100644
--- a/CORE/MAC/src/pe/lim/limUtils.c
+++ b/CORE/MAC/src/pe/lim/limUtils.c
@@ -3305,8 +3305,8 @@
    mmhMsg.bodyptr = pSirSmeSwitchChInd;
    mmhMsg.bodyval = 0;
    
-   MTRACE(macTraceMsgTx(pMac, psessionEntry->peSessionId, mmhMsg.type));
-   
+   MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, psessionEntry->peSessionId,
+                                                            mmhMsg.type));
    SysProcessMmhMsg(pMac, &mmhMsg);
 }
 
@@ -7486,7 +7486,7 @@
    mmhMsg.type = eWNI_SME_ADD_STA_SELF_RSP;
    mmhMsg.bodyptr = pRsp;
    mmhMsg.bodyval = 0;
-   MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+   MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
    limSysProcessMmhMsgApi(pMac, &mmhMsg,  ePROT);
 
 }
@@ -7525,7 +7525,7 @@
    mmhMsg.type = eWNI_SME_DEL_STA_SELF_RSP;
    mmhMsg.bodyptr = pRsp;
    mmhMsg.bodyval = 0;
-   MTRACE(macTraceMsgTx(pMac, NO_SESSION, mmhMsg.type));
+   MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, NO_SESSION, mmhMsg.type));
    limSysProcessMmhMsgApi(pMac, &mmhMsg,  ePROT);
 
 }
diff --git a/CORE/MAC/src/pe/rrm/rrmApi.c b/CORE/MAC/src/pe/rrm/rrmApi.c
index 66c18e5..d094864 100644
--- a/CORE/MAC/src/pe/rrm/rrmApi.c
+++ b/CORE/MAC/src/pe/rrm/rrmApi.c
@@ -450,7 +450,8 @@
    //Send request to SME.
    mmhMsg.type    = pSmeNeighborRpt->messageType;
    mmhMsg.bodyptr = pSmeNeighborRpt;
-   MTRACE(macTraceMsgTx(pMac, pSessionEntry->peSessionId, mmhMsg.type));
+   MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, pSessionEntry->peSessionId,
+                                                           mmhMsg.type));
    status = limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 
    return status;
@@ -669,7 +670,8 @@
    //Send request to SME.
    mmhMsg.type    = eWNI_SME_BEACON_REPORT_REQ_IND;
    mmhMsg.bodyptr = pSmeBcnReportReq;
-   MTRACE(macTraceMsgTx(pMac, pSessionEntry->peSessionId, mmhMsg.type));
+   MTRACE(macTrace(pMac, TRACE_CODE_TX_SME_MSG, pSessionEntry->peSessionId,
+                                                           mmhMsg.type));
    return limSysProcessMmhMsgApi(pMac, &mmhMsg, ePROT);
 }
 
diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h
index ff648ba..d8defd9 100644
--- a/CORE/SME/inc/sme_Api.h
+++ b/CORE/SME/inc/sme_Api.h
@@ -3707,4 +3707,7 @@
                                       tANI_U8 fcc_constraint);
 
 eHalStatus sme_DeleteAllTDLSPeers(tHalHandle hHal, uint8_t sessionId);
+eHalStatus sme_fatal_event_logs_req(tHalHandle hHal, tANI_U32 is_fatal,
+                               tANI_U32 indicator, tANI_U32 reason_code);
+
 #endif //#if !defined( __SME_API_H )
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 30e7200..2a4ed84 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -12794,6 +12794,55 @@
 
 }
 
+
+/* ---------------------------------------------------------------------------
+    \fn sme_fatal_event_logs_req
+    \brief  API to to send flush log command to FW..
+
+    \param  hHal - Mac Context Handle
+    \- return VOS_STATUS_SUCCES if command is posted to
+       WDA else return eHAL_STATUS_FAILURE
+    -------------------------------------------------------------------------*/
+eHalStatus sme_fatal_event_logs_req(tHalHandle hHal, tANI_U32 is_fatal,
+                               tANI_U32 indicator, tANI_U32 reason_code)
+{
+    tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+    vos_msg_t msg;
+    eHalStatus status = eHAL_STATUS_SUCCESS;
+    VOS_STATUS vosStatus = VOS_STATUS_SUCCESS;
+    tpSirFatalEventLogsReqParam pFatalEventLogsReqParams;
+
+    if ( eHAL_STATUS_SUCCESS ==  sme_AcquireGlobalLock( &pMac->sme ))
+    {
+        pFatalEventLogsReqParams = vos_mem_malloc(sizeof(tSirFatalEventLogsReqParam));
+        if(NULL == pFatalEventLogsReqParams)
+        {
+            smsLog(pMac, LOGE,
+                 FL("vos_mem_alloc failed "));
+            return eHAL_STATUS_FAILED_ALLOC;
+        }
+        vos_mem_set(pFatalEventLogsReqParams, sizeof(pFatalEventLogsReqParams), 0);
+        pFatalEventLogsReqParams->reason_code = reason_code;
+
+        vos_mem_zero(&msg, sizeof(vos_msg_t));
+        msg.type = WDA_FATAL_EVENT_LOGS_REQ;
+        msg.reserved = 0;
+        msg.bodyptr = pFatalEventLogsReqParams;
+        msg.bodyval = 0;
+        vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &msg);
+        if ( !VOS_IS_STATUS_SUCCESS(vosStatus) )
+        {
+           vos_mem_free(pFatalEventLogsReqParams);
+           status = eHAL_STATUS_FAILURE;
+        }
+        sme_ReleaseGlobalLock( &pMac->sme );
+        return status;
+
+    }
+    return eHAL_STATUS_FAILURE;
+}
+
+
 /**
  * sme_handleSetFccChannel() - handle fcc constraint request
  * @hal: HAL pointer
diff --git a/CORE/SME/src/sme_common/sme_Trace.c b/CORE/SME/src/sme_common/sme_Trace.c
index 481181f..3542354 100644
--- a/CORE/SME/src/sme_common/sme_Trace.c
+++ b/CORE/SME/src/sme_common/sme_Trace.c
@@ -147,7 +147,14 @@
 #ifdef FEATURE_WLAN_LPHB
         CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_LPHB_CONFIG_REQ);
 #endif /* FEATURE_WLAN_LPHB */
-
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CAPABILITIES);
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_START);
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_STOP);
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_BSS_HOTLIST);
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_BSS_HOTLIST);
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_SIGNF_CHANGE);
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_SIGNF_CHANGE);
+        CASE_RETURN_STRING(TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CACHED_RESULTS);
         default:
             return( "UNKNOWN" );
             break;
@@ -167,6 +174,17 @@
         CASE_RETURN_STRING(eSmeCommandRemoveKey);
         CASE_RETURN_STRING(eSmeCommandAddStaSession);
         CASE_RETURN_STRING(eSmeCommandDelStaSession);
+        CASE_RETURN_STRING(eSmeCommandPnoReq);
+        CASE_RETURN_STRING(eSmeCommandMacSpoofRequest);
+        CASE_RETURN_STRING(eSmeCommandGetFrameLogRequest);
+#ifdef FEATURE_WLAN_TDLS
+        CASE_RETURN_STRING(eSmeCommandTdlsSendMgmt);
+        CASE_RETURN_STRING(eSmeCommandTdlsAddPeer);
+        CASE_RETURN_STRING(eSmeCommandTdlsDelPeer);
+        CASE_RETURN_STRING(eSmeCommandTdlsLinkEstablish);
+        CASE_RETURN_STRING(eSmeCommandTdlsChannelSwitch);
+#endif
+        CASE_RETURN_STRING(eSmeCommandNanReq);
         CASE_RETURN_STRING(eSmePmcCommandMask);
         CASE_RETURN_STRING(eSmeCommandEnterImps);
         CASE_RETURN_STRING(eSmeCommandExitImps);
diff --git a/CORE/SVC/inc/wlan_logging_sock_svc.h b/CORE/SVC/inc/wlan_logging_sock_svc.h
index f3c1412..2cd6745 100644
--- a/CORE/SVC/inc/wlan_logging_sock_svc.h
+++ b/CORE/SVC/inc/wlan_logging_sock_svc.h
@@ -39,6 +39,7 @@
 #include <vos_trace.h>
 #include <wlan_nlink_common.h>
 
+
 int wlan_logging_sock_init_svc(void);
 int wlan_logging_sock_deinit_svc(void);
 int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf);
@@ -46,6 +47,20 @@
 int wlan_logging_sock_deactivate_svc(void);
 int wlan_log_to_user(VOS_TRACE_LEVEL log_level, char *to_be_sent, int length);
 int wlan_queue_logpkt_for_app(vos_pkt_t *pPacket, uint32 pkt_type);
+void wlan_process_done_indication(uint8 type, uint32 reason_code);
+
+void wlan_init_log_completion(void);
+int wlan_set_log_completion(uint32 is_fatal,
+                            uint32 indicator,
+                            uint32 reason_code);
+void wlan_get_log_completion(uint32 *is_fatal,
+                             uint32 *indicator,
+                             uint32 *reason_code);
+bool wlan_is_log_report_in_progress(void);
+void wlan_reset_log_report_in_progress(void);
+
+void wlan_deinit_log_completion(void);
+
 void wlan_logging_set_log_level(void);
 
 
diff --git a/CORE/SVC/src/logging/wlan_logging_sock_svc.c b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
old mode 100755
new mode 100644
index 1d6ddec..0558f85
--- a/CORE/SVC/src/logging/wlan_logging_sock_svc.c
+++ b/CORE/SVC/src/logging/wlan_logging_sock_svc.c
@@ -58,6 +58,7 @@
 #define LOGGER_MGMT_DATA_PKT_POST_MASK   0x001
 #define HOST_LOG_POST_MASK   0x002
 #define LOGGER_FW_LOG_PKT_POST_MASK   0x003
+#define LOGGER_FATAL_EVENT_POST_MASK  0x004
 
 #define LOGGER_MAX_DATA_MGMT_PKT_Q_LEN   (8)
 #define LOGGER_MAX_FW_LOG_PKT_Q_LEN   (16)
@@ -85,6 +86,14 @@
 	char logbuf[MAX_LOGMSG_LENGTH];
 };
 
+struct logger_log_complete {
+	uint32_t is_fatal;
+	uint32_t indicator;
+	uint32_t reason_code;
+	bool is_report_in_progress;
+	bool is_flush_complete;
+};
+
 struct wlan_logging {
 	/* Log Fatal and ERROR to console */
 	bool log_fe_to_console;
@@ -128,6 +137,9 @@
 	unsigned long event_flag;
 	/* Indicates logger thread is activated */
 	bool is_active;
+	/* data structure for log complete event*/
+	struct logger_log_complete log_complete;
+	spinlock_t bug_report_lock;
 };
 
 static struct wlan_logging gwlan_logging;
@@ -722,9 +734,10 @@
 		ret_wait_status = wait_event_interruptible(
 		  gwlan_logging.wait_queue,
 		  (test_bit(HOST_LOG_POST_MASK, &gwlan_logging.event_flag) ||
-		  gwlan_logging.exit || test_bit(LOGGER_MGMT_DATA_PKT_POST_MASK,
-		  &gwlan_logging.event_flag) || test_bit(
-		  LOGGER_FW_LOG_PKT_POST_MASK, &gwlan_logging.event_flag)));
+		   gwlan_logging.exit ||
+		   test_bit(LOGGER_MGMT_DATA_PKT_POST_MASK,&gwlan_logging.event_flag) ||
+		   test_bit(LOGGER_FW_LOG_PKT_POST_MASK, &gwlan_logging.event_flag) ||
+		   test_bit(LOGGER_FATAL_EVENT_POST_MASK, &gwlan_logging.event_flag)));
 
 		if (ret_wait_status == -ERESTARTSYS) {
 			pr_err("%s: wait_event return -ERESTARTSYS", __func__);
@@ -753,6 +766,21 @@
 			&gwlan_logging.event_flag)) {
 			send_data_mgmt_log_pkt_to_user();
 		}
+
+		if (test_and_clear_bit(LOGGER_FATAL_EVENT_POST_MASK,
+			&gwlan_logging.event_flag)) {
+			if (gwlan_logging.log_complete.is_flush_complete == true) {
+				gwlan_logging.log_complete.is_flush_complete = false;
+				vos_send_fatal_event_done();
+			}
+			else {
+				gwlan_logging.log_complete.is_flush_complete = true;
+				set_bit(HOST_LOG_POST_MASK,&gwlan_logging.event_flag);
+				set_bit(LOGGER_FW_LOG_PKT_POST_MASK,&gwlan_logging.event_flag);
+				set_bit(LOGGER_FATAL_EVENT_POST_MASK,&gwlan_logging.event_flag);
+				wake_up_interruptible(&gwlan_logging.wait_queue);
+			}
+		}
 	}
 
 	pr_info("%s: Terminating\n", __func__);
@@ -817,6 +845,67 @@
 	return ret;
 }
 
+void wlan_init_log_completion(void)
+{
+	gwlan_logging.log_complete.indicator = WLAN_LOG_TYPE_NON_FATAL;
+	gwlan_logging.log_complete.is_fatal = WLAN_LOG_INDICATOR_UNUSED;
+	gwlan_logging.log_complete.is_report_in_progress = false;
+	gwlan_logging.log_complete.reason_code = WLAN_LOG_REASON_CODE_UNUSED;
+
+	spin_lock_init(&gwlan_logging.bug_report_lock);
+}
+
+int wlan_set_log_completion(uint32 is_fatal,
+                            uint32 indicator,
+                            uint32 reason_code)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&gwlan_logging.bug_report_lock, flags);
+	gwlan_logging.log_complete.indicator = indicator;
+	gwlan_logging.log_complete.is_fatal = is_fatal;
+	gwlan_logging.log_complete.is_report_in_progress = true;
+	gwlan_logging.log_complete.reason_code = reason_code;
+	spin_unlock_irqrestore(&gwlan_logging.bug_report_lock, flags);
+
+	return 0;
+}
+void wlan_get_log_completion(uint32 *is_fatal,
+                             uint32 *indicator,
+                             uint32 *reason_code)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&gwlan_logging.bug_report_lock, flags);
+	*indicator = gwlan_logging.log_complete.indicator;
+	*is_fatal = gwlan_logging.log_complete.is_fatal;
+	*reason_code = gwlan_logging.log_complete.reason_code;
+	gwlan_logging.log_complete.is_report_in_progress = false;
+
+	spin_unlock_irqrestore(&gwlan_logging.bug_report_lock, flags);
+
+}
+bool wlan_is_log_report_in_progress(void)
+{
+	return gwlan_logging.log_complete.is_report_in_progress;
+}
+
+void wlan_reset_log_report_in_progress(void)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&gwlan_logging.bug_report_lock, flags);
+	gwlan_logging.log_complete.is_report_in_progress = false;
+	spin_unlock_irqrestore(&gwlan_logging.bug_report_lock, flags);
+}
+
+
+void wlan_deinit_log_completion(void)
+{
+	return;
+}
+
+
 int wlan_logging_sock_activate_svc(int log_fe_to_console, int num_buf)
 {
 	int i = 0;
@@ -856,6 +945,8 @@
 	gwlan_logging.exit = false;
 	clear_bit(HOST_LOG_POST_MASK, &gwlan_logging.event_flag);
 	clear_bit(LOGGER_MGMT_DATA_PKT_POST_MASK, &gwlan_logging.event_flag);
+	clear_bit(LOGGER_FW_LOG_PKT_POST_MASK, &gwlan_logging.event_flag);
+	clear_bit(LOGGER_FATAL_EVENT_POST_MASK, &gwlan_logging.event_flag);
 	init_completion(&gwlan_logging.shutdown_comp);
 	gwlan_logging.thread = kthread_create(wlan_logging_thread, NULL,
 					"wlan_logging_thread");
@@ -955,6 +1046,8 @@
 	gapp_pid = INVALID_PID;
 	gwlan_logging.pcur_node = NULL;
 
+	wlan_init_log_completion();
+
 	return 0;
 }
 
@@ -963,7 +1056,8 @@
 	gwlan_logging.pcur_node = NULL;
 	gapp_pid = INVALID_PID;
 
-       return 0;
+	wlan_deinit_log_completion();
+	return 0;
 }
 
 int wlan_queue_data_mgmt_pkt_for_app(vos_pkt_t *pPacket)
@@ -1121,4 +1215,15 @@
 	return status;
 }
 
+
+void wlan_process_done_indication(uint8 type, uint32 reason_code)
+{
+    if ((type == WLAN_QXDM_LOGGING) && (wlan_is_log_report_in_progress() == TRUE))
+    {
+        pr_info("%s: Setting LOGGER_FATAL_EVENT\n", __func__);
+        set_bit(LOGGER_FATAL_EVENT_POST_MASK, &gwlan_logging.event_flag);
+        wake_up_interruptible(&gwlan_logging.wait_queue);
+    }
+}
+
 #endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */
diff --git a/CORE/SYS/legacy/src/utils/src/macTrace.c b/CORE/SYS/legacy/src/utils/src/macTrace.c
index 8245bd3..27e9a63 100644
--- a/CORE/SYS/legacy/src/utils/src/macTrace.c
+++ b/CORE/SYS/legacy/src/utils/src/macTrace.c
@@ -52,7 +52,9 @@
 #include "csrNeighborRoam.h"
 #include "csrInternal.h"
 #include "limGlobal.h"
+#include "limTypes.h"
 #include "wlan_qct_tl.h"
+#include "wlan_qct_wda.h"
 #include "vos_trace.h"
 
 #ifdef TRACE_RECORD
@@ -430,6 +432,7 @@
         CASE_RETURN_STRING(eWNI_SME_SET_APWPARSNIEs_REQ);
         CASE_RETURN_STRING(eWNI_SME_UPPER_LAYER_ASSOC_CNF);
         CASE_RETURN_STRING(eWNI_SME_HIDE_SSID_REQ);
+        CASE_RETURN_STRING(eWNI_SME_CHNG_MCC_BEACON_INTERVAL);
         CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHANNEL_REQ);
         CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_IND);
         CASE_RETURN_STRING(eWNI_SME_REMAIN_ON_CHN_RSP);
@@ -525,15 +528,45 @@
 #endif // WLAN_WAKEUP_EVENTS
         CASE_RETURN_STRING(eWNI_SME_EXCLUDE_UNENCRYPTED);
         CASE_RETURN_STRING(eWNI_SME_RSSI_IND); //RSSI indication from TL to be serialized on MC thread
-        CASE_RETURN_STRING(eWNI_SME_MSG_TYPES_END);
+#ifdef FEATURE_WLAN_TDLS
+        CASE_RETURN_STRING(eWNI_SME_TDLS_SEND_MGMT_REQ);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_SEND_MGMT_RSP);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_ADD_STA_REQ);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_ADD_STA_RSP);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_REQ);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_RSP);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_STA_IND);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_DEL_ALL_PEER_IND);
+        CASE_RETURN_STRING(eWNI_SME_MGMT_FRM_TX_COMPLETION_IND);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_LINK_ESTABLISH_REQ);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_LINK_ESTABLISH_RSP);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_CHANNEL_SWITCH_REQ);
+        CASE_RETURN_STRING(eWNI_SME_TDLS_CHANNEL_SWITCH_RSP);
+#endif
+        CASE_RETURN_STRING(eWNI_SME_SET_BCN_FILTER_REQ);
+        CASE_RETURN_STRING(eWNI_SME_RESET_AP_CAPS_CHANGED);
+#ifdef WLAN_FEATURE_11W
+        CASE_RETURN_STRING(eWNI_SME_UNPROT_MGMT_FRM_IND);
+#endif
+        CASE_RETURN_STRING(eWNI_SME_CANDIDATE_FOUND_IND);
+        CASE_RETURN_STRING(eWNI_SME_HANDOFF_REQ);
         CASE_RETURN_STRING(eWNI_SME_GET_ROAM_RSSI_REQ);
         CASE_RETURN_STRING(eWNI_SME_GET_ROAM_RSSI_RSP);
         CASE_RETURN_STRING(eWNI_SME_GET_TSM_STATS_REQ);
         CASE_RETURN_STRING(eWNI_SME_GET_TSM_STATS_RSP);
+        CASE_RETURN_STRING(eWNI_SME_TSM_IE_IND);
         CASE_RETURN_STRING(eWNI_SME_HT40_OBSS_SCAN_IND);
         CASE_RETURN_STRING(eWNI_SME_HT40_STOP_OBSS_SCAN_IND);
         CASE_RETURN_STRING(eWNI_SME_NAN_EVENT);
         CASE_RETURN_STRING(eWNI_SME_ENCRYPT_MSG_RSP);
+#ifdef WLAN_FEATURE_AP_HT40_24G
+        CASE_RETURN_STRING(eWNI_SME_SET_HT_2040_MODE);
+        CASE_RETURN_STRING(eWNI_SME_2040_COEX_IND);
+#endif
+        CASE_RETURN_STRING(eWNI_SME_MAC_SPOOF_ADDR_IND);
+        CASE_RETURN_STRING(eWNI_SME_UPDATE_MAX_RATE_IND);
+        CASE_RETURN_STRING(eWNI_SME_SET_TDLS_2040_BSSCOEX_REQ);
+        CASE_RETURN_STRING(eWNI_SME_MSG_TYPES_END);
         default:
             return( (tANI_U8*)"UNKNOWN" );
             break;
@@ -681,6 +714,9 @@
         CASE_RETURN_STRING(WDA_TIMER_CHIP_MONITOR_TIMEOUT);
         CASE_RETURN_STRING(WDA_TIMER_TRAFFIC_ACTIVITY_REQ);
         CASE_RETURN_STRING(WDA_TIMER_ADC_RSSI_STATS);
+#ifdef WLAN_FEATURE_11W
+        CASE_RETURN_STRING(WDA_EXCLUDE_UNENCRYPTED_IND);
+#endif
 #ifdef FEATURE_WLAN_ESE
         CASE_RETURN_STRING(WDA_TSM_STATS_REQ);
         CASE_RETURN_STRING(WDA_TSM_STATS_RSP);
@@ -731,6 +767,7 @@
 #endif //SUPPORT_BEACON_FILTER
         CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_REQ);
         CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_RSP);
+        CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_PER_BAND_RSP);
         CASE_RETURN_STRING(WDA_SET_MAX_TX_POWER_PER_BAND_REQ);
         CASE_RETURN_STRING(WDA_SEND_MSG_COMPLETE);
         CASE_RETURN_STRING(WDA_SET_HOST_OFFLOAD);
@@ -741,6 +778,8 @@
         CASE_RETURN_STRING(WDA_ADD_STA_SELF_REQ);
         CASE_RETURN_STRING(WDA_DEL_STA_SELF_REQ);
         CASE_RETURN_STRING(WDA_SET_P2P_GO_NOA_REQ);
+        CASE_RETURN_STRING(WDA_SET_TDLS_LINK_ESTABLISH_REQ);
+        CASE_RETURN_STRING(WDA_SET_TDLS_LINK_ESTABLISH_REQ_RSP);
         CASE_RETURN_STRING(WDA_TX_COMPLETE_TIMEOUT_IND);
         CASE_RETURN_STRING(WDA_TIMER_TRAFFIC_STATS_IND);
         CASE_RETURN_STRING(WDA_WLAN_SUSPEND_IND);
@@ -763,6 +802,7 @@
 #endif // FEATURE_WLAN_SCAN_PNO
 #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
         CASE_RETURN_STRING(WDA_ROAM_SCAN_OFFLOAD_REQ);
+        CASE_RETURN_STRING(WDA_ROAM_SCAN_OFFLOAD_RSP);
 #endif
 #ifdef WLAN_WAKEUP_EVENTS
         CASE_RETURN_STRING(WDA_WAKE_REASON_IND);
@@ -784,8 +824,22 @@
 #ifdef WLAN_FEATURE_11AC
         CASE_RETURN_STRING(WDA_UPDATE_OP_MODE);
 #endif
+        CASE_RETURN_STRING(WDA_GET_ROAM_RSSI_REQ);
+        CASE_RETURN_STRING(WDA_GET_ROAM_RSSI_RSP);
+        CASE_RETURN_STRING(WDA_NAN_REQUEST);
+        CASE_RETURN_STRING(WDA_START_SCAN_OFFLOAD_REQ);
+        CASE_RETURN_STRING(WDA_START_SCAN_OFFLOAD_RSP);
+        CASE_RETURN_STRING(WDA_STOP_SCAN_OFFLOAD_REQ);
+        CASE_RETURN_STRING(WDA_STOP_SCAN_OFFLOAD_RSP);
+        CASE_RETURN_STRING(WDA_UPDATE_CHAN_LIST_RSP);
+        CASE_RETURN_STRING(WDA_RX_SCAN_EVENT);
+        CASE_RETURN_STRING(WDA_IBSS_PEER_INACTIVITY_IND);
+#ifdef FEATURE_WLAN_LPHB
+        CASE_RETURN_STRING(WDA_LPHB_WAIT_EXPIRE_IND);
+#endif
 #ifdef FEATURE_WLAN_BATCH_SCAN
         CASE_RETURN_STRING(WDA_SET_BATCH_SCAN_REQ);
+        CASE_RETURN_STRING(WDA_SET_BATCH_SCAN_RSP);
         CASE_RETURN_STRING(WDA_STOP_BATCH_SCAN_IND);
         CASE_RETURN_STRING(WDA_TRIGGER_BATCH_SCAN_RESULT_IND);
 #endif
@@ -815,6 +869,22 @@
         CASE_RETURN_STRING(WDA_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ);
         CASE_RETURN_STRING(WDA_EXTSCAN_GET_CACHED_RESULTS_REQ);
 #endif /* WLAN_FEATURE_EXTSCAN */
+        CASE_RETURN_STRING(WDA_HT40_OBSS_SCAN_IND);
+        CASE_RETURN_STRING(WDA_HT40_OBSS_STOP_SCAN_IND);
+        CASE_RETURN_STRING(WDA_ENCRYPT_MSG_REQ);
+        CASE_RETURN_STRING(WDA_ENCRYPT_MSG_RSP);
+#ifdef WLAN_FEATURE_LINK_LAYER_STATS
+        CASE_RETURN_STRING(WDA_LINK_LAYER_STATS_RESULTS_RSP);
+#endif
+#ifdef FEATURE_WLAN_TDLS
+        CASE_RETURN_STRING(WDA_SET_TDLS_CHAN_SWITCH_REQ);
+        CASE_RETURN_STRING(WDA_SET_TDLS_CHAN_SWITCH_REQ_RSP);
+#endif
+        CASE_RETURN_STRING(WDA_FW_STATS_GET_REQ);
+        CASE_RETURN_STRING(WDA_SET_RTS_CTS_HTVHT);
+        CASE_RETURN_STRING(WDA_MON_START_REQ);
+        CASE_RETURN_STRING(WDA_MON_STOP_REQ);
+        CASE_RETURN_STRING(WDA_SPOOF_MAC_ADDR_REQ);
         default:
             return((tANI_U8*) "UNKNOWN" );
             break;
@@ -878,6 +948,43 @@
         CASE_RETURN_STRING(SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT);
         CASE_RETURN_STRING(SIR_LIM_AUTH_RETRY_TIMEOUT);
         CASE_RETURN_STRING(SIR_LIM_MSG_TYPES_END);
+        CASE_RETURN_STRING(LIM_MLM_SCAN_REQ);
+        CASE_RETURN_STRING(LIM_MLM_SCAN_CNF);
+        CASE_RETURN_STRING(LIM_MLM_START_REQ);
+        CASE_RETURN_STRING(LIM_MLM_START_CNF);
+        CASE_RETURN_STRING(LIM_MLM_JOIN_REQ);
+        CASE_RETURN_STRING(LIM_MLM_JOIN_CNF);
+        CASE_RETURN_STRING(LIM_MLM_AUTH_REQ);
+        CASE_RETURN_STRING(LIM_MLM_AUTH_CNF);
+        CASE_RETURN_STRING(LIM_MLM_AUTH_IND);
+        CASE_RETURN_STRING(LIM_MLM_ASSOC_REQ);
+        CASE_RETURN_STRING(LIM_MLM_ASSOC_CNF);
+        CASE_RETURN_STRING(LIM_MLM_ASSOC_IND);
+        CASE_RETURN_STRING(LIM_MLM_DISASSOC_REQ);
+        CASE_RETURN_STRING(LIM_MLM_DISASSOC_CNF);
+        CASE_RETURN_STRING(LIM_MLM_DISASSOC_IND);
+        CASE_RETURN_STRING(LIM_MLM_REASSOC_REQ);
+        CASE_RETURN_STRING(LIM_MLM_REASSOC_CNF);
+        CASE_RETURN_STRING(LIM_MLM_REASSOC_IND);
+        CASE_RETURN_STRING(LIM_MLM_DEAUTH_REQ);
+        CASE_RETURN_STRING(LIM_MLM_DEAUTH_CNF);
+        CASE_RETURN_STRING(LIM_MLM_DEAUTH_IND);
+        CASE_RETURN_STRING(LIM_MLM_TSPEC_REQ);
+        CASE_RETURN_STRING(LIM_MLM_TSPEC_CNF);
+        CASE_RETURN_STRING(LIM_MLM_SETKEYS_REQ);
+        CASE_RETURN_STRING(LIM_MLM_SETKEYS_CNF);
+        CASE_RETURN_STRING(LIM_MLM_PURGE_STA_IND);
+        CASE_RETURN_STRING(LIM_MLM_ADDBA_REQ);
+        CASE_RETURN_STRING(LIM_MLM_ADDBA_CNF);
+        CASE_RETURN_STRING(LIM_MLM_ADDBA_RSP);
+        CASE_RETURN_STRING(LIM_MLM_DELBA_REQ);
+        CASE_RETURN_STRING(LIM_MLM_DELBA_CNF);
+        CASE_RETURN_STRING(LIM_MLM_REMOVEKEY_REQ);
+        CASE_RETURN_STRING(LIM_MLM_REMOVEKEY_CNF);
+#ifdef FEATURE_OEM_DATA_SUPPORT
+        CASE_RETURN_STRING(LIM_MLM_OEM_DATA_REQ);
+        CASE_RETURN_STRING(LIM_MLM_OEM_DATA_CNF);
+#endif
         default:
             return( (tANI_U8*)"UNKNOWN" );
             break;
@@ -895,7 +1002,9 @@
         CASE_RETURN_STRING(WNI_CFG_SET_CNF);
         CASE_RETURN_STRING(SIR_CFG_PARAM_UPDATE_IND);
         CASE_RETURN_STRING(SIR_CFG_DOWNLOAD_COMPLETE_IND);
-
+        CASE_RETURN_STRING(WNI_CFG_DNLD_RSP);
+        CASE_RETURN_STRING(WNI_CFG_GET_REQ);
+        CASE_RETURN_STRING(WNI_CFG_SET_REQ);
         CASE_RETURN_STRING(WNI_CFG_SET_REQ_NO_RSP);
         default:
             return( (tANI_U8*)"UNKNOWN" );
diff --git a/CORE/TL/src/wlan_qct_tl_trace.c b/CORE/TL/src/wlan_qct_tl_trace.c
index 8241670..3a3e2f3 100644
--- a/CORE/TL/src/wlan_qct_tl_trace.c
+++ b/CORE/TL/src/wlan_qct_tl_trace.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -52,6 +52,10 @@
          CASE_RETURN_STRING(TRACE_CODE_TL_QUEUE_CURRENT);
          CASE_RETURN_STRING(TRACE_CODE_TL_REORDER_TIMER_EXP_CB);
          CASE_RETURN_STRING(TRACE_CODE_TL_BA_SESSION_DEL);
+         CASE_RETURN_STRING(TRACE_CODE_TL_ASSOC_FAILED);
+         CASE_RETURN_STRING(TRACE_CODE_TL_FORWARD_CACHED_FRAMES);
+         CASE_RETURN_STRING(TRACE_CODE_TL_FLUSH_CACHED_FRAMES);
+         CASE_RETURN_STRING(TRACE_CODE_TL_CACHE_FRAME);
          default:
                return ("UNKNOWN");
                break;
diff --git a/CORE/VOSS/inc/vos_api.h b/CORE/VOSS/inc/vos_api.h
index 6f6d4d7..100ac75 100644
--- a/CORE/VOSS/inc/vos_api.h
+++ b/CORE/VOSS/inc/vos_api.h
@@ -75,6 +75,80 @@
 #include <vos_timer.h>
 #include <vos_pack_align.h>
 
+
+/**
+ * enum log_event_type - Type of event initiating bug report
+ * @WLAN_LOG_TYPE_NON_FATAL: Non fatal event
+ * @WLAN_LOG_TYPE_FATAL: Fatal event
+ *
+ * Enum indicating the type of event that is initiating the bug report
+ */
+enum log_event_type {
+	WLAN_LOG_TYPE_NON_FATAL,
+	WLAN_LOG_TYPE_FATAL,
+};
+
+/**
+ * enum log_event_indicator - Module triggering bug report
+ * @WLAN_LOG_INDICATOR_UNUSED: Unused
+ * @WLAN_LOG_INDICATOR_FRAMEWORK: Framework triggers bug report
+ * @WLAN_LOG_INDICATOR_HOST_DRIVER: Host driver triggers bug report
+ * @WLAN_LOG_INDICATOR_FIRMWARE: FW initiates bug report
+ *
+ * Enum indicating the module that triggered the bug report
+ */
+enum log_event_indicator {
+	WLAN_LOG_INDICATOR_UNUSED,
+	WLAN_LOG_INDICATOR_FRAMEWORK,
+	WLAN_LOG_INDICATOR_HOST_DRIVER,
+	WLAN_LOG_INDICATOR_FIRMWARE,
+	WLAN_LOG_INDICATOR_IOCTL
+};
+
+/**
+ * enum log_event_host_reason_code - Reason code for bug report
+ * @WLAN_LOG_REASON_CODE_UNUSED: Unused
+ * @WLAN_LOG_REASON_COMMAND_UNSUCCESSFUL: Command response status from FW
+ * is error
+ * @WLAN_LOG_REASON_ROAM_FAIL: Driver initiated roam has failed
+ * @WLAN_LOG_REASON_THREAD_STUCK: Monitor Health of host threads and report
+ * fatal event if some thread is stuck
+ * @WLAN_LOG_REASON_DATA_STALL: Unable to send/receive data due to low resource
+ * scenario for a prolonged period
+ * @WLAN_LOG_REASON_SME_COMMAND_STUCK: SME command is stuck in SME active queue
+ * @WLAN_LOG_REASON_ZERO_SCAN_RESULTS: Full scan resulted in zero scan results
+ * @WLAN_LOG_REASON_QUEUE_FULL: Defer queue becomes full for a prolonged period
+ * @WLAN_LOG_REASON_POWER_COLLAPSE_FAIL: Unable to allow apps power collapse
+ * for a prolonged period
+ * @WLAN_LOG_REASON_SSR_FAIL: Unable to gracefully complete SSR
+ * @WLAN_LOG_REASON_DISCONNECT_FAIL: Disconnect from Supplicant is not
+ * successful
+ * @WLAN_LOG_REASON_CLEAN_UP_FAIL: Clean up of  TDLS or Pre-Auth Sessions
+ * not successful
+ * @WLAN_LOG_REASON_MALLOC_FAIL: Memory allocation Fails
+ * @WLAN_LOG_REASON_VOS_MSG_UNDER_RUN: VOS Core runs out of message wrapper
+ * @WLAN_LOG_REASON_MSG_POST_FAIL: Unable to post msg
+ *
+ * This enum contains the different reason codes for bug report
+ */
+enum log_event_host_reason_code {
+	WLAN_LOG_REASON_CODE_UNUSED,
+	WLAN_LOG_REASON_COMMAND_UNSUCCESSFUL,
+	WLAN_LOG_REASON_ROAM_FAIL,
+	WLAN_LOG_REASON_THREAD_STUCK,
+	WLAN_LOG_REASON_DATA_STALL,
+	WLAN_LOG_REASON_SME_COMMAND_STUCK,
+	WLAN_LOG_REASON_ZERO_SCAN_RESULTS,
+	WLAN_LOG_REASON_QUEUE_FULL,
+	WLAN_LOG_REASON_POWER_COLLAPSE_FAIL,
+	WLAN_LOG_REASON_SSR_FAIL,
+	WLAN_LOG_REASON_DISCONNECT_FAIL,
+	WLAN_LOG_REASON_CLEAN_UP_FAIL,
+	WLAN_LOG_REASON_MALLOC_FAIL,
+	WLAN_LOG_REASON_VOS_MSG_UNDER_RUN,
+	WLAN_LOG_REASON_MSG_POST_FAIL,
+};
+
 /*------------------------------------------------------------------------- 
   Function declarations and documenation
   ------------------------------------------------------------------------*/
@@ -178,6 +252,15 @@
 v_U8_t vos_is_reinit_in_progress(VOS_MODULE_ID moduleId, v_VOID_t *moduleContext);
 void vos_set_reinit_in_progress(VOS_MODULE_ID moduleId, v_U8_t value);
 VOS_STATUS vos_logger_pkt_serialize(vos_pkt_t *pPacket, uint32 pkt_type);
+bool vos_is_log_report_in_progress(void);
+void vos_reset_log_report_in_progress(void);
+int vos_set_log_completion(uint32 is_fatal, uint32 indicator, uint32 reason_code);
+void vos_get_log_completion(uint32 *is_fatal, uint32 *indicator, uint32 *reason_code);
+VOS_STATUS vos_fatal_event_logs_req( uint32_t is_fatal, uint32_t indicator,
+                                 uint32_t reason_code, bool waitRequired);
+VOS_STATUS vos_process_done_indication(v_U8_t type, v_U32_t reason_code);
+void vos_send_fatal_event_done(void);
+
 
 /**---------------------------------------------------------------------------
   
diff --git a/CORE/VOSS/inc/vos_trace.h b/CORE/VOSS/inc/vos_trace.h
index 5ed4944..a0c32f7 100644
--- a/CORE/VOSS/inc/vos_trace.h
+++ b/CORE/VOSS/inc/vos_trace.h
@@ -86,6 +86,17 @@
 	LOG_PKT_TYPE_FW_LOG    = 0x2
 };
 
+
+
+/* Log types. These types are defined in mailbox*/
+typedef enum
+{
+    WLAN_MGMT_FRAME_LOGS    = 0,
+    WLAN_QXDM_LOGGING       = 1,
+    WLAN_FW_MEMORY_DUMP     = 2
+}FrameLoggingType;
+
+
 /*-------------------------------------------------------------------------- 
   Preprocessor definitions and constants
   ------------------------------------------------------------------------*/
diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c
index e5be663..21484db 100644
--- a/CORE/VOSS/src/vos_api.c
+++ b/CORE/VOSS/src/vos_api.c
@@ -284,6 +284,14 @@
     
       goto err_probe_event;
    }
+   if (vos_event_init( &(gpVosContext->fwLogsComplete) ) != VOS_STATUS_SUCCESS )
+   {
+      VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
+                  "%s: Unable to init fwLogsComplete", __func__);
+      VOS_ASSERT(0);
+
+      goto err_wda_complete_event;
+   }
 
    /* Initialize the free message queue */
    vStatus = vos_mq_init(&gpVosContext->freeVosMq);
@@ -294,7 +302,7 @@
       VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL,
                 "%s: Failed to initialize VOS free message queue", __func__);
       VOS_ASSERT(0);
-      goto err_wda_complete_event;
+      goto err_fw_logs_complete_event;
    }
 
    for (iter = 0; iter < VOS_CORE_MAX_MESSAGES; iter++)
@@ -466,6 +474,9 @@
 err_msg_queue:
    vos_mq_deinit(&gpVosContext->freeVosMq);
 
+err_fw_logs_complete_event:
+    vos_event_destroy( &gpVosContext->fwLogsComplete);
+
 err_wda_complete_event:
    vos_event_destroy( &gpVosContext->wdaCompleteEvent );
 
@@ -1153,6 +1164,14 @@
 
   vos_mq_deinit(&((pVosContextType)vosContext)->freeVosMq);
 
+  vosStatus = vos_event_destroy(&gpVosContext->fwLogsComplete);
+  if (!VOS_IS_STATUS_SUCCESS(vosStatus))
+  {
+     VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+         "%s: failed to destroy fwLogsComplete", __func__);
+     VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
+  }
+
   vosStatus = vos_event_destroy(&gpVosContext->wdaCompleteEvent);
   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
   {
@@ -1161,6 +1180,7 @@
      VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
   }
 
+
   vosStatus = vos_event_destroy(&gpVosContext->ProbeEvent);
   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
   {
@@ -1647,6 +1667,170 @@
 
 } /* vos_free_context() */
 
+
+bool vos_is_log_report_in_progress(void)
+{
+    return wlan_is_log_report_in_progress();
+}
+
+void vos_reset_log_report_in_progress(void)
+{
+    return wlan_reset_log_report_in_progress();
+}
+
+
+
+
+int vos_set_log_completion(uint32 is_fatal,
+                            uint32 indicator,
+                            uint32 reason_code)
+{
+    return wlan_set_log_completion(is_fatal,
+                                   indicator,reason_code);
+}
+
+void vos_get_log_completion(uint32 *is_fatal,
+                             uint32 *indicator,
+                             uint32 *reason_code)
+{
+    wlan_get_log_completion(is_fatal, indicator, reason_code);
+}
+
+
+
+void vos_send_fatal_event_done(void)
+{
+    /*Complete the fwLogsComplete Event*/
+    VosContextType *vos_context;
+    uint32_t is_fatal, indicator, reason_code;
+
+    vos_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL);
+    if (!vos_context) {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+            "%s: vos context is Invalid", __func__);
+        return;
+    }
+    VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
+         "%s: vos_event_set for fwLogsComplete", __func__);
+    if (vos_event_set(&vos_context->fwLogsComplete)!= VOS_STATUS_SUCCESS)
+    {
+        VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+         "%s: vos_event_set failed for fwLogsComplete", __func__);
+        return;
+    }
+    /*The below API will reset is_report_in_progress flag*/
+    vos_get_log_completion(&is_fatal, &indicator, &reason_code);
+    VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
+         "%s: is_fatal : %d, indicator: %d, reason_code=%d",
+         __func__, is_fatal, indicator, reason_code);
+}
+
+
+
+/**---------------------------------------------------------------------------
+
+  \brief vos_fatal_event_logs_req() - used to send flush command to FW
+
+  This API is wrapper to SME flush API.
+
+  \param is_fatal - fatal or non fatal event
+         indicator - Tyoe of indicator framework/Host/FW
+         reason_code - reason code for flush logs
+
+  \return VOS_STATUS_SUCCESS - if command is sent successfully.
+          VOS_STATUS_E_FAILURE - if command is not sent successfully.
+  --------------------------------------------------------------------------*/
+VOS_STATUS vos_fatal_event_logs_req( uint32_t is_fatal,
+                        uint32_t indicator,
+                        uint32_t reason_code,
+                        bool waitRequired)
+{
+    VOS_STATUS vosStatus;
+    eHalStatus status;
+    VosContextType *vos_context;
+
+    vos_context = vos_get_global_context(VOS_MODULE_ID_SYS, NULL);
+    if (!vos_context)
+    {
+        VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+            "%s: vos context is Invalid", __func__);
+        return eHAL_STATUS_FAILURE;
+    }
+
+
+    if (vos_is_log_report_in_progress() == true)
+    {
+        VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+        "%s: Fatal Event Req already in progress - dropping! type:%d, indicator=%d reason_code=%d",
+        __func__, is_fatal, indicator, reason_code);
+        return VOS_STATUS_E_FAILURE;
+    }
+
+    vosStatus = vos_set_log_completion(is_fatal, indicator, reason_code);
+    if (VOS_STATUS_SUCCESS != vosStatus) {
+        VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+        "%s: Failed to set log trigger params for fatalEvent", __func__);
+        return VOS_STATUS_E_FAILURE;
+    }
+    VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
+        "%s: Triggering fatal Event: type:%d, indicator=%d reason_code=%d",
+        __func__, is_fatal, indicator, reason_code);
+
+    vos_event_reset(&gpVosContext->fwLogsComplete);
+    status = sme_fatal_event_logs_req(vos_context->pMACContext,
+                                      is_fatal, indicator,
+                                      reason_code);
+
+    if (HAL_STATUS_SUCCESS(status) && (waitRequired == TRUE))
+    {
+
+        /* Need to update time out of complete */
+        vosStatus = vos_wait_single_event(&gpVosContext->fwLogsComplete,
+                                    WAIT_TIME_FW_LOGS);
+        if ( vosStatus != VOS_STATUS_SUCCESS )
+        {
+            if ( vosStatus == VOS_STATUS_E_TIMEOUT )
+            {
+                VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+                 "%s: Timeout occurred before fwLogsComplete", __func__);
+            }
+            else
+            {
+                VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+                     "%s: fwLogsComplete reporting other error", __func__);
+            }
+            /*Done indication is not received.So reset the bug report in progress*/
+            vos_reset_log_report_in_progress();
+            return VOS_STATUS_E_FAILURE;
+        }
+    }
+    if (HAL_STATUS_SUCCESS( status ))
+        return VOS_STATUS_SUCCESS;
+    else
+        return VOS_STATUS_E_FAILURE;
+}
+
+/**---------------------------------------------------------------------------
+
+  \brief vos_process_done_indication() - Process the done indication for fatal event,
+   FW memory dump
+
+  This API processes the done indication and wakeup the logger thread accordingly.
+
+  \param type - Type for which done indication is received.
+
+
+  \return VOS_STATUS_SUCCESS - the pkt has been successfully queued.
+          VOS_STATUS_E_FAILURE - the pkt queue handler has reported
+          a failure.
+  --------------------------------------------------------------------------*/
+
+VOS_STATUS vos_process_done_indication(v_U8_t type, v_U32_t reason_code)
+{
+    wlan_process_done_indication(type, reason_code);
+    return VOS_STATUS_SUCCESS;
+}
+
 /**---------------------------------------------------------------------------
 
   \brief vos_logger_pkt_serialize() - queue a logging vos pkt
@@ -2241,6 +2425,15 @@
 
   vos_mq_deinit(&((pVosContextType)vosContext)->freeVosMq);
 
+  vosStatus = vos_event_destroy(&gpVosContext->fwLogsComplete);
+  if (!VOS_IS_STATUS_SUCCESS(vosStatus))
+  {
+     VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR,
+         "%s: failed to destroy fwLogsComplete", __func__);
+     VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
+  }
+
+
   vosStatus = vos_event_destroy(&gpVosContext->wdaCompleteEvent);
   if (!VOS_IS_STATUS_SUCCESS(vosStatus))
   {
diff --git a/CORE/VOSS/src/vos_sched.h b/CORE/VOSS/src/vos_sched.h
index 500f684..f9c3b65 100644
--- a/CORE/VOSS/src/vos_sched.h
+++ b/CORE/VOSS/src/vos_sched.h
@@ -336,6 +336,9 @@
 
    /* Roam delay statistic enabled in ini*/
    v_U8_t             roamDelayStatsEnabled;
+
+   /*Fw log complete Event*/
+   vos_event_t fwLogsComplete;
 } VosContextType, *pVosContextType;
 
 
diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h
index cf9ae9d..80eeb34 100644
--- a/CORE/WDA/inc/wlan_qct_wda.h
+++ b/CORE/WDA/inc/wlan_qct_wda.h
@@ -1283,6 +1283,9 @@
 #define WDA_MGMT_LOGGING_INIT_REQ               SIR_HAL_MGMT_LOGGING_INIT_REQ
 #define WDA_GET_FRAME_LOG_REQ                   SIR_HAL_GET_FRAME_LOG_REQ
 
+#define WDA_FATAL_EVENT_LOGS_REQ                   SIR_HAL_FATAL_EVENT_LOGS_REQ
+
+
 #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 // Bit 6 will be used to control BD rate for Management frames
 
 #define halTxFrame(hHal, pFrmBuf, frmLen, frmType, txDir, tid, pCompFunc, pData, txFlag) \
diff --git a/CORE/WDA/src/wlan_qct_wda.c b/CORE/WDA/src/wlan_qct_wda.c
index 6233305..eca5f7e 100644
--- a/CORE/WDA/src/wlan_qct_wda.c
+++ b/CORE/WDA/src/wlan_qct_wda.c
@@ -9778,6 +9778,122 @@
    return status;
 }
 
+
+/*
+ * FUNCTION: WDA_FatalEventLogsRspCallback
+ * recieves Flush Logs response from FW
+ */
+
+void WDA_FatalEventLogsRspCallback(WDI_FatalEventLogsRspParamType* wdiRsp,
+                                        void* pUserData)
+{
+    tWDA_ReqParams *pWdaParams = (tWDA_ReqParams *)pUserData;
+
+    VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
+                     "<------ %s,wdiStatus:%d  " ,
+                     __func__, wdiRsp->wdiStatus);
+    if(NULL == pWdaParams)
+    {
+       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+               "%s: pWdaParams received NULL", __func__);
+       VOS_ASSERT(0);
+       return ;
+    }
+
+    if(NULL == pWdaParams->wdaMsgParam)
+    {
+       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+               "%s: pWdaParams->wdaMsgParam is NULL", __func__);
+       VOS_ASSERT(0);
+       vos_mem_free(pWdaParams);
+       return ;
+    }
+
+    if(IS_WDI_STATUS_FAILURE(wdiRsp->wdiStatus))
+    {
+        /*
+              * If it is failure, it means JOb is already posted by FW
+              * for logging, so for failure scenario also we will get the
+              * done indication
+              */
+        VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+               "%s: Fatal Event Rsp Failure,wdiStatus : %d ",
+               __func__, wdiRsp->wdiStatus);
+    }
+
+    vos_mem_free(pWdaParams->wdaWdiApiMsgParam);
+    vos_mem_free(pWdaParams->wdaMsgParam);
+    vos_mem_free(pWdaParams);
+
+    return;
+
+}
+
+/*
+ * FUNCTION: WDA_ProcessFatalEventLogsReq
+ * Request to WDI to send the fatal Event Logs Req.
+ */
+
+VOS_STATUS WDA_ProcessFatalEventLogsReq(tWDA_CbContext *pWDA,
+                              tSirFatalEventLogsReqParam *pFatalEventLogsReqParam)
+{
+    VOS_STATUS status = VOS_STATUS_SUCCESS;
+    WDI_FatalEventLogsReqInfoType *wdiFatalEventLogsReqInfo;
+    tWDA_ReqParams *pWdaParams ;
+    WDI_Status wstatus;
+
+
+    VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_INFO,
+                                          "------> %s " ,__func__);
+    if (NULL == pFatalEventLogsReqParam)
+    {
+        VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+                           "%s: pMgmtLoggingInitParam received NULL", __func__);
+        VOS_ASSERT(0) ;
+        return VOS_STATUS_E_FAULT;
+    }
+    wdiFatalEventLogsReqInfo = (WDI_FatalEventLogsReqInfoType *)vos_mem_malloc(
+                                       sizeof(WDI_FatalEventLogsReqInfoType));
+    if(NULL == wdiFatalEventLogsReqInfo)
+    {
+       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+                            "%s: VOS MEM Alloc Failure", __func__);
+       VOS_ASSERT(0);
+       vos_mem_free(pFatalEventLogsReqParam);
+       return VOS_STATUS_E_NOMEM;
+    }
+    pWdaParams = (tWDA_ReqParams *)vos_mem_malloc(sizeof(tWDA_ReqParams)) ;
+    if(NULL == pWdaParams)
+    {
+       VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+                            "%s: VOS MEM Alloc Failure", __func__);
+       VOS_ASSERT(0);
+       vos_mem_free(wdiFatalEventLogsReqInfo);
+       vos_mem_free(pFatalEventLogsReqParam);
+       return VOS_STATUS_E_NOMEM;
+    }
+    wdiFatalEventLogsReqInfo->reason_code = pFatalEventLogsReqParam->reason_code;
+    pWdaParams->pWdaContext = pWDA;
+    pWdaParams->wdaMsgParam = pFatalEventLogsReqParam;
+    pWdaParams->wdaWdiApiMsgParam = (void *)wdiFatalEventLogsReqInfo;
+
+   wstatus = WDI_FatalEventLogsReq(wdiFatalEventLogsReqInfo,
+                       (WDI_FatalEventLogsRspCb)WDA_FatalEventLogsRspCallback,
+                        pWdaParams);
+   if(IS_WDI_STATUS_FAILURE(wstatus))
+   {
+      VOS_TRACE( VOS_MODULE_ID_WDA, VOS_TRACE_LEVEL_ERROR,
+              "Failure in Mgmt Logging init REQ WDI API, free all the memory" );
+      status = CONVERT_WDI2VOS_STATUS(wstatus);
+      vos_mem_free(pWdaParams->wdaWdiApiMsgParam) ;
+      vos_mem_free(pWdaParams->wdaMsgParam);
+      vos_mem_free(pWdaParams);
+   }
+
+   return status;
+
+}
+
 /*
  * FUNCTION: WDA_ProcessFWLoggingInitReq
  *
@@ -13765,6 +13881,12 @@
                                         (tAniGetFrameLogReq *)pMsg->bodyptr);
          break;
       }
+      case WDA_FATAL_EVENT_LOGS_REQ:
+      {
+         WDA_ProcessFatalEventLogsReq(pWDA,
+                                       (tSirFatalEventLogsReqParam *)pMsg->bodyptr);
+         break;
+      }
       case WDA_SET_HOST_OFFLOAD:
       {
          WDA_ProcessHostOffloadReq(pWDA, (tSirHostOffloadReq *)pMsg->bodyptr);
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi.h b/CORE/WDI/CP/inc/wlan_qct_wdi.h
index 4e66279..bab070c 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi.h
@@ -2693,6 +2693,17 @@
   wpt_uint32 reserved1;
   wpt_uint32 reserved2;
 }WDI_FWLoggingInitRspParamType;
+
+
+/*---------------------------------------------------------------------------
+  WDI_FatalEventLogsRspParamType
+---------------------------------------------------------------------------*/
+typedef struct
+{
+  /* wdi status */
+  wpt_uint32   wdiStatus;
+}WDI_FatalEventLogsRspParamType;
+
 /*---------------------------------------------------------------------------
   WDI_AddBAReqinfoType
 ---------------------------------------------------------------------------*/
@@ -4078,6 +4089,12 @@
 
 typedef struct
 {
+    wpt_uint32 reason_code;
+}WDI_FatalEventLogsReqInfoType;
+
+
+typedef struct
+{
    wpt_uint8 flags;
 }WDI_GetFrameLogReqInfoType;
 
@@ -8026,6 +8043,8 @@
                         WDI_FWLoggingInitRspParamType *wdiRsp, void *pUserData);
 typedef void  (*WDI_GetFrameLogRspCb)(
                         WDI_GetFrameLogRspParamType *wdiRsp, void *pUserData);
+typedef void  (*WDI_FatalEventLogsRspCb)(
+                         WDI_FatalEventLogsRspParamType *wdiRsp, void *pUserData);
 
 typedef void  (*WDI_MonStartRspCb)(void *pEventData,void *pUserData);
 typedef void  (*WDI_MonStopRspCb)(void *pUserData);
@@ -9457,6 +9476,39 @@
   WDI_SetUapsdAcParamsCb  wdiSetUapsdAcParamsCb,
   void*                   pUserData
 );
+
+
+/**
+ @brief WDI_FatalEventLogsReq will be called when the upper
+        MAC wants to send the fatal event req. Upon the call of
+        this API the WLAN DAL will pack and send a HAL
+        Fatal event request message to the lower RIVA sub-system.
+
+        In state BUSY this request will be queued. Request won't
+        be allowed in any other state.
+
+
+ @param pwdiFatalEventLogsReqInfo: the Fatal event logs params
+                      as specified by the Device Interface
+
+        wdiFatalEventLogsRspCb: callback for passing back the
+        response of the fatal event operation received
+        from the device
+
+        pUserData: user data will be passed back with the
+        callback
+
+ @return Result of the function call
+*/
+
+WDI_Status
+WDI_FatalEventLogsReq
+(
+   WDI_FatalEventLogsReqInfoType      *pwdiFatalEventLogsReqInfo,
+   WDI_FatalEventLogsRspCb             wdiFatalEventLogsRspCb,
+   void*                               pUserData
+);
+
 /**
  @brief WDI_GetFrameLogReq will be called when the upper
         MAC wants to initialize frame logging. Upon the call of
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi_i.h b/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
index 8a8a3a6..04cc121 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi_i.h
@@ -478,6 +478,7 @@
 
   WDI_MON_START_REQ                              = 107,
   WDI_MON_STOP_REQ                               = 108,
+  WDI_FATAL_EVENT_LOGGING_REQ                    = 109,
 
   WDI_MAX_REQ,
 
@@ -818,6 +819,7 @@
 
   WDI_MON_START_RSP                              = 107,
   WDI_MON_STOP_RSP                               = 108,
+  WDI_FATAL_EVENT_LOGGING_RSP                    = 109,
 
   /*-------------------------------------------------------------------------
     Indications
@@ -6145,6 +6147,21 @@
 );
 
 WDI_Status
+WDI_ProcessFatalEventLogsReq
+
+(
+  WDI_ControlBlockType*  pWDICtx,
+  WDI_EventInfoType*     pEventData
+);
+
+WDI_Status
+WDI_ProcessFatalEventLogsRsp
+(
+  WDI_ControlBlockType*  pWDICtx,
+  WDI_EventInfoType*     pEventData
+);
+
+WDI_Status
 WDI_ProcessFWLoggingInitReq
 (
   WDI_ControlBlockType*  pWDICtx,
diff --git a/CORE/WDI/CP/src/wlan_qct_wdi.c b/CORE/WDI/CP/src/wlan_qct_wdi.c
index 430257e..f1b3f9d 100644
--- a/CORE/WDI/CP/src/wlan_qct_wdi.c
+++ b/CORE/WDI/CP/src/wlan_qct_wdi.c
@@ -479,6 +479,7 @@
 
   WDI_ProcessMonStartReq,          /* WDI_MON_START_REQ */
   WDI_ProcessMonStopReq,           /* WDI_MON_STOP_REQ */
+  WDI_ProcessFatalEventLogsReq,     /*WDI_FATAL_EVENT_LOGGING_REQ*/
   /*-------------------------------------------------------------------------
     Indications
   -------------------------------------------------------------------------*/
@@ -750,6 +751,7 @@
 
     WDI_ProcessMonStartRsp,                    /* WDI_MON_START_RSP*/
     WDI_ProcessMonStopRsp,                    /* WDI_MON_STOP_RSP*/
+    WDI_ProcessFatalEventLogsRsp,              /*WDI_FATAL_EVENT_LOGGING_RSP*/
   /*---------------------------------------------------------------------
     Indications
   ---------------------------------------------------------------------*/
@@ -1177,6 +1179,7 @@
     CASE_RETURN_STRING( WDI_SET_RTS_CTS_HTVHT_IND );
     CASE_RETURN_STRING( WDI_MON_START_REQ );
     CASE_RETURN_STRING( WDI_MON_STOP_REQ );
+    CASE_RETURN_STRING( WDI_FATAL_EVENT_LOGGING_REQ );
     default:
         return "Unknown WDI MessageId";
   }
@@ -1312,6 +1315,7 @@
     CASE_RETURN_STRING( WDI_ENCRYPT_MSG_RSP);
     CASE_RETURN_STRING( WDI_FW_LOGGING_INIT_RSP);
     CASE_RETURN_STRING( WDI_GET_FRAME_LOG_RSP);
+    CASE_RETURN_STRING (WDI_FATAL_EVENT_LOGGING_RSP);
     default:
         return "Unknown WDI MessageId";
   }
@@ -4325,6 +4329,66 @@
 
    return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
 }
+
+
+/**
+ @brief WDI_FatalEventLogsReq will be called when the upper
+        MAC wants to send the flush command. Upon the call of
+        this API the WLAN DAL will pack and send a HAL
+        Fatal Event Req message to the lower RIVA sub-system.
+
+        In state BUSY this request will be queued. Request won't
+        be allowed in any other state.
+
+
+ @param pwdiFlushLogsReqInfo: the Flush Logs params
+                      as specified by the Device Interface
+
+        wdiFlushLogsRspCb: callback for passing back the
+        response of the Flush Logs operation received
+        from the device
+
+        pUserData: user data will be passed back with the
+        callback
+
+ @return Result of the function call
+*/
+
+WDI_Status
+WDI_FatalEventLogsReq
+(
+   WDI_FatalEventLogsReqInfoType      *pwdiFatalEventLogsReqInfo,
+   WDI_FatalEventLogsRspCb             wdiFatalEventLogsRspCb,
+   void*                               pUserData
+)
+{
+    WDI_EventInfoType      wdiEventData;
+
+    /*------------------------------------------------------------------------
+      Sanity Check
+    ------------------------------------------------------------------------*/
+    if ( eWLAN_PAL_FALSE == gWDIInitialized )
+    {
+      WPAL_TRACE(eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_ERROR,
+                "WDI API call before module is initialized - Fail request");
+
+      return WDI_STATUS_E_NOT_ALLOWED;
+    }
+
+    /*------------------------------------------------------------------------
+      Fill in Event data and post to the Main FSM
+    ------------------------------------------------------------------------*/
+    wdiEventData.wdiRequest      = WDI_FATAL_EVENT_LOGGING_REQ;
+    wdiEventData.pEventData      = pwdiFatalEventLogsReqInfo;
+    wdiEventData.uEventDataSize  = sizeof(*pwdiFatalEventLogsReqInfo);
+    wdiEventData.pCBfnc          = wdiFatalEventLogsRspCb;
+    wdiEventData.pUserData       = pUserData;
+
+    return WDI_PostMainEvent(&gWDICb, WDI_REQUEST_EVENT, &wdiEventData);
+
+}
+
+
 /**
  @brief WDI_FWLoggingInitReq will be called when the upper
         MAC wants to initialize frame logging. Upon the call of
@@ -24203,6 +24267,9 @@
        return WLAN_HAL_DISABLE_MONITOR_MODE_REQ;
   case WDI_FW_LOGGING_DXE_DONE_IND:
        return WLAN_HAL_FW_LOGGING_DXE_DONE_IND;
+  case WDI_FATAL_EVENT_LOGGING_REQ:
+       return WLAN_HAL_FATAL_EVENT_LOGGING_REQ;
+
   default:
     return WLAN_HAL_MSG_MAX;
   }
@@ -24532,6 +24599,8 @@
        return WDI_MON_START_RSP;
   case WLAN_HAL_DISABLE_MONITOR_MODE_RSP:
        return WDI_MON_STOP_RSP;
+  case WLAN_HAL_FATAL_EVENT_LOGGING_RSP:
+       return WDI_FATAL_EVENT_LOGGING_RSP;
   default:
     return eDRIVER_TYPE_MAX;
   }
@@ -34551,6 +34620,139 @@
   return (wdiStatus != WDI_STATUS_SUCCESS) ? wdiStatus:WDI_STATUS_SUCCESS_SYNC;
 }
 
+
+/**
+ @brief Process Fatal Event Logs Rsp function
+        (called when a response is being received over the bus from HAL)
+
+ @param  pWDICtx:         pointer to the WLAN DAL context
+         pEventData:      pointer to the event information structure
+
+ @see
+ @return Result of the function call
+*/
+WDI_Status
+WDI_ProcessFatalEventLogsRsp
+(
+  WDI_ControlBlockType*  pWDICtx,
+  WDI_EventInfoType*     pEventData
+)
+{
+    tHalFatalEventLoggingRspParams           halRsp;
+    WDI_FatalEventLogsRspCb                 wdiFatalEventLogsRspCb;
+    WDI_FatalEventLogsRspParamType          wdiFatalEventLogsRsp;
+
+    VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO,
+                    "%s: %d Enter",__func__, __LINE__);
+
+    /*-------------------------------------------------------------------------
+      Sanity check
+    -------------------------------------------------------------------------*/
+    if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
+        ( NULL == pEventData->pEventData))
+    {
+       WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
+                   "%s: Invalid parameters", __func__);
+       WDI_ASSERT(0);
+       return WDI_STATUS_E_FAILURE;
+    }
+    wdiFatalEventLogsRspCb = (WDI_FatalEventLogsRspCb)pWDICtx->pfncRspCB;
+
+    /*-------------------------------------------------------------------------
+      Extract response and send it to UMAC
+    -------------------------------------------------------------------------*/
+    wpalMemoryCopy( &halRsp, pEventData->pEventData, sizeof(halRsp));
+
+    wdiFatalEventLogsRsp.wdiStatus = WDI_HAL_2_WDI_STATUS(halRsp.status);
+
+    /*Notify UMAC*/
+    wdiFatalEventLogsRspCb( &wdiFatalEventLogsRsp,
+                                  pWDICtx->pRspCBUserData);
+
+    return WDI_STATUS_SUCCESS;
+}
+
+/**
+ @brief Process FatalEventLogs Request
+
+ @param  pWDICtx:         pointer to the WLAN DAL context
+         pEventData:      pointer to the event information structure
+
+ @see
+ @return Result of the function call
+*/
+
+WDI_Status
+WDI_ProcessFatalEventLogsReq
+
+(
+  WDI_ControlBlockType*  pWDICtx,
+  WDI_EventInfoType*     pEventData
+)
+{
+    WDI_FatalEventLogsReqInfoType*     wdiFatalEventLogsReq;
+    wpt_uint8*                         pSendBuffer  = NULL;
+    wpt_uint16                         usDataOffset = 0;
+    wpt_uint16                         usSendSize   = 0;
+    WDI_Status                         wdiStatus;
+    tHalFatalEventLoggingReqMsg        halFatalEventLoggingReq;
+    WDI_FatalEventLogsRspCb            wdiFatalEventLogsRspCb;
+
+
+    VOS_TRACE( VOS_MODULE_ID_WDI, VOS_TRACE_LEVEL_INFO,
+            "%s: %d Enter",__func__, __LINE__);
+
+    /*-------------------------------------------------------------------------
+      Sanity check
+      ------------------------------------------------------------------------*/
+    if (( NULL == pWDICtx ) || ( NULL == pEventData ) ||
+            ( NULL == pEventData->pEventData))
+    {
+        WPAL_TRACE( eWLAN_MODULE_DAL_CTRL, eWLAN_PAL_TRACE_LEVEL_WARN,
+                "%s: Invalid parameters", __func__);
+        WDI_ASSERT(0);
+        return WDI_STATUS_E_FAILURE;
+    }
+    wdiFatalEventLogsReq =
+                     (WDI_FatalEventLogsReqInfoType *)pEventData->pEventData;
+
+    /*-----------------------------------------------------------------------
+      Get message buffer
+      -----------------------------------------------------------------------*/
+    if (( WDI_STATUS_SUCCESS != WDI_GetMessageBuffer( pWDICtx,
+                    WDI_FATAL_EVENT_LOGGING_REQ,
+                    sizeof(halFatalEventLoggingReq.tFatalEventLoggingReqParams),
+                    &pSendBuffer, &usDataOffset, &usSendSize))||
+            (usSendSize < (usDataOffset +
+            sizeof(halFatalEventLoggingReq.tFatalEventLoggingReqParams))))
+    {
+        WPAL_TRACE( eWLAN_MODULE_DAL_CTRL,  eWLAN_PAL_TRACE_LEVEL_FATAL,
+                "Unable to get send buffer in Fatal Event Req");
+        WDI_ASSERT(0);
+        return WDI_STATUS_E_FAILURE;
+    }
+    halFatalEventLoggingReq.tFatalEventLoggingReqParams.reasonCode =
+                                    wdiFatalEventLogsReq->reason_code;
+
+    wdiFatalEventLogsRspCb   = (WDI_FatalEventLogsRspCb)pEventData->pCBfnc;
+
+    wpalMemoryCopy( pSendBuffer+usDataOffset,
+                    &halFatalEventLoggingReq.tFatalEventLoggingReqParams,
+                    sizeof(halFatalEventLoggingReq.tFatalEventLoggingReqParams));
+
+    /*-------------------------------------------------------------------------
+      Send Mgmt Logging Init Request to HAL
+      ------------------------------------------------------------------------*/
+    wdiStatus = WDI_SendMsg( pWDICtx, pSendBuffer, usSendSize,
+                             wdiFatalEventLogsRspCb, pEventData->pUserData,
+                             WDI_FATAL_EVENT_LOGGING_RSP);
+
+    return  wdiStatus;
+
+
+}
+
+
 /**
  @brief Process FWLoggingInit Request
 
diff --git a/riva/inc/wlan_hal_msg.h b/riva/inc/wlan_hal_msg.h
index 59992bc..f1c29bb 100644
--- a/riva/inc/wlan_hal_msg.h
+++ b/riva/inc/wlan_hal_msg.h
@@ -8529,6 +8529,35 @@
 }  tGetFrameLogRespMsg,  * tpGetFrameLogRespMsg;
 
 /*---------------------------------------------------------------------------
+ * WLAN_HAL_FATAL_EVENT_LOGGING_REQ
+ *-------------------------------------------------------------------------*/
+typedef PACKED_PRE struct PACKED_POST
+{
+    tANI_U32 reasonCode;
+}tHalFatalEventLoggingReqParams, *tpHalFatalEventLoggingReqParams;
+
+typedef PACKED_PRE struct PACKED_POST
+{
+    tHalMsgHeader header;
+    tHalFatalEventLoggingReqParams tFatalEventLoggingReqParams;
+}tHalFatalEventLoggingReqMsg, *tpHalFatalEventLoggingReqMsg;
+
+/*---------------------------------------------------------------------------
+ * WLAN_HAL_FATAL_EVENT_LOGGING_RSP
+ *-------------------------------------------------------------------------*/
+typedef PACKED_PRE struct PACKED_POST
+{   tANI_U32 status;
+}tHalFatalEventLoggingRspParams, *tpHalFatalEventLoggingRspParams;
+
+typedef PACKED_PRE struct PACKED_POST
+{
+    tHalMsgHeader header;
+    tHalFatalEventLoggingRspParams tFatalEventLoggingRspParams;
+}tHalFatalEventLoggingRspMsg, *tpHalFatalEventLoggingRspMsg;
+
+
+
+/*---------------------------------------------------------------------------
  *WLAN_HAL_FW_LOGGING_INIT_REQ
  *--------------------------------------------------------------------------*/
 typedef PACKED_PRE struct PACKED_POST