wlan: False driver reload by transport fix

When RX CH ring wrapped around and RX free pool is till empty
Transport RX should wait till next free RX frame ready.
Current Transport RX handle this case as unrecoverable error
and try to reload driver.
But most of this case is simply return RX frame takes long time.

Change-Id: Ica21f869c588b28cb171e32754e18b3d70049167
CRs-fixed: 464502
diff --git a/CORE/DXE/src/wlan_qct_dxe.c b/CORE/DXE/src/wlan_qct_dxe.c
index f99adc1..738d9c2 100644
--- a/CORE/DXE/src/wlan_qct_dxe.c
+++ b/CORE/DXE/src/wlan_qct_dxe.c
@@ -2123,7 +2123,7 @@
       currentCtrlBlk->xfrFrame = NULL;
 
       /* Now try to refill the ring with empty Rx buffers to keep DXE busy */
-      dxeRXFrameRefillRing(dxeCtxt,channelEntry);
+      dxeRXFrameRefillRing(dxeCtxt, channelEntry);
 
       /* Test next contorl block
        * if valid, this control block also has new RX frame must be handled */
@@ -2139,7 +2139,8 @@
 
    /* Deliver all the reaped RX frames to upper layers */
    i = 0;
-   while(i < frameCount) {
+   while(i < frameCount)
+   {
       dxeCtxt->rxReadyCB(dxeCtxt->clientCtxt, rx_reaped_buf[i], channelEntry->channelType);
       i++;
    }
@@ -2169,7 +2170,8 @@
 static wpt_status dxeRXFrameReady
 (
    WLANDXE_CtrlBlkType     *dxeCtxt,
-   WLANDXE_ChannelCBType   *channelEntry
+   WLANDXE_ChannelCBType   *channelEntry,
+   wpt_uint32               chStat
 )
 {
    wpt_status                status = eWLAN_PAL_STATUS_SUCCESS;
@@ -2195,16 +2197,29 @@
    frameCount = dxeRXFrameRouteUpperLayer(dxeCtxt, channelEntry);
 
    if(0 > frameCount)
-      {
-         HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
+   {
+      HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
                "dxeRXFrameReady RX frame route fail");
-         return eWLAN_PAL_STATUS_E_INVAL;
-      }
+      return eWLAN_PAL_STATUS_E_INVAL;
+   }
 
-  if((0 == frameCount) &&
+   if((0 == frameCount) &&
       ((WLANDXE_POWER_STATE_BMPS == dxeCtxt->hostPowerState) ||
        (WLANDXE_POWER_STATE_FULL == dxeCtxt->hostPowerState)))
    {
+      /* None of the frame handled and CH is not enabled
+       * RX CH wrap around happen and No RX free frame
+       * RX side should wait till new free frame available in the pool
+       * Do not try reload driver at here*/
+      if(!(chStat & WLANDXE_CH_CTRL_EN_MASK))
+      {
+         HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
+                  "dxeRXFrameReady %s RING Wrapped, RX Free Low 0x%x",
+                  channelType[channelEntry->channelType], chStat);
+         channelEntry->numFragmentCurrentChain = 0;
+         return eWLAN_PAL_STATUS_SUCCESS;
+      }
+
       currentCtrlBlk = channelEntry->headCtrlBlk;
       currentDesc    = currentCtrlBlk->linkedDesc;
       descCtrl       = currentDesc->descCtrl.ctrl;
@@ -2478,7 +2493,8 @@
        * First high priority */
       channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_HIGH_PRI];
       status = dxeRXFrameReady(dxeCtxt,
-                               channelCb);
+                               channelCb,
+                               chHighStat);
       if(eWLAN_PAL_STATUS_SUCCESS != status)
       {
          HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
@@ -2488,7 +2504,8 @@
        /* Second low priority */
       channelCb = &dxeCtxt->dxeChannel[WDTS_CHANNEL_RX_LOW_PRI];
       status = dxeRXFrameReady(dxeCtxt,
-                               channelCb);
+                               channelCb,
+                               chLowStat);
       if(eWLAN_PAL_STATUS_SUCCESS != status)
       {
          HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
@@ -2540,12 +2557,14 @@
       {
          /* Handle RX Ready for high priority channel */
          status = dxeRXFrameReady(dxeCtxt,
-                                  channelCb);
+                                  channelCb,
+                                  chHighStat);
       }
       else if(WLANDXE_CH_STAT_MASKED_MASK & chHighStat)
       {
          status = dxeRXFrameReady(dxeCtxt,
-                                  channelCb);
+                                  channelCb,
+                                  chHighStat);
       }
       HDXE_MSG(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_INFO,
                "RX HIGH CH EVNT STAT 0x%x, %d frames handled", chHighStat, channelCb->numFragmentCurrentChain);
@@ -2586,7 +2605,8 @@
       {
          /* Handle RX Ready for high priority channel */
          status = dxeRXFrameReady(dxeCtxt,
-                                  channelCb);
+                                  channelCb,
+                                  chStat);
       }
       /* Update the Rx DONE histogram */
       channelCb->rxDoneHistogram = (channelCb->rxDoneHistogram << 1);
@@ -2629,7 +2649,8 @@
       {
          /* Handle RX Ready for low priority channel */
          status = dxeRXFrameReady(dxeCtxt,
-                                  channelCb);
+                                  channelCb,
+                                  chLowStat);
        }
 
       /* Update the Rx DONE histogram */