qca-wifi: CFR: Add enhanced debug counters

Add counters for following scenarios -

1. Ucode aborts DMA of CFR data when a higher priority TX/RX activity
needs to be scheduled, add counters in host to identify the no. of
aborts.

2. Add counters to track the total no. of TX-based CFR captures since
wifi up.

Change-Id: I3c0e0e68651348c3484a14dfcd1f664962c8647f
diff --git a/target_if/cfr/src/target_if_cfr_6018.c b/target_if/cfr/src/target_if_cfr_6018.c
index b427b21..5c572fd 100644
--- a/target_if/cfr/src/target_if_cfr_6018.c
+++ b/target_if/cfr/src/target_if_cfr_6018.c
@@ -490,6 +490,8 @@
 						     WLAN_UMAC_COMP_CFR);
 
 	if (module_id == CORRELATE_TXRX_EV_MODULE_ID) {
+		if (lut->tx_recv)
+			pcfr->cfr_dma_aborts++;
 		lut->tx_recv = true;
 	} else if (module_id == CORRELATE_DBR_MODULE_ID) {
 		pcfr->dbr_evt_cnt++;
@@ -557,6 +559,7 @@
 			lut->tx_recv = false;
 			lut->tx_ppdu_id = 0;
 			pcfr->clear_txrx_event++;
+			pcfr->cfr_dma_aborts++;
 			status = STATUS_HOLD;
 		}
 	} else {
@@ -1204,6 +1207,7 @@
 	}
 
 	pcfr->tx_evt_cnt++;
+	pcfr->total_tx_evt_cnt++;
 
 	lut->tx_ppdu_id = (tx_evt_param.correlation_info_2 >> 16);
 	lut->tx_address1 = tx_evt_param.correlation_info_1;
@@ -1550,6 +1554,7 @@
 	pcfr->tx_evt_cnt = 0;
 	pcfr->dbr_evt_cnt = 0;
 	pcfr->release_cnt = 0;
+	pcfr->total_tx_evt_cnt = 0;
 	pcfr->rx_tlv_evt_cnt = 0;
 	pcfr->flush_dbr_cnt = 0;
 	pcfr->flush_timeout_dbr_cnt = 0;
@@ -1558,6 +1563,7 @@
 	pcfr->bb_captured_channel_cnt = 0;
 	pcfr->bb_captured_timeout_cnt = 0;
 	pcfr->rx_loc_info_valid_cnt = 0;
+	pcfr->cfr_dma_aborts = 0;
 	qdf_mem_zero(&pcfr->chan_capture_status,
 		     sizeof(uint64_t) * NUM_CHAN_CAPTURE_STATUS);
 	qdf_mem_zero(&pcfr->bb_captured_reason_cnt,
diff --git a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h
index 2b072dd..9560a6e 100644
--- a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h
+++ b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h
@@ -444,6 +444,22 @@
  * pdev_obj: pointer to pdev object
  * is_cfr_capable: flag to determine if cfr is enabled or not
  * cfr_timer_enable: flag to enable/disable timer
+ * cfr_mem_chunk: Region of memory used for storing cfr data
+ * cfr_max_sta_count: Maximum stations supported in one-shot capture mode
+ * num_subbufs: No. of sub-buffers used in relayfs
+ * subbuf_size: Size of sub-buffer used in relayfs
+ * chan_ptr: Channel in relayfs
+ * dir_ptr: Parent directory of relayfs file
+ * lut: lookup table used to store asynchronous DBR and TX/RX events for
+ * correlation
+ * dbr_buf_size: Size of DBR completion buffer
+ * dbr_num_bufs: No. of DBR completions
+ * tx_evt_cnt: No. of TX completion events till CFR stop was issued
+ * total_tx_evt_cnt: No. of Tx completion events since wifi was up
+ * dbr_evt_cnt: No. of WMI DBR completion events
+ * release_cnt: No. of CFR data buffers relayed to userspace
+ * rcc_param: Structure to store CFR config for the current commit session
+ * global: Structure to store accumulated CFR config
  * rx_tlv_evt_cnt: Number of CFR WDI events from datapath
  * lut_age_timer: Timer to flush pending TXRX/DBR events in lookup table
  * lut_timer_init: flag to determine if lut_age_timer is initialized or not
@@ -465,10 +481,17 @@
  *	[3] - No. PPDUs filtered due to freeze_reason_TA_RA_TYPE_FILTER
  *	[4] - No. PPDUs filtered due to freeze_reason_NDPA_NDP
  *	[5] - No. PPDUs filtered due to freeze_reason_ALL_PACKET
- * release_err_cnt: No. of lookup table entries freed due to invalid CFR data
- * length
+ * flush_dbr_cnt: No. of un-correlated DBR completions flushed when a newer PPDU
+ * is correlated successfully with newer DBR completion
+ * invalid_dma_length_cnt: No. of buffers for which CFR DMA header length (or)
+ * data length was invalid
+ * flush_timeout_dbr_cnt: No. of DBR completion flushed out in ageout logic
+ * clear_txrx_event: No. of PPDU status TLVs over-written in LUT
+ * unassoc_pool: Pool of un-associated clients used when capture method is
+ * CFR_CAPTURE_METHOD_PROBE_RESPONSE
  * last_success_tstamp: DBR timestamp which indicates that both DBR and TX/RX
  * events have been received successfully.
+ * cfr_dma_aborts: No. of CFR DMA aborts in ucode
  */
 /*
  * To be extended if we get more capbality info
@@ -489,6 +512,7 @@
 	uint32_t dbr_buf_size;
 	uint32_t dbr_num_bufs;
 	uint64_t tx_evt_cnt;
+	uint64_t total_tx_evt_cnt;
 	uint64_t dbr_evt_cnt;
 	uint64_t release_cnt;
 #ifdef WLAN_ENH_CFR_ENABLE
@@ -507,6 +531,7 @@
 	uint64_t flush_timeout_dbr_cnt;
 	uint64_t clear_txrx_event;
 	uint64_t last_success_tstamp;
+	uint64_t cfr_dma_aborts;
 #endif
 	struct unassoc_pool_entry unassoc_pool[MAX_CFR_ENABLED_CLIENTS];
 };
diff --git a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c
index c5e90fb..fd589c7 100644
--- a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c
+++ b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c
@@ -800,29 +800,31 @@
 		return status;
 
 	cfr_err("bb_captured_channel_cnt = %llu\n",
-		 pcfr->bb_captured_channel_cnt);
+		pcfr->bb_captured_channel_cnt);
 	cfr_err("bb_captured_timeout_cnt = %llu\n",
-		 pcfr->bb_captured_timeout_cnt);
+		pcfr->bb_captured_timeout_cnt);
 	cfr_err("rx_loc_info_valid_cnt = %llu\n",
-		 pcfr->rx_loc_info_valid_cnt);
-	cfr_err("tx_evt_cnt = %llu\n",
-		 pcfr->tx_evt_cnt);
+		pcfr->rx_loc_info_valid_cnt);
+	cfr_err("total_tx_evt_cnt = %llu\n",
+		pcfr->total_tx_evt_cnt);
 	cfr_err("dbr_evt_cnt = %llu\n",
-		 pcfr->dbr_evt_cnt);
+		pcfr->dbr_evt_cnt);
 	cfr_err("rx_tlv_evt_cnt = %llu\n",
-		 pcfr->rx_tlv_evt_cnt);
+		pcfr->rx_tlv_evt_cnt);
 	cfr_err("release_cnt = %llu\n",
-		 pcfr->release_cnt);
+		pcfr->release_cnt);
 	cfr_err("Error cnt:\n");
 	cfr_err("flush_dbr_cnt = %llu\n",
-		 pcfr->flush_dbr_cnt);
+		pcfr->flush_dbr_cnt);
 	cfr_err("invalid_dma_length_cnt = %llu\n",
-		 pcfr->invalid_dma_length_cnt);
+		pcfr->invalid_dma_length_cnt);
 	cfr_err("flush_timeout_dbr_cnt = %llu\n",
-		 pcfr->flush_timeout_dbr_cnt);
+		pcfr->flush_timeout_dbr_cnt);
 	cfr_err("PPDU id mismatch for same cookie:\n");
 	cfr_err("clear_txrx_event = %llu\n",
-		 pcfr->clear_txrx_event);
+		pcfr->clear_txrx_event);
+	cfr_err("cfr_dma_aborts = %llu\n",
+		pcfr->cfr_dma_aborts);
 
 	cfr_err("Channel capture status:\n");
 	for (counter = 0; counter < CAPTURE_MAX; counter++) {