prima: Fix race condition between disassoc/deauth from peer, supplicant

When disassoc request is received from peer and at the same time
if deauth request is received from supplicant, LIM cleanup
may not happen properly as there is a chance of session deletion
in limSendSmeDeauthNtf while cleanup in progress from
limProcessSmeDisassocCnf. This can result in not sending delbss to FW.
Hence, FW can crash when config bss is sent for new connection.

Following changes are added to handle this.
1. Add state eLIM_SME_WT_DISASSOC_STATE in __limProcessSmeDeauthReq
   and allow host to post LIM_MLM_DEAUTH_REQ instead of invoking
   limSendSmeDeauthNtf, where session is deleted.

2. Send eWNI_SME_DEAUTH_RSP if cleanup is already in progress to avoid
   cleanup again. If mlm state is not eLIM_MLM_LINK_ESTABLISHED_STATE,
   then it means cleanup is already in progress.

3. Return from __limProcessSmeDisassocCnf if cleanup is already in
   progress.

4. Add check in limProcessMlmDeauthCnf to send deauth confirmation even
   if state is eLIM_SME_WT_DISASSOC_STATE.

5. Add similar checks in limProcessMlmDisassocReqNtf to handle disassoc
   from peer and supplicant simultaneously.

Change-Id: Ie19a7b79d835a5e5a77ef48f9379c1cf90dc38d7
CRs-Fixed: 878334
diff --git a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
index e34f0ad..d9a0f5d 100644
--- a/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessMlmRspMessages.c
@@ -1551,7 +1551,8 @@
     if ((psessionEntry->limSystemRole == eLIM_STA_ROLE)|| (psessionEntry->limSystemRole == eLIM_BT_AMP_STA_ROLE))
     {
         // Deauth Confirm from MLM
-        if (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)
+        if ((psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) &&
+            (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE))
         {
             /**
              * Should not have received Deauth confirm