wlan: Debug ROC if pConfig->debugP2pRemainOnChannel is set.

Added debug messages at start and cancel of remain on channel request
if pConfig->debugP2pRemainOnChannel configuration flag is set in
WCNSS_qcom_cfg.ini file. This helps in debugging ROC related issues.

CRs-Fixed: 600438
Change-Id: Id2905594513253ad0b26b24668e18e925e41c710
diff --git a/CORE/MAC/src/pe/lim/limApi.c b/CORE/MAC/src/pe/lim/limApi.c
index c7ac83b..ce207db 100644
--- a/CORE/MAC/src/pe/lim/limApi.c
+++ b/CORE/MAC/src/pe/lim/limApi.c
@@ -633,6 +633,15 @@
        return eSIR_FAILURE;
    }
 #endif
+   if (eSIR_SUCCESS !=
+       wlan_cfgGetInt(pMac, WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL,
+                      (tANI_U32 *)&pMac->lim.gDebugP2pRemainOnChannel))
+    {
+        limLog( pMac, LOGE,
+                "%s: Couldn't get WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL value",
+                 __func__);
+        pMac->lim.gDebugP2pRemainOnChannel = 0;
+   }
    return eSIR_SUCCESS;
 }
 
diff --git a/CORE/MAC/src/pe/lim/limP2P.c b/CORE/MAC/src/pe/lim/limP2P.c
index bd20e07..ae92a9b 100644
--- a/CORE/MAC/src/pe/lim/limP2P.c
+++ b/CORE/MAC/src/pe/lim/limP2P.c
@@ -286,7 +286,7 @@
                                         MsgRemainonChannel,
                                         REMAIN_ON_CHANNEL_SECOND_MARKER_FRAME) )
             {
-                limLog( pMac, LOG1,
+                limLog( pMac, LOGE,
                         "%s: Successfully sent 2nd Marker frame "
                         "seq num = %d on start ROC", __func__,
                         pMac->lim.remOnChnSeqNum);
@@ -556,16 +556,6 @@
                   "%s: remain on channel Timer Start Failed", __func__);
         goto error;
     }
-
-    if (eSIR_SUCCESS !=
-        wlan_cfgGetInt(pMac, WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL,
-                       (tANI_U32 *)&pMac->lim.gDebugP2pRemainOnChannel))
-    {
-        limLog( pMac, LOGE,
-                "%s: Couldn't get WNI_CFG_DEBUG_P2P_REMAIN_ON_CHANNEL value",
-                 __func__);
-        pMac->lim.gDebugP2pRemainOnChannel = 0;
-    }
     if (pMac->lim.gDebugP2pRemainOnChannel)
     {
         pMac->lim.remOnChnSeqNum++;
@@ -573,7 +563,7 @@
                                      pMac, MsgRemainonChannel,
                                      REMAIN_ON_CHANNEL_FIRST_MARKER_FRAME) )
         {
-            limLog( pMac, LOG1,
+            limLog( pMac, LOGE,
                     "%s: Successfully sent 1st marker frame with seq num = %d"
                     " on start ROC", __func__, pMac->lim.remOnChnSeqNum);
         }
@@ -678,7 +668,7 @@
                                       pMac,
                                       REMAIN_ON_CHANNEL_SECOND_MARKER_FRAME))
         {
-            limLog( pMac, LOG1,
+            limLog( pMac, LOGE,
                     "%s: Successfully sent 2nd marker frame with seq num=%d"
                     " on cancel ROC", __func__, pMac->lim.remOnChnSeqNum);
         }
@@ -723,7 +713,7 @@
                                         pMac,
                                         REMAIN_ON_CHANNEL_FIRST_MARKER_FRAME))
         {
-            limLog( pMac, LOG1,
+            limLog( pMac, LOGE,
                     "%s: Successfully sent 1st marker frame with seqnum = %d"
                     " on cancel ROC", __func__, pMac->lim.remOnChnSeqNum);
         }
@@ -806,6 +796,8 @@
         return;
     }
 
+    limLog( pMac, LOG1, "Remain on channel rsp with status %d", status);
+
     //Incase of the Remain on Channel Failure Case
     //Cleanup Everything
     if(eHAL_STATUS_FAILURE == status)
@@ -836,7 +828,7 @@
     }
 
     /* Post the meessage to Sme */
-    limSendSmeRsp(pMac, eWNI_SME_REMAIN_ON_CHN_RSP, status, 
+    limSendSmeRsp(pMac, eWNI_SME_REMAIN_ON_CHN_RSP, status,
                   MsgRemainonChannel->sessionId, 0);
 
     vos_mem_free(pMac->lim.gpLimRemainOnChanReq);
@@ -848,6 +840,8 @@
      * indicaiton confirmation with status failure */
     if (pMac->lim.mgmtFrameSessionId != 0xff)
     {
+       limLog(pMac, LOGE,
+              FL("Remain on channel expired, Action frame status failure"));
        limP2PActionCnf(pMac, 0);
     }
 
@@ -962,6 +956,9 @@
 
 eHalStatus limP2PActionCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess)
 {
+    limLog(pMac, LOG1,
+              FL(" %s txCompleteSuccess %d, Session Id %d"),
+              __func__, txCompleteSuccess, pMac->lim.mgmtFrameSessionId);
     if (pMac->lim.mgmtFrameSessionId != 0xff)
     {
         /* The session entry might be invalid(0xff) action confirmation received after
@@ -1341,6 +1338,7 @@
     {
         //TODO check for state and take appropriate actions
         limDeactivateAndChangeTimer(pMac, eLIM_REMAIN_CHN_TIMER);
+        limLog( pMac, LOG1, FL("Abort ROC !!!" ));
         limProcessRemainOnChnTimeout(pMac);
     }
     return;