wlan: Fix SAP TX QOS prioritization

As part of Soft AP flow control implementation to get the station
and access category to fetch packets from corresponding queue weight
is not decremented. This impacts the QOS prioritization on when SAP
interface is up. In this change decrement the access category weight
when a packet is fetched from it's queue.

Change-Id: I47c096d1d602dd44fdb9877e81fcb4e02d8c255c
CRs-Fixed: 2016103
diff --git a/CORE/TL/src/wlan_qct_tl.c b/CORE/TL/src/wlan_qct_tl.c
index 73eb6f1..2454477 100755
--- a/CORE/TL/src/wlan_qct_tl.c
+++ b/CORE/TL/src/wlan_qct_tl.c
@@ -698,8 +698,8 @@
   }
 
   // scheduling init to be the last one of previous round
-  pTLCb->uCurServedAC = WLANTL_AC_BK;
-  pTLCb->ucCurLeftWeight = 1;
+  pTLCb->uCurServedAC = WLANTL_AC_VO;
+  pTLCb->ucCurLeftWeight = pTLCb->tlConfigInfo.ucAcWeights[pTLCb->uCurServedAC];
   pTLCb->ucCurrentSTA = WLAN_MAX_STA_COUNT-1;
 
   vos_timer_init(&pTLCb->tx_frames_timer, VOS_TIMER_TYPE_SW,
@@ -11691,10 +11691,8 @@
   ++ucNextSTA;
 
   if ( WLAN_MAX_STA_COUNT <= ucNextSTA )
-  {
-    //one round is done.
     ucNextSTA = 0;
-    pTLCb->ucCurLeftWeight--;
+
     isServed = FALSE;
     if ( 0 == pTLCb->ucCurLeftWeight )
     {
@@ -11712,7 +11710,6 @@
       pTLCb->ucCurLeftWeight =  pTLCb->tlConfigInfo.ucAcWeights[pTLCb->uCurServedAC];
  
     } // (0 == pTLCb->ucCurLeftWeight)
-  } //( WLAN_MAX_STA_COUNT == ucNextSTA )
 
   ucTempSTA = ucNextSTA;
   minWeightSta = ucNextSTA;
@@ -11807,6 +11804,7 @@
                    " TL serve one station AC: %d  W: %d StaId: %d",
                    pTLCb->uCurServedAC, pTLCb->ucCurLeftWeight, pTLCb->ucCurrentSTA ));
       
+        pTLCb->ucCurLeftWeight--;
         return VOS_STATUS_SUCCESS;
       } //STA loop
 
@@ -11859,6 +11857,7 @@
          TLLOG4(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,
                     " TL serve one station AC: %d  W: %d StaId: %d",
                    pTLCb->uCurServedAC, pTLCb->ucCurLeftWeight, pTLCb->ucCurrentSTA ));
+         pTLCb->ucCurLeftWeight--;
          return VOS_STATUS_SUCCESS;
       }
 
@@ -11887,6 +11886,7 @@
          TLLOG4(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_INFO_LOW,
                     " TL serve one station AC: %d  W: %d StaId: %d",
                    pTLCb->uCurServedAC, pTLCb->ucCurLeftWeight, pTLCb->ucCurrentSTA ));
+         pTLCb->ucCurLeftWeight--;
          return VOS_STATUS_SUCCESS;
       }