Bladeren bron

qcacmn: Fix issues with rdkstats

The following issues are fixed with this change-
1. Sojourn stats were printing incorrect values
2. RSSI values were junk numbers

Change-Id: Ibed73cf370a309bf9db5baad37a0e8261c58463b
Aakanksha Doda 3 jaren geleden
bovenliggende
commit
d92a7a0776

+ 2 - 2
dp/inc/cdp_txrx_stats_struct.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021,2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -55,7 +55,7 @@
 /* 1 additional GI is for invalid values */
 #define MAX_GI (4 + 1)
 #define SS_COUNT 8
-#define MAX_BW 7
+#define MAX_BW 8
 #define MAX_RECEPTION_TYPES 4
 
 #define MAX_TRANSMIT_TYPES	9

+ 3 - 2
dp/wifi3.0/be/dp_be_tx.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021,2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -531,7 +531,8 @@ dp_tx_hw_enqueue_be(struct dp_soc *soc, struct dp_vdev *vdev,
 		hal_tx_desc_set_hlos_tid(hal_tx_desc_cached, tid);
 
 	if (qdf_unlikely(vdev->pdev->delay_stats_flag) ||
-	    qdf_unlikely(wlan_cfg_is_peer_ext_stats_enabled(soc->wlan_cfg_ctx)))
+		qdf_unlikely(wlan_cfg_is_peer_ext_stats_enabled(soc->wlan_cfg_ctx)) ||
+		qdf_unlikely(soc->rdkstats_enabled))
 		tx_desc->timestamp = qdf_ktime_to_ms(qdf_ktime_real_get());
 
 	dp_verbose_debug("length:%d , type = %d, dma_addr %llx, offset %d desc id %u",

+ 1 - 1
dp/wifi3.0/dp_tx.c

@@ -3918,7 +3918,7 @@ static inline void dp_tx_sojourn_stats_process(struct dp_pdev *pdev,
 
 	sojourn_stats->cookie = (void *)peer->rdkstats_ctx;
 
-	delta_ms = qdf_ktime_to_ms(qdf_ktime_get()) -
+	delta_ms = qdf_ktime_to_ms(qdf_ktime_real_get()) -
 				txdesc_ts;
 	qdf_ewma_tx_lag_add(&peer->avg_sojourn_msdu[tid],
 			    delta_ms);

+ 1 - 1
dp/wifi3.0/dp_types.h

@@ -47,7 +47,7 @@
 #include "hal_rx.h"
 //#include "hal_rx_flow.h"
 
-#define MAX_BW 7
+#define MAX_BW 8
 #define MAX_RETRIES 4
 #define MAX_RECEPTION_TYPES 4
 

+ 3 - 2
dp/wifi3.0/li/dp_li_tx.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021,2022 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -403,7 +403,8 @@ dp_tx_hw_enqueue_li(struct dp_soc *soc, struct dp_vdev *vdev,
 	if (qdf_unlikely(vdev->pdev->delay_stats_flag) ||
 	    qdf_unlikely(
 		       wlan_cfg_is_peer_ext_stats_enabled(soc->wlan_cfg_ctx)) ||
-	    dp_tx_pkt_tracepoints_enabled())
+		dp_tx_pkt_tracepoints_enabled() ||
+		qdf_unlikely(soc->rdkstats_enabled))
 		tx_desc->timestamp = qdf_ktime_to_ms(qdf_ktime_real_get());
 
 	dp_verbose_debug("length:%d , type = %d, dma_addr %llx, offset %d desc id %u",

+ 1 - 1
dp/wifi3.0/monitor/dp_rx_mon.c

@@ -312,7 +312,7 @@ dp_rx_populate_rx_rssi_chain(struct hal_rx_ppdu_info *ppdu_info,
 			     struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
 {
 	uint8_t chain, bw;
-	int8_t rssi;
+	uint8_t rssi;
 
 	for (chain = 0; chain < SS_COUNT; chain++) {
 		for (bw = 0; bw < MAX_BW; bw++) {