qcacmn: Add common framework for mon filters

A framework is added where the filters for every
mode are stored on a radio instance. Whenever a mode comes
up, it stores the filters in the radio and calls a
common API which iterates through all the enabled
mode filters and loops through them to create a
superset of filters which is sent to HTT.

This framework can be extended for new feature addition
which set filters for the monitor status and monitor
destination rings.

Change-Id: I9b739af2086bbe261b65c57af0a5bd867294f30f
CRs-Fixed: 2585872
This commit is contained in:
Aniruddha Paul
2019-10-22 14:28:37 +05:30
committed by nshrivas
parent fe67c34963
commit f9d2c0f54e
11 changed files with 1677 additions and 566 deletions

View File

@@ -65,6 +65,8 @@ cdp_mempools_attach(ol_txrx_soc_handle soc)
return soc->ops->ctrl_ops->txrx_mempools_attach(soc);
}
#if defined(ATH_SUPPORT_NAC) || defined(ATH_SUPPORT_NAC_RSSI)
/**
* @brief update the neighbour peer addresses
* @details
@@ -95,6 +97,7 @@ cdp_update_filter_neighbour_peers(ol_txrx_soc_handle soc,
return soc->ops->ctrl_ops->txrx_update_filter_neighbour_peers
(soc, vdev_id, cmd, macaddr);
}
#endif /* ATH_SUPPORT_NAC || ATH_SUPPORT_NAC_RSSI*/
/**
* @brief set the Reo Destination ring for the pdev

View File

@@ -27,7 +27,8 @@
#include "cdp_txrx_handle.h"
static inline QDF_STATUS cdp_reset_monitor_mode(ol_txrx_soc_handle soc,
uint8_t pdev_id)
uint8_t pdev_id,
u_int8_t smart_monitor)
{
if (!soc || !soc->ops) {
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
@@ -40,7 +41,8 @@ static inline QDF_STATUS cdp_reset_monitor_mode(ol_txrx_soc_handle soc,
!soc->ops->mon_ops->txrx_reset_monitor_mode)
return 0;
return soc->ops->mon_ops->txrx_reset_monitor_mode(soc, pdev_id);
return soc->ops->mon_ops->txrx_reset_monitor_mode(soc, pdev_id,
smart_monitor);
}
/**

View File

@@ -700,8 +700,8 @@ struct cdp_me_ops {
struct cdp_mon_ops {
QDF_STATUS (*txrx_reset_monitor_mode)(ol_txrx_soc_handle soc,
uint8_t pdev_id);
QDF_STATUS (*txrx_reset_monitor_mode)
(ol_txrx_soc_handle soc, uint8_t pdev_id, u_int8_t smart_monitor);
QDF_STATUS (*txrx_deliver_tx_mgmt)
(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2020 The Linux Foundation. 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
@@ -200,6 +200,8 @@ struct htt_soc {
* @rx_msdu_end_offset: Offset of rx_msdu_end tlv
* @rx_msdu_start_offset: Offset of rx_msdu_start tlv
* @rx_attn_offset: Offset of rx_attention tlv
*
* NOTE: Do not change the layout of this structure
*/
struct htt_rx_ring_tlv_filter {
u_int32_t mpdu_start:1,

View File

@@ -1977,5 +1977,15 @@ QDF_STATUS dp_rx_tid_update_wifi3(struct dp_peer *peer, int tid, uint32_t
uint16_t dp_get_peer_mac_list(ol_txrx_soc_handle soc, uint8_t vdev_id,
u_int8_t newmac[][QDF_MAC_ADDR_SIZE],
u_int16_t mac_cnt);
/*
* dp_is_hw_dbs_enable() - Procedure to check if DBS is supported
* @soc: DP SoC context
* @max_mac_rings: No of MAC rings
*
* Return: None
*/
void dp_is_hw_dbs_enable(struct dp_soc *soc,
int *max_mac_rings);
#endif /* #ifndef _DP_INTERNAL_H_ */

File diff suppressed because it is too large Load Diff

1182
dp/wifi3.0/dp_mon_filter.c Normal file

File diff suppressed because it is too large Load Diff

262
dp/wifi3.0/dp_mon_filter.h Normal file
View File

@@ -0,0 +1,262 @@
/*
* Copyright (c) 2020 The Linux Foundation. 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 copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN 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_FILTER_H_
#define _DP_MON_FILTER_H_
/**
* Accessor Macros to access the software
* defined HTT filter htt_rx_ring_tlv_filter.
*/
#define DP_MON_FILTER_TLV_OFFSET 0x00000000
#define DP_MON_FILTER_TLV_MASK 0xffffffff
#define DP_MON_FILTER_TLV_LSB 0
#define DP_MON_FILTER_FP_MGMT_OFFSET 0x00000004
#define DP_MON_FILTER_FP_MGMT_MASK 0x0000ffff
#define DP_MON_FILTER_FP_MGMT_LSB 0
#define DP_MON_FILTER_MO_MGMT_OFFSET 0x00000004
#define DP_MON_FILTER_MO_MGMT_MASK 0xffff0000
#define DP_MON_FILTER_MO_MGMT_LSB 16
#define DP_MON_FILTER_FP_CTRL_OFFSET 0x00000008
#define DP_MON_FILTER_FP_CTRL_MASK 0x0000ffff
#define DP_MON_FILTER_FP_CTRL_LSB 0
#define DP_MON_FILTER_MO_CTRL_OFFSET 0x00000008
#define DP_MON_FILTER_MO_CTRL_MASK 0xffff0000
#define DP_MON_FILTER_MO_CTRL_LSB 16
#define DP_MON_FILTER_FP_DATA_OFFSET 0x0000000c
#define DP_MON_FILTER_FP_DATA_MASK 0x0000ffff
#define DP_MON_FILTER_FP_DATA_LSB 0
#define DP_MON_FILTER_MO_DATA_OFFSET 0x0000000c
#define DP_MON_FILTER_MO_DATA_MASK 0xffff0000
#define DP_MON_FILTER_MO_DATA_LSB 16
#define DP_MON_FILTER_MD_DATA_OFFSET 0x00000010
#define DP_MON_FILTER_MD_DATA_MASK 0x0000ffff
#define DP_MON_FILTER_MD_DATA_LSB 0
#define DP_MON_FILTER_MD_MGMT_OFFSET 0x00000010
#define DP_MON_FILTER_MD_MGMT_MASK 0xffff0000
#define DP_MON_FILTER_MD_MGMT_LSB 16
#define DP_MON_FILTER_MD_CTRL_OFFSET 0x00000014
#define DP_MON_FILTER_MD_CTRL_MASK 0x0000ffff
#define DP_MON_FILTER_MD_CTRL_LSB 0
#define DP_MON_FILTER_GET(src, field) \
((*((uint32_t *)((uint8_t *)(src) + DP_MON_ ## field ## _OFFSET)) & \
(DP_MON_ ## field ## _MASK)) >> DP_MON_ ## field ## _LSB) \
#define DP_MON_FILTER_SET(dst, field, value) \
do { \
uint32_t *val = \
((uint32_t *)((uint8_t *)(dst) + DP_MON_ ## field ## _OFFSET)); \
*val &= ~(DP_MON_ ## field ## _MASK); \
*val |= ((value) << DP_MON_ ## field ## _LSB); \
} while (0)
#define DP_MON_FILTER_PRINT(fmt, args ...) \
QDF_TRACE(QDF_MODULE_ID_MON_FILTER, QDF_TRACE_LEVEL_DEBUG, \
fmt, ## args)
/**
* struct dp_mon_filter - Monitor TLV filter
* @valid: enable/disable TLV filter
* @tlv_filter: Rx ring TLV filter
*/
struct dp_mon_filter {
bool valid;
struct htt_rx_ring_tlv_filter tlv_filter;
};
/**
* enum dp_mon_filter_mode - Different modes for SRNG filters
* @DP_MON_FILTER_ENHACHED_STATS_MODE: PPDU enhanced stats mode
* @DP_MON_FILTER_SMART_MONITOR_MODE: Smart monitor mode
* @DP_MON_FILTER_MCOPY_MODE: AM copy mode
* @DP_MON_FILTER_MONITOR_MODE: Monitor mode
* @DP_MON_FILTER_RX_CAPTURE_MODE: Rx Capture mode
* @DP_MON_FILTER_PKT_LOG_FULL_MODE: Packet log full mode
* @DP_MON_FILTER_PKT_LOG_LITE_MODE: Packet log lite mode
*/
enum dp_mon_filter_mode {
#ifdef FEATURE_PERPKT_INFO
DP_MON_FILTER_ENHACHED_STATS_MODE,
DP_MON_FILTER_MCOPY_MODE,
#endif /* FEATURE_PERPKT_INFO */
#if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
DP_MON_FILTER_SMART_MONITOR_MODE,
#endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */
DP_MON_FILTER_MONITOR_MODE,
#ifdef WLAN_RX_PKT_CAPTURE_ENH
DP_MON_FILTER_RX_CAPTURE_MODE,
#endif /* WLAN_RX_PKT_CAPTURE_ENH */
#ifdef WDI_EVENT_ENABLE
DP_MON_FILTER_PKT_LOG_FULL_MODE,
DP_MON_FILTER_PKT_LOG_LITE_MODE,
#endif /* WDI_EVENT_ENABLE */
DP_MON_FILTER_MAX_MODE
};
/**
* enum dp_mon_filter_srng_type - Srng types dynamic mode filter
* settings.
* @DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF: RXDMA srng type
* @DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS: RxDMA monitor status srng
* @DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF: RxDMA destination srng
* @DP_MON_FILTER_SRNG_TYPE_MAX: Srng max type
*/
enum dp_mon_filter_srng_type {
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF,
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS,
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF,
DP_MON_FILTER_SRNG_TYPE_MAX
};
/**
* enum dp_mon_filter_action - Action for storing the filters
* into the radio structure.
* @DP_MON_FILTER_CLEAR - Clears the filter for a mode
* @DP_MON_FILTER_SET - Set the filtes for a mode
*/
enum dp_mon_filter_action {
DP_MON_FILTER_CLEAR,
DP_MON_FILTER_SET,
};
#ifdef FEATURE_PERPKT_INFO
/**
* dp_mon_filter_setup_enhanced_stats() - Setup the enhanced stats filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_setup_enhanced_stats(struct dp_pdev *pdev);
/***
* dp_mon_filter_reset_enhanced_stats() - Reset the enhanced stats filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_enhanced_stats(struct dp_pdev *pdev);
/**
* dp_mon_filter_setup_mcopy_mode() - Setup the m_copy mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_setup_mcopy_mode(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_mcopy_mode() - Reset the m_copy mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_mcopy_mode(struct dp_pdev *pdev);
#endif /* FEATURE_PERPKT_INFO */
#if defined(ATH_SUPPORT_NAC_RSSI) || defined(ATH_SUPPORT_NAC)
/**
* dp_mon_filter_setup_smart_monitor() - Setup the smart monitor mode filter
* @pdev: DP pdev handle
*/
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_pdev *pdev);
#endif /* ATH_SUPPORT_NAC_RSSI || ATH_SUPPORT_NAC */
#ifdef WLAN_RX_PKT_CAPTURE_ENH
/**
* dp_mon_filter_setup_rx_enh_capture() - Setup the Rx capture mode filters
* @pdev: DP pdev handle
*/
void dp_mon_filter_setup_rx_enh_capture(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_rx_enh_capture() - Reset the Rx capture mode filters
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_rx_enh_capture(struct dp_pdev *pdev);
#endif /* WLAN_RX_PKT_CAPTURE_ENH */
/**
* dp_mon_filter_setup_mon_mode() - Setup the Rx monitor mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_setup_mon_mode(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_mon_mode() - Reset the Rx monitor mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_mon_mode(struct dp_pdev *pdev);
#ifdef WDI_EVENT_ENABLE
/**
* dp_mon_filter_setup_rx_pkt_log_full() - Setup the Rx pktlog full mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_setup_rx_pkt_log_full(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_rx_pkt_log_full() - Reset the Rx pktlog full mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_rx_pkt_log_full(struct dp_pdev *pdev);
/**
* dp_mon_filter_setup_rx_pkt_log_lite() - Setup the Rx pktlog lite mode filter
* in the radio object.
* @pdev: DP pdev handle
*/
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
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_rx_pkt_log_lite(struct dp_pdev *pdev);
#endif /* WDI_EVENT_ENABLE */
/**
* dp_mon_filter_update() - Setup the monitor filter setting for a srng
* type
* @pdev: DP pdev handle
*
* Return: QDF_STATUS
*/
QDF_STATUS dp_mon_filter_update(struct dp_pdev *pdev);
/**
* dp_mon_filter_dealloc() - Deallocate the filter objects to be stored in
* the radio object.
* @pdev: DP pdev handle
*/
void dp_mon_filter_dealloc(struct dp_pdev *pdev);
/**
* dp_mon_filter_alloc() - Allocate the filter objects to be stored in
* the radio object.
* @pdev: DP pdev handle
*/
struct dp_mon_filter **dp_mon_filter_alloc(struct dp_pdev *pdev);
#endif /* #ifndef _DP_MON_FILTER_H_ */

View File

@@ -45,15 +45,9 @@ QDF_STATUS dp_rx_pdev_mon_status_detach(struct dp_pdev *pdev, int mac_id);
*
* Return: QDF_STATUS
*/
QDF_STATUS dp_reset_monitor_mode(struct cdp_soc_t *soc_hdl, uint8_t pdev_id);
/**
* dp_pdev_configure_monitor_rings() - configure monitor rings
* @vdev_handle: Datapath VDEV handle
*
* Return: QDF_STATUS
*/
QDF_STATUS dp_pdev_configure_monitor_rings(struct dp_pdev *pdev);
QDF_STATUS dp_reset_monitor_mode(struct cdp_soc_t *soc_hdl,
uint8_t pdev_id,
uint8_t smart_monitor);
/**
* dp_mon_link_free() - free monitor link desc pool

View File

@@ -3143,6 +3143,7 @@ static inline void dp_tx_sojourn_stats_process(struct dp_pdev *pdev,
}
#else
static inline void dp_tx_sojourn_stats_process(struct dp_pdev *pdev,
struct dp_peer *peer,
uint8_t tid,
uint64_t txdesc_ts,
uint32_t ppdu_id)

View File

@@ -134,6 +134,7 @@ union dp_rx_desc_list_elem_t;
struct cdp_peer_rate_stats_ctx;
struct cdp_soc_rate_stats_ctx;
struct dp_rx_fst;
struct dp_mon_filter;
#define DP_PDEV_ITERATE_VDEV_LIST(_pdev, _vdev) \
TAILQ_FOREACH((_vdev), &(_pdev)->vdev_list, vdev_list_elem)
@@ -1774,6 +1775,8 @@ struct dp_pdev {
#ifdef WLAN_SUPPORT_DATA_STALL
data_stall_detect_cb data_stall_detect_callback;
#endif /* WLAN_SUPPORT_DATA_STALL */
struct dp_mon_filter **filter; /* Monitor Filter pointer */
};
struct dp_peer;