From 1b30bee31528c40d72cd9d762a8391dca498f675 Mon Sep 17 00:00:00 2001 From: Ajit Vaishya Date: Tue, 26 Feb 2019 18:57:43 +0530 Subject: Wifi-hal: RX and Per packet fate stats for new pkt log version V2 Current RX stats parsing structure differs with the recent architectures. Hence , the firmware / host indicates this need to parse the data with the updated structures through the version ( V2) and the parser is expected to adapt to the same. This commit introduces to parse pktlog stats based on PKT_LOG_V2 parsing structure and the rx rate calculation also differs based on this Version 2. Change-Id: Id0997296e93be15158cb9fd27b25067010227666 CRs-Fixed: 2402099 Bug: 130226017 Test: Manual Test, turn verbose logging and check pkt log --- qcwcn/wifi_hal/wifilogger_diag.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'qcwcn') diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp index 12aa69f..1bcece4 100644 --- a/qcwcn/wifi_hal/wifilogger_diag.cpp +++ b/qcwcn/wifi_hal/wifilogger_diag.cpp @@ -2394,7 +2394,27 @@ static wifi_error parse_stats_record_v2(hal_info *info, { wifi_error status = WIFI_SUCCESS; - if (pkt_stats_header->log_type == PKTLOG_TYPE_PKT_SW_EVENT) { + if (pkt_stats_header->log_type == PKTLOG_TYPE_RX_STAT) { + /* Ignore the event if it doesn't carry RX descriptor */ + if (pkt_stats_header->flags & PKT_INFO_FLG_RX_RXDESC_MASK) + status = parse_rx_stats_v2(info, + (u8 *)(pkt_stats_header + 1), + pkt_stats_header->size); + else + status = WIFI_SUCCESS; + } else if (pkt_stats_header->log_type == PKTLOG_TYPE_PKT_DUMP_V2) { + pthread_mutex_lock(&info->pkt_fate_stats_lock); + if (info->fate_monitoring_enabled) { + if (pkt_stats_header->flags & PKT_INFO_FLG_PKT_DUMP_V2) + status = parse_pkt_fate_stats(info, + (u8 *)pkt_stats_header + sizeof(wh_pktlog_hdr_v2_t), + pkt_stats_header->size); + else + status = WIFI_SUCCESS; + } else + status = WIFI_SUCCESS; + pthread_mutex_unlock(&info->pkt_fate_stats_lock); + } else if (pkt_stats_header->log_type == PKTLOG_TYPE_PKT_SW_EVENT) { status = parse_stats_sw_event(info, pkt_stats_header); } else ALOGE("%s: invalid log_type %d",__FUNCTION__, pkt_stats_header->log_type); -- cgit v1.2.3