wlan: Fix for a hardware bug causing Out of order datagrams with voice traffic. TID in BD header not updated properly.

Hardware does not update tid field in BD header for BAR frames. It
always stay 0.
This resulted in out of sync between hardware and software while
forwarding pkts to OS.
Fix is to get the tid value from MAC frame rather than reading it from
BD header for the case of BAR frames.

Change-Id: Ia5ed09315c444b1ac7e6cc371686bf2f6840e7b5
CR-Fixed: 360955
diff --git a/CORE/TL/src/wlan_qct_tl.c b/CORE/TL/src/wlan_qct_tl.c
index ea16fe0..cefb2b5 100644
--- a/CORE/TL/src/wlan_qct_tl.c
+++ b/CORE/TL/src/wlan_qct_tl.c
@@ -6798,6 +6798,8 @@
    v_U64_t                  ullpreviousReplayCounter=0; /*previous replay counter*/
    v_U16_t                  ucUnicastBroadcastType=0; /*It denotes whether received frame is UC or BC*/
 #endif
+   struct _BARFrmStruct     *pBarFrame = NULL;
+
   /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
 
   /*------------------------------------------------------------------------
@@ -6832,6 +6834,16 @@
   ucMPDUHLen    = (v_U8_t)WDA_GET_RX_MPDU_HEADER_LEN(aucBDHeader);
   ucTid         = (v_U8_t)WDA_GET_RX_TID(aucBDHeader);
 
+  /* Fix for a hardware bug. 
+   * H/W does not update the tid field in BD header for BAR frames.
+   * Fix is to read the tid field from MAC header of BAR frame */
+  if( (WDA_GET_RX_TYPE(aucBDHeader) == SIR_MAC_CTRL_FRAME) &&
+      (WDA_GET_RX_SUBTYPE(aucBDHeader) == SIR_MAC_CTRL_BAR))
+  {
+      pBarFrame = (struct _BARFrmStruct *)(WDA_GET_RX_MAC_HEADER(aucBDHeader));
+      ucTid = pBarFrame->barControl.numTID;
+  }
+
 #ifdef ANI_CHIPSET_VOLANS
   /*Host based replay check is needed for unicast data frames*/
   ucUnicastBroadcastType  = (v_U16_t)WDA_IS_RX_BCAST(aucBDHeader);