WiFi-HAL: Populate stats of previous AMPDU if first MPDU misses

Per packet stats module collects below stats from first MPDU of
the AMPDU.
1. RxMCS
2. last_transmit_rate
3. rssi
4. tid

But the first MPDU may not be received by
hardware/corrupted sometimes. Populate the cached stats
from first MPDU of the previous AMPDU in such cases.

Don't parse Rx packets if the REORDER flag is set as parsing of
these packets may show duplicate entries in the stats.

Change-Id: I8cf78f42e055b0c22d123f21c91f2c204087afe0
diff --git a/qcwcn/wifi_hal/pkt_stats.h b/qcwcn/wifi_hal/pkt_stats.h
index 533ef3d..89e51e9 100644
--- a/qcwcn/wifi_hal/pkt_stats.h
+++ b/qcwcn/wifi_hal/pkt_stats.h
@@ -67,8 +67,7 @@
          PKT_INFO_FLG_RX_LOCAL_S | \
          PKT_INFO_FLG_RX_REMOTE_S | \
          PKT_INFO_FLG_RX_LOCAL_DISCARD_S | \
-         PKT_INFO_FLG_RX_REMOTE_DISCARD_S | \
-         PKT_INFO_FLG_RX_REORDER_STORE_S)
+         PKT_INFO_FLG_RX_REMOTE_DISCARD_S)
 
 /* Format of the packet stats event*/
 typedef struct {
diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp
index b8eafdd..99a7e26 100644
--- a/qcwcn/wifi_hal/wifilogger_diag.cpp
+++ b/qcwcn/wifi_hal/wifilogger_diag.cpp
@@ -1246,7 +1246,6 @@
                             + pRingBufferEntry->entry_size);
     }
     memset(info->rx_aggr_pkts, 0, info->rx_buf_size_occupied);
-    memset(&info->aggr_stats, 0, sizeof(rx_aggr_stats));
     info->rx_buf_size_occupied = 0;
 
     return WIFI_SUCCESS;
@@ -1324,6 +1323,9 @@
     if (rx_stats_rcvd->attention.first_mpdu) {
         MCS *mcs = &info->aggr_stats.RxMCS;
         u32 ht_vht_sig;
+
+        /* Flush the cached stats as this is the first MPDU. */
+        memset(&info->aggr_stats, 0, sizeof(rx_aggr_stats));
         if (rx_stats_rcvd->ppdu_start.preamble_type == PREAMBLE_L_SIG_RATE) {
             if (rx_stats_rcvd->ppdu_start.l_sig_rate_select)
                 mcs->mcs_s.preamble = WL_PREAMBLE_OFDM;