Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3529ba79 authored by Surabhi Vishnoi's avatar Surabhi Vishnoi Committed by Madan Koyyalamudi
Browse files

qcacmn: Add support to parse HTT_PPDU_STATS_FOR_SMU_TLV

Firmware sends some ppdu stats required for packet capture
mode in new ppdu stats tlv HTT_PPDU_STATS_FOR_SMU_TLV.
Add code to parse it if feature is enabled via ini and
send the ppdu stats using wdi event to packet capture
component.

Change-Id: I5567007a91093dd342f37458760b3a61c040b779
CRs-Fixed: 3004476
parent 47fefb59
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -367,6 +367,7 @@ enum WDI_EVENT {
	WDI_EVENT_PKT_CAPTURE_RX_DATA,
	WDI_EVENT_PKT_CAPTURE_RX_DATA_NO_PEER,
	WDI_EVENT_PKT_CAPTURE_OFFLOAD_TX_DATA,
	WDI_EVENT_PKT_CAPTURE_PPDU_STATS,
	/* End of new event items */
	WDI_EVENT_LAST
};
+48 −0
Original line number Diff line number Diff line
@@ -4094,6 +4094,45 @@ static struct ppdu_info *dp_htt_process_tlv(struct dp_pdev *pdev,
}
#endif /* FEATURE_PERPKT_INFO */

#ifdef WLAN_FEATURE_PKT_CAPTURE_V2
static void dp_htt_process_stats_tlv(struct dp_soc *soc,
				     qdf_nbuf_t htt_t2h_msg)
{
	uint32_t length;
	uint8_t tlv_type;
	uint32_t tlv_length, tlv_expected_size;
	uint8_t *tlv_buf;

	uint32_t *msg_word = (uint32_t *) qdf_nbuf_data(htt_t2h_msg);

	length = HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(*msg_word);

	msg_word = msg_word + 4;

	while (length > 0) {
		tlv_buf = (uint8_t *)msg_word;
		tlv_type = HTT_STATS_TLV_TAG_GET(*msg_word);
		tlv_length = HTT_STATS_TLV_LENGTH_GET(*msg_word);

		if (tlv_length == 0)
			break;

		tlv_length += HTT_TLV_HDR_LEN;

		if (tlv_type == HTT_PPDU_STATS_FOR_SMU_TLV) {
			tlv_expected_size = sizeof(htt_ppdu_stats_for_smu_tlv);

			if (tlv_length >= tlv_expected_size)
				dp_wdi_event_handler(
					WDI_EVENT_PKT_CAPTURE_PPDU_STATS,
					soc, msg_word, HTT_INVALID_VDEV,
					WDI_NO_VAL, 0);
		}
		msg_word = (uint32_t *)((uint8_t *)tlv_buf + tlv_length);
		length -= (tlv_length);
	}
}
#endif
/**
 * dp_txrx_ppdu_stats_handler() - Function to process HTT PPDU stats from FW
 * @soc: DP SOC handle
@@ -4140,6 +4179,15 @@ static bool dp_txrx_ppdu_stats_handler(struct dp_soc *soc,

	return free_buf;
}
#elif defined(WLAN_FEATURE_PKT_CAPTURE_V2)
static bool dp_txrx_ppdu_stats_handler(struct dp_soc *soc,
				       uint8_t pdev_id, qdf_nbuf_t htt_t2h_msg)
{
	if (wlan_cfg_get_pkt_capture_mode(soc->wlan_cfg_ctx))
		dp_htt_process_stats_tlv(soc, htt_t2h_msg);

	return true;
}
#else
static bool dp_txrx_ppdu_stats_handler(struct dp_soc *soc,
				       uint8_t pdev_id, qdf_nbuf_t htt_t2h_msg)