qcacmn: Update statistics counters

Account for tx.success and tx.comp_pkt stats counters
at peer level and propagate them to pdev level.
NSS stats need to be updated for all packets.

Change-Id: I18de95217690c9234060253671e0d5e1ef295e2a
CRs-Fixed: 2270816
diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c
index 12b6ec7..a8b8107 100644
--- a/dp/wifi3.0/dp_main.c
+++ b/dp/wifi3.0/dp_main.c
@@ -5180,6 +5180,11 @@
 			pdev->stats.tx.dropped.fw_reason3);
 	DP_PRINT_STATS("	Aged Out from msdu/mpdu queues = %d",
 			pdev->stats.tx.dropped.age_out);
+	DP_PRINT_STATS("	Multicast:");
+	DP_PRINT_STATS("	Packets: %u",
+		       pdev->stats.tx.mcast.num);
+	DP_PRINT_STATS("	Bytes: %llu",
+		       pdev->stats.tx.mcast.bytes);
 	DP_PRINT_STATS("Scatter Gather:");
 	DP_PRINT_STATS("	Packets = %d",
 			pdev->stats.tx_i.sg.sg_pkt.num);
@@ -5656,7 +5661,9 @@
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)vdev->pdev;
 	uint8_t mcs, pkt_type;
-	uint32_t index;
+	uint8_t index;
+	char nss[DP_NSS_LENGTH];
+	int nss_index;
 
 	DP_PRINT_STATS("Tx Rate Info:\n");
 
@@ -5689,6 +5696,13 @@
 			pdev->stats.tx.bw[0], pdev->stats.tx.bw[1],
 			pdev->stats.tx.bw[2], pdev->stats.tx.bw[3]);
 
+	index = 0;
+	for (nss_index = 0; nss_index < SS_COUNT; nss_index++) {
+		index += qdf_snprint(&nss[index], DP_NSS_LENGTH - index,
+				" %d", pdev->stats.tx.nss[nss_index]);
+	}
+
+	DP_PRINT_STATS("NSS(1-8) = %s", nss);
 	DP_PRINT_STATS("OFDMA = %d", pdev->stats.tx.ofdma);
 	DP_PRINT_STATS("STBC = %d", pdev->stats.tx.stbc);
 	DP_PRINT_STATS("LDPC = %d", pdev->stats.tx.ldpc);
diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c
index cc4249a..03ca509 100644
--- a/dp/wifi3.0/dp_rx.c
+++ b/dp/wifi3.0/dp_rx.c
@@ -1145,6 +1145,7 @@
 	/* Save tid to skb->priority */
 	DP_RX_TID_SAVE(nbuf, tid);
 
+	DP_STATS_INC(peer, rx.bw[bw], 1);
 	DP_STATS_INC(peer, rx.nss[nss], 1);
 	DP_STATS_INC(peer, rx.sgi_count[sgi], 1);
 	DP_STATS_INCC(peer, rx.err.mic_err, 1,
@@ -1153,7 +1154,6 @@
 		      hal_rx_mpdu_end_decrypt_err_get(rx_tlv_hdr));
 
 	DP_STATS_INC(peer, rx.wme_ac_type[TID_TO_WME_AC(tid)], 1);
-	DP_STATS_INC(peer, rx.bw[bw], 1);
 	DP_STATS_INC(peer, rx.reception_type[reception_type], 1);
 
 	DP_STATS_INCC(peer, rx.pkt_type[pkt_type].mcs_count[MAX_MCS], 1,
diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c
index 1429fe0..fa60ba0 100644
--- a/dp/wifi3.0/dp_tx.c
+++ b/dp/wifi3.0/dp_tx.c
@@ -2613,32 +2613,34 @@
 	if (peer->bss_peer) {
 		DP_STATS_INC_PKT(peer, tx.mcast, 1, length);
 	} else {
-		if (ts->status == HAL_TX_TQM_RR_FRAME_ACKED) {
-			DP_STATS_INC_PKT(peer, tx.tx_success, 1, length);
-		}
 		DP_STATS_INC_PKT(peer, tx.ucast, 1, length);
 	}
 
+	DP_STATS_INC_PKT(peer, tx.comp_pkt, 1, length);
+
+	DP_STATS_INCC_PKT(peer, tx.tx_success, 1, length,
+			  (ts->status == HAL_TX_TQM_RR_FRAME_ACKED));
+
 	DP_STATS_INCC(peer, tx.dropped.age_out, 1,
-			(ts->status == HAL_TX_TQM_RR_REM_CMD_AGED));
+		     (ts->status == HAL_TX_TQM_RR_REM_CMD_AGED));
 
 	DP_STATS_INCC(peer, tx.dropped.fw_rem, 1,
-			(ts->status == HAL_TX_TQM_RR_REM_CMD_REM));
+		     (ts->status == HAL_TX_TQM_RR_REM_CMD_REM));
 
 	DP_STATS_INCC(peer, tx.dropped.fw_rem_notx, 1,
-			(ts->status == HAL_TX_TQM_RR_REM_CMD_NOTX));
+		     (ts->status == HAL_TX_TQM_RR_REM_CMD_NOTX));
 
 	DP_STATS_INCC(peer, tx.dropped.fw_rem_tx, 1,
-			(ts->status == HAL_TX_TQM_RR_REM_CMD_TX));
+		     (ts->status == HAL_TX_TQM_RR_REM_CMD_TX));
 
 	DP_STATS_INCC(peer, tx.dropped.fw_reason1, 1,
-			(ts->status == HAL_TX_TQM_RR_FW_REASON1));
+		     (ts->status == HAL_TX_TQM_RR_FW_REASON1));
 
 	DP_STATS_INCC(peer, tx.dropped.fw_reason2, 1,
-			(ts->status == HAL_TX_TQM_RR_FW_REASON2));
+		     (ts->status == HAL_TX_TQM_RR_FW_REASON2));
 
 	DP_STATS_INCC(peer, tx.dropped.fw_reason3, 1,
-			(ts->status == HAL_TX_TQM_RR_FW_REASON3));
+		     (ts->status == HAL_TX_TQM_RR_FW_REASON3));
 
 	if (!ts->status == HAL_TX_TQM_RR_FRAME_ACKED)
 		return;
@@ -2677,7 +2679,6 @@
 	DP_STATS_INC(peer, tx.wme_ac_type[TID_TO_WME_AC(ts->tid)], 1);
 	DP_STATS_INCC(peer, tx.stbc, 1, ts->stbc);
 	DP_STATS_INCC(peer, tx.ldpc, 1, ts->ldpc);
-	DP_STATS_INC_PKT(peer, tx.tx_success, 1, length);
 	DP_STATS_INCC(peer, tx.retries, 1, ts->transmit_cnt > 1);
 
 	if (soc->cdp_soc.ol_ops->update_dp_stats) {