wlan: Missing error and info logs in PE disconnect path (Part 1)

Trimmed the logs (exeeding 80 characters) and added info
and error logs for disconnect path limProcessDeauthFrame
and limProcessDisassocFrame
Change-Id: I4b6abad32e419f4a51888a4655b8db2bf7723c65
CRs-Fixed: 576059
diff --git a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c
index 7377665..ed68e7d 100644
--- a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c
@@ -78,8 +78,8 @@
         {
             PELOGE(limLog(pMac, LOGE,
              FL("received Deauth frame in DEAUTH_WT_STATE"
-                "(already processing previously received DEAUTH frame).."
-                "Dropping this.. Deauth Failed %d \n "),++pMac->lim.deauthMsgCnt);)
+             "(already processing previously received DEAUTH frame).."
+             "Dropping this.. Deauth Failed %d"),++pMac->lim.deauthMsgCnt);)
         }
         else
         {
@@ -92,7 +92,7 @@
     {
         // Received Deauth frame from a BC/MC address
         // Log error and ignore it
-        PELOG1(limLog(pMac, LOG1,
+        PELOGE(limLog(pMac, LOGE,
                FL("received Deauth frame from a BC/MC address"));)
 
         return;
@@ -102,7 +102,7 @@
     {
         // Received Deauth frame for a MC address
         // Log error and ignore it
-        PELOG1(limLog(pMac, LOG1,
+        PELOGE(limLog(pMac, LOGE,
                FL("received Deauth frame for a MC address"));)
 
         return;
@@ -129,15 +129,18 @@
     reasonCode = sirReadU16(pBody);
 
     PELOGE(limLog(pMac, LOGE,
-        FL("Received Deauth frame for Addr: "MAC_ADDRESS_STR" (mlm state = %s, sme state = %d)"
-        "with reason code %d from "MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da),
-        limMlmStateStr(psessionEntry->limMlmState), psessionEntry->limSmeState, reasonCode,
+        FL("Received Deauth frame for Addr: "MAC_ADDRESS_STR" (mlm state = %s,"
+        " sme state = %d systemrole  = %d) with reason code %d from "
+        MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pHdr->da),
+        limMlmStateStr(psessionEntry->limMlmState), psessionEntry->limSmeState,
+        psessionEntry->limSystemRole, reasonCode,
         MAC_ADDR_ARRAY(pHdr->sa));)
       
     if (limCheckDisassocDeauthAckPending(pMac, (tANI_U8*)pHdr->sa))
     {
-        PELOGW(limLog(pMac, LOGW,
-                    FL("Ignore the Deauth received, while waiting for ack of disassoc/deauth"));)
+        PELOGE(limLog(pMac, LOGE,
+                    FL("Ignore the Deauth received, while waiting for ack of "
+                    "disassoc/deauth"));)
         limCleanUpDisassocDeauthReq(pMac,(tANI_U8*)pHdr->sa, 1);
         return;
     }
@@ -155,10 +158,9 @@
             default:
                 // Invalid reasonCode in received Deauthentication frame
                 // Log error and ignore the frame
-                PELOG1(limLog(pMac, LOG1,
-                   FL("received Deauth frame with invalid reasonCode %d from "),
-                   reasonCode);
-                limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+                PELOGE(limLog(pMac, LOGE,
+                   FL("received Deauth frame with invalid reasonCode %d from "
+                   MAC_ADDRESS_STR), reasonCode, MAC_ADDR_ARRAY(pHdr->sa));)
 
                 break;
         }
@@ -179,10 +181,9 @@
             default:
                 // Invalid reasonCode in received Deauth frame
                 // Log error and ignore the frame
-                PELOG1(limLog(pMac, LOG1,
-                   FL("received Deauth frame with invalid reasonCode %d from "),
-                   reasonCode);
-                limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+                PELOGE(limLog(pMac, LOGE,
+                   FL("received Deauth frame with invalid reasonCode %d from "
+                   MAC_ADDRESS_STR), reasonCode, MAC_ADDR_ARRAY(pHdr->sa));)
 
                 break;
         }
@@ -191,10 +192,10 @@
     {
         // Received Deauth frame in either IBSS
         // or un-known role. Log and ignore it
-        limLog(pMac, LOG1,
-           FL("received Deauth frame with reasonCode %d in role %d from "),
-           reasonCode, psessionEntry->limSystemRole);
-          limPrintMacAddr(pMac, pHdr->sa, LOG1);
+        limLog(pMac, LOGE,
+           FL("received Deauth frame with reasonCode %d in role %d from "
+           MAC_ADDRESS_STR),reasonCode, psessionEntry->limSystemRole,
+           MAC_ADDR_ARRAY(pHdr->sa));
 
         return;
     }
@@ -223,9 +224,10 @@
     }
     if (limIsReassocInProgress(pMac,psessionEntry) || limIsReassocInProgress(pMac,pRoamSessionEntry)) {
         if (!IS_REASSOC_BSSID(pMac,pHdr->sa,psessionEntry)) {
-            PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from unknown/different AP while ReAssoc. Ignore "));)
-            limPrintMacAddr(pMac, pHdr->sa, LOGE);
-            limPrintMacAddr(pMac, psessionEntry->limReAssocbssId, LOGE);
+            PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from unknown/different "
+            "AP while ReAssoc. Ignore "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa));)
+            PELOGE(limLog(pMac, LOGE, FL(" limReAssocbssId : "MAC_ADDRESS_STR),
+            MAC_ADDR_ARRAY(psessionEntry->limReAssocbssId));)
             return;
         }
 
@@ -233,9 +235,10 @@
          *  Drop ReAssoc and Restore the Previous context( current connected AP).
          */
         if (!IS_CURRENT_BSSID(pMac, pHdr->sa,psessionEntry)) {
-            PELOGE(limLog(pMac, LOGE, FL("received DeAuth from the New AP to which ReAssoc is sent "));)
-            limPrintMacAddr(pMac, pHdr->sa, LOGE);
-            limPrintMacAddr(pMac, psessionEntry->bssId, LOGE);
+            PELOGE(limLog(pMac, LOGE, FL("received DeAuth from the New AP to "
+            "which ReAssoc is sent "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa));)
+            PELOGE(limLog(pMac, LOGE, FL(" psessionEntry->bssId: "MAC_ADDRESS_STR),
+            MAC_ADDR_ARRAY(psessionEntry->bssId));)
             limRestorePreReassocState(pMac,
                                   eSIR_SME_REASSOC_REFUSED, reasonCode,psessionEntry);
             return;
@@ -249,10 +252,13 @@
     if(psessionEntry->limSystemRole != eLIM_AP_ROLE ){
         if (!IS_CURRENT_BSSID(pMac, pHdr->bssId, psessionEntry))
         {
-            PELOGE(limLog(pMac, LOGE, FL("received DeAuth from an AP other than we're trying to join. Ignore. "));)
+            PELOGE(limLog(pMac, LOGE, FL("received DeAuth from an AP other "
+            "than we're trying to join. Ignore. "MAC_ADDRESS_STR),
+            MAC_ADDR_ARRAY(pHdr->sa));)
             if (limSearchPreAuthList(pMac, pHdr->sa))
             {
-                PELOG1(limLog(pMac, LOG1, FL("Preauth entry exist. Deleting... "));)
+                PELOG1(limLog(pMac, LOG1, FL("Preauth entry exist. "
+                "Deleting... "));)
                 limDeletePreAuthNode(pMac, pHdr->sa);
             }
             return;
@@ -277,9 +283,10 @@
 
                         // Log error
                         PELOG1(limLog(pMac, LOG1,
-                           FL("received Deauth frame with failure code %d from "),
-                           reasonCode);
-                        limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+                           FL("received Deauth frame state %X with failure "
+                           "code %d from "MAC_ADDRESS_STR),
+                           psessionEntry->limMlmState, reasonCode,
+                           MAC_ADDR_ARRAY(pHdr->sa));)
 
                         limRestoreFromAuthState(pMac, eSIR_SME_DEAUTH_WHILE_JOIN,
                                                 reasonCode,psessionEntry);
@@ -287,6 +294,11 @@
                         return;
 
                     case eLIM_MLM_AUTHENTICATED_STATE:
+                        limLog(pMac, LOG1,
+                           FL("received Deauth frame state %X with "
+                           "reasonCode=%d from "MAC_ADDRESS_STR),
+                           psessionEntry->limMlmState, reasonCode,
+                           MAC_ADDR_ARRAY(pHdr->sa));
                         /// Issue Deauth Indication to SME.
                         vos_mem_copy((tANI_U8 *) &mlmDeauthInd.peerMacAddr,
                                      pHdr->sa,
@@ -308,7 +320,12 @@
                          * context. Delete local pre-auth context
                          * if any and issue ASSOC_CNF to SME.
                          */
-                        if (limSearchPreAuthList(pMac, pHdr->sa))
+                       limLog(pMac, LOG1,
+                           FL("received Deauth frame state %X with "
+                           "reasonCode=%d from "MAC_ADDRESS_STR),
+                           psessionEntry->limMlmState, reasonCode,
+                           MAC_ADDR_ARRAY(pHdr->sa));
+                       if (limSearchPreAuthList(pMac, pHdr->sa))
                             limDeletePreAuthNode(pMac, pHdr->sa);
 
                        if (psessionEntry->pLimMlmJoinReq)
@@ -342,9 +359,10 @@
                     case eLIM_MLM_WT_ADD_STA_RSP_STATE:
                          psessionEntry->fDeauthReceived = true;
                          PELOGW(limLog(pMac, LOGW,
-                            FL("Received Deauth frame with Reason Code %d from Peer"),
-                                  reasonCode);
-                         limPrintMacAddr(pMac, pHdr->sa, LOGW);)
+                            FL("Received Deauth frame in state %X with Reason "
+                            "Code %d from Peer"MAC_ADDRESS_STR),
+                            psessionEntry->limMlmState, reasonCode,
+                            MAC_ADDR_ARRAY(pHdr->sa));)
                          return ;
 
                     case eLIM_MLM_IDLE_STATE:
@@ -353,9 +371,11 @@
                         if ((NULL != pStaDs) && (STA_ENTRY_TDLS_PEER == pStaDs->staType))
                         {
                            PELOGE(limLog(pMac, LOGE,
-                              FL("received Deauth frame with reason code %d from Tdls peer"),
-                                 reasonCode);
-                           limPrintMacAddr(pMac, pHdr->sa, LOGE);)
+                              FL("received Deauth frame in state %X with "
+                              "reason code %d from Tdls peer"
+                              MAC_ADDRESS_STR),
+                              psessionEntry->limMlmState,reasonCode,
+                              MAC_ADDR_ARRAY(pHdr->sa));)
                            limSendSmeTDLSDelStaInd(pMac, pStaDs, psessionEntry,
                                                    reasonCode);
                            return;
@@ -378,20 +398,27 @@
                         break;
 
                     case eLIM_MLM_WT_REASSOC_RSP_STATE:
+                        limLog(pMac, LOGE,
+                           FL("received Deauth frame state %X with "
+                           "reasonCode=%d from "MAC_ADDRESS_STR),
+                           psessionEntry->limMlmState, reasonCode,
+                           MAC_ADDR_ARRAY(pHdr->sa));
                         break;
 
                     case eLIM_MLM_WT_FT_REASSOC_RSP_STATE:
                         PELOGE(limLog(pMac, LOGE,
-                           FL("received Deauth frame in FT state %X with reasonCode=%d from "),
-                           psessionEntry->limMlmState, reasonCode);)
-                        limPrintMacAddr(pMac, pHdr->sa, LOGE);
+                           FL("received Deauth frame in FT state %X with "
+                           "reasonCode=%d from "MAC_ADDRESS_STR),
+                           psessionEntry->limMlmState, reasonCode,
+                           MAC_ADDR_ARRAY(pHdr->sa));)
                         break;
 
                     default:
-                        PELOG1(limLog(pMac, LOG1,
-                           FL("received Deauth frame in state %X with reasonCode=%d from "),
-                           psessionEntry->limMlmState, reasonCode);)
-                        limPrintMacAddr(pMac, pHdr->sa, LOG1);
+                        PELOGE(limLog(pMac, LOGE,
+                           FL("received Deauth frame in state %X with "
+                           "reasonCode=%d from "MAC_ADDRESS_STR),
+                           psessionEntry->limMlmState, reasonCode,
+                           MAC_ADDR_ARRAY(pHdr->sa));)
                         return;
                 }
                 break;
@@ -415,8 +442,10 @@
      * This is maintained by DPH and created by LIM.
      */
     if (NULL == pStaDs)
+    {
+        limLog(pMac, LOGE, FL("pStaDs is NULL"));
         return;
-
+    }
 
     if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) ||
         (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE))
@@ -425,10 +454,10 @@
          * Already in the process of deleting context for the peer
          * and received Deauthentication frame. Log and Ignore.
          */
-        PELOG1(limLog(pMac, LOG1,
-           FL("received Deauth frame from peer that is in state %X, addr "),
-           pStaDs->mlmStaContext.mlmState);
-        limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+        PELOGE(limLog(pMac, LOGE,
+           FL("received Deauth frame from peer that is in state %X, addr "
+           MAC_ADDRESS_STR),
+           pStaDs->mlmStaContext.mlmState,MAC_ADDR_ARRAY(pHdr->sa));)
         return;
     } 
     pStaDs->mlmStaContext.disassocReason = (tSirMacReasonCodes)reasonCode;
@@ -462,7 +491,8 @@
             psessionEntry->limAssocResponseData = NULL;                            
         }
 
-        PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from ReAssoc AP. Issue REASSOC_CNF. "));)
+        PELOGE(limLog(pMac, LOGE, FL("Rcv Deauth from ReAssoc AP. "
+        "Issue REASSOC_CNF. "));)
        /*
         * TODO: Instead of overloading eSIR_SME_FT_REASSOC_TIMEOUT_FAILURE
         * it would have been good to define/use a different failure type.
diff --git a/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c b/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c
index c08d505..54b991c 100644
--- a/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c
+++ b/CORE/MAC/src/pe/lim/limProcessDisassocFrame.c
@@ -82,7 +82,7 @@
     {
         // Received Disassoc frame from a BC/MC address
         // Log error and ignore it
-        PELOG1(limLog(pMac, LOG1,
+        PELOGE(limLog(pMac, LOGE,
                FL("received Disassoc frame from a BC/MC address"));)
 
         return;
@@ -92,7 +92,7 @@
     {
         // Received Disassoc frame for a MC address
         // Log error and ignore it
-        PELOG1(limLog(pMac, LOG1,
+        PELOGE(limLog(pMac, LOGE,
                FL("received Disassoc frame for a MC address"));)
 
         return;
@@ -135,18 +135,19 @@
          * Disassociating STA is not associated.
          * Log error.
          */
-        PELOG1(limLog(pMac, LOG1,
-           FL("received Disassoc frame from STA that does not have context reasonCode=%d, addr "),
-           reasonCode);
-        limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+        PELOGE(limLog(pMac, LOGE,
+           FL("received Disassoc frame from STA that does not have context "
+           "reasonCode=%d, addr "MAC_ADDRESS_STR),
+            reasonCode,MAC_ADDR_ARRAY(pHdr->sa));)
 
         return;
     }
 
     if (limCheckDisassocDeauthAckPending(pMac, (tANI_U8*)pHdr->sa))
     {
-        PELOGW(limLog(pMac, LOGW,
-                    FL("Ignore the DisAssoc received, while waiting for ack of disassoc/deauth"));)
+        PELOGE(limLog(pMac, LOGE,
+                    FL("Ignore the DisAssoc received, while waiting "
+                    "for ack of disassoc/deauth"));)
         limCleanUpDisassocDeauthReq(pMac,(tANI_U8*)pHdr->sa, 1);
         return;
     }
@@ -159,14 +160,16 @@
         *   drop/ignore the DisAssoc received
         */
         if (!IS_REASSOC_BSSID(pMac,pHdr->sa,psessionEntry)) {
-            PELOGW(limLog(pMac, LOGW, FL("Ignore the DisAssoc received, while Processing ReAssoc with different/unknown AP"));)
+            PELOGE(limLog(pMac, LOGE, FL("Ignore the DisAssoc received, while "
+                     "Processing ReAssoc with different/unknown AP"));)
             return;
         }
         /** If the Disassoc is received from the new AP to which we tried to ReAssociate
          *  Drop ReAssoc and Restore the Previous context( current connected AP).
          */
         if (!IS_CURRENT_BSSID(pMac, pHdr->sa,psessionEntry)) {
-            PELOGW(limLog(pMac, LOGW, FL("received Disassoc from the New AP to which ReAssoc is sent "));)
+            PELOGE(limLog(pMac, LOGE, FL("received Disassoc from the New AP to "
+                                      "which ReAssoc is sent "));)
             limRestorePreReassocState(pMac,
                                   eSIR_SME_REASSOC_REFUSED, reasonCode,psessionEntry);
             return;
@@ -191,10 +194,10 @@
 
             default:
                 // Invalid reasonCode in received Disassociation frame
-                PELOG1(limLog(pMac, LOG1,
-                       FL("received Disassoc frame with invalid reasonCode %d from "),
-                       reasonCode);
-                limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+                PELOGE(limLog(pMac, LOGE,
+                       FL("received Disassoc frame with invalid reasonCode "
+                       "%d from "MAC_ADDRESS_STR),
+                       reasonCode, MAC_ADDR_ARRAY(pHdr->sa));)
                 break;
         }
     }
@@ -227,10 +230,9 @@
                 // as long as we're not about to channel switch
                 if(psessionEntry->gLimChannelSwitch.state != eLIM_CHANNEL_SWITCH_IDLE)
                 {
-                    limLog(pMac, LOGW,
+                    limLog(pMac, LOGE,
                         FL("Ignoring disassoc frame due to upcoming "
-                           "channel switch, from"));
-                    limPrintMacAddr(pMac, pHdr->sa, LOGW);
+                           "channel switch, from "MAC_ADDRESS_STR),MAC_ADDR_ARRAY(pHdr->sa));
                     return;
                 }
                 break;
@@ -238,10 +240,10 @@
             default:
                 // Invalid reasonCode in received Disassociation frame
                 // Log error and ignore the frame
-                PELOG1(limLog(pMac, LOG1,
-                       FL("received Disassoc frame with invalid reasonCode %d from "),
-                       reasonCode);
-                limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+                PELOGE(limLog(pMac, LOGE,
+                       FL("received Disassoc frame with invalid reasonCode "
+                       "%d from "MAC_ADDRESS_STR), reasonCode,
+                       MAC_ADDR_ARRAY(pHdr->sa));)
                 return;
         }
     }
@@ -249,20 +251,15 @@
     {
         // Received Disassociation frame in either IBSS
         // or un-known role. Log and ignore it
-        limLog(pMac, LOG1,
-               FL("received Disassoc frame with invalid reasonCode %d in role %d in sme state %d from "),
-               reasonCode, psessionEntry->limSystemRole, psessionEntry->limSmeState);
-        limPrintMacAddr(pMac, pHdr->sa, LOG1);
+        limLog(pMac, LOGE,
+               FL("received Disassoc frame with invalid reasonCode %d in role "
+               "%d in sme state %d from "MAC_ADDRESS_STR), reasonCode,
+               psessionEntry->limSystemRole, psessionEntry->limSmeState,
+               MAC_ADDR_ARRAY(pHdr->sa));
 
         return;
     }
 
-    // Disassociation from peer MAC entity
-
-   PELOG1(limLog(pMac, LOG1,
-           FL("Received Disassoc frame from sta with assocId=%d with reasonCode=%d. Peer MAC is "MAC_ADDRESS_STR),
-           pStaDs->assocId, reasonCode, MAC_ADDR_ARRAY(pHdr->sa));)
-
     if ((pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_STA_RSP_STATE) ||
         (pStaDs->mlmStaContext.mlmState == eLIM_MLM_WT_DEL_BSS_RSP_STATE))
     {
@@ -270,10 +267,9 @@
          * Already in the process of deleting context for the peer
          * and received Disassociation frame. Log and Ignore.
          */
-        PELOG1(limLog(pMac, LOG1,
-               FL("received Disassoc frame in state %d from"),
-               pStaDs->mlmStaContext.mlmState);
-        limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+        PELOGE(limLog(pMac, LOGE,
+               FL("received Disassoc frame in state %d from "MAC_ADDRESS_STR),
+               pStaDs->mlmStaContext.mlmState, MAC_ADDR_ARRAY(pHdr->sa));)
 
         return;
     } 
@@ -284,10 +280,10 @@
          * Requesting STA is in some 'transient' state?
          * Log error.
          */
-        PELOG1(limLog(pMac, LOG1,
-               FL("received Disassoc frame from peer that is in state %X, addr "),
-               pStaDs->mlmStaContext.mlmState);
-        limPrintMacAddr(pMac, pHdr->sa, LOG1);)
+        PELOGE(limLog(pMac, LOGE,
+               FL("received Disassoc frame from peer that is in state %X, addr "
+               MAC_ADDRESS_STR),
+               pStaDs->mlmStaContext.mlmState, MAC_ADDR_ARRAY(pHdr->sa));)
     } // if (pStaDs->mlmStaContext.mlmState != eLIM_MLM_LINK_ESTABLISHED_STATE)
 
     pStaDs->mlmStaContext.cleanupTrigger = eLIM_PEER_ENTITY_DISASSOC;
@@ -311,7 +307,8 @@
      * failure result code. By design, SME will then issue "Disassoc"  
      * and cleanup will happen at that time. 
      */
-        PELOGE(limLog(pMac, LOGE, FL("received Disassoc from AP while waiting for Reassoc Rsp"));)
+        PELOGE(limLog(pMac, LOGE, FL("received Disassoc from AP while waiting "
+                                  "for Reassoc Rsp"));)
      
         if (psessionEntry->limAssocResponseData) {
             vos_mem_free(psessionEntry->limAssocResponseData);