From 3f5fbbbbe761486389b1bddaaf5ffa0a5b1c2404 Mon Sep 17 00:00:00 2001 From: guangde Date: Thu, 11 Jul 2019 16:20:29 +0800 Subject: [PATCH] qcacld-3.0: Add timestamp RX support in SAP mode Host need to fill netbuf with qtime instead of tsf. This function already realized in Change-Id "Ib19ac1411c4e17624c012f188297c9f2122642d2". But it only support STATION RX mode. add the similar action for SAP RX mode. Change-Id: Idb3f9da5488b19db48e96258ecb4539b5af3c9a6 CRs-Fixed: 2483566 --- core/hdd/src/wlan_hdd_softap_tx_rx.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 286b53ecf4234..7346fa1611564 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -817,6 +817,32 @@ QDF_STATUS hdd_softap_deinit_tx_rx_sta(struct hdd_adapter *adapter, return status; } +/** + * hdd_softap_tsf_timestamp_rx() - time stamp Rx netbuf + * @context: pointer to HDD context + * @netbuf: pointer to a Rx netbuf + * + * Return: None + */ +#ifdef WLAN_FEATURE_TSF_PLUS +static inline void hdd_softap_tsf_timestamp_rx(struct hdd_context *hdd_ctx, + qdf_nbuf_t netbuf) +{ + uint64_t target_time; + + if (!hdd_tsf_is_rx_set(hdd_ctx)) + return; + + target_time = ktime_to_us(netbuf->tstamp); + hdd_rx_timestamp(netbuf, target_time); +} +#else +static inline void hdd_softap_tsf_timestamp_rx(struct hdd_context *hdd_ctx, + qdf_nbuf_t netbuf) +{ +} +#endif + /** * hdd_softap_notify_tx_compl_cbk() - callback to notify tx completion * @skb: pointer to skb data @@ -948,6 +974,8 @@ QDF_STATUS hdd_softap_rx_packet_cbk(void *adapter_context, qdf_nbuf_t rx_buf) */ qdf_net_buf_debug_release_skb(skb); + hdd_softap_tsf_timestamp_rx(hdd_ctx, skb); + qdf_status = hdd_rx_deliver_to_stack(adapter, skb); if (QDF_IS_STATUS_SUCCESS(qdf_status))