qcacld-3.0: update PTP timestamp for Rx packet

Host driver could not get correct timestamp of Rx AMPDU packet sometimes.
The reason is PTP timestamp is stored in PPDU_END info, only last msdu
description contain it.Rx indication which sent from target has limited
number of MSDU.If none of them is last msdu, Host driver will not get
the correct timestamp.
Add two parameters to record the last system time and timestamp. If
Host driver detect no last msdu in Rx indication, It will calculate the
timestamp according to the difference of two parameters and current
system time.

Change-Id: Iea94f5c0a681ec1d377cbed9dd5b00b100223cc7
CRs-Fixed: 2513659
此提交包含在:
guangde
2019-09-04 18:17:33 +08:00
提交者 nshrivas
父節點 4613baba7f
當前提交 3e57c247d2
共有 3 個檔案被更改,包括 114 行新增11 行删除

查看文件

@@ -1396,6 +1396,40 @@ int htt_rx_msdu_buff_in_order_replenish(htt_pdev_handle pdev, uint32_t num)
return filled;
}
#if defined(WLAN_FEATURE_TSF_PLUS) && !defined(CONFIG_HL_SUPPORT)
/**
* htt_rx_tail_msdu_timestamp() - update tail msdu tsf64 timestamp
* @tail_rx_desc: pointer to tail msdu descriptor
* @timestamp_rx_desc: pointer to timestamp msdu descriptor
*
* Return: none
*/
static inline void htt_rx_tail_msdu_timestamp(
struct htt_host_rx_desc_base *tail_rx_desc,
struct htt_host_rx_desc_base *timestamp_rx_desc)
{
if (tail_rx_desc) {
if (!timestamp_rx_desc) {
tail_rx_desc->ppdu_end.wb_timestamp_lower_32 = 0;
tail_rx_desc->ppdu_end.wb_timestamp_upper_32 = 0;
} else {
if (timestamp_rx_desc != tail_rx_desc) {
tail_rx_desc->ppdu_end.wb_timestamp_lower_32 =
timestamp_rx_desc->ppdu_end.wb_timestamp_lower_32;
tail_rx_desc->ppdu_end.wb_timestamp_upper_32 =
timestamp_rx_desc->ppdu_end.wb_timestamp_upper_32;
}
}
}
}
#else
static inline void htt_rx_tail_msdu_timestamp(
struct htt_host_rx_desc_base *tail_rx_desc,
struct htt_host_rx_desc_base *timestamp_rx_desc)
{
}
#endif
static int
htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
qdf_nbuf_t rx_ind_msg,
@@ -1409,12 +1443,13 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
unsigned int msdu_count = 0;
uint8_t offload_ind, frag_ind;
uint8_t peer_id;
struct htt_host_rx_desc_base *rx_desc;
struct htt_host_rx_desc_base *rx_desc = NULL;
enum rx_pkt_fate status = RX_PKT_FATE_SUCCESS;
qdf_dma_addr_t paddr;
qdf_mem_info_t mem_map_table = {0};
int ret = 1;
bool ipa_smmu = false;
struct htt_host_rx_desc_base *timestamp_rx_desc = NULL;
HTT_ASSERT1(htt_rx_in_order_ring_elems(pdev) != 0);
@@ -1523,6 +1558,10 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
rx_desc = htt_rx_desc(msdu);
htt_rx_extract_lro_info(msdu, rx_desc);
/* check if the msdu is last mpdu */
if (rx_desc->attention.last_mpdu)
timestamp_rx_desc = rx_desc;
/*
* Make the netbuf's data pointer point to the payload rather
* than the descriptor.
@@ -1640,6 +1679,8 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev,
}
}
htt_rx_tail_msdu_timestamp(rx_desc, timestamp_rx_desc);
end:
return ret;
}