From ffcab816e958462b0cab401a9e72c40423b97884 Mon Sep 17 00:00:00 2001 From: Jia Ding Date: Mon, 28 Jun 2021 10:51:09 +0800 Subject: [PATCH] qcacmn: Get buffer_timestamp from wbm release ring Upon TX completion, get buffer_timestamp from wbm release ring descriptor. Change-Id: I0203b51c52a265711e62afc3a940392674ac014a CRs-Fixed: 2978492 --- hal/wifi3.0/hal_tx.h | 5 +++++ hal/wifi3.0/li/hal_li_generic_api.h | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/hal/wifi3.0/hal_tx.h b/hal/wifi3.0/hal_tx.h index d5de75af85..b60518c492 100644 --- a/hal/wifi3.0/hal_tx.h +++ b/hal/wifi3.0/hal_tx.h @@ -178,6 +178,8 @@ do { \ * @transmit_cnt: Number of times this frame has been transmitted * @tid: TID of the flow or MPDU queue * @peer_id: Peer ID of the flow or MPDU queue + * @buffer_timestamp: Frame system entrance timestamp in units of 1024 + * microseconds */ struct hal_tx_completion_status { uint8_t status; @@ -200,6 +202,9 @@ struct hal_tx_completion_status { uint8_t transmit_cnt; uint8_t tid; uint16_t peer_id; +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY + uint32_t buffer_timestamp:19; +#endif }; /** diff --git a/hal/wifi3.0/li/hal_li_generic_api.h b/hal/wifi3.0/li/hal_li_generic_api.h index 0862e1002c..6a3b228200 100644 --- a/hal/wifi3.0/li/hal_li_generic_api.h +++ b/hal/wifi3.0/li/hal_li_generic_api.h @@ -68,6 +68,22 @@ void hal_rx_wbm_err_info_get_generic_li(void *wbm_desc, wbm_er_info->rxdma_err_code = HAL_RX_WBM_RXDMA_ERROR_CODE_GET(wbm_desc); } +#ifdef WLAN_FEATURE_TSF_UPLINK_DELAY +static inline void +hal_tx_comp_get_buffer_timestamp(void *desc, + struct hal_tx_completion_status *ts) +{ + ts->buffer_timestamp = HAL_TX_DESC_GET(desc, WBM_RELEASE_RING_4, + BUFFER_TIMESTAMP); +} +#else /* !WLAN_FEATURE_TSF_UPLINK_DELAY */ +static inline void +hal_tx_comp_get_buffer_timestamp(void *desc, + struct hal_tx_completion_status *ts) +{ +} +#endif /* WLAN_FEATURE_TSF_UPLINK_DELAY */ + /** * hal_tx_comp_get_status() - TQM Release reason * @hal_desc: completion ring Tx status @@ -135,6 +151,8 @@ hal_tx_comp_get_status_generic_li(void *desc, void *ts1, ts->tsf = HAL_TX_DESC_GET(desc, UNIFIED_WBM_RELEASE_RING_6, TX_RATE_STATS_INFO_TX_RATE_STATS); + + hal_tx_comp_get_buffer_timestamp(desc, ts); } /**