From c31daef13067123152f4d980fdcc92b814cc45e6 Mon Sep 17 00:00:00 2001 From: aloksing Date: Thu, 28 Jul 2022 17:58:43 +0530 Subject: [PATCH] qcacmn: fix compilation issue without monitor support Compilation is failing when Monitor support is disabled Moved monitor related API and structure to monitor header files. CRs-Fixed: 3257872 Change-Id: Ie1b3dc16b38c88bfd73fc89aaa395d4b57a61e5c --- dp/wifi3.0/be/dp_be.c | 31 ++------ dp/wifi3.0/be/dp_be.h | 36 +-------- dp/wifi3.0/dp_internal.h | 114 +++++++++++++++++++++++++++- dp/wifi3.0/dp_main.c | 20 ++--- dp/wifi3.0/dp_tx.c | 18 ++++- dp/wifi3.0/dp_types.h | 2 + dp/wifi3.0/li/dp_li.c | 17 ++--- dp/wifi3.0/li/dp_li.h | 27 +------ dp/wifi3.0/monitor/1.0/dp_mon_1.0.h | 35 +++++++++ dp/wifi3.0/monitor/2.0/dp_mon_2.0.h | 46 +++++++++++ dp/wifi3.0/monitor/dp_mon.h | 105 +++++++++++++++++++++++++ 11 files changed, 337 insertions(+), 114 deletions(-) diff --git a/dp/wifi3.0/be/dp_be.c b/dp/wifi3.0/be/dp_be.c index 804e31fe51..9294ff52e1 100644 --- a/dp/wifi3.0/be/dp_be.c +++ b/dp/wifi3.0/be/dp_be.c @@ -23,9 +23,12 @@ #include "dp_be.h" #include "dp_be_tx.h" #include "dp_be_rx.h" +#ifdef WIFI_MONITOR_SUPPORT #if !defined(DISABLE_MON_CONFIG) && defined(QCA_MONITOR_2_0_SUPPORT) #include "dp_mon_2.0.h" #endif +#include "dp_mon.h" +#endif #include /* Generic AST entry aging timer value */ @@ -89,32 +92,6 @@ qdf_size_t dp_get_context_size_be(enum dp_context_type context_type) } } -#if !defined(DISABLE_MON_CONFIG) && defined(QCA_MONITOR_2_0_SUPPORT) -qdf_size_t dp_mon_get_context_size_be(enum dp_context_type context_type) -{ - switch (context_type) { - case DP_CONTEXT_TYPE_MON_SOC: - return sizeof(struct dp_mon_soc_be); - case DP_CONTEXT_TYPE_MON_PDEV: - return sizeof(struct dp_mon_pdev_be); - default: - return 0; - } -} -#else -qdf_size_t dp_mon_get_context_size_be(enum dp_context_type context_type) -{ - switch (context_type) { - case DP_CONTEXT_TYPE_MON_SOC: - return sizeof(struct dp_mon_soc); - case DP_CONTEXT_TYPE_MON_PDEV: - return sizeof(struct dp_mon_pdev); - default: - return 0; - } -} -#endif - #ifdef DP_FEATURE_HW_COOKIE_CONVERSION #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1) /** @@ -1971,7 +1948,9 @@ void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops) arch_ops->dp_tx_compute_hw_delay = dp_tx_compute_tx_delay_be; #endif arch_ops->txrx_get_context_size = dp_get_context_size_be; +#ifdef WIFI_MONITOR_SUPPORT arch_ops->txrx_get_mon_context_size = dp_mon_get_context_size_be; +#endif arch_ops->dp_rx_desc_cookie_2_va = dp_rx_desc_cookie_2_va_be; arch_ops->dp_rx_intrabss_handle_nawds = dp_rx_intrabss_handle_nawds_be; diff --git a/dp/wifi3.0/be/dp_be.h b/dp/wifi3.0/be/dp_be.h index 8a830c462c..e18883b8f3 100644 --- a/dp/wifi3.0/be/dp_be.h +++ b/dp/wifi3.0/be/dp_be.h @@ -26,7 +26,9 @@ #else #include #endif +#ifdef WIFI_MONITOR_SUPPORT #include +#endif enum CMEM_MEM_CLIENTS { COOKIE_CONVERSION, @@ -355,14 +357,6 @@ void dp_initialize_arch_ops_be(struct dp_arch_ops *arch_ops); */ qdf_size_t dp_get_context_size_be(enum dp_context_type context_type); -/** - * dp_mon_get_context_size_be() - get BE specific size for mon pdev/soc - * @arch_ops: arch ops pointer - * - * Return: size in bytes for the context_type - */ -qdf_size_t dp_mon_get_context_size_be(enum dp_context_type context_type); - /** * dp_get_be_soc_from_dp_soc() - get dp_soc_be from dp_soc * @soc: dp_soc pointer @@ -374,18 +368,6 @@ static inline struct dp_soc_be *dp_get_be_soc_from_dp_soc(struct dp_soc *soc) return (struct dp_soc_be *)soc; } -/** - * dp_get_be_mon_soc_from_dp_mon_soc() - get dp_mon_soc_be from dp_mon_soc - * @soc: dp_mon_soc pointer - * - * Return: dp_mon_soc_be pointer - */ -static inline -struct dp_mon_soc_be *dp_get_be_mon_soc_from_dp_mon_soc(struct dp_mon_soc *soc) -{ - return (struct dp_mon_soc_be *)soc; -} - #ifdef WLAN_MLO_MULTI_CHIP typedef struct dp_mlo_ctxt *dp_mld_peer_hash_obj_t; @@ -521,20 +503,6 @@ struct dp_pdev_be *dp_get_be_pdev_from_dp_pdev(struct dp_pdev *pdev) return (struct dp_pdev_be *)pdev; } -#ifdef QCA_MONITOR_2_0_SUPPORT -/** - * dp_get_be_mon_pdev_from_dp_mon_pdev() - get dp_mon_pdev_be from dp_mon_pdev - * @pdev: dp_mon_pdev pointer - * - * Return: dp_mon_pdev_be pointer - */ -static inline -struct dp_mon_pdev_be *dp_get_be_mon_pdev_from_dp_mon_pdev(struct dp_mon_pdev *mon_pdev) -{ - return (struct dp_mon_pdev_be *)mon_pdev; -} -#endif - /** * dp_get_be_vdev_from_dp_vdev() - get dp_vdev_be from dp_vdev * @vdev: dp_vdev pointer diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index b17a344b98..acaad024c7 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -21,6 +21,7 @@ #define _DP_INTERNAL_H_ #include "dp_types.h" +#include "dp_htt.h" #define RX_BUFFER_SIZE_PKTLOG_LITE 1024 @@ -562,8 +563,9 @@ static inline void dp_monitor_pktlogmod_exit(struct dp_pdev *pdev) } static inline -void dp_monitor_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev) +QDF_STATUS dp_monitor_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev) { + return QDF_STATUS_E_FAILURE; } static inline @@ -717,6 +719,18 @@ dp_monitor_get_chan_band(struct dp_pdev *pdev) return 0; } +static inline int +dp_monitor_get_chan_num(struct dp_pdev *pdev) +{ + return 0; +} + +static inline qdf_freq_t +dp_monitor_get_chan_freq(struct dp_pdev *pdev) +{ + return 0; +} + static inline void dp_monitor_get_mpdu_status(struct dp_pdev *pdev, struct dp_soc *soc, uint8_t *rx_tlv_hdr) @@ -805,6 +819,104 @@ dp_mon_rx_hdr_length_set(struct dp_soc *soc, uint32_t *msg_word, struct htt_rx_ring_tlv_filter *tlv_filter) { } + +static inline void dp_monitor_soc_init(struct dp_soc *soc) +{ +} + +static inline void dp_monitor_soc_deinit(struct dp_soc *soc) +{ +} + +static inline +QDF_STATUS dp_monitor_config_undecoded_metadata_capture(struct dp_pdev *pdev, + int val) +{ + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS +dp_monitor_config_undecoded_metadata_phyrx_error_mask(struct dp_pdev *pdev, + int mask1, int mask2) +{ + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS +dp_monitor_get_undecoded_metadata_phyrx_error_mask(struct dp_pdev *pdev, + int *mask, int *mask_cont) +{ + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS dp_monitor_soc_htt_srng_setup(struct dp_soc *soc) +{ + return QDF_STATUS_E_FAILURE; +} + +static inline bool dp_is_monitor_mode_using_poll(struct dp_soc *soc) +{ + return false; +} + +static inline +uint32_t dp_tx_mon_buf_refill(struct dp_intr *int_ctx) +{ + return 0; +} + +static inline uint32_t +dp_tx_mon_process(struct dp_soc *soc, struct dp_intr *int_ctx, + uint32_t mac_id, uint32_t quota) +{ + return 0; +} + +static inline +uint32_t dp_rx_mon_buf_refill(struct dp_intr *int_ctx) +{ + return 0; +} + +static inline bool dp_monitor_is_tx_cap_enabled(struct dp_peer *peer) +{ + return 0; +} + +static inline bool dp_monitor_is_rx_cap_enabled(struct dp_peer *peer) +{ + return 0; +} + +static inline void +dp_rx_mon_enable(struct dp_soc *soc, uint32_t *msg_word, + struct htt_rx_ring_tlv_filter *tlv_filter) +{ +} + +static inline void +dp_mon_rx_packet_length_set(struct dp_soc *soc, uint32_t *msg_word, + struct htt_rx_ring_tlv_filter *tlv_filter) +{ +} + +static inline void +dp_mon_rx_enable_mpdu_logging(struct dp_soc *soc, uint32_t *msg_word, + struct htt_rx_ring_tlv_filter *tlv_filter) +{ +} + +static inline void +dp_mon_rx_wmask_subscribe(struct dp_soc *soc, uint32_t *msg_word, + struct htt_rx_ring_tlv_filter *tlv_filter) +{ +} + +static inline +void dp_monitor_peer_telemetry_stats(struct dp_peer *peer, + struct cdp_peer_telemetry_stats *stats) +{ +} #endif /** diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 83389fb869..afc2b4864d 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1802,10 +1802,8 @@ dp_print_peer_info(struct dp_soc *soc, struct dp_peer *peer, void *arg) txrx_peer->nawds_enabled, txrx_peer->bss_peer, txrx_peer->wds_enabled, - peer->monitor_peer ? - peer->monitor_peer->tx_cap_enabled : 0, - peer->monitor_peer ? - peer->monitor_peer->rx_cap_enabled : 0); + dp_monitor_is_tx_cap_enabled(peer), + dp_monitor_is_rx_cap_enabled(peer)); } /** @@ -6138,15 +6136,12 @@ static void dp_soc_deinit(void *txrx_soc) { struct dp_soc *soc = (struct dp_soc *)txrx_soc; struct htt_soc *htt_soc = soc->htt_handle; - struct dp_mon_ops *mon_ops; qdf_atomic_set(&soc->cmn_init_done, 0); soc->arch_ops.txrx_soc_deinit(soc); - mon_ops = dp_mon_ops_get(soc); - if (mon_ops && mon_ops->mon_soc_deinit) - mon_ops->mon_soc_deinit(soc); + dp_monitor_soc_deinit(soc); /* free peer tables & AST tables allocated during peer_map_attach */ if (soc->peer_map_attach_success) { @@ -10301,11 +10296,11 @@ static QDF_STATUS dp_get_pdev_param(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, break; case CDP_MONITOR_CHANNEL: val->cdp_pdev_param_monitor_chan = - ((struct dp_pdev *)pdev)->monitor_pdev->mon_chan_num; + dp_monitor_get_chan_num((struct dp_pdev *)pdev); break; case CDP_MONITOR_FREQUENCY: val->cdp_pdev_param_mon_freq = - ((struct dp_pdev *)pdev)->monitor_pdev->mon_chan_freq; + dp_monitor_get_chan_freq((struct dp_pdev *)pdev); break; default: return QDF_STATUS_E_FAILURE; @@ -14940,7 +14935,6 @@ void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle, bool is_monitor_mode = false; uint8_t i; int num_dp_msi; - struct dp_mon_ops *mon_ops; wlan_minidump_log(soc, sizeof(*soc), soc->ctrl_psoc, WLAN_MD_DP_SOC, "dp_soc"); @@ -15071,9 +15065,7 @@ void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle, wlan_cfg_get_defrag_timeout_check(soc->wlan_cfg_ctx); qdf_spinlock_create(&soc->rx.defrag.defrag_lock); - mon_ops = dp_mon_ops_get(soc); - if (mon_ops && mon_ops->mon_soc_init) - mon_ops->mon_soc_init(soc); + dp_monitor_soc_init(soc); qdf_atomic_set(&soc->cmn_init_done, 1); diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 0e79a46a6d..58ecf2a729 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -4167,6 +4167,20 @@ dp_update_no_ack_stats(qdf_nbuf_t nbuf, struct dp_txrx_peer *txrx_peer) #endif #ifndef QCA_ENHANCED_STATS_SUPPORT +#ifdef DP_PEER_EXTENDED_API +static inline uint8_t +dp_tx_get_mpdu_retry_threshold(struct dp_txrx_peer *txrx_peer) +{ + return txrx_peer->mpdu_retry_threshold; +} +#else +static inline uint8_t +dp_tx_get_mpdu_retry_threshold(struct dp_txrx_peer *txrx_peer) +{ + return 0; +} +#endif + /** * dp_tx_update_peer_extd_stats()- Update Tx extended path stats for peer * @@ -4180,7 +4194,7 @@ dp_tx_update_peer_extd_stats(struct hal_tx_completion_status *ts, struct dp_txrx_peer *txrx_peer) { uint8_t mcs, pkt_type, dst_mcs_idx; - uint8_t retry_threshold = txrx_peer->mpdu_retry_threshold; + uint8_t retry_threshold = dp_tx_get_mpdu_retry_threshold(txrx_peer); mcs = ts->mcs; pkt_type = ts->pkt_type; @@ -4943,7 +4957,7 @@ void dp_tx_update_peer_basic_stats(struct dp_txrx_peer *txrx_peer, uint32_t length, uint8_t tx_status, bool update) { - if (!peer->hw_txrx_stats_en) { + if (!txrx_peer->hw_txrx_stats_en) { DP_PEER_STATS_FLAT_INC_PKT(txrx_peer, comp_pkt, 1, length); if (tx_status != HAL_TX_TQM_RR_FRAME_ACKED) diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index e6bce26e65..741b106562 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -1904,7 +1904,9 @@ struct dp_arch_ops { /* Misc Arch Ops */ qdf_size_t (*txrx_get_context_size)(enum dp_context_type); +#ifdef WIFI_MONITOR_SUPPORT qdf_size_t (*txrx_get_mon_context_size)(enum dp_context_type); +#endif int (*dp_srng_test_and_update_nf_params)(struct dp_soc *soc, struct dp_srng *dp_srng, int *max_reap_limit); diff --git a/dp/wifi3.0/li/dp_li.c b/dp/wifi3.0/li/dp_li.c index 4aed39dcfb..06cf8d8acb 100644 --- a/dp/wifi3.0/li/dp_li.c +++ b/dp/wifi3.0/li/dp_li.c @@ -27,6 +27,9 @@ #include "dp_peer.h" #include #include "dp_ipa.h" +#ifdef WIFI_MONITOR_SUPPORT +#include +#endif #if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1) static struct wlan_cfg_tcl_wbm_ring_num_map g_tcl_wbm_map_array[MAX_TCL_DATA_RINGS] = { @@ -96,18 +99,6 @@ qdf_size_t dp_get_context_size_li(enum dp_context_type context_type) } } -qdf_size_t dp_mon_get_context_size_li(enum dp_context_type context_type) -{ - switch (context_type) { - case DP_CONTEXT_TYPE_MON_PDEV: - return sizeof(struct dp_mon_pdev_li); - case DP_CONTEXT_TYPE_MON_SOC: - return sizeof(struct dp_mon_soc_li); - default: - return 0; - } -} - static QDF_STATUS dp_soc_attach_li(struct dp_soc *soc, struct cdp_soc_attach_params *params) { @@ -597,7 +588,9 @@ void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops) arch_ops->dp_rx_desc_pool_deinit = dp_rx_desc_pool_deinit_generic; #endif arch_ops->txrx_get_context_size = dp_get_context_size_li; +#ifdef WIFI_MONITOR_SUPPORT arch_ops->txrx_get_mon_context_size = dp_mon_get_context_size_li; +#endif arch_ops->txrx_soc_attach = dp_soc_attach_li; arch_ops->txrx_soc_detach = dp_soc_detach_li; arch_ops->txrx_soc_init = dp_soc_init_li; diff --git a/dp/wifi3.0/li/dp_li.h b/dp/wifi3.0/li/dp_li.h index c508363111..0b7af2c4da 100644 --- a/dp/wifi3.0/li/dp_li.h +++ b/dp/wifi3.0/li/dp_li.h @@ -20,7 +20,9 @@ #define __DP_LI_H #include +#ifdef WIFI_MONITOR_SUPPORT #include +#endif #include #include @@ -59,22 +61,6 @@ struct dp_peer_li { struct dp_peer peer; }; -/** - * struct dp_mon_soc_li - Extended DP mon soc for LI targets - * @mon_soc: dp_mon_soc structure - */ -struct dp_mon_soc_li { - struct dp_mon_soc mon_soc; -}; - -/** - * struct dp_mon_pdev_li - Extended DP mon pdev for LI targets - * @mon_pdev: dp_mon_pdev structure - */ -struct dp_mon_pdev_li { - struct dp_mon_pdev mon_pdev; -}; - /** * dp_get_soc_context_size_LI() - get context size for dp_soc_li * @@ -98,13 +84,4 @@ void dp_initialize_arch_ops_li(struct dp_arch_ops *arch_ops); */ qdf_size_t dp_get_context_size_li(enum dp_context_type context_type); - -/** - * dp_mon_get_context_size_li() - get LI specific size for mon pdev/soc - * @arch_ops: arch ops pointer - * - * Return: size in bytes for the context_type - */ - -qdf_size_t dp_mon_get_context_size_li(enum dp_context_type context_type); #endif diff --git a/dp/wifi3.0/monitor/1.0/dp_mon_1.0.h b/dp/wifi3.0/monitor/1.0/dp_mon_1.0.h index 35d24bad81..1349fb49ba 100644 --- a/dp/wifi3.0/monitor/1.0/dp_mon_1.0.h +++ b/dp/wifi3.0/monitor/1.0/dp_mon_1.0.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2021-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 above @@ -52,4 +53,38 @@ void dp_service_mon_rings(struct dp_soc *soc, uint32_t quota); uint32_t dp_mon_drop_packets_for_mac(struct dp_pdev *pdev, uint32_t mac_id, uint32_t quota); +/** + * struct dp_mon_soc_li - Extended DP mon soc for LI targets + * @mon_soc: dp_mon_soc structure + */ +struct dp_mon_soc_li { + struct dp_mon_soc mon_soc; +}; + +/** + * struct dp_mon_pdev_li - Extended DP mon pdev for LI targets + * @mon_pdev: dp_mon_pdev structure + */ +struct dp_mon_pdev_li { + struct dp_mon_pdev mon_pdev; +}; + +/** + * dp_mon_get_context_size_li() - get LI specific size for mon pdev/soc + * @arch_ops: arch ops pointer + * + * Return: size in bytes for the context_type + */ +static inline +qdf_size_t dp_mon_get_context_size_li(enum dp_context_type context_type) +{ + switch (context_type) { + case DP_CONTEXT_TYPE_MON_PDEV: + return sizeof(struct dp_mon_pdev_li); + case DP_CONTEXT_TYPE_MON_SOC: + return sizeof(struct dp_mon_soc_li); + default: + return 0; + } +} #endif /* _DP_MON_1_0_H_ */ diff --git a/dp/wifi3.0/monitor/2.0/dp_mon_2.0.h b/dp/wifi3.0/monitor/2.0/dp_mon_2.0.h index db3876da2d..592bef2aac 100644 --- a/dp/wifi3.0/monitor/2.0/dp_mon_2.0.h +++ b/dp/wifi3.0/monitor/2.0/dp_mon_2.0.h @@ -421,4 +421,50 @@ void dp_mon_rx_update_rx_protocol_tag_stats(struct dp_pdev *pdev, uint16_t protocol_index); #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */ +#if !defined(DISABLE_MON_CONFIG) && defined(QCA_MONITOR_2_0_SUPPORT) +/** + * dp_mon_get_context_size_be() - get BE specific size for mon pdev/soc + * @arch_ops: arch ops pointer + * + * Return: size in bytes for the context_type + */ +static inline +qdf_size_t dp_mon_get_context_size_be(enum dp_context_type context_type) +{ + switch (context_type) { + case DP_CONTEXT_TYPE_MON_SOC: + return sizeof(struct dp_mon_soc_be); + case DP_CONTEXT_TYPE_MON_PDEV: + return sizeof(struct dp_mon_pdev_be); + default: + return 0; + } +} +#endif + +#ifdef QCA_MONITOR_2_0_SUPPORT +/** + * dp_get_be_mon_soc_from_dp_mon_soc() - get dp_mon_soc_be from dp_mon_soc + * @soc: dp_mon_soc pointer + * + * Return: dp_mon_soc_be pointer + */ +static inline +struct dp_mon_soc_be *dp_get_be_mon_soc_from_dp_mon_soc(struct dp_mon_soc *soc) +{ + return (struct dp_mon_soc_be *)soc; +} + +/** + * dp_get_be_mon_pdev_from_dp_mon_pdev() - get dp_mon_pdev_be from dp_mon_pdev + * @pdev: dp_mon_pdev pointer + * + * Return: dp_mon_pdev_be pointer + */ +static inline +struct dp_mon_pdev_be *dp_get_be_mon_pdev_from_dp_mon_pdev(struct dp_mon_pdev *mon_pdev) +{ + return (struct dp_mon_pdev_be *)mon_pdev; +} +#endif #endif /* _DP_MON_2_0_H_ */ diff --git a/dp/wifi3.0/monitor/dp_mon.h b/dp/wifi3.0/monitor/dp_mon.h index b8411cdeb7..b451a37c5a 100644 --- a/dp/wifi3.0/monitor/dp_mon.h +++ b/dp/wifi3.0/monitor/dp_mon.h @@ -506,6 +506,7 @@ QDF_STATUS dp_vdev_set_monitor_mode_rings(struct dp_pdev *pdev, static inline QDF_STATUS dp_vdev_set_monitor_mode_buf_rings(struct dp_pdev *pdev) { + return QDF_STATUS_SUCCESS; } static inline QDF_STATUS @@ -1504,6 +1505,20 @@ static inline void dp_monitor_set_chan_num(struct dp_pdev *pdev, int chan_num) pdev->monitor_pdev->mon_chan_num = chan_num; } +/* + * dp_monitor_get_chan_num() - get channel number + * @pdev: DP pdev handle + * + * Return: channel number + */ +static inline int dp_monitor_get_chan_num(struct dp_pdev *pdev) +{ + if (qdf_unlikely(!pdev || !pdev->monitor_pdev)) + return 0; + + return pdev->monitor_pdev->mon_chan_num; +} + /* * dp_monitor_set_chan_freq() - set channel frequency * @pdev: point to dp pdev @@ -1519,6 +1534,21 @@ dp_monitor_set_chan_freq(struct dp_pdev *pdev, qdf_freq_t chan_freq) pdev->monitor_pdev->mon_chan_freq = chan_freq; } +/* + * dp_monitor_get_chan_freq() - get channel frequency + * @pdev: DP pdev handle + * + * @Return: channel frequency + */ +static inline qdf_freq_t +dp_monitor_get_chan_freq(struct dp_pdev *pdev) +{ + if (qdf_unlikely(!pdev || !pdev->monitor_pdev)) + return 0; + + return pdev->monitor_pdev->mon_chan_freq; +} + /* * dp_monitor_set_chan_band() - set channel band * @pdev: point to dp pdev @@ -3943,6 +3973,38 @@ struct cdp_mon_ops *dp_mon_cdp_ops_get(struct dp_soc *soc) return ops->mon_ops; } +/** + * dp_monitor_soc_init() - Monitor SOC init + * @soc: DP soc handle + * + * Return: void + */ +static inline void dp_monitor_soc_init(struct dp_soc *soc) +{ + struct dp_mon_ops *mon_ops; + + mon_ops = dp_mon_ops_get(soc); + + if (mon_ops && mon_ops->mon_soc_init) + mon_ops->mon_soc_init(soc); +} + +/** + * dp_monitor_soc_deinit() - Monitor SOC deinit + * @soc: DP soc handle + * + * Return: void + */ +static inline void dp_monitor_soc_deinit(struct dp_soc *soc) +{ + struct dp_mon_ops *mon_ops; + + mon_ops = dp_mon_ops_get(soc); + + if (mon_ops && mon_ops->mon_soc_deinit) + mon_ops->mon_soc_deinit(soc); +} + /** * dp_ppdu_desc_user_stats_update(): Function to update TX user stats * @pdev: DP pdev handle @@ -4193,4 +4255,47 @@ void dp_monitor_peer_telemetry_stats(struct dp_peer *peer, stats->snr = CDP_SNR_OUT(mon_peer_stats->rx.avg_snr); } #endif + +/** + * dp_monitor_is_tx_cap_enabled() - get tx-cature enabled/disabled + * @peer: DP peer handle + * + * Return: true if tx-capture is enabled + */ +static inline bool dp_monitor_is_tx_cap_enabled(struct dp_peer *peer) +{ + return peer->monitor_peer ? peer->monitor_peer->tx_cap_enabled : 0; +} + +/** + * dp_monitor_is_rx_cap_enabled() - get rx-cature enabled/disabled + * @peer: DP peer handle + * + * Return: true if rx-capture is enabled + */ +static inline bool dp_monitor_is_rx_cap_enabled(struct dp_peer *peer) +{ + return peer->monitor_peer ? peer->monitor_peer->rx_cap_enabled : 0; +} + +#if !(!defined(DISABLE_MON_CONFIG) && defined(QCA_MONITOR_2_0_SUPPORT)) +/** + * dp_mon_get_context_size_be() - get BE specific size for mon pdev/soc + * @arch_ops: arch ops pointer + * + * Return: size in bytes for the context_type + */ +static inline +qdf_size_t dp_mon_get_context_size_be(enum dp_context_type context_type) +{ + switch (context_type) { + case DP_CONTEXT_TYPE_MON_SOC: + return sizeof(struct dp_mon_soc); + case DP_CONTEXT_TYPE_MON_PDEV: + return sizeof(struct dp_mon_pdev); + default: + return 0; + } +} +#endif #endif /* _DP_MON_H_ */