qcacmn: Change to make monitor ops per soc
- make monitor ops per soc, so that when ops are reset it will not impact other soc. - reset filter setting during pdev deinit. Change-Id: Ic40582fc1d03343d0bfaf879177212ecb83ae058 CRs-Fixed: 3086841
This commit is contained in:

zatwierdzone przez
Madan Koyyalamudi

rodzic
0dd1799d92
commit
719e163615
@@ -1026,12 +1026,52 @@ struct cdp_mon_ops dp_ops_mon_1_0 = {
|
||||
.soc_config_full_mon_mode = dp_soc_config_full_mon_mode,
|
||||
};
|
||||
|
||||
struct dp_mon_ops *dp_mon_ops_get_1_0(void)
|
||||
#ifdef QCA_MONITOR_OPS_PER_SOC_SUPPORT
|
||||
void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc)
|
||||
{
|
||||
return &monitor_ops_1_0;
|
||||
struct dp_mon_ops *mon_ops = NULL;
|
||||
|
||||
if (mon_soc->mon_ops) {
|
||||
dp_mon_err("monitor ops is allocated");
|
||||
return;
|
||||
}
|
||||
|
||||
mon_ops = qdf_mem_malloc(sizeof(struct dp_mon_ops));
|
||||
if (!mon_ops) {
|
||||
dp_mon_err("Failed to allocate memory for mon ops");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_copy(mon_ops, &monitor_ops_1_0, sizeof(struct dp_mon_ops));
|
||||
mon_soc->mon_ops = mon_ops;
|
||||
}
|
||||
|
||||
struct cdp_mon_ops *dp_mon_cdp_ops_get_1_0(void)
|
||||
void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops)
|
||||
{
|
||||
return &dp_ops_mon_1_0;
|
||||
struct cdp_mon_ops *mon_ops = NULL;
|
||||
|
||||
if (ops->mon_ops) {
|
||||
dp_mon_err("cdp monitor ops is allocated");
|
||||
return;
|
||||
}
|
||||
|
||||
mon_ops = qdf_mem_malloc(sizeof(struct cdp_mon_ops));
|
||||
if (!mon_ops) {
|
||||
dp_mon_err("Failed to allocate memory for cdp mon ops");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_copy(mon_ops, &dp_ops_mon_1_0, sizeof(struct cdp_mon_ops));
|
||||
ops->mon_ops = mon_ops;
|
||||
}
|
||||
#else
|
||||
void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc)
|
||||
{
|
||||
mon_soc->mon_ops = &monitor_ops_1_0;
|
||||
}
|
||||
|
||||
void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops)
|
||||
{
|
||||
ops->mon_ops = &dp_ops_mon_1_0;
|
||||
}
|
||||
#endif
|
||||
|
@@ -1055,7 +1055,7 @@ struct dp_mon_ops monitor_ops_2_0 = {
|
||||
#ifndef DISABLE_MON_CONFIG
|
||||
.mon_register_intr_ops = dp_mon_register_intr_ops_2_0,
|
||||
#endif
|
||||
.mon_register_feature_ops = dp_mon_register_feature_ops_1_0,
|
||||
.mon_register_feature_ops = dp_mon_register_feature_ops_2_0,
|
||||
};
|
||||
|
||||
struct cdp_mon_ops dp_ops_mon_2_0 = {
|
||||
@@ -1067,13 +1067,52 @@ struct cdp_mon_ops dp_ops_mon_2_0 = {
|
||||
.soc_config_full_mon_mode = NULL,
|
||||
};
|
||||
|
||||
struct dp_mon_ops *dp_mon_ops_get_2_0(void)
|
||||
#ifdef QCA_MONITOR_OPS_PER_SOC_SUPPORT
|
||||
void dp_mon_ops_register_2_0(struct dp_mon_soc *mon_soc)
|
||||
{
|
||||
return &monitor_ops_2_0;
|
||||
struct dp_mon_ops *mon_ops = NULL;
|
||||
|
||||
if (mon_soc->mon_ops) {
|
||||
dp_mon_err("monitor ops is allocated");
|
||||
return;
|
||||
}
|
||||
|
||||
mon_ops = qdf_mem_malloc(sizeof(struct dp_mon_ops));
|
||||
if (!mon_ops) {
|
||||
dp_mon_err("Failed to allocate memory for mon ops");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_copy(mon_ops, &monitor_ops_2_0, sizeof(struct dp_mon_ops));
|
||||
mon_soc->mon_ops = mon_ops;
|
||||
}
|
||||
|
||||
struct cdp_mon_ops *dp_mon_cdp_ops_get_2_0(void)
|
||||
void dp_mon_cdp_ops_register_2_0(struct cdp_ops *ops)
|
||||
{
|
||||
return &dp_ops_mon_2_0;
|
||||
struct cdp_mon_ops *mon_ops = NULL;
|
||||
|
||||
if (ops->mon_ops) {
|
||||
dp_mon_err("cdp monitor ops is allocated");
|
||||
return;
|
||||
}
|
||||
|
||||
mon_ops = qdf_mem_malloc(sizeof(struct cdp_mon_ops));
|
||||
if (!mon_ops) {
|
||||
dp_mon_err("Failed to allocate memory for mon ops");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_copy(mon_ops, &dp_ops_mon_2_0, sizeof(struct cdp_mon_ops));
|
||||
ops->mon_ops = mon_ops;
|
||||
}
|
||||
#else
|
||||
void dp_mon_ops_register_2_0(struct dp_mon_soc *mon_soc)
|
||||
{
|
||||
mon_soc->mon_ops = &monitor_ops_2_0;
|
||||
}
|
||||
|
||||
void dp_mon_cdp_ops_register_2_0(struct cdp_ops *ops)
|
||||
{
|
||||
ops->mon_ops = &dp_ops_mon_2_0;
|
||||
}
|
||||
#endif
|
||||
|
@@ -4717,6 +4717,7 @@ QDF_STATUS dp_mon_pdev_deinit(struct dp_pdev *pdev)
|
||||
if (!mon_pdev->is_dp_mon_pdev_initialized)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
dp_mon_filters_reset(pdev);
|
||||
dp_tx_ppdu_stats_detach(pdev);
|
||||
|
||||
if (mon_ops->rx_mon_buffers_free)
|
||||
@@ -4848,11 +4849,11 @@ void dp_mon_ops_register(struct dp_soc *soc)
|
||||
case TARGET_TYPE_QCN9000:
|
||||
case TARGET_TYPE_QCA5018:
|
||||
case TARGET_TYPE_QCN6122:
|
||||
mon_soc->mon_ops = dp_mon_ops_get_1_0();
|
||||
dp_mon_ops_register_1_0(mon_soc);
|
||||
break;
|
||||
case TARGET_TYPE_QCN9224:
|
||||
#ifdef QCA_MONITOR_2_0_SUPPORT
|
||||
mon_soc->mon_ops = dp_mon_ops_get_2_0();
|
||||
dp_mon_ops_register_2_0(mon_soc);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
@@ -4862,6 +4863,26 @@ void dp_mon_ops_register(struct dp_soc *soc)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef QCA_MONITOR_OPS_PER_SOC_SUPPORT
|
||||
void dp_mon_ops_free(struct dp_soc *soc)
|
||||
{
|
||||
struct cdp_ops *ops = soc->cdp_soc.ops;
|
||||
struct cdp_mon_ops *cdp_mon_ops = ops->mon_ops;
|
||||
struct dp_mon_soc *mon_soc = soc->monitor_soc;
|
||||
struct dp_mon_ops *mon_ops = mon_soc->mon_ops;
|
||||
|
||||
if (cdp_mon_ops)
|
||||
qdf_mem_free(cdp_mon_ops);
|
||||
|
||||
if (mon_ops)
|
||||
qdf_mem_free(mon_ops);
|
||||
}
|
||||
#else
|
||||
void dp_mon_ops_free(struct dp_soc *soc)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void dp_mon_cdp_ops_register(struct dp_soc *soc)
|
||||
{
|
||||
struct cdp_ops *ops = soc->cdp_soc.ops;
|
||||
@@ -4886,11 +4907,11 @@ void dp_mon_cdp_ops_register(struct dp_soc *soc)
|
||||
case TARGET_TYPE_QCN9000:
|
||||
case TARGET_TYPE_QCA5018:
|
||||
case TARGET_TYPE_QCN6122:
|
||||
ops->mon_ops = dp_mon_cdp_ops_get_1_0();
|
||||
dp_mon_cdp_ops_register_1_0(ops);
|
||||
break;
|
||||
case TARGET_TYPE_QCN9224:
|
||||
#ifdef QCA_MONITOR_2_0_SUPPORT
|
||||
ops->mon_ops = dp_mon_cdp_ops_get_2_0();
|
||||
dp_mon_cdp_ops_register_2_0(ops);
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
@@ -4984,6 +5005,108 @@ void dp_mon_cdp_ops_deregister(struct dp_soc *soc)
|
||||
return;
|
||||
}
|
||||
|
||||
void dp_mon_intr_ops_deregister(struct dp_soc *soc)
|
||||
{
|
||||
struct dp_mon_soc *mon_soc = soc->monitor_soc;
|
||||
|
||||
mon_soc->mon_rx_process = NULL;
|
||||
}
|
||||
|
||||
void dp_mon_feature_ops_deregister(struct dp_soc *soc)
|
||||
{
|
||||
struct dp_mon_ops *mon_ops = dp_mon_ops_get(soc);
|
||||
|
||||
if (!mon_ops) {
|
||||
dp_err("mon_ops is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
mon_ops->mon_config_debug_sniffer = NULL;
|
||||
mon_ops->mon_peer_tx_init = NULL;
|
||||
mon_ops->mon_peer_tx_cleanup = NULL;
|
||||
mon_ops->mon_htt_ppdu_stats_attach = NULL;
|
||||
mon_ops->mon_htt_ppdu_stats_detach = NULL;
|
||||
mon_ops->mon_print_pdev_rx_mon_stats = NULL;
|
||||
mon_ops->mon_set_bsscolor = NULL;
|
||||
mon_ops->mon_pdev_get_filter_ucast_data = NULL;
|
||||
mon_ops->mon_pdev_get_filter_mcast_data = NULL;
|
||||
mon_ops->mon_pdev_get_filter_non_data = NULL;
|
||||
mon_ops->mon_neighbour_peer_add_ast = NULL;
|
||||
#ifdef WLAN_TX_PKT_CAPTURE_ENH
|
||||
mon_ops->mon_peer_tid_peer_id_update = NULL;
|
||||
mon_ops->mon_tx_ppdu_stats_attach = NULL;
|
||||
mon_ops->mon_tx_ppdu_stats_detach = NULL;
|
||||
mon_ops->mon_tx_capture_debugfs_init = NULL;
|
||||
mon_ops->mon_tx_add_to_comp_queue = NULL;
|
||||
mon_ops->mon_peer_tx_capture_filter_check = NULL;
|
||||
mon_ops->mon_print_pdev_tx_capture_stats = NULL;
|
||||
mon_ops->mon_config_enh_tx_capture = NULL;
|
||||
#endif
|
||||
#if defined(WDI_EVENT_ENABLE) &&\
|
||||
(defined(QCA_ENHANCED_STATS_SUPPORT) || !defined(REMOVE_PKT_LOG))
|
||||
mon_ops->mon_ppdu_stats_ind_handler = NULL;
|
||||
#endif
|
||||
#ifdef WLAN_RX_PKT_CAPTURE_ENH
|
||||
mon_ops->mon_config_enh_rx_capture = NULL;
|
||||
#endif
|
||||
#ifdef QCA_SUPPORT_BPR
|
||||
mon_ops->mon_set_bpr_enable = NULL;
|
||||
#endif
|
||||
#ifdef ATH_SUPPORT_NAC
|
||||
mon_ops->mon_set_filter_neigh_peers = NULL;
|
||||
#endif
|
||||
#ifdef WLAN_ATF_ENABLE
|
||||
mon_ops->mon_set_atf_stats_enable = NULL;
|
||||
#endif
|
||||
#ifdef FEATURE_NAC_RSSI
|
||||
mon_ops->mon_filter_neighbour_peer = NULL;
|
||||
#endif
|
||||
#ifdef QCA_MCOPY_SUPPORT
|
||||
mon_ops->mon_filter_setup_mcopy_mode = NULL;
|
||||
mon_ops->mon_filter_reset_mcopy_mode = NULL;
|
||||
mon_ops->mon_mcopy_check_deliver = NULL;
|
||||
#endif
|
||||
#ifdef QCA_ENHANCED_STATS_SUPPORT
|
||||
mon_ops->mon_filter_setup_enhanced_stats = NULL;
|
||||
#ifdef WLAN_FEATURE_11BE
|
||||
mon_ops->mon_tx_stats_update = NULL;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
|
||||
mon_ops->mon_filter_setup_smart_monitor = NULL;
|
||||
#endif
|
||||
#ifdef WLAN_RX_PKT_CAPTURE_ENH
|
||||
mon_ops->mon_filter_setup_rx_enh_capture = NULL;
|
||||
#endif
|
||||
#ifdef WDI_EVENT_ENABLE
|
||||
mon_ops->mon_set_pktlog_wifi3 = NULL;
|
||||
mon_ops->mon_filter_setup_rx_pkt_log_full = NULL;
|
||||
mon_ops->mon_filter_reset_rx_pkt_log_full = NULL;
|
||||
mon_ops->mon_filter_setup_rx_pkt_log_lite = NULL;
|
||||
mon_ops->mon_filter_reset_rx_pkt_log_lite = NULL;
|
||||
mon_ops->mon_filter_setup_rx_pkt_log_cbf = NULL;
|
||||
mon_ops->mon_filter_reset_rx_pkt_log_cbf = NULL;
|
||||
#ifdef QCA_WIFI_QCN9224
|
||||
mon_ops->mon_filter_setup_pktlog_hybrid = NULL;
|
||||
mon_ops->mon_filter_reset_pktlog_hybrid = NULL;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
|
||||
mon_ops->mon_pktlogmod_exit = NULL;
|
||||
#endif
|
||||
mon_ops->rx_packet_length_set = NULL;
|
||||
mon_ops->rx_wmask_subscribe = NULL;
|
||||
mon_ops->rx_enable_mpdu_logging = NULL;
|
||||
mon_ops->mon_neighbour_peers_detach = NULL;
|
||||
mon_ops->mon_vdev_set_monitor_mode_buf_rings = NULL;
|
||||
mon_ops->mon_vdev_set_monitor_mode_rings = NULL;
|
||||
#ifdef QCA_ENHANCED_STATS_SUPPORT
|
||||
mon_ops->mon_rx_stats_update = NULL;
|
||||
mon_ops->mon_rx_populate_ppdu_usr_info = NULL;
|
||||
mon_ops->mon_rx_populate_ppdu_info = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
QDF_STATUS dp_mon_soc_attach(struct dp_soc *soc)
|
||||
{
|
||||
struct dp_mon_soc *mon_soc;
|
||||
|
@@ -193,6 +193,27 @@ void dp_mon_cdp_ops_register(struct dp_soc *soc);
|
||||
*/
|
||||
void dp_mon_cdp_ops_deregister(struct dp_soc *soc);
|
||||
|
||||
/*
|
||||
* dp_mon_intr_ops_deregister() - deregister monitor interrupt ops
|
||||
* @soc: Datapath soc handle
|
||||
*
|
||||
*/
|
||||
void dp_mon_intr_ops_deregister(struct dp_soc *soc);
|
||||
|
||||
/*
|
||||
* dp_mon_feature_ops_deregister() - deregister monitor feature ops
|
||||
* @soc: Datapath soc handle
|
||||
*
|
||||
*/
|
||||
void dp_mon_feature_ops_deregister(struct dp_soc *soc);
|
||||
|
||||
/*
|
||||
* dp_mon_ops_free() - free monitor ops
|
||||
* @soc: Datapath soc handle
|
||||
*
|
||||
*/
|
||||
void dp_mon_ops_free(struct dp_soc *soc);
|
||||
|
||||
/*
|
||||
* dp_mon_ops_register() - Register monitor ops
|
||||
* @soc: Datapath soc handle
|
||||
@@ -3330,34 +3351,38 @@ dp_ppdu_desc_user_stats_update(struct dp_pdev *pdev,
|
||||
#endif /* QCA_ENHANCED_STATS_SUPPORT */
|
||||
|
||||
/**
|
||||
* dp_mon_ops_get_1_0(): Get legacy monitor ops
|
||||
* dp_mon_ops_register_1_0(): register legacy monitor ops
|
||||
* @mon_soc: monitor soc handle
|
||||
*
|
||||
* return: Pointer to dp_mon_ops
|
||||
* return: void
|
||||
*/
|
||||
struct dp_mon_ops *dp_mon_ops_get_1_0(void);
|
||||
void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc);
|
||||
|
||||
/**
|
||||
* dp_mon_cdp_ops_get_1_0(): Get legacy monitor cdp ops
|
||||
* dp_mon_cdp_ops_register_1_0(): register legacy monitor cdp ops
|
||||
* @ops: cdp ops handle
|
||||
*
|
||||
* return: Pointer to dp_mon_cdp_ops
|
||||
* return: void
|
||||
*/
|
||||
struct cdp_mon_ops *dp_mon_cdp_ops_get_1_0(void);
|
||||
void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops);
|
||||
|
||||
#ifdef QCA_MONITOR_2_0_SUPPORT
|
||||
/**
|
||||
* dp_mon_ops_get_2_0(): Get BE monitor ops
|
||||
* dp_mon_ops_register_2_0(): register monitor ops
|
||||
* @mon_soc: monitor soc handle
|
||||
*
|
||||
* return: Pointer to dp_mon_ops
|
||||
* return: void
|
||||
*/
|
||||
struct dp_mon_ops *dp_mon_ops_get_2_0(void);
|
||||
void dp_mon_ops_register_2_0(struct dp_mon_soc *mon_soc);
|
||||
|
||||
/**
|
||||
* dp_mon_cdp_ops_get_2_0(): Get BE monitor cdp ops
|
||||
* dp_mon_cdp_ops_register_2_0(): register monitor cdp ops
|
||||
* @ops: cdp ops handle
|
||||
*
|
||||
* return: Pointer to dp_mon_cdp_ops
|
||||
* return: void
|
||||
*/
|
||||
struct cdp_mon_ops *dp_mon_cdp_ops_get_2_0(void);
|
||||
#endif
|
||||
void dp_mon_cdp_ops_register_2_0(struct cdp_ops *ops);
|
||||
#endif /* QCA_MONITOR_2_0_SUPPORT */
|
||||
|
||||
/**
|
||||
* dp_mon_register_feature_ops(): Register mon feature ops
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 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
|
||||
@@ -287,6 +288,19 @@ QDF_STATUS dp_mon_filter_update(struct dp_pdev *pdev)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef QCA_ENHANCED_STATS_SUPPORT
|
||||
void dp_mon_filters_reset(struct dp_pdev *pdev)
|
||||
{
|
||||
dp_mon_filter_reset_enhanced_stats(pdev);
|
||||
dp_mon_filter_reset_mon_mode(pdev);
|
||||
dp_mon_filter_update(pdev);
|
||||
}
|
||||
#else
|
||||
void dp_mon_filters_reset(struct dp_pdev *pdev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
dp_mon_filter_reset_mon_srng(struct dp_soc *soc, struct dp_pdev *pdev,
|
||||
enum dp_mon_filter_srng_type mon_srng_type)
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 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
|
||||
@@ -119,6 +120,12 @@ enum dp_mon_filter_action {
|
||||
DP_MON_FILTER_SET,
|
||||
};
|
||||
|
||||
/**
|
||||
* dp_mon_filters_reset() - reset all filters
|
||||
* @pdev: DP pdev handle
|
||||
*/
|
||||
void dp_mon_filters_reset(struct dp_pdev *pdev);
|
||||
|
||||
#ifdef QCA_ENHANCED_STATS_SUPPORT
|
||||
/**
|
||||
* dp_mon_filter_setup_enhanced_stats() - Setup the enhanced stats filter
|
||||
|
Reference in New Issue
Block a user