From 66a250bbb532de9af896e47da1d535bc112ca291 Mon Sep 17 00:00:00 2001 From: Yu Wang Date: Wed, 19 Jul 2017 11:46:40 +0800 Subject: [PATCH] qcacld-3.0: add ini config for PTP options Add ini param 'gtsf_ptp_options' to control PTP options, it's a bitmap: bit0 - PTP_OPT_RX(0x1) set this bit to enable RX time stamping bit1 - PTP_OPT_TX(0x2) set this bit to enable TX time stamping bit2 - PTP_OPT_RAW(0x4) set this bit to use raw time as timestamp bit3 - TSF_DBG_FS(0x8) set this bit to add device attriubte 'tsf' for iface The default value of gtsf_ptp_options is 0xf Propagated from qcacld-2.0. Change-Id: Ie53d503bdd2e85790502583a238ee138f4bcf6c6 CRs-Fixed: 2079466 --- core/bmi/src/ol_fw_common.c | 15 ++++------ core/cds/inc/cds_api.h | 16 +++++++++++ core/cds/src/cds_api.c | 51 ++++++++++++++++++++++++++++++++++ core/dp/ol/inc/ol_cfg.h | 19 +++++++++++++ core/dp/txrx/ol_cfg.c | 19 +++++++++++++ core/dp/txrx/ol_rx.c | 13 ++++++--- core/dp/txrx/ol_txrx.c | 1 + core/hdd/inc/wlan_hdd_cfg.h | 16 +++++++++++ core/hdd/inc/wlan_hdd_tsf.h | 34 +++++++++++++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 9 ++++++ core/hdd/src/wlan_hdd_tsf.c | 52 ++++++++++++++++++++++------------- core/hdd/src/wlan_hdd_tx_rx.c | 21 +++++++++++++- 12 files changed, 232 insertions(+), 34 deletions(-) diff --git a/core/bmi/src/ol_fw_common.c b/core/bmi/src/ol_fw_common.c index d9584afa60b0..2799ff0aee5a 100644 --- a/core/bmi/src/ol_fw_common.c +++ b/core/bmi/src/ol_fw_common.c @@ -97,15 +97,6 @@ ol_usb_extra_initialization(struct ol_context *ol_ctx) return status; } -#if defined(WLAN_FEATURE_TSF_PLUS) -#define SDIO_HI_ACS_FLAGS (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET | \ - HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE) -#else -#define SDIO_HI_ACS_FLAGS (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET | \ - HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET | \ - HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE) -#endif - /*Setting SDIO block size, mbox ISR yield limit for SDIO based HIF*/ static QDF_STATUS ol_sdio_extra_initialization(struct ol_context *ol_ctx) @@ -173,7 +164,11 @@ QDF_STATUS ol_sdio_extra_initialization(struct ol_context *ol_ctx) goto exit; } - param |= SDIO_HI_ACS_FLAGS; + param |= (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET | + HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE); + + if (!cds_is_ptp_tx_opt_enabled()) + param |= HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET; /* enable TX completion to collect tx_desc for pktlog */ if (cds_is_packet_log_enabled()) diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index fb7318236c14..4a35fef9136e 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -393,6 +393,22 @@ void cds_get_and_reset_log_completion(uint32_t *is_fatal, bool *recovery_needed); bool cds_is_log_report_in_progress(void); bool cds_is_fatal_event_enabled(void); + +#ifdef WLAN_FEATURE_TSF_PLUS +bool cds_is_ptp_rx_opt_enabled(void); +bool cds_is_ptp_tx_opt_enabled(void); +#else +static inline bool cds_is_ptp_rx_opt_enabled(void) +{ + return false; +} + +static inline bool cds_is_ptp_tx_opt_enabled(void) +{ + return false; +} +#endif + uint32_t cds_get_log_indicator(void); void cds_set_fatal_event(bool value); void cds_wlan_flush_host_logs_for_fatal(void); diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index b6baa949c32b..8c465cd630cc 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -43,6 +43,7 @@ #include "cds_reg_service.h" #include "wma_types.h" #include "wlan_hdd_main.h" +#include "wlan_hdd_tsf.h" #include #include "pld_common.h" @@ -316,6 +317,10 @@ static void cds_cdp_cfg_attach(struct cds_config_info *cds_cfg) */ cdp_cfg_set_packet_log_enabled(soc, gp_cds_context->cfg_ctx, (uint8_t)cds_is_packet_log_enabled()); + + /* adjust the ptp rx option default value based on CFG INI setting */ + cdp_cfg_set_ptp_rx_opt_enabled(soc, gp_cds_context->cfg_ctx, + (uint8_t)cds_is_ptp_rx_opt_enabled()); } static QDF_STATUS cds_register_all_modules(void) { @@ -2217,6 +2222,52 @@ bool cds_is_fatal_event_enabled(void) return p_cds_context->enable_fatal_event; } +#ifdef WLAN_FEATURE_TSF_PLUS +bool cds_is_ptp_rx_opt_enabled(void) +{ + struct hdd_context *hdd_ctx; + p_cds_contextType p_cds_context; + + p_cds_context = cds_get_global_context(); + if (!p_cds_context) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, + "%s: cds context is Invalid", __func__); + return false; + } + + hdd_ctx = (struct hdd_context *)(p_cds_context->pHDDContext); + if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, + "%s: Hdd Context is Null", __func__); + return false; + } + + return HDD_TSF_IS_RX_SET(hdd_ctx); +} + +bool cds_is_ptp_tx_opt_enabled(void) +{ + struct hdd_context *hdd_ctx; + p_cds_contextType p_cds_context; + + p_cds_context = cds_get_global_context(); + if (!p_cds_context) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, + "%s: cds context is Invalid", __func__); + return false; + } + + hdd_ctx = (struct hdd_context *)(p_cds_context->pHDDContext); + if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) { + QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, + "%s: Hdd Context is Null", __func__); + return false; + } + + return HDD_TSF_IS_TX_SET(hdd_ctx); +} +#endif + /** * cds_get_log_indicator() - Get the log flush indicator * diff --git a/core/dp/ol/inc/ol_cfg.h b/core/dp/ol/inc/ol_cfg.h index 40123a48e4fd..062c6af81719 100644 --- a/core/dp/ol/inc/ol_cfg.h +++ b/core/dp/ol/inc/ol_cfg.h @@ -86,6 +86,9 @@ struct txrx_pdev_cfg_t { u8 rx_fwd_disabled; u8 is_packet_log_enabled; u8 is_full_reorder_offload; +#ifdef WLAN_FEATURE_TSF_PLUS + u8 is_ptp_rx_opt_enabled; +#endif struct wlan_ipa_uc_rsc_t ipa_uc_rsc; bool ip_tcp_udp_checksum_offload; bool enable_rxthread; @@ -425,6 +428,22 @@ int ol_cfg_is_full_reorder_offload(struct cdp_cfg *cfg_pdev); int ol_cfg_is_rx_thread_enabled(struct cdp_cfg *cfg_pdev); +#ifdef WLAN_FEATURE_TSF_PLUS +void ol_set_cfg_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev, u_int8_t val); +u_int8_t ol_cfg_is_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev); +#else +static inline void +ol_set_cfg_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev, u_int8_t val) +{ +} + +static inline u_int8_t +ol_cfg_is_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev) +{ + return 0; +} +#endif + /** * ol_cfg_is_ip_tcp_udp_checksum_offload_enabled() - return * ip_tcp_udp_checksum_offload is enable/disable diff --git a/core/dp/txrx/ol_cfg.c b/core/dp/txrx/ol_cfg.c index 246d7847ee69..6b3559dc655b 100644 --- a/core/dp/txrx/ol_cfg.c +++ b/core/dp/txrx/ol_cfg.c @@ -133,6 +133,9 @@ struct cdp_cfg *ol_pdev_cfg_attach(qdf_device_t osdev, void *pcfg_param) cfg_ctx->rx_fwd_disabled = 0; cfg_ctx->is_packet_log_enabled = 0; cfg_ctx->is_full_reorder_offload = cfg_param->is_full_reorder_offload; +#ifdef WLAN_FEATURE_TSF_PLUS + cfg_ctx->is_ptp_rx_opt_enabled = 0; +#endif cfg_ctx->ipa_uc_rsc.uc_offload_enabled = cfg_param->is_uc_offload_enabled; cfg_ctx->ipa_uc_rsc.tx_max_buf_cnt = cfg_param->uc_tx_buffer_count; @@ -315,6 +318,22 @@ int ol_cfg_is_full_reorder_offload(struct cdp_cfg *cfg_pdev) return cfg->is_full_reorder_offload; } +#ifdef WLAN_FEATURE_TSF_PLUS +void ol_set_cfg_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev, u_int8_t val) +{ + struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev; + + cfg->is_ptp_rx_opt_enabled = val; +} + +u_int8_t ol_cfg_is_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev) +{ + struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev; + + return cfg->is_ptp_rx_opt_enabled; +} +#endif + /** * ol_cfg_is_rx_thread_enabled() - return rx_thread is enable/disable * @pdev : handle to the physical device diff --git a/core/dp/txrx/ol_rx.c b/core/dp/txrx/ol_rx.c index 9014a31ff17a..a8a4bd791399 100644 --- a/core/dp/txrx/ol_rx.c +++ b/core/dp/txrx/ol_rx.c @@ -1142,20 +1142,25 @@ ol_rx_filter(struct ol_txrx_vdev_t *vdev, } #ifdef WLAN_FEATURE_TSF_PLUS -static inline void ol_rx_timestamp(void *rx_desc, qdf_nbuf_t msdu) +static inline void ol_rx_timestamp(struct cdp_cfg *cfg_pdev, + void *rx_desc, qdf_nbuf_t msdu) { struct htt_rx_ppdu_desc_t *rx_ppdu_desc; + if (!ol_cfg_is_ptp_rx_opt_enabled(cfg_pdev)) + return; + if (!rx_desc || !msdu) return; rx_ppdu_desc = (struct htt_rx_ppdu_desc_t *)((uint8_t *)(rx_desc) - HTT_RX_IND_HL_BYTES + HTT_RX_IND_HDR_PREFIX_BYTES); msdu->tstamp = ns_to_ktime((u_int64_t)rx_ppdu_desc->tsf32 * - NSEC_PER_USEC); + NSEC_PER_USEC); } #else -static inline void ol_rx_timestamp(void *rx_desc, qdf_nbuf_t msdu) +static inline void ol_rx_timestamp(struct cdp_cfg *cfg_pdev, + void *rx_desc, qdf_nbuf_t msdu) { } #endif @@ -1341,7 +1346,7 @@ DONE: OL_RX_ERR_NONE); TXRX_STATS_MSDU_INCR(vdev->pdev, rx.delivered, msdu); - ol_rx_timestamp(rx_desc, msdu); + ol_rx_timestamp(pdev->ctrl_pdev, rx_desc, msdu); OL_TXRX_LIST_APPEND(deliver_list_head, deliver_list_tail, msdu); } diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 8462bba0b992..f9448733be89 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -5640,6 +5640,7 @@ static struct cdp_cfg_ops ol_ops_cfg = { .set_flow_control_parameters = ol_txrx_wrapper_set_flow_control_parameters, .set_flow_steering = ol_set_cfg_flow_steering, + .set_ptp_rx_opt_enabled = ol_set_cfg_ptp_rx_opt_enabled, }; static struct cdp_peer_ops ol_ops_peer = { diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 7907964cafc4..1b37f4bb5e19 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -8920,6 +8920,18 @@ enum dot11p_mode { #define TSF_GPIO_PIN_INVALID (255) #define CFG_SET_TSF_GPIO_PIN_DEFAULT (TSF_GPIO_PIN_INVALID) +#ifdef WLAN_FEATURE_TSF_PLUS +/* PTP options */ +#define CFG_SET_TSF_PTP_OPT_NAME "gtsf_ptp_options" +#define CFG_SET_TSF_PTP_OPT_MIN (0) +#define CFG_SET_TSF_PTP_OPT_MAX (0xff) +#define CFG_SET_TSF_PTP_OPT_RX (0x1) +#define CFG_SET_TSF_PTP_OPT_TX (0x2) +#define CFG_SET_TSF_PTP_OPT_RAW (0x4) +#define CFG_SET_TSF_DBG_FS (0x8) +#define CFG_SET_TSF_PTP_OPT_DEFAULT (0xf) +#endif + /* * Dense traffic threshold * traffic threshold required for dense roam scan @@ -12869,6 +12881,10 @@ struct hdd_config { uint8_t inform_bss_rssi_raw; #ifdef WLAN_FEATURE_TSF uint32_t tsf_gpio_pin; + +#ifdef WLAN_FEATURE_TSF_PLUS + uint8_t tsf_ptp_options; +#endif /* WLAN_FEATURE_TSF_PLUS */ #endif uint32_t roam_dense_traffic_thresh; uint32_t roam_dense_rssi_thresh_offset; diff --git a/core/hdd/inc/wlan_hdd_tsf.h b/core/hdd/inc/wlan_hdd_tsf.h index 384ee2c444ac..561555d68ddf 100644 --- a/core/hdd/inc/wlan_hdd_tsf.h +++ b/core/hdd/inc/wlan_hdd_tsf.h @@ -27,6 +27,7 @@ #if !defined WLAN_HDD_TSF_H #define WLAN_HDD_TSF_H +#include "wlan_hdd_cfg.h" struct hdd_context; @@ -169,6 +170,39 @@ static inline int hdd_get_tsf_cb(void *pcb_cxt, struct stsf *ptsf) #endif #if defined(WLAN_FEATURE_TSF_PLUS) && defined(WLAN_FEATURE_TSF) +#define HDD_TSF_IS_PTP_ENABLED(hdd) \ +({ \ + struct hdd_context *hdd_ctx = (hdd); \ + hdd_ctx && hdd_ctx->config && hdd_ctx->config->tsf_ptp_options; \ +}) + +#define HDD_TSF_IS_TX_SET(hdd) \ +({ \ + struct hdd_context *hdd_ctx = (hdd); \ + hdd_ctx && hdd_ctx->config && \ + (hdd_ctx->config->tsf_ptp_options & CFG_SET_TSF_PTP_OPT_TX); \ +}) + +#define HDD_TSF_IS_RX_SET(hdd) \ +({ \ + struct hdd_context *hdd_ctx = (hdd); \ + hdd_ctx && hdd_ctx->config && \ + (hdd_ctx->config->tsf_ptp_options & CFG_SET_TSF_PTP_OPT_RX); \ +}) + +#define HDD_TSF_IS_RAW_SET(hdd) \ +({ \ + struct hdd_context *hdd_ctx = (hdd); \ + hdd_ctx && hdd_ctx->config && \ + (hdd_ctx->config->tsf_ptp_options & CFG_SET_TSF_PTP_OPT_RAW); \ +}) + +#define HDD_TSF_IS_DBG_FS_SET(hdd) \ +({ \ + struct hdd_context *hdd_ctx = (hdd); \ + hdd_ctx && hdd_ctx->config && \ + (hdd_ctx->config->tsf_ptp_options & CFG_SET_TSF_DBG_FS); \ +}) /** * hdd_start_tsf_sync() - start tsf sync diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index d29b9e77e4d7..8e89b5d58065 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3939,6 +3939,15 @@ struct reg_table_entry g_registry_table[] = { CFG_SET_TSF_GPIO_PIN_DEFAULT, CFG_SET_TSF_GPIO_PIN_MIN, CFG_SET_TSF_GPIO_PIN_MAX), + +#ifdef WLAN_FEATURE_TSF_PLUS + REG_VARIABLE(CFG_SET_TSF_PTP_OPT_NAME, WLAN_PARAM_HexInteger, + struct hdd_config, tsf_ptp_options, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_SET_TSF_PTP_OPT_DEFAULT, + CFG_SET_TSF_PTP_OPT_MIN, + CFG_SET_TSF_PTP_OPT_MAX), +#endif /* WLAN_FEATURE_TSF_PLUS */ #endif REG_VARIABLE(CFG_ROAM_DENSE_TRAFFIC_THRESHOLD, WLAN_PARAM_Integer, diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index 45f6a1cbe8b2..452bef6eb42b 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -603,12 +603,11 @@ static inline int32_t hdd_get_targettime_from_hosttime( return ret; } -static inline uint64_t hdd_get_monotonic_host_time(void) +static inline +uint64_t hdd_get_monotonic_host_time(struct hdd_context *hdd_ctx) { - struct timespec ts; - - getrawmonotonic(&ts); - return timespec_to_ns(&ts); + return HDD_TSF_IS_RAW_SET(hdd_ctx) ? + ktime_get_ns() : ktime_get_real_ns(); } static ssize_t __hdd_wlan_tsf_show(struct device *dev, @@ -616,6 +615,7 @@ static ssize_t __hdd_wlan_tsf_show(struct device *dev, { struct hdd_station_ctx *hdd_sta_ctx; struct hdd_adapter *adapter; + struct hdd_context *hdd_ctx; ssize_t size; uint64_t host_time, target_time; @@ -633,7 +633,11 @@ static ssize_t __hdd_wlan_tsf_show(struct device *dev, if (eConnectionState_Associated != hdd_sta_ctx->conn_info.connState) return scnprintf(buf, PAGE_SIZE, "NOT connected\n"); - host_time = hdd_get_monotonic_host_time(); + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + if (!hdd_ctx) + return scnprintf(buf, PAGE_SIZE, "Invalid HDD context\n"); + + host_time = hdd_get_monotonic_host_time(hdd_ctx); if (hdd_get_targettime_from_hosttime(adapter, host_time, &target_time)) size = scnprintf(buf, PAGE_SIZE, "Invalid timestamp\n"); @@ -680,9 +684,8 @@ static irqreturn_t hdd_tsf_captured_irq_handler(int irq, void *arg) if (!arg) return IRQ_NONE; - host_time = hdd_get_monotonic_host_time(); - hdd_ctx = (struct hdd_context *)arg; + host_time = hdd_get_monotonic_host_time(hdd_ctx); adapter = hdd_ctx->cap_tsf_context; if (!adapter) @@ -742,8 +745,8 @@ static enum hdd_tsf_op_result hdd_tsf_sync_init(struct hdd_adapter *adapter) } net_dev = adapter->dev; - if (net_dev) - device_create_file(&net_dev->dev, &dev_attr_tsf); + if (net_dev && HDD_TSF_IS_DBG_FS_SET(hddctx)) + device_create_file(&net_dev->dev, &dev_attr_tsf); hdd_set_th_sync_status(adapter, true); return HDD_TSF_OP_SUCC; @@ -768,13 +771,6 @@ static enum hdd_tsf_op_result hdd_tsf_sync_deinit(struct hdd_adapter *adapter) hdd_set_th_sync_status(adapter, false); - net_dev = adapter->dev; - if (net_dev) { - struct device *dev = &net_dev->dev; - - device_remove_file(dev, &dev_attr_tsf); - } - ret = qdf_mc_timer_destroy(&adapter->host_target_sync_timer); if (ret != QDF_STATUS_SUCCESS) hdd_err("Failed to destroy timer, ret: %d", ret); @@ -794,6 +790,13 @@ static enum hdd_tsf_op_result hdd_tsf_sync_deinit(struct hdd_adapter *adapter) } hdd_reset_timestamps(adapter); + + net_dev = adapter->dev; + if (net_dev && HDD_TSF_IS_DBG_FS_SET(hddctx)) { + struct device *dev = &net_dev->dev; + + device_remove_file(dev, &dev_attr_tsf); + } return HDD_TSF_OP_SUCC; } @@ -953,6 +956,11 @@ enum hdd_tsf_op_result wlan_hdd_tsf_plus_init(struct hdd_context *hdd_ctx) { int ret; + if (!HDD_TSF_IS_PTP_ENABLED(hdd_ctx)) { + hdd_info("To enable TSF_PLUS, set gtsf_ptp_options in ini"); + return HDD_TSF_OP_FAIL; + } + ret = cnss_common_register_tsf_captured_handler( hdd_ctx->parent_dev, hdd_tsf_captured_irq_handler, @@ -962,7 +970,8 @@ enum hdd_tsf_op_result wlan_hdd_tsf_plus_init(struct hdd_context *hdd_ctx) return HDD_TSF_OP_FAIL; } - ol_register_timestamp_callback(hdd_tx_timestamp); + if (HDD_TSF_IS_TX_SET(hdd_ctx)) + ol_register_timestamp_callback(hdd_tx_timestamp); return HDD_TSF_OP_SUCC; } @@ -971,7 +980,12 @@ enum hdd_tsf_op_result wlan_hdd_tsf_plus_deinit(struct hdd_context *hdd_ctx) { int ret; - ol_deregister_timestamp_callback(); + if (!HDD_TSF_IS_PTP_ENABLED(hdd_ctx)) + return HDD_TSF_OP_SUCC; + + if (HDD_TSF_IS_TX_SET(hdd_ctx)) + ol_deregister_timestamp_callback(); + ret = cnss_common_unregister_tsf_captured_handler( hdd_ctx->parent_dev, (void *)hdd_ctx); diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 41ca4e459e23..845ec5693994 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1148,6 +1148,24 @@ static bool hdd_is_rx_wake_lock_needed(struct sk_buff *skb) return false; } +#ifdef WLAN_FEATURE_TSF_PLUS +static inline void hdd_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; + + hdd_rx_timestamp(netbuf, target_time); +} +#else +static inline void hdd_tsf_timestamp_rx(struct hdd_context *hdd_ctx, + qdf_nbuf_t netbuf, + uint64_t target_time) +{ +} +#endif + /** * hdd_rx_packet_cbk() - Receive packet handler * @context: pointer to HDD context @@ -1295,7 +1313,8 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) */ qdf_net_buf_debug_release_skb(skb); - hdd_rx_timestamp(skb, ktime_to_us(skb->tstamp)); + hdd_tsf_timestamp_rx(hdd_ctx, skb, ktime_to_us(skb->tstamp)); + if (HDD_LRO_NO_RX == hdd_lro_rx(hdd_ctx, adapter, skb)) { if (hdd_napi_enabled(HDD_NAPI_ANY) &&