qcacmn: Conditionally compile monitor related features and issue fixes

PATCH[7/7]:
This patch consists following changes:
 -Conditionally compile all monitor destination ring related code
  Macro used QCA_MONITOR_PKT_SUPPORT
 -Add QCA_ENHANCED_STATS_SUPPORT macro to conditionally compile
  enhanced stats support
 -Use QCA_MCOPY_SUPPORT and QCA_TX_CAPTURE_SUPPORT macros
  to conditionally compile MCOPY and Tx capture features
  respectively
 -Use QCN_IE macro to conditionally compile BPR
  feature
 -Use QCA_ADVANCE_MON_FILTER_SUPPORT macro to conditionally
  compile advance monitor filter feature
 -Fix vdev attach issue for special and smart monitor vap
 -Fix status ring initialization issue.

Change-Id: I0deaa28a9a54bf34b0f41e6dd510fdd8d4992db2
CRs-Fixed: 2983780
This commit is contained in:
aloksing
2021-06-14 20:12:04 +05:30
committed by Madan Koyyalamudi
parent 53fe7000ba
commit c60b9619a3
24 changed files with 2719 additions and 1971 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -13,6 +13,11 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _DP_MON_H_
#define _DP_MON_H_
#include "dp_htt.h"
#ifdef WLAN_TX_PKT_CAPTURE_ENH
#include "dp_tx_capture.h"
#endif
@@ -28,6 +33,14 @@
#define mon_rx_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_RX, params)
#ifndef WLAN_TX_PKT_CAPTURE_ENH
struct dp_pdev_tx_capture {
};
struct dp_peer_tx_capture {
};
#endif
struct dp_mon_ops {
QDF_STATUS (*mon_soc_cfg_init)(struct dp_soc *soc);
QDF_STATUS (*mon_pdev_attach)(struct dp_pdev *pdev);
@@ -76,7 +89,8 @@ struct dp_mon_ops {
struct hal_tx_completion_status *ts,
struct dp_peer *peer);
#endif
#if defined(WDI_EVENT_ENABLE) && !defined(REMOVE_PKT_LOG)
#if defined(WDI_EVENT_ENABLE) &&\
(defined(QCA_ENHANCED_STATS_SUPPORT) || !defined(REMOVE_PKT_LOG))
bool (*mon_ppdu_stats_ind_handler)(struct htt_soc *soc,
uint32_t *msg_word,
qdf_nbuf_t htt_t2h_msg);
@@ -94,7 +108,9 @@ struct dp_mon_ops {
QDF_STATUS (*mon_config_enh_rx_capture)(struct dp_pdev *pdev,
uint8_t val);
#endif
#ifdef QCA_SUPPORT_BPR
QDF_STATUS (*mon_set_bpr_enable)(struct dp_pdev *pdev, int val);
#endif
#ifdef ATH_SUPPORT_NAC
int (*mon_set_filter_neigh_peers)(struct dp_pdev *pdev, bool val);
#endif
@@ -119,17 +135,19 @@ struct dp_mon_ops {
uint8_t *rx_pkt_hdr);
#endif
void (*mon_vdev_timer_init)(struct dp_soc *soc);
void (*mon_vdev_timer_start)(struct dp_mon_soc *mon_soc);
bool (*mon_vdev_timer_stop)(struct dp_mon_soc *mon_soc);
void (*mon_vdev_timer_deinit)(struct dp_mon_soc *mon_soc);
void (*mon_vdev_timer_start)(struct dp_soc *soc);
bool (*mon_vdev_timer_stop)(struct dp_soc *soc);
void (*mon_vdev_timer_deinit)(struct dp_soc *soc);
void (*mon_reap_timer_init)(struct dp_soc *soc);
void (*mon_reap_timer_start)(struct dp_mon_soc *mon_soc);
bool (*mon_reap_timer_stop)(struct dp_mon_soc *mon_soc);
void (*mon_reap_timer_deinit)(struct dp_mon_soc *mon_soc);
QDF_STATUS (*mon_mcopy_check_deliver)(struct dp_mon_pdev *mon_pdev,
void (*mon_reap_timer_start)(struct dp_soc *soc);
bool (*mon_reap_timer_stop)(struct dp_soc *soc);
void (*mon_reap_timer_deinit)(struct dp_soc *soc);
#ifdef QCA_MCOPY_SUPPORT
QDF_STATUS (*mon_mcopy_check_deliver)(struct dp_pdev *pdev,
uint16_t peer_id,
uint32_t ppdu_id,
uint8_t first_msdu);
#endif
void (*mon_neighbour_peer_add_ast)(struct dp_pdev *pdev,
struct dp_peer *ta_peer,
uint8_t *mac_addr,
@@ -288,6 +306,8 @@ struct dp_mon_pdev {
uint64_t status_buf_addr;
struct hal_rx_ppdu_info ppdu_info;
/* ppdu_id of last received HTT TX stats */
uint32_t last_ppdu_id;
struct {
uint8_t last_user;
qdf_nbuf_t buf;
@@ -353,7 +373,7 @@ struct dp_mon_peer {
struct mon_ops {
};
#ifdef FEATURE_PERPKT_INFO
#if defined(QCA_TX_CAPTURE_SUPPORT) || defined(QCA_ENHANCED_STATS_SUPPORT)
void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf);
#else
static inline
@@ -362,12 +382,49 @@ void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
}
#endif
#ifndef WLAN_TX_PKT_CAPTURE_ENH
struct dp_pdev_tx_capture {
};
#if defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) ||\
defined(WLAN_SUPPORT_RX_FLOW_TAG)
/**
* dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
* mode and then tags appropriate packets
* @soc: core txrx main context
* @vdev: pdev on which packet is received
* @msdu: QDF packet buffer on which the protocol tag should be set
* @rx_desc: base address where the RX TLVs start
* Return: void
*/
void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
struct dp_pdev *dp_pdev,
qdf_nbuf_t msdu, void *rx_desc);
#endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
struct dp_peer_tx_capture {
};
#if !defined(WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG) &&\
!defined(WLAN_SUPPORT_RX_FLOW_TAG)
/**
* dp_rx_mon_update_protocol_flow_tag() - Performs necessary checks for monitor
* mode and then tags appropriate packets
* @soc: core txrx main context
* @vdev: pdev on which packet is received
* @msdu: QDF packet buffer on which the protocol tag should be set
* @rx_desc: base address where the RX TLVs start
* Return: void
*/
static inline
void dp_rx_mon_update_protocol_flow_tag(struct dp_soc *soc,
struct dp_pdev *dp_pdev,
qdf_nbuf_t msdu, void *rx_desc)
{
}
#endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG || WLAN_SUPPORT_RX_FLOW_TAG */
#ifndef WLAN_TX_PKT_CAPTURE_ENH
static inline
QDF_STATUS dp_peer_set_tx_capture_enabled(struct dp_pdev *pdev,
struct dp_peer *peer_handle,
uint8_t value, uint8_t *peer_mac)
{
return QDF_STATUS_SUCCESS;
}
/**
* dp_peer_tid_queue_init() Initialize ppdu stats queue per TID
@@ -500,12 +557,6 @@ static inline QDF_STATUS dp_peer_stats_notify(struct dp_pdev *pdev,
}
#endif
#if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
static void dp_pktlogmod_exit(struct dp_pdev *handle);
#else
static void dp_pktlogmod_exit(struct dp_pdev *handle) { }
#endif
#ifndef WLAN_TX_PKT_CAPTURE_ENH
/**
* dp_tx_ppdu_stats_process - Deferred PPDU stats handler
@@ -601,7 +652,7 @@ static inline bool dp_soc_is_full_mon_enable(struct dp_pdev *pdev)
*/
static inline bool monitor_is_enable_reap_timer_non_pkt(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return false;
return pdev->monitor_pdev->enable_reap_timer_non_pkt;
@@ -615,7 +666,7 @@ static inline bool monitor_is_enable_reap_timer_non_pkt(struct dp_pdev *pdev)
*/
static inline bool monitor_is_enable_mcopy_mode(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return false;
return pdev->monitor_pdev->mcopy_mode;
@@ -629,7 +680,7 @@ static inline bool monitor_is_enable_mcopy_mode(struct dp_pdev *pdev)
*/
static inline bool monitor_is_enable_tx_sniffer(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return false;
return pdev->monitor_pdev->tx_sniffer_enable;
@@ -643,7 +694,7 @@ static inline bool monitor_is_enable_tx_sniffer(struct dp_pdev *pdev)
*/
static inline bool monitor_is_configured(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return false;
return pdev->monitor_pdev->monitor_configured;
@@ -656,7 +707,7 @@ static inline QDF_STATUS monitor_check_com_info_ppdu_id(struct dp_pdev *pdev,
struct dp_mon_pdev *mon_pdev;
uint32_t msdu_ppdu_id = 0;
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return QDF_STATUS_E_FAILURE;
mon_pdev = pdev->monitor_pdev;
@@ -668,7 +719,6 @@ static inline QDF_STATUS monitor_check_com_info_ppdu_id(struct dp_pdev *pdev,
return QDF_STATUS_E_FAILURE;
msdu_ppdu_id = hal_rx_get_ppdu_id(pdev->soc->hal_soc, rx_desc);
if (msdu_ppdu_id != mon_pdev->ppdu_info.com_info.ppdu_id) {
QDF_TRACE(QDF_MODULE_ID_DP,
QDF_TRACE_LEVEL_ERROR,
@@ -682,9 +732,9 @@ static inline QDF_STATUS monitor_check_com_info_ppdu_id(struct dp_pdev *pdev,
}
static inline struct mon_rx_status*
monitor_get_rx_status_addr(struct dp_pdev *pdev)
monitor_get_rx_status(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return NULL;
return &pdev->monitor_pdev->ppdu_info.rx_status;
@@ -698,7 +748,7 @@ monitor_get_rx_status_addr(struct dp_pdev *pdev)
*/
static inline bool monitor_is_chan_band_known(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return false;
if (pdev->monitor_pdev->mon_chan_band != REG_BAND_UNKNOWN)
@@ -726,7 +776,7 @@ monitor_get_chan_band(struct dp_pdev *pdev)
*/
static inline void monitor_print_tx_stats(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
DP_PRINT_STATS("ppdu info schedule completion list depth: %d",
@@ -747,7 +797,7 @@ static inline void monitor_print_tx_stats(struct dp_pdev *pdev)
*/
static inline bool monitor_is_enable_enhanced_stats(struct dp_pdev *pdev)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return false;
return pdev->monitor_pdev->enhanced_stats_en;
@@ -762,7 +812,7 @@ static inline bool monitor_is_enable_enhanced_stats(struct dp_pdev *pdev)
*/
static inline void monitor_set_chan_num(struct dp_pdev *pdev, int chan_num)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
pdev->monitor_pdev->mon_chan_num = chan_num;
@@ -778,7 +828,7 @@ static inline void monitor_set_chan_num(struct dp_pdev *pdev, int chan_num)
static inline void
monitor_set_chan_freq(struct dp_pdev *pdev, qdf_freq_t chan_freq)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
pdev->monitor_pdev->mon_chan_freq = chan_freq;
@@ -794,7 +844,7 @@ monitor_set_chan_freq(struct dp_pdev *pdev, qdf_freq_t chan_freq)
static inline void
monitor_set_chan_band(struct dp_pdev *pdev, enum reg_wifi_band chan_band)
{
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
pdev->monitor_pdev->mon_chan_band = chan_band;
@@ -812,7 +862,7 @@ static inline void monitor_get_mpdu_status(struct dp_pdev *pdev,
{
struct dp_mon_pdev *mon_pdev;
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
mon_pdev = pdev->monitor_pdev;
@@ -895,7 +945,7 @@ static inline bool monitor_is_vdev_timer_running(struct dp_soc *soc)
{
struct dp_mon_soc *mon_soc;
if (!soc || !soc->monitor_soc)
if (qdf_unlikely(!soc || !soc->monitor_soc))
return false;
mon_soc = soc->monitor_soc;
@@ -906,7 +956,7 @@ static inline bool monitor_is_vdev_timer_running(struct dp_soc *soc)
static inline struct qdf_mem_multi_page_t*
monitor_get_link_desc_pages(struct dp_soc *soc, uint32_t mac_id)
{
if (!soc || !soc->monitor_soc)
if (qdf_unlikely(!soc || !soc->monitor_soc))
return NULL;
return &soc->monitor_soc->mon_link_desc_pages[mac_id];
@@ -1450,7 +1500,8 @@ QDF_STATUS monitor_tx_add_to_comp_queue(struct dp_soc *soc,
#endif
#if defined(WDI_EVENT_ENABLE) && !defined(REMOVE_PKT_LOG)
#if defined(WDI_EVENT_ENABLE) &&\
(defined(QCA_ENHANCED_STATS_SUPPORT) || !defined(REMOVE_PKT_LOG))
static inline bool monitor_ppdu_stats_ind_handler(struct htt_soc *soc,
uint32_t *msg_word,
qdf_nbuf_t htt_t2h_msg)
@@ -1617,6 +1668,7 @@ static inline QDF_STATUS monitor_config_enh_rx_capture(struct dp_pdev *pdev,
}
#endif
#ifdef QCA_SUPPORT_BPR
static inline QDF_STATUS monitor_set_bpr_enable(struct dp_pdev *pdev,
uint32_t val)
{
@@ -1636,6 +1688,13 @@ static inline QDF_STATUS monitor_set_bpr_enable(struct dp_pdev *pdev,
return monitor_ops->mon_set_bpr_enable(pdev, val);
}
#else
static inline QDF_STATUS monitor_set_bpr_enable(struct dp_pdev *pdev,
uint32_t val)
{
return QDF_STATUS_E_FAILURE;
}
#endif
#ifdef ATH_SUPPORT_NAC
static inline int monitor_set_filter_neigh_peers(struct dp_pdev *pdev, bool val)
@@ -1794,8 +1853,8 @@ int monitor_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event, bool enable)
return monitor_ops->mon_set_pktlog_wifi3(pdev, event, enable);
}
#else
static inline int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
bool enable)
static inline int monitor_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
bool enable)
{
return 0;
}
@@ -1923,7 +1982,7 @@ void monitor_reap_timer_deinit(struct dp_soc *soc)
return;
}
monitor_ops->mon_reap_timer_deinit(mon_soc);
monitor_ops->mon_reap_timer_deinit(soc);
}
static inline
@@ -1943,7 +2002,7 @@ void monitor_reap_timer_start(struct dp_soc *soc)
return;
}
monitor_ops->mon_reap_timer_start(mon_soc);
monitor_ops->mon_reap_timer_start(soc);
}
static inline
@@ -1963,7 +2022,7 @@ bool monitor_reap_timer_stop(struct dp_soc *soc)
return false;
}
return monitor_ops->mon_reap_timer_stop(mon_soc);
return monitor_ops->mon_reap_timer_stop(soc);
}
static inline
@@ -2003,7 +2062,7 @@ void monitor_vdev_timer_deinit(struct dp_soc *soc)
return;
}
monitor_ops->mon_vdev_timer_deinit(mon_soc);
monitor_ops->mon_vdev_timer_deinit(soc);
}
static inline
@@ -2023,7 +2082,7 @@ void monitor_vdev_timer_start(struct dp_soc *soc)
return;
}
monitor_ops->mon_vdev_timer_start(mon_soc);
monitor_ops->mon_vdev_timer_start(soc);
}
static inline
@@ -2043,32 +2102,41 @@ bool monitor_vdev_timer_stop(struct dp_soc *soc)
return false;
}
return monitor_ops->mon_vdev_timer_stop(mon_soc);
return monitor_ops->mon_vdev_timer_stop(soc);
}
#ifdef QCA_MCOPY_SUPPORT
static inline
QDF_STATUS monitor_mcopy_check_deliver(struct dp_pdev *pdev,
uint16_t peer_id, uint32_t ppdu_id,
uint8_t first_msdu)
{
struct dp_mon_ops *monitor_ops;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
struct dp_mon_soc *mon_soc = pdev->soc->monitor_soc;
if (!mon_soc) {
qdf_err("monitor soc is NULL");
return QDF_STATUS_SUCCESS;
return QDF_STATUS_E_FAILURE;
}
monitor_ops = mon_soc->mon_ops;
if (!monitor_ops || !monitor_ops->mon_mcopy_check_deliver) {
qdf_err("callback not registered");
return QDF_STATUS_SUCCESS;
return QDF_STATUS_E_FAILURE;
}
return monitor_ops->mon_mcopy_check_deliver(mon_pdev, peer_id,
return monitor_ops->mon_mcopy_check_deliver(pdev, peer_id,
ppdu_id, first_msdu);
}
#else
static inline
QDF_STATUS monitor_mcopy_check_deliver(struct dp_pdev *pdev,
uint16_t peer_id, uint32_t ppdu_id,
uint8_t first_msdu)
{
return QDF_STATUS_SUCCESS;
}
#endif
static inline void monitor_neighbour_peer_add_ast(struct dp_pdev *pdev,
struct dp_peer *ta_peer,
@@ -2109,16 +2177,16 @@ static inline void monitor_vdev_delete(struct dp_soc *soc, struct dp_vdev *vdev)
#ifdef DP_POWER_SAVE
/*
* monitor_stop_reap_timer() - stop reap timer
* monitor_pktlog_reap_pending_frames() - reap pending frames
* @pdev: point to dp pdev
*
* Return:
* Return: void
*/
static inline void monitor_stop_reap_timer(struct dp_pdev *pdev)
static inline void monitor_pktlog_reap_pending_frames(struct dp_pdev *pdev)
{
struct dp_soc *soc;
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
soc = pdev->soc;
@@ -2131,16 +2199,16 @@ static inline void monitor_stop_reap_timer(struct dp_pdev *pdev)
}
/*
* monitor_start_reap_timer() - start reap timer
* monitor_pktlog_start_reap_timer() - start reap timer
* @pdev: point to dp pdev
*
* Return:
* Return: void
*/
static inline void monitor_start_reap_timer(struct dp_pdev *pdev)
static inline void monitor_pktlog_start_reap_timer(struct dp_pdev *pdev)
{
struct dp_soc *soc;
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
soc = pdev->soc;
@@ -2158,7 +2226,7 @@ void monitor_neighbour_peer_list_remove(struct dp_pdev *pdev,
struct dp_mon_pdev *mon_pdev;
struct dp_neighbour_peer *temp_peer = NULL;
if (!pdev || !pdev->monitor_pdev)
if (qdf_unlikely(!pdev || !pdev->monitor_pdev))
return;
mon_pdev = pdev->monitor_pdev;
@@ -2181,3 +2249,35 @@ void monitor_neighbour_peer_list_remove(struct dp_pdev *pdev,
}
qdf_spin_unlock_bh(&mon_pdev->neighbour_peer_mutex);
}
static inline
void monitor_pdev_set_mon_vdev(struct dp_vdev *vdev)
{
struct dp_mon_pdev *mon_pdev = vdev->pdev->monitor_pdev;
if (!mon_pdev)
return;
mon_pdev->mvdev = vdev;
}
QDF_STATUS dp_mon_soc_attach(struct dp_soc *soc);
QDF_STATUS dp_mon_soc_detach(struct dp_soc *soc);
QDF_STATUS dp_mon_pdev_attach(struct dp_pdev *pdev);
QDF_STATUS dp_mon_pdev_detach(struct dp_pdev *pdev);
QDF_STATUS dp_mon_pdev_init(struct dp_pdev *pdev);
QDF_STATUS dp_mon_pdev_deinit(struct dp_pdev *pdev);
QDF_STATUS dp_mon_soc_cfg_init(struct dp_soc *soc);
void dp_mon_cdp_ops_register(struct dp_soc *soc);
void dp_mon_cdp_ops_deregister(struct dp_soc *soc);
void dp_mon_ops_register(struct dp_mon_soc *mon_soc);
QDF_STATUS dp_mon_htt_srng_setup(struct dp_soc *soc,
struct dp_pdev *pdev,
int mac_id,
int mac_for_pdev);
#ifdef QCA_ENHANCED_STATS_SUPPORT
QDF_STATUS dp_peer_qos_stats_notify(struct dp_pdev *dp_pdev,
struct cdp_rx_stats_ppdu_user *ppdu_user);
#endif
#endif /* _DP_MON_H_ */

View File

@@ -29,10 +29,12 @@
* Monitor Filter mode to string
*/
static int8_t *dp_mon_filter_mode_type_to_str[DP_MON_FILTER_MAX_MODE] = {
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_ENHANCED_STATS_SUPPORT
"DP MON FILTER ENHACHED STATS MODE",
#endif /* QCA_ENHANCED_STATS_SUPPORT */
#ifdef QCA_MCOPY_SUPPORT
"DP MON FILTER MCOPY MODE",
#endif /* FEATURE_PERPKT_INFO */
#endif /* QCA_MCOPY_SUPPORT */
#if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
"DP MON FILTER SMART MONITOR MODE",
#endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */
@@ -48,7 +50,7 @@ static int8_t *dp_mon_filter_mode_type_to_str[DP_MON_FILTER_MAX_MODE] = {
/**
* dp_mon_filter_show_filter() - Show the set filters
* @pdev: DP pdev handle
* @mon_pdev: Monitor pdev handle
* @mode: The filter modes
* @tlv_filter: tlv filter
*/
@@ -310,6 +312,7 @@ static void dp_mon_filter_ht2_setup(struct dp_soc *soc, struct dp_pdev *pdev,
dp_mon_filter_show_filter(mon_pdev, 0, filter);
}
#ifdef QCA_MONITOR_PKT_SUPPORT
/**
* dp_mon_filter_reset_mon_srng()
* @soc: DP SoC handle
@@ -328,8 +331,9 @@ dp_mon_filter_reset_mon_srng(struct dp_soc *soc, struct dp_pdev *pdev,
soc);
}
}
#endif
#if defined(FEATURE_PERPKT_INFO) || defined(ATH_SUPPORT_NAC_RSSI) \
#if defined(QCA_MCOPY_SUPPORT) || defined(ATH_SUPPORT_NAC_RSSI) \
|| defined(ATH_SUPPORT_NAC) || defined(WLAN_RX_PKT_CAPTURE_ENH)
/**
* dp_mon_filter_check_co_exist() - Check the co-existing of the
@@ -414,6 +418,8 @@ static QDF_STATUS dp_mon_filter_check_co_exist(struct dp_pdev *pdev)
#else
static QDF_STATUS dp_mon_filter_check_co_exist(struct dp_pdev *pdev)
{
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
/*
* Check if the Rx packet log lite or full can co-exist with
* the enable modes.
@@ -430,9 +436,10 @@ static QDF_STATUS dp_mon_filter_check_co_exist(struct dp_pdev *pdev)
}
#endif
#ifdef QCA_MONITOR_PKT_SUPPORT
/**
* dp_mon_filter_set_mon_cmn() - Setp the common mon filters
* @pdev: DP pdev handle
* @mon_pdev: Monitor pdev handle
* @filter: DP mon filter
*
* Return: QDF_STATUS
@@ -466,10 +473,11 @@ static void dp_mon_filter_set_mon_cmn(struct dp_mon_pdev *mon_pdev,
filter->tlv_filter.mo_data_filter = mon_pdev->mo_data_filter;
filter->tlv_filter.offset_valid = false;
}
#endif
/**
* dp_mon_filter_set_status_cmn() - Setp the common status filters
* @pdev: DP pdev handle
* @mon_pdev: Monitor pdev handle
* @filter: Dp mon filters
*
* Return: QDF_STATUS
@@ -535,6 +543,7 @@ static void dp_mon_filter_set_status_cbf(struct dp_pdev *pdev,
filter->tlv_filter.enable_mo = 0;
}
#ifdef QCA_MONITOR_PKT_SUPPORT
/**
* dp_mon_filter_set_cbf_cmn() - Set the common cbf mode filters
* @pdev: DP pdev handle
@@ -562,11 +571,12 @@ static void dp_mon_filter_set_cbf_cmn(struct dp_pdev *pdev,
filter->tlv_filter.offset_valid = false;
filter->tlv_filter.enable_mo = 0;
}
#endif
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_ENHANCED_STATS_SUPPORT
/**
* dp_mon_filter_setup_enhanced_stats() - Setup the enhanced stats filter
* @mon_pdev: Monitor DP pdev handle
* @mon_pdev: Monitor pdev handle
*/
void dp_mon_filter_setup_enhanced_stats(struct dp_mon_pdev *mon_pdev)
{
@@ -590,24 +600,58 @@ void dp_mon_filter_setup_enhanced_stats(struct dp_mon_pdev *mon_pdev)
/**
* dp_mon_filter_reset_enhanced_stats() - Reset the enhanced stats filter
* @pdev: DP pdev handle
* @mon_pdev: Monitor pdev handle
*/
void dp_mon_filter_reset_enhanced_stats(struct dp_pdev *pdev)
void dp_mon_filter_reset_enhanced_stats(struct dp_mon_pdev *mon_pdev)
{
struct dp_mon_filter filter = {0};
enum dp_mon_filter_mode mode = DP_MON_FILTER_ENHACHED_STATS_MODE;
enum dp_mon_filter_srng_type srng_type =
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
struct dp_mon_pdev *mon_pdev;
if (!pdev) {
if (!mon_pdev) {
dp_mon_filter_err("pdev Context is null");
return;
}
mon_pdev = pdev->monitor_pdev;
mon_pdev->filter[mode][srng_type] = filter;
}
#endif /* QCA_ENHANCED_STATS_SUPPORT */
#ifdef QCA_MCOPY_SUPPORT
#ifdef QCA_MONITOR_PKT_SUPPORT
static void
dp_mon_filter_set_reset_mcopy_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
struct dp_soc *soc = pdev->soc;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
enum dp_mon_filter_mode mode = DP_MON_FILTER_MCOPY_MODE;
enum dp_mon_filter_srng_type srng_type;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
/* Set the filter */
if (pfilter->valid) {
dp_mon_filter_set_mon_cmn(mon_pdev, pfilter);
pfilter->tlv_filter.fp_data_filter = 0;
pfilter->tlv_filter.mo_data_filter = 0;
dp_mon_filter_show_filter(mon_pdev, mode, pfilter);
mon_pdev->filter[mode][srng_type] = *pfilter;
} else /* Reset the filter */
mon_pdev->filter[mode][srng_type] = *pfilter;
}
#else
static void
dp_mon_filter_set_reset_mcopy_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
}
#endif
/**
* dp_mon_filter_setup_mcopy_mode() - Setup the m_copy mode filter
@@ -640,17 +684,7 @@ void dp_mon_filter_setup_mcopy_mode(struct dp_pdev *pdev)
}
/* Enabled the filter */
filter.valid = true;
dp_mon_filter_set_mon_cmn(mon_pdev, &filter);
filter.tlv_filter.fp_data_filter = 0;
filter.tlv_filter.mo_data_filter = 0;
dp_mon_filter_show_filter(mon_pdev, mode, &filter);
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_mcopy_mon_buf(pdev, &filter);
/* Clear the filter as the same filter will be used to set the
* monitor status ring
@@ -696,15 +730,12 @@ void dp_mon_filter_reset_mcopy_mode(struct dp_pdev *pdev)
}
mon_pdev = pdev->monitor_pdev;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_mcopy_mon_buf(pdev, &filter);
srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
mon_pdev->filter[mode][srng_type] = filter;
}
#endif /* FEATURE_PERPKT_INFO */
#endif /* QCA_MCOPY_SUPPORT */
#if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
/**
@@ -754,22 +785,62 @@ void dp_mon_filter_setup_smart_monitor(struct dp_pdev *pdev)
* dp_mon_filter_reset_smart_monitor() - Reset the smart monitor mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_smart_monitor(struct dp_mon_pdev *mon_pdev)
void dp_mon_filter_reset_smart_monitor(struct dp_pdev *pdev)
{
struct dp_mon_filter filter = {0};
enum dp_mon_filter_mode mode = DP_MON_FILTER_SMART_MONITOR_MODE;
enum dp_mon_filter_srng_type srng_type =
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
struct dp_mon_pdev *mon_pdev;
if (!mon_pdev) {
if (!pdev) {
dp_mon_filter_err("monitor pdev Context is null");
return;
}
mon_pdev = pdev->monitor_pdev;
mon_pdev->filter[mode][srng_type] = filter;
}
#endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */
#ifdef WLAN_RX_PKT_CAPTURE_ENH
#ifdef QCA_MONITOR_PKT_SUPPORT
static void
dp_mon_filter_set_reset_rx_enh_capture_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
struct dp_soc *soc = pdev->soc;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
enum dp_mon_filter_mode mode = DP_MON_FILTER_RX_CAPTURE_MODE;
enum dp_mon_filter_srng_type srng_type;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
/* Set the filter */
if (pfilter->valid) {
dp_mon_filter_set_mon_cmn(mon_pdev, pfilter);
pfilter->tlv_filter.fp_mgmt_filter = 0;
pfilter->tlv_filter.fp_ctrl_filter = 0;
pfilter->tlv_filter.fp_data_filter = 0;
pfilter->tlv_filter.mo_mgmt_filter = 0;
pfilter->tlv_filter.mo_ctrl_filter = 0;
pfilter->tlv_filter.mo_data_filter = 0;
dp_mon_filter_show_filter(mon_pdev, mode, pfilter);
pdev->monitor_pdev->filter[mode][srng_type] = *pfilter;
} else /* Reset the filter */
pdev->monitor_pdev->filter[mode][srng_type] = *pfilter;
}
#else
static void
dp_mon_filter_set_reset_rx_enh_capture_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
}
#endif
/**
* dp_mon_filter_setup_rx_enh_capture() - Setup the Rx capture mode filters
* @pdev: DP pdev handle
@@ -798,21 +869,7 @@ void dp_mon_filter_setup_rx_enh_capture(struct dp_pdev *pdev)
/* Enabled the filter */
filter.valid = true;
dp_mon_filter_set_mon_cmn(mon_pdev, &filter);
filter.tlv_filter.fp_mgmt_filter = 0;
filter.tlv_filter.fp_ctrl_filter = 0;
filter.tlv_filter.fp_data_filter = 0;
filter.tlv_filter.mo_mgmt_filter = 0;
filter.tlv_filter.mo_ctrl_filter = 0;
filter.tlv_filter.mo_data_filter = 0;
dp_mon_filter_show_filter(mon_pdev, mode, &filter);
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_rx_enh_capture_mon_buf(pdev, &filter);
/* Clear the filter as the same filter will be used to set the
* monitor status ring
@@ -873,16 +930,42 @@ void dp_mon_filter_reset_rx_enh_capture(struct dp_pdev *pdev)
}
mon_pdev = pdev->monitor_pdev;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_rx_enh_capture_mon_buf(pdev, &filter);
srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
mon_pdev->filter[mode][srng_type] = filter;
}
#endif /* WLAN_RX_PKT_CAPTURE_ENH */
#ifdef QCA_MONITOR_PKT_SUPPORT
static void dp_mon_filter_set_reset_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
struct dp_soc *soc = pdev->soc;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
enum dp_mon_filter_mode mode = DP_MON_FILTER_MONITOR_MODE;
enum dp_mon_filter_srng_type srng_type;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
/* set the filter */
if (pfilter->valid) {
dp_mon_filter_set_mon_cmn(mon_pdev, pfilter);
dp_mon_filter_show_filter(mon_pdev, mode, pfilter);
mon_pdev->filter[mode][srng_type] = *pfilter;
} else /* reset the filter */
mon_pdev->filter[mode][srng_type] = *pfilter;
}
#else
static void dp_mon_filter_set_reset_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
}
#endif
/**
* dp_mon_filter_setup_mon_mode() - Setup the Rx monitor mode filter
* @pdev: DP pdev handle
@@ -909,13 +992,7 @@ void dp_mon_filter_setup_mon_mode(struct dp_pdev *pdev)
mon_pdev = pdev->monitor_pdev;
filter.valid = true;
dp_mon_filter_set_mon_cmn(mon_pdev, &filter);
dp_mon_filter_show_filter(mon_pdev, mode, &filter);
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_mon_buf(pdev, &filter);
/* Clear the filter as the same filter will be used to set the
* monitor status ring
@@ -957,10 +1034,7 @@ void dp_mon_filter_reset_mon_mode(struct dp_pdev *pdev)
}
mon_pdev = pdev->monitor_pdev;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_mon_buf(pdev, &filter);
srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
mon_pdev->filter[mode][srng_type] = filter;
@@ -1049,23 +1123,56 @@ void dp_mon_filter_setup_rx_pkt_log_lite(struct dp_pdev *pdev)
/**
* dp_mon_filter_reset_rx_pkt_log_lite() - Reset the Rx pktlog lite mode filter
* @mon_pdev: Monitor pdev handle
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_rx_pkt_log_lite(struct dp_mon_pdev *mon_pdev)
void dp_mon_filter_reset_rx_pkt_log_lite(struct dp_pdev *pdev)
{
struct dp_mon_filter filter = {0};
enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_LITE_MODE;
enum dp_mon_filter_srng_type srng_type =
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
struct dp_mon_pdev *mon_pdev;
if (!mon_pdev) {
dp_mon_filter_err("monitor pdev Context is null");
if (!pdev) {
dp_mon_filter_err("dp pdev Context is null");
return;
}
mon_pdev = pdev->monitor_pdev;
mon_pdev->filter[mode][srng_type] = filter;
}
#ifdef QCA_MONITOR_PKT_SUPPORT
static void
dp_mon_filter_set_reset_rx_pkt_log_cbf_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
struct dp_soc *soc = pdev->soc;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_CBF_MODE;
enum dp_mon_filter_srng_type srng_type;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
/*set the filter */
if (pfilter->valid) {
dp_mon_filter_set_cbf_cmn(pdev, pfilter);
dp_mon_filter_show_filter(mon_pdev, mode, pfilter);
mon_pdev->filter[mode][srng_type] = *pfilter;
} else /* reset the filter */
mon_pdev->filter[mode][srng_type] = *pfilter;
}
#else
static void
dp_mon_filter_set_reset_rx_pkt_log_cbf_mon_buf(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter)
{
}
#endif
/**
* dp_mon_filter_setup_rx_pkt_log_cbf() - Setup the Rx pktlog CBF mode filter
* @pdev: DP pdev handle
@@ -1077,13 +1184,14 @@ void dp_mon_filter_setup_rx_pkt_log_cbf(struct dp_pdev *pdev)
enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_CBF_MODE;
enum dp_mon_filter_srng_type srng_type =
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
struct dp_mon_pdev *mon_pdev;
if (!pdev) {
dp_mon_filter_err("pdev Context is null");
return;
}
mon_pdev = pdev->monitor_pdev;
soc = pdev->soc;
if (!soc) {
dp_mon_filter_err("Soc Context is null");
@@ -1102,13 +1210,7 @@ void dp_mon_filter_setup_rx_pkt_log_cbf(struct dp_pdev *pdev)
qdf_mem_zero(&(filter), sizeof(struct dp_mon_filter));
filter.valid = true;
dp_mon_filter_set_cbf_cmn(pdev, &filter);
dp_mon_filter_show_filter(mon_pdev, mode, &filter);
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_rx_pkt_log_cbf_mon_buf(pdev, &filter);
}
/**
@@ -1122,7 +1224,7 @@ void dp_mon_filter_reset_rx_pktlog_cbf(struct dp_pdev *pdev)
enum dp_mon_filter_mode mode = DP_MON_FILTER_PKT_LOG_CBF_MODE;
enum dp_mon_filter_srng_type srng_type =
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
struct dp_mon_pdev *mon_pdev;
if (!pdev) {
QDF_TRACE(QDF_MODULE_ID_MON_FILTER, QDF_TRACE_LEVEL_ERROR,
@@ -1130,6 +1232,7 @@ void dp_mon_filter_reset_rx_pktlog_cbf(struct dp_pdev *pdev)
return;
}
mon_pdev = pdev->monitor_pdev;
soc = pdev->soc;
if (!soc) {
QDF_TRACE(QDF_MODULE_ID_MON_FILTER, QDF_TRACE_LEVEL_ERROR,
@@ -1137,10 +1240,7 @@ void dp_mon_filter_reset_rx_pktlog_cbf(struct dp_pdev *pdev)
return;
}
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
mon_pdev->filter[mode][srng_type] = filter;
dp_mon_filter_set_reset_rx_pkt_log_cbf_mon_buf(pdev, &filter);
srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
mon_pdev->filter[mode][srng_type] = filter;
@@ -1173,6 +1273,68 @@ static inline bool dp_mon_should_reset_buf_ring_filter(struct dp_pdev *pdev)
}
#endif
#ifdef QCA_MONITOR_PKT_SUPPORT
static QDF_STATUS dp_mon_filter_mon_buf_update(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter,
bool *pmon_mode_set)
{
struct dp_soc *soc = pdev->soc;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
enum dp_mon_filter_srng_type srng_type;
QDF_STATUS status = QDF_STATUS_SUCCESS;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
dp_mon_filter_ht2_setup(soc, pdev, srng_type, pfilter);
*pmon_mode_set = pfilter->valid;
if (dp_mon_should_reset_buf_ring_filter(pdev) || *pmon_mode_set) {
status = dp_mon_ht2_rx_ring_cfg(soc, pdev,
srng_type,
&pfilter->tlv_filter);
} else {
/*
* For WIN case the monitor buffer ring is used and it does need
* reset when monitor mode gets enabled/disabled.
*/
if (soc->wlan_cfg_ctx->rxdma1_enable) {
if (mon_pdev->monitor_configured || *pmon_mode_set) {
status = dp_mon_ht2_rx_ring_cfg(soc, pdev,
srng_type,
&pfilter->tlv_filter);
}
}
}
return status;
}
static void dp_mon_filter_mon_buf_reset(struct dp_pdev *pdev)
{
struct dp_soc *soc = pdev->soc;
enum dp_mon_filter_srng_type srng_type;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
dp_mon_filter_reset_mon_srng(soc, pdev, srng_type);
}
#else
static QDF_STATUS dp_mon_filter_mon_buf_update(struct dp_pdev *pdev,
struct dp_mon_filter *pfilter,
bool *pmon_mode_set)
{
return QDF_STATUS_SUCCESS;
}
static void dp_mon_filter_mon_buf_reset(struct dp_pdev *pdev)
{
}
#endif
/**
* dp_mon_filter_update() - Setup the monitor filter setting for a srng
* type
@@ -1185,8 +1347,6 @@ QDF_STATUS dp_mon_filter_update(struct dp_pdev *pdev)
struct dp_soc *soc;
bool mon_mode_set = false;
struct dp_mon_filter filter = {0};
enum dp_mon_filter_srng_type mon_srng_type =
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF;
QDF_STATUS status = QDF_STATUS_SUCCESS;
struct dp_mon_pdev *mon_pdev;
@@ -1209,33 +1369,8 @@ QDF_STATUS dp_mon_filter_update(struct dp_pdev *pdev)
/*
* Setup the filters for the monitor destination ring.
*/
if (!soc->wlan_cfg_ctx->rxdma1_enable)
mon_srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF;
/*
* Setup the filters for the monitor mode.
*/
qdf_mem_zero(&(filter), sizeof(filter));
dp_mon_filter_ht2_setup(soc, pdev, mon_srng_type, &filter);
mon_mode_set = filter.valid;
if (dp_mon_should_reset_buf_ring_filter(pdev) || mon_mode_set) {
status = dp_mon_ht2_rx_ring_cfg(soc, pdev,
mon_srng_type,
&filter.tlv_filter);
} else {
/*
* For WIN case the monitor buffer ring is used and it does need
* reset when monitor mode gets enabled/disabled.
*/
if (soc->wlan_cfg_ctx->rxdma1_enable) {
if (mon_pdev->monitor_configured || mon_mode_set) {
status = dp_mon_ht2_rx_ring_cfg(soc, pdev,
mon_srng_type,
&filter.tlv_filter);
}
}
}
status = dp_mon_filter_mon_buf_update(pdev, &filter,
&mon_mode_set);
if (status != QDF_STATUS_SUCCESS) {
dp_mon_filter_err("%pK: Monitor destination ring filter setting failed",
@@ -1258,14 +1393,14 @@ QDF_STATUS dp_mon_filter_update(struct dp_pdev *pdev)
* are not enabled.
*/
if (!filter.valid && mon_mode_set)
dp_mon_filter_reset_mon_srng(soc, pdev, mon_srng_type);
dp_mon_filter_mon_buf_reset(pdev);
if (dp_mon_ht2_rx_ring_cfg(soc, pdev,
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS,
&filter.tlv_filter) != QDF_STATUS_SUCCESS) {
dp_mon_filter_err("%pK: Monitor status ring filter setting failed",
soc);
dp_mon_filter_reset_mon_srng(soc, pdev, mon_srng_type);
dp_mon_filter_mon_buf_reset(pdev);
return QDF_STATUS_E_FAILURE;
}
@@ -1316,7 +1451,7 @@ void dp_mon_filter_dealloc(struct dp_mon_pdev *mon_pdev)
/**
* dp_mon_filter_alloc() - Allocate the filter objects to be stored in
* the radio object.
* @mon_pdev: DP pdev handle
* @mon_pdev: Monitor pdev handle
*/
struct dp_mon_filter **dp_mon_filter_alloc(struct dp_mon_pdev *mon_pdev)
{

View File

@@ -106,10 +106,12 @@ struct dp_mon_filter {
* @DP_MON_FILTER_PKT_LOG_LITE_MODE: Packet log lite mode
*/
enum dp_mon_filter_mode {
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_ENHANCED_STATS_SUPPORT
DP_MON_FILTER_ENHACHED_STATS_MODE,
#endif /* QCA_ENHANCED_STATS_SUPPORT */
#ifdef QCA_MCOPY_SUPPORT
DP_MON_FILTER_MCOPY_MODE,
#endif /* FEATURE_PERPKT_INFO */
#endif /* QCA_MCOPY_SUPPORT */
#if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
DP_MON_FILTER_SMART_MONITOR_MODE,
#endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */
@@ -152,19 +154,21 @@ enum dp_mon_filter_action {
DP_MON_FILTER_SET,
};
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_ENHANCED_STATS_SUPPORT
/**
* dp_mon_filter_setup_enhanced_stats() - Setup the enhanced stats filter
* @mon_pdev: Monitor DP pdev handle
* @mon_pdev: Monitor pdev handle
*/
void dp_mon_filter_setup_enhanced_stats(struct dp_mon_pdev *mon_pdev);
/***
* dp_mon_filter_reset_enhanced_stats() - Reset the enhanced stats filter
* @pdev: DP pdev handle
* @mon_pdev: Monitor pdev handle
*/
void dp_mon_filter_reset_enhanced_stats(struct dp_pdev *pdev);
void dp_mon_filter_reset_enhanced_stats(struct dp_mon_pdev *mon_pdev);
#endif /* QCA_ENHANCED_STATS_SUPPORT */
#ifdef QCA_MCOPY_SUPPORT
/**
* dp_mon_filter_setup_mcopy_mode() - Setup the m_copy mode filter
* @pdev: DP pdev handle
@@ -176,7 +180,7 @@ void dp_mon_filter_setup_mcopy_mode(struct dp_pdev *pdev);
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_mcopy_mode(struct dp_pdev *pdev);
#endif /* FEATURE_PERPKT_INFO */
#endif /* QCA_MCOPY_SUPPORT */
#if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
/**
@@ -187,9 +191,9 @@ void dp_mon_filter_setup_smart_monitor(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_smart_monitor() - Reset the smart monitor mode filter
* @mon_pdev: monitor pdev handle
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_smart_monitor(struct dp_mon_pdev *mon_pdev);
void dp_mon_filter_reset_smart_monitor(struct dp_pdev *pdev);
#endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */
#ifdef WLAN_RX_PKT_CAPTURE_ENH
@@ -240,9 +244,9 @@ void dp_mon_filter_setup_rx_pkt_log_lite(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_rx_pkt_log_lite() - Reset the Rx pktlog lite mode filter
* @mon_pdev: Monitor pdev handle
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_rx_pkt_log_lite(struct dp_mon_pdev *mon_pdev);
void dp_mon_filter_reset_rx_pkt_log_lite(struct dp_pdev *pdev);
/**
* dp_mon_filter_setup_rx_pkt_log_cbf() - Setup the Rx pktlog cbf mode filter

View File

@@ -19,6 +19,8 @@
#ifndef _DP_RX_MON_H_
#define _DP_RX_MON_H_
#include "dp_mon.h"
/*
* MON_BUF_MIN_ENTRIES macro defines minimum number of network buffers
* to be refilled in the RXDMA monitor buffer ring at init, remaining
@@ -112,16 +114,54 @@ dp_rx_mon_status_process(struct dp_soc *soc, struct dp_intr *int_ctx,
*
* Return: none
*/
void dp_rx_mon_dest_process(struct dp_soc *soc, struct dp_intr *int_ctx,
uint32_t mac_id, uint32_t quota);
QDF_STATUS dp_rx_pdev_mon_desc_pool_alloc(struct dp_pdev *pdev);
QDF_STATUS dp_rx_pdev_mon_buffers_alloc(struct dp_pdev *pdev);
void dp_rx_pdev_mon_buffers_free(struct dp_pdev *pdev);
void dp_rx_pdev_mon_desc_pool_init(struct dp_pdev *pdev);
void dp_rx_pdev_mon_desc_pool_deinit(struct dp_pdev *pdev);
void dp_rx_pdev_mon_desc_pool_free(struct dp_pdev *pdev);
#ifdef QCA_MONITOR_PKT_SUPPORT
void dp_rx_mon_dest_process(struct dp_soc *soc, struct dp_intr *int_ctx,
uint32_t mac_id, uint32_t quota);
void dp_rx_pdev_mon_buf_buffers_free(struct dp_pdev *pdev, uint32_t mac_id);
QDF_STATUS
dp_rx_pdev_mon_buf_buffers_alloc(struct dp_pdev *pdev, uint32_t mac_id,
bool delayed_replenish);
QDF_STATUS
dp_rx_pdev_mon_buf_desc_pool_alloc(struct dp_pdev *pdev, uint32_t mac_id);
void
dp_rx_pdev_mon_buf_desc_pool_init(struct dp_pdev *pdev, uint32_t mac_id);
#else
static inline
void dp_rx_mon_dest_process(struct dp_soc *soc, struct dp_intr *int_ctx,
uint32_t mac_id, uint32_t quota)
{
}
static inline
void dp_rx_pdev_mon_buf_buffers_free(struct dp_pdev *pdev, uint32_t mac_id)
{
}
static inline QDF_STATUS
dp_rx_pdev_mon_buf_buffers_alloc(struct dp_pdev *pdev, uint32_t mac_id,
bool delayed_replenish)
{
return QDF_STATUS_SUCCESS;
}
static inline QDF_STATUS
dp_rx_pdev_mon_buf_desc_pool_alloc(struct dp_pdev *pdev, uint32_t mac_id)
{
return QDF_STATUS_SUCCESS;
}
static inline void
dp_rx_pdev_mon_buf_desc_pool_init(struct dp_pdev *pdev, uint32_t mac_id)
{
}
#endif
QDF_STATUS dp_rx_pdev_mon_status_buffers_alloc(struct dp_pdev *pdev,
uint32_t mac_id);
@@ -134,13 +174,6 @@ void dp_rx_pdev_mon_status_desc_pool_deinit(struct dp_pdev *pdev,
void dp_rx_pdev_mon_status_desc_pool_free(struct dp_pdev *pdev,
uint32_t mac_id);
void dp_rx_pdev_mon_status_buffers_free(struct dp_pdev *pdev, uint32_t mac_id);
QDF_STATUS
dp_rx_pdev_mon_buf_buffers_alloc(struct dp_pdev *pdev, uint32_t mac_id,
bool delayed_replenish);
QDF_STATUS
dp_rx_pdev_mon_buf_desc_pool_alloc(struct dp_pdev *pdev, uint32_t mac_id);
void
dp_rx_pdev_mon_buf_desc_pool_init(struct dp_pdev *pdev, uint32_t mac_id);
/*
* dp_rx_populate_cbf_hdr - Send CBF frame with htt header
@@ -315,6 +348,7 @@ uint32_t dp_rxdma_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
*/
void dp_mon_buf_delayed_replenish(struct dp_pdev *pdev);
#ifdef QCA_MONITOR_PKT_SUPPORT
/**
* dp_rx_mon_link_desc_return() - Return a MPDU link descriptor to HW
* (WBM), following error handling
@@ -327,6 +361,15 @@ QDF_STATUS
dp_rx_mon_link_desc_return(struct dp_pdev *dp_pdev,
hal_buff_addrinfo_t buf_addr_info,
int mac_id);
#else
static inline QDF_STATUS
dp_rx_mon_link_desc_return(struct dp_pdev *dp_pdev,
hal_buff_addrinfo_t buf_addr_info,
int mac_id)
{
return QDF_STATUS_SUCCESS;
}
#endif
/**
* dp_mon_adjust_frag_len() - MPDU and MSDU may spread across

File diff suppressed because it is too large Load Diff

View File

@@ -180,7 +180,7 @@ dp_send_ack_frame_to_stack(struct dp_soc *soc,
}
#endif
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_ENHANCED_STATS_SUPPORT
static inline void
dp_rx_populate_rx_rssi_chain(struct hal_rx_ppdu_info *ppdu_info,
struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
@@ -540,7 +540,8 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
struct cdp_rx_indication_ppdu *cdp_rx_ppdu)
{
}
#endif
#endif/* QCA_ENHANCED_STATS_SUPPORT */
/**
* dp_rx_stats_update() - Update per-peer statistics
* @soc: Datapath SOC handle
@@ -549,7 +550,7 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev,
*
* Return: None
*/
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_ENHANCED_STATS_SUPPORT
static inline void dp_rx_rate_stats_update(struct dp_peer *peer,
struct cdp_rx_indication_ppdu *ppdu,
uint32_t user)
@@ -812,7 +813,7 @@ static void dp_rx_stats_update(struct dp_pdev *pdev,
dp_peer_unref_delete(peer, DP_MOD_ID_RX_PPDU_STATS);
}
}
#endif
#endif/* QCA_ENHANCED_STATS_SUPPORT */
/**
* dp_rx_handle_mcopy_mode() - Allocate and deliver first MSDU payload
@@ -826,7 +827,7 @@ static void dp_rx_stats_update(struct dp_pdev *pdev,
* Return: QDF_STATUS_SUCCESS - If nbuf to be freed by caller
* QDF_STATUS_E_ALREADY - If nbuf not to be freed by caller
*/
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_MCOPY_SUPPORT
static inline QDF_STATUS
dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info, qdf_nbuf_t nbuf,
@@ -882,7 +883,7 @@ dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif /* QCA_MCOPY_SUPPORT */
/**
* dp_rx_mcopy_handle_last_mpdu() - cache and delive last MPDU header in a
@@ -894,7 +895,7 @@ dp_rx_handle_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
*
* Return: void
*/
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_MCOPY_SUPPORT
static inline void
dp_rx_mcopy_handle_last_mpdu(struct dp_soc *soc, struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info,
@@ -967,7 +968,7 @@ dp_rx_mcopy_handle_last_mpdu(struct dp_soc *soc, struct dp_pdev *pdev,
qdf_nbuf_t status_nbuf)
{
}
#endif
#endif /* QCA_MCOPY_SUPPORT */
/**
* dp_rx_mcopy_process_ppdu_info() - update mcopy ppdu info
@@ -976,7 +977,7 @@ dp_rx_mcopy_handle_last_mpdu(struct dp_soc *soc, struct dp_pdev *pdev,
*
* Return: void
*/
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_MCOPY_SUPPORT
static inline void
dp_rx_mcopy_process_ppdu_info(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info,
@@ -1022,9 +1023,9 @@ dp_rx_mcopy_process_ppdu_info(struct dp_pdev *pdev,
uint32_t tlv_status)
{
}
#endif
#endif /* QCA_MCOPY_SUPPORT */
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_MCOPY_SUPPORT
static inline void
dp_rx_process_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info,
@@ -1085,7 +1086,7 @@ dp_rx_process_mcopy_mode(struct dp_soc *soc, struct dp_pdev *pdev,
qdf_nbuf_t status_nbuf)
{
}
#endif
#endif /* QCA_MCOPY_SUPPORT */
/**
* dp_rx_handle_smart_mesh_mode() - Deliver header for smart mesh
@@ -1492,7 +1493,7 @@ dp_cfr_rcc_mode_status(struct dp_pdev *pdev)
*
* Return: none
*/
#ifdef FEATURE_PERPKT_INFO
#ifdef QCA_ENHANCED_STATS_SUPPORT
static inline void
dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info)
@@ -1591,7 +1592,7 @@ dp_rx_handle_ppdu_stats(struct dp_soc *soc, struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info)
{
}
#endif
#endif/* QCA_ENHANCED_STATS_SUPPORT */
/**
* dp_rx_process_peer_based_pktlog() - Process Rx pktlog if peer based