Browse Source

qcacld-3.0: Save mac_id and mac_id_valid in TSF report

To support uplink delay calculation, FW will report mac_id and
mac_id_valid in TSF report so as to differentiate from legacy
TSF report. Thus save mac_id and mac_id_valid fields in TSF
report so that host can differentiate the TSF report purposes.

Change-Id: If76fd49ff9693a7733389d184a84360c0564216e
CRs-Fixed: 2991959
Jia Ding 3 years ago
parent
commit
eb0b786e14
2 changed files with 28 additions and 0 deletions
  1. 6 0
      core/mac/inc/sir_api.h
  2. 22 0
      core/wma/src/wma_features.c

+ 6 - 0
core/mac/inc/sir_api.h

@@ -3925,6 +3925,8 @@ struct sir_sme_ext_cng_chan_ind {
  * @soc_timer_high: high 32bits of synced SOC timer value
  * @global_tsf_low: low 32bits of tsf64
  * @global_tsf_high: high 32bits of tsf64
+ * @mac_id: MAC identifier
+ * @mac_id_valid: Indicate if mac_id is valid or not
  *
  * driver use this struct to store the tsf info
  */
@@ -3936,6 +3938,10 @@ struct stsf {
 	uint32_t soc_timer_high;
 	uint32_t global_tsf_low;
 	uint32_t global_tsf_high;
+#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY
+	uint32_t mac_id;
+	uint32_t mac_id_valid;
+#endif
 };
 
 #define SIR_BCN_FLT_MAX_ELEMS_IE_LIST 8

+ 22 - 0
core/wma/src/wma_features.c

@@ -309,6 +309,24 @@ end:
 }
 
 #ifdef WLAN_FEATURE_TSF
+
+#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY
+static void wma_vdev_tsf_set_mac_id(struct stsf *ptsf, uint32_t mac_id,
+				    uint32_t mac_id_valid)
+{
+	ptsf->mac_id = mac_id;
+	ptsf->mac_id_valid = mac_id_valid;
+
+	wma_nofl_debug("mac_id %d mac_id_valid %d", ptsf->mac_id,
+		       ptsf->mac_id_valid);
+}
+#else /* !WLAN_FEATURE_TSF_UPLINK_DELAY */
+static inline void wma_vdev_tsf_set_mac_id(struct stsf *ptsf, uint32_t mac_id,
+					   uint32_t mac_id_valid)
+{
+}
+#endif /* WLAN_FEATURE_TSF_UPLINK_DELAY */
+
 /**
  * wma_vdev_tsf_handler() - handle tsf event indicated by FW
  * @handle: wma context
@@ -348,6 +366,10 @@ int wma_vdev_tsf_handler(void *handle, uint8_t *data, uint32_t data_len)
 	wma_nofl_debug("g_tsf: %d %d; soc_timer: %d %d",
 		       ptsf->global_tsf_low, ptsf->global_tsf_high,
 			   ptsf->soc_timer_low, ptsf->soc_timer_high);
+
+	wma_vdev_tsf_set_mac_id(ptsf, tsf_event->mac_id,
+				tsf_event->mac_id_valid);
+
 	tsf_msg.type = eWNI_SME_TSF_EVENT;
 	tsf_msg.bodyptr = ptsf;
 	tsf_msg.bodyval = 0;