Kaynağa Gözat

qcacmn: support 64 bits timestamp in wmi mgmt completion

added support for 64 bits timestamp that come for each tx
wmi mgmt completion

Change-Id: I70d66bcbe04aebad507a872faa97df8ab9752657
nobelj 5 yıl önce
ebeveyn
işleme
cf57a9af2a

+ 14 - 0
dp/inc/cdp_txrx_cmn_struct.h

@@ -1501,6 +1501,20 @@ struct cdp_tx_indication_info {
 	qdf_nbuf_t mpdu_nbuf;
 };
 
+/**
+ * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
+ * @ppdu_id: ppdu_id
+ * @is_sgen_pkt: payload recevied from wmi or htt path
+ * @retries_count: retries count
+ * @tx_tsf: 64 bit timestamp
+ */
+struct cdp_tx_mgmt_comp_info {
+	uint32_t ppdu_id;
+	bool is_sgen_pkt;
+	uint16_t retries_count;
+	uint64_t tx_tsf;
+};
+
 /**
  * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  * @completion_status: completion status - OK/Filter/Abort/Timeout

+ 20 - 3
dp/wifi3.0/dp_htt.c

@@ -2772,6 +2772,8 @@ dp_process_ppdu_stats_tx_mgmtctrl_payload_tlv(struct dp_pdev *pdev,
 {
 	uint32_t *nbuf_ptr;
 	uint8_t trim_size;
+	size_t head_size;
+	struct cdp_tx_mgmt_comp_info *ptr_mgmt_comp_info;
 
 	if ((!pdev->tx_sniffer_enable) && (!pdev->mcopy_mode) &&
 	    (!pdev->bpr_enable) && (!pdev->tx_capture_enabled))
@@ -2787,9 +2789,24 @@ dp_process_ppdu_stats_tx_mgmtctrl_payload_tlv(struct dp_pdev *pdev,
 	qdf_nbuf_trim_tail(tag_buf, qdf_nbuf_len(tag_buf) -
 			    pdev->mgmtctrl_frm_info.mgmt_buf_len);
 
-	nbuf_ptr = (uint32_t *)qdf_nbuf_push_head(
-				tag_buf, sizeof(ppdu_id));
-	*nbuf_ptr = ppdu_id;
+	if (pdev->tx_capture_enabled) {
+		head_size = sizeof(struct cdp_tx_mgmt_comp_info);
+		if (qdf_unlikely(qdf_nbuf_headroom(tag_buf) < head_size)) {
+			qdf_err("Fail to get headroom h_sz %d h_avail %d\n",
+				head_size, qdf_nbuf_headroom(tag_buf));
+			qdf_assert_always(0);
+			return QDF_STATUS_E_NOMEM;
+		}
+		ptr_mgmt_comp_info = (struct cdp_tx_mgmt_comp_info *)
+					qdf_nbuf_push_head(tag_buf, head_size);
+		qdf_assert_always(ptr_mgmt_comp_info);
+		ptr_mgmt_comp_info->ppdu_id = ppdu_id;
+		ptr_mgmt_comp_info->is_sgen_pkt = true;
+	} else {
+		head_size = sizeof(ppdu_id);
+		nbuf_ptr = (uint32_t *)qdf_nbuf_push_head(tag_buf, head_size);
+		*nbuf_ptr = ppdu_id;
+	}
 
 	if (pdev->bpr_enable) {
 		dp_wdi_event_handler(WDI_EVENT_TX_BEACON, pdev->soc,

+ 4 - 0
wmi/inc/wmi_unified_param.h

@@ -5585,12 +5585,16 @@ typedef struct {
  * @status: WMI_MGMT_TX_COMP_STATUS_TYPE
  * @pdev_id: pdev_id
  * @ppdu_id: ppdu_id
+ * @retries_count: retries count
+ * @tx_tsf: 64 bits completion timestamp
  */
 typedef struct {
 	uint32_t	desc_id;
 	uint32_t	status;
 	uint32_t	pdev_id;
 	uint32_t        ppdu_id;
+	uint32_t	retries_count;
+	uint64_t	tx_tsf;
 } wmi_host_mgmt_tx_compl_event;
 
 /**