wlan: Handle RX firmware indication for TX flow control

For SAP TX flow control firmware sends the TX stats information
on DXE channel five. In this change handle the firmware indication
based on the indication type filed present in the RX BD.

Change-Id: I56228b4b78ec143c7b5e225c9a09c4d621fa349a
CRs-Fixed: 1097660
diff --git a/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h b/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h
index 5729672..e7c0dac 100644
--- a/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h
+++ b/CORE/WDI/CP/inc/wlan_qct_wdi_dp.h
@@ -227,7 +227,7 @@
 #endif
 
 #define WDI_RXBD_MLME_STA_STATUS 0x1
-#define WDI_RXBD_SAP_TX_COMPL_STATS  0x2
+#define WDI_RXBD_SAP_TX_STATS  0x2
 /*--------------------------------------------------------------------------
    BD header macros - used by the data path to get or set various values
    inside the packet BD 
diff --git a/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c b/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
index 3dfb38b..ae1afe5 100644
--- a/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
+++ b/CORE/WDI/TRP/DTS/src/wlan_qct_wdi_dts.c
@@ -668,7 +668,7 @@
   wpt_uint8                  isFcBd = 0;
   WDI_DS_LoggingSessionType *pLoggingSession;
   tPerPacketStats             rxStats = {0};
-  wpt_uint32 indType =0;
+  wpt_uint8 indType = 0;
 
   tpSirMacFrameCtl  pMacFrameCtl;
   // Do Sanity checks
@@ -725,6 +725,7 @@
   bFSF = WDI_RX_BD_GET_ESF(pBDHeader);
   bLSF = WDI_RX_BD_GET_LSF(pBDHeader);
   isFcBd = WDI_RX_FC_BD_GET_FC(pBDHeader);
+  indType = WDI_RX_BD_GET_PER_SAPOFFLOAD(pBDHeader);
 
   DTI_TRACE( DTI_TRACE_LEVEL_INFO,
       "WLAN TL:BD header processing data: HO %d DO %d Len %d HLen %d"
@@ -736,48 +737,50 @@
 
   if (WDTS_CHANNEL_RX_LOG == channel)
   {
-      indType       = (wpt_uint32)WDI_RX_BD_GET_PER_SAPOFFLOAD(pBDHeader);
+      if (VPKT_SIZE_BUFFER_ALIGNED < (usMPDULen+ucMPDUHOffset))
+      {
+          /* Size of the packet tranferred by the DMA engine is
+           * greater than the the memory allocated for the skb
+           * Recover the SKB  case of length is in same memory page
+           */
+          WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL,
+                   "Invalid Frame size, might memory corrupted(%d+%d/%d)",
+                   usMPDULen, ucMPDUHOffset, VPKT_SIZE_BUFFER_ALIGNED);
+
+          // Store RXBD,  skb head, tail and skb lenght in circular buffer
+          WDTS_StoreMetaInfo(pFrame, pBDHeader);
+
+          if ((usMPDULen+ucMPDUHOffset) <= WDTS_MAX_PAGE_SIZE)
+          {
+              wpalRecoverTail(pFrame);
+              wpalPacketFree(pFrame);
+          } else {
+              //Recovery may cause adjoining buffer corruption
+              WPAL_BUG(0);
+          }
+
+          return eWLAN_PAL_STATUS_SUCCESS;
+      }
+
+      /* Firmware should send the Header offset as length
+       * of RxBd and data length should be populated to
+       * the length of total data being sent
+       */
+      wpalPacketSetRxLength(pFrame, usMPDULen+ucMPDUHOffset);
+      wpalPacketRawTrimHead(pFrame, ucMPDUHOffset);
+
       if(indType) {
           DTI_TRACE(DTI_TRACE_LEVEL_INFO, "indtype is %d size of pacekt is %lu",
                   indType, sizeof(WDI_RxBdType));
+         if (WDI_RXBD_SAP_TX_STATS == indType) {
+            pRxMetadata->fc = 1;
+            pClientData->receiveFrameCB(pClientData->pCallbackContext, pFrame);
+            return eWLAN_PAL_STATUS_SUCCESS;
+         }
       }
-      else
-      {
-          if (VPKT_SIZE_BUFFER_ALIGNED < (usMPDULen+ucMPDUHOffset))
-          {
-              /* Size of the packet tranferred by the DMA engine is
-               * greater than the the memory allocated for the skb
-               * Recover the SKB  case of length is in same memory page
-               */
-              WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_FATAL,
-                      "Invalid Frame size, might memory corrupted(%d+%d/%d)",
-                      usMPDULen, ucMPDUHOffset, VPKT_SIZE_BUFFER_ALIGNED);
-
-              // Store RXBD,  skb head, tail and skb lenght in circular buffer
-              WDTS_StoreMetaInfo(pFrame, pBDHeader);
-
-              if ((usMPDULen+ucMPDUHOffset) <= WDTS_MAX_PAGE_SIZE)
-              {
-                  wpalRecoverTail(pFrame);
-                  wpalPacketFree(pFrame);
-              } else {
-                  //Recovery may cause adjoining buffer corruption
-                  WPAL_BUG(0);
-              }
-
-              return eWLAN_PAL_STATUS_SUCCESS;
-          }
-
-          /* Firmware should send the Header offset as length
-           * of RxBd and data length should be populated to
-           * the length of total data being sent
-           */
-          wpalPacketSetRxLength(pFrame, usMPDULen+ucMPDUHOffset);
-          wpalPacketRawTrimHead(pFrame, ucMPDUHOffset);
-
+      else {
           // Invoke Rx complete callback
           wpalLogPktSerialize(pFrame);
-
           return eWLAN_PAL_STATUS_SUCCESS;
       }
   }