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

Commit 80e3b667 authored by Jia Ding's avatar Jia Ding Committed by Madan Koyyalamudi
Browse files

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
parent d7b2a525
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -21,6 +21,22 @@

#include <hal_rx.h>

#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
@@ -88,6 +104,8 @@ void hal_tx_comp_get_status_generic(void *desc,

	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);
}

/**
+6 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -165,6 +166,8 @@ enum hal_tx_ret_buf_manager {
 * @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;
@@ -187,6 +190,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
};

/**