From c155eb244932a3d5515874e8081a3bba23cae6ac Mon Sep 17 00:00:00 2001 From: Jia Ding Date: Tue, 26 Apr 2022 11:14:19 +0800 Subject: [PATCH] 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 --- core/mac/inc/sir_api.h | 6 ++++++ core/wma/src/wma_features.c | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 9ce1452e5df4..07bfe3bb0e91 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -4413,6 +4413,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 */ @@ -4424,6 +4426,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 diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index e2532df44c4f..d5eb08a3d295 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -313,6 +313,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 @@ -352,6 +370,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;