diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 473f6095e74e..d602307c3e5a 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -551,40 +551,4 @@ QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present); * Return: Status of map operation */ int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr); - -#ifdef WLAN_FEATURE_PKT_CAPTURE -/** - * cds_is_pktcapture_enabled() - is packet capture support enabled - * - * Check is packet capture mode enabled from ini - * - * Return: 0 - disable, 1 - enable - */ -bool cds_is_pktcapture_enabled(void); - -/** - * cds_get_pktcapture_mode() - get pktcapture mode value - * - * Get the pktcapture mode value from hdd context - * - * Return: 0 - disable - * 1 - Mgmt packets - * 2 - Data packets - * 3 - Both Mgmt and Data packets - */ -uint8_t cds_get_pktcapture_mode(void); -#else -static inline -bool cds_is_pktcapture_enabled(void) -{ - return false; -} - -static inline -uint8_t cds_get_pktcapture_mode(void) -{ - return 0; -} -#endif /* WLAN_FEATURE_PKT_CAPTURE */ - #endif /* if !defined __CDS_API_H */ diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index aec5b2fe7f3b..1e9aedbfed30 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -2874,31 +2874,3 @@ int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr) return 0; } #endif - -#ifdef WLAN_FEATURE_PKT_CAPTURE -bool cds_is_pktcapture_enabled(void) -{ - struct hdd_context *hdd_ctx; - - hdd_ctx = gp_cds_context->hdd_context; - if (!hdd_ctx) { - cds_err("HDD context is NULL"); - return false; - } - - return hdd_ctx->enable_pkt_capture_support; -} - -uint8_t cds_get_pktcapture_mode(void) -{ - struct hdd_context *hdd_ctx; - - hdd_ctx = gp_cds_context->hdd_context; - if (!hdd_ctx) { - cds_err("HDD context is NULL"); - return false; - } - - return hdd_ctx->val_pkt_capture_mode; -} -#endif /* WLAN_FEATURE_PKT_CAPTURE */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 8b6093d84bf4..48a10c02a284 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -16466,7 +16466,14 @@ void hdd_hidden_ssid_enable_roaming(hdd_handle_t hdd_handle, uint8_t vdev_id) */ bool wlan_hdd_is_session_type_monitor(uint8_t session_type) { - if (cds_is_pktcapture_enabled() && + struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + + if (!hdd_ctx) { + cds_err("HDD context is NULL"); + return false; + } + + if (ucfg_pkt_capture_get_mode(hdd_ctx->psoc) && cds_get_conparam() != QDF_GLOBAL_MONITOR_MODE && session_type == QDF_MONITOR_MODE) return true; @@ -16491,7 +16498,7 @@ bool wlan_hdd_check_mon_concurrency(void) return -EINVAL; } - if (cds_is_pktcapture_enabled()) { + if (ucfg_pkt_capture_get_mode(hdd_ctx->psoc)) { if (policy_mgr_get_concurrency_mode(hdd_ctx->psoc) == (QDF_STA_MASK | QDF_MONITOR_MASK)) { hdd_err("STA + MON mode is UP"); @@ -16550,7 +16557,7 @@ wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx, uint32_t mode; uint8_t num_open_session = 0; - if (!cds_is_pktcapture_enabled()) + if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc)) return 0; /*