wlan: Handle slow RA rate ramp down for SCC case

Currently when link quality deteriorate rapidly then station's RA
rate does get ramp down quickly resulting in pile up of stations
in its BTQM and also high PER. In case of SAP adapter handling is
taken care but for station adapter it is not taken care. So in SCC
case SAP DL shows 0 Mbps for few seconds when Ref station AP link
is moving to low RSSI rapidly.

In this change bring the same logic to sta adapter which is done for
sap adapter connected stations.

Change-Id: Iaef06331314d099f2327faccce279a537e1d102f
CRs-Fixed: 2007089
diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c
index 089282a..9a42301 100644
--- a/CORE/HDD/src/wlan_hdd_tx_rx.c
+++ b/CORE/HDD/src/wlan_hdd_tx_rx.c
@@ -903,6 +903,24 @@
          return NETDEV_TX_OK;
       }
    }
+
+   if (pHddCtx->bad_sta[STAId]) {
+      hdd_list_node_t *anchor = NULL;
+      skb_list_node_t *pktNode = NULL;
+      struct sk_buff *fskb = NULL;
+
+      if (pAdapter->wmm_tx_queue[qid].count >=
+          pAdapter->wmm_tx_queue[qid].max_size / 2) {
+         hdd_list_remove_front(&pAdapter->wmm_tx_queue[qid],
+                               &anchor);
+         pktNode = list_entry(anchor, skb_list_node_t, anchor);
+         fskb = pktNode->skb;
+         kfree_skb(fskb);
+         ++pAdapter->stats.tx_dropped;
+         ++pAdapter->hdd_stats.hddTxRxStats.txXmitDropped;
+      }
+   }
+
    //If we have already reached the max queue size, disable the TX queue
    if ( pAdapter->wmm_tx_queue[qid].count == pAdapter->wmm_tx_queue[qid].max_size)
    {
diff --git a/CORE/TL/src/wlan_qct_tl.c b/CORE/TL/src/wlan_qct_tl.c
index eebc2d3..73eb6f1 100755
--- a/CORE/TL/src/wlan_qct_tl.c
+++ b/CORE/TL/src/wlan_qct_tl.c
@@ -6078,9 +6078,11 @@
       if (pTLCb->atlSTAClients[staid[i]]->weight <
           WLANTL_RATE_RATIO_THRESHOLD) {
          if (pTLCb->atlSTAClients[staid[i]]->per >= WLANTL_PER_THRESHOLD &&
-             pTLCb->atlSTAClients[staid[i]]->queue > WLANTL_QUEUE_THRESHOLD) {
-             vos_set_hdd_bad_sta(staid[i]);
-             pTLCb->atlSTAClients[staid[i]]->set_flag = true;
+             pTLCb->atlSTAClients[staid[i]]->queue > WLANTL_QUEUE_THRESHOLD
+             && !pTLCb->atlSTAClients[staid[i]]->set_flag) {
+            pTLCb->atlSTAClients[staid[i]]->weight *= 2;
+            vos_set_hdd_bad_sta(staid[i]);
+            pTLCb->atlSTAClients[staid[i]]->set_flag = true;
          }
          else if (pTLCb->atlSTAClients[staid[i]]->set_flag) {
             vos_reset_hdd_bad_sta(staid[i]);