qcacmn: Add support for local packet capture start

Add support for local packet capture start and relevant changes.

Change-Id: I709e41e0be09cf73e93694efc59bfefbf51fe359
CRs-Fixed: 3415788
This commit is contained in:
Srinivas Girigowda
2023-03-06 20:04:39 -08:00
committed by Madan Koyyalamudi
parent 980d883f07
commit 5d8e550bb7
25 changed files with 874 additions and 108 deletions

View File

@@ -304,4 +304,43 @@ cdp_update_pdev_mon_telemetry_airtime_stats(ol_txrx_soc_handle soc,
soc, pdev_id); soc, pdev_id);
} }
#endif #endif
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
/**
* cdp_start_local_pkt_capture() - start local pkt capture
* @soc: opaque soc handle
* @pdev_id: pdev id
* @filter: monitor filter config
*
* Return: QDF_STATUS_SUCCESS if success
* QDF_STATUS_E_FAILURE if error
*/
static inline
QDF_STATUS cdp_start_local_pkt_capture(ol_txrx_soc_handle soc,
uint8_t pdev_id,
struct cdp_monitor_filter *filter)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
return QDF_STATUS_E_FAILURE;
}
if (!soc->ops->mon_ops ||
!soc->ops->mon_ops->start_local_pkt_capture)
return QDF_STATUS_E_FAILURE;
return soc->ops->mon_ops->start_local_pkt_capture(soc, pdev_id, filter);
}
#else
static inline
QDF_STATUS cdp_start_local_pkt_capture(ol_txrx_soc_handle soc,
uint8_t pdev_id,
struct cdp_monitor_filter *filter)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
#endif #endif

View File

@@ -993,6 +993,7 @@ struct cdp_me_ops {
* stats in monitor pdev * stats in monitor pdev
* @txrx_cfr_filter: Handler to configure host rx monitor status ring * @txrx_cfr_filter: Handler to configure host rx monitor status ring
* @txrx_update_mon_mac_filter: Handler to configure mon mac filter * @txrx_update_mon_mac_filter: Handler to configure mon mac filter
* @start_local_pkt_capture: start local packet capture
*/ */
struct cdp_mon_ops { struct cdp_mon_ops {
@@ -1101,6 +1102,11 @@ struct cdp_mon_ops {
QDF_STATUS (*txrx_update_mon_mac_filter)(struct cdp_soc_t *soc, QDF_STATUS (*txrx_update_mon_mac_filter)(struct cdp_soc_t *soc,
uint8_t vdev_id, uint8_t vdev_id,
uint32_t cmd); uint32_t cmd);
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
QDF_STATUS (*start_local_pkt_capture)
(struct cdp_soc_t *soc, uint8_t pdev_id,
struct cdp_monitor_filter *filter);
#endif
}; };
/** /**

View File

@@ -707,7 +707,8 @@ struct htt_rx_ring_tlv_filter {
u_int32_t phy_err_mask_cont; u_int32_t phy_err_mask_cont;
#endif #endif
#if defined(WLAN_PKT_CAPTURE_RX_2_0) || defined(CONFIG_WORD_BASED_TLV) || \ #if defined(WLAN_PKT_CAPTURE_RX_2_0) || defined(CONFIG_WORD_BASED_TLV) || \
defined(CONFIG_MON_WORD_BASED_TLV) defined(CONFIG_MON_WORD_BASED_TLV) || \
defined(WLAN_FEATURE_LOCAL_PKT_CAPTURE)
uint32_t rx_mpdu_start_wmask; uint32_t rx_mpdu_start_wmask;
uint16_t rx_mpdu_end_wmask; uint16_t rx_mpdu_end_wmask;
uint32_t rx_msdu_end_wmask; uint32_t rx_msdu_end_wmask;

View File

@@ -3018,6 +3018,18 @@ void dp_rxdma_setup_refill_ring3(struct dp_soc *soc,
{ } { }
#endif #endif
#ifdef WIFI_MONITOR_SUPPORT
static inline QDF_STATUS dp_lpc_tx_config(struct dp_pdev *pdev)
{
return dp_local_pkt_capture_tx_config(pdev);
}
#else
static inline QDF_STATUS dp_lpc_tx_config(struct dp_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
#endif
/** /**
* dp_rxdma_ring_config() - configure the RX DMA rings * dp_rxdma_ring_config() - configure the RX DMA rings
* @soc: data path SoC handle * @soc: data path SoC handle
@@ -3058,6 +3070,7 @@ static QDF_STATUS dp_rxdma_ring_config(struct dp_soc *soc)
dp_rxdma_setup_refill_ring3(soc, pdev, i); dp_rxdma_setup_refill_ring3(soc, pdev, i);
dp_update_num_mac_rings_for_dbs(soc, &max_mac_rings); dp_update_num_mac_rings_for_dbs(soc, &max_mac_rings);
dp_lpc_tx_config(pdev);
dp_err("pdev_id %d max_mac_rings %d", dp_err("pdev_id %d max_mac_rings %d",
pdev->pdev_id, max_mac_rings); pdev->pdev_id, max_mac_rings);
@@ -3730,7 +3743,8 @@ static QDF_STATUS dp_vdev_attach_wifi3(struct cdp_soc_t *cdp_soc,
qdf_timer_mod(&soc->int_timer, DP_INTR_POLL_TIMER_MS); qdf_timer_mod(&soc->int_timer, DP_INTR_POLL_TIMER_MS);
} else if (dp_soc_get_con_mode(soc) == QDF_GLOBAL_MISSION_MODE && } else if (dp_soc_get_con_mode(soc) == QDF_GLOBAL_MISSION_MODE &&
soc->intr_mode == DP_INTR_MSI && soc->intr_mode == DP_INTR_MSI &&
wlan_op_mode_monitor == vdev->opmode) { wlan_op_mode_monitor == vdev->opmode &&
!wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx)) {
/* Timer to reap status ring in mission mode */ /* Timer to reap status ring in mission mode */
dp_monitor_vdev_timer_start(soc); dp_monitor_vdev_timer_start(soc);
} }

View File

@@ -1041,7 +1041,8 @@ static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) { soc->cdp_soc.ol_ops->get_con_mode() == QDF_GLOBAL_MONITOR_MODE) {
if (ring_type == REO_DST || ring_type == RXDMA_DST) if (ring_type == REO_DST || ring_type == RXDMA_DST)
return true; return true;
} else if (ring_type == RXDMA_MONITOR_STATUS) { } else if (ring_type == RXDMA_MONITOR_STATUS &&
!wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx)) {
return true; return true;
} }
@@ -1807,7 +1808,8 @@ dp_soc_near_full_interrupt_attach(struct dp_soc *soc, int num_irq,
static inline bool dp_skip_rx_mon_ring_mask_set(struct dp_soc *soc) static inline bool dp_skip_rx_mon_ring_mask_set(struct dp_soc *soc)
{ {
return !!(soc->cdp_soc.ol_ops->get_con_mode() != return !!(soc->cdp_soc.ol_ops->get_con_mode() !=
QDF_GLOBAL_MONITOR_MODE); QDF_GLOBAL_MONITOR_MODE &&
!wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx));
} }
#else #else
static inline bool dp_skip_rx_mon_ring_mask_set(struct dp_soc *soc) static inline bool dp_skip_rx_mon_ring_mask_set(struct dp_soc *soc)

View File

@@ -211,7 +211,6 @@ void dp_flush_monitor_rings(struct dp_soc *soc)
dp_info("After flush: Monitor DST ring HP %u TP %u", hp, tp); dp_info("After flush: Monitor DST ring HP %u TP %u", hp, tp);
} }
static
void dp_mon_rings_deinit_1_0(struct dp_pdev *pdev) void dp_mon_rings_deinit_1_0(struct dp_pdev *pdev)
{ {
int mac_id = 0; int mac_id = 0;
@@ -231,7 +230,6 @@ void dp_mon_rings_deinit_1_0(struct dp_pdev *pdev)
} }
} }
static
void dp_mon_rings_free_1_0(struct dp_pdev *pdev) void dp_mon_rings_free_1_0(struct dp_pdev *pdev)
{ {
int mac_id = 0; int mac_id = 0;
@@ -250,7 +248,6 @@ void dp_mon_rings_free_1_0(struct dp_pdev *pdev)
} }
} }
static
QDF_STATUS dp_mon_rings_init_1_0(struct dp_pdev *pdev) QDF_STATUS dp_mon_rings_init_1_0(struct dp_pdev *pdev)
{ {
struct dp_soc *soc = pdev->soc; struct dp_soc *soc = pdev->soc;
@@ -279,7 +276,6 @@ fail1:
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
} }
static
QDF_STATUS dp_mon_rings_alloc_1_0(struct dp_pdev *pdev) QDF_STATUS dp_mon_rings_alloc_1_0(struct dp_pdev *pdev)
{ {
struct dp_soc *soc = pdev->soc; struct dp_soc *soc = pdev->soc;
@@ -317,28 +313,6 @@ void dp_flush_monitor_rings(struct dp_soc *soc)
{ {
} }
static inline
void dp_mon_rings_deinit_1_0(struct dp_pdev *pdev)
{
}
static inline
void dp_mon_rings_free_1_0(struct dp_pdev *pdev)
{
}
static inline
QDF_STATUS dp_mon_rings_init_1_0(struct dp_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
static inline
QDF_STATUS dp_mon_rings_alloc_1_0(struct dp_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
#endif #endif
#ifdef QCA_MONITOR_PKT_SUPPORT #ifdef QCA_MONITOR_PKT_SUPPORT
@@ -731,18 +705,7 @@ static void dp_mon_neighbour_peer_add_ast(struct dp_pdev *pdev,
} }
#if !defined(DISABLE_MON_CONFIG) #if !defined(DISABLE_MON_CONFIG)
/**
* dp_mon_htt_srng_setup_1_0() - Prepare HTT messages for Monitor rings
* @soc: soc handle
* @pdev: physical device handle
* @mac_id: ring number
* @mac_for_pdev: mac_id
*
* Return: non-zero for failure, zero for success
*/
#if defined(DP_CON_MON) #if defined(DP_CON_MON)
static
QDF_STATUS dp_mon_htt_srng_setup_1_0(struct dp_soc *soc, QDF_STATUS dp_mon_htt_srng_setup_1_0(struct dp_soc *soc,
struct dp_pdev *pdev, struct dp_pdev *pdev,
int mac_id, int mac_id,
@@ -771,7 +734,6 @@ QDF_STATUS dp_mon_htt_srng_setup_1_0(struct dp_soc *soc,
} }
#else #else
/* This is only for WIN */ /* This is only for WIN */
static
QDF_STATUS dp_mon_htt_srng_setup_1_0(struct dp_soc *soc, QDF_STATUS dp_mon_htt_srng_setup_1_0(struct dp_soc *soc,
struct dp_pdev *pdev, struct dp_pdev *pdev,
int mac_id, int mac_id,
@@ -1386,7 +1348,6 @@ dp_mon_register_feature_ops_1_0(struct dp_soc *soc)
#if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG) #if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
mon_ops->mon_pktlogmod_exit = dp_pktlogmod_exit; mon_ops->mon_pktlogmod_exit = dp_pktlogmod_exit;
#endif #endif
mon_ops->rx_hdr_length_set = NULL;
mon_ops->rx_packet_length_set = NULL; mon_ops->rx_packet_length_set = NULL;
mon_ops->rx_mon_enable = NULL; mon_ops->rx_mon_enable = NULL;
mon_ops->rx_wmask_subscribe = NULL; mon_ops->rx_wmask_subscribe = NULL;
@@ -1417,6 +1378,7 @@ dp_mon_register_feature_ops_1_0(struct dp_soc *soc)
struct dp_mon_ops monitor_ops_1_0 = { struct dp_mon_ops monitor_ops_1_0 = {
.mon_soc_cfg_init = dp_mon_soc_cfg_init, .mon_soc_cfg_init = dp_mon_soc_cfg_init,
.mon_pdev_alloc = NULL, .mon_pdev_alloc = NULL,
.mon_pdev_free = NULL, .mon_pdev_free = NULL,
.mon_pdev_attach = dp_mon_pdev_attach, .mon_pdev_attach = dp_mon_pdev_attach,
@@ -1434,9 +1396,6 @@ struct dp_mon_ops monitor_ops_1_0 = {
dp_mon_invalid_peer_update_pdev_stats, dp_mon_invalid_peer_update_pdev_stats,
.mon_peer_get_stats_param = dp_mon_peer_get_stats_param, .mon_peer_get_stats_param = dp_mon_peer_get_stats_param,
.mon_flush_rings = dp_flush_monitor_rings, .mon_flush_rings = dp_flush_monitor_rings,
#if !defined(DISABLE_MON_CONFIG)
.mon_pdev_htt_srng_setup = dp_mon_htt_srng_setup_1_0,
#endif
#if defined(DP_CON_MON) #if defined(DP_CON_MON)
.mon_service_rings = dp_service_mon_rings, .mon_service_rings = dp_service_mon_rings,
#endif #endif
@@ -1456,10 +1415,7 @@ struct dp_mon_ops monitor_ops_1_0 = {
.mon_reap_timer_deinit = dp_mon_reap_timer_deinit, .mon_reap_timer_deinit = dp_mon_reap_timer_deinit,
.mon_filter_setup_rx_mon_mode = dp_mon_filter_setup_mon_mode_1_0, .mon_filter_setup_rx_mon_mode = dp_mon_filter_setup_mon_mode_1_0,
.mon_filter_reset_rx_mon_mode = dp_mon_filter_reset_mon_mode_1_0, .mon_filter_reset_rx_mon_mode = dp_mon_filter_reset_mon_mode_1_0,
.mon_filter_setup_tx_mon_mode = NULL,
.mon_filter_reset_tx_mon_mode = NULL,
.rx_mon_filter_update = dp_mon_filter_update_1_0, .rx_mon_filter_update = dp_mon_filter_update_1_0,
.tx_mon_filter_update = NULL,
.set_mon_mode_buf_rings_tx = NULL, .set_mon_mode_buf_rings_tx = NULL,
.rx_mon_desc_pool_init = dp_rx_pdev_mon_desc_pool_init, .rx_mon_desc_pool_init = dp_rx_pdev_mon_desc_pool_init,
.rx_mon_desc_pool_deinit = dp_rx_pdev_mon_desc_pool_deinit, .rx_mon_desc_pool_deinit = dp_rx_pdev_mon_desc_pool_deinit,
@@ -1472,24 +1428,10 @@ struct dp_mon_ops monitor_ops_1_0 = {
.tx_mon_desc_pool_alloc = NULL, .tx_mon_desc_pool_alloc = NULL,
.tx_mon_desc_pool_free = NULL, .tx_mon_desc_pool_free = NULL,
.tx_mon_filter_alloc = NULL, .tx_mon_filter_alloc = NULL,
.mon_rings_alloc = dp_mon_rings_alloc_1_0,
.mon_rings_free = dp_mon_rings_free_1_0,
.mon_rings_init = dp_mon_rings_init_1_0,
.mon_rings_deinit = dp_mon_rings_deinit_1_0,
#if !defined(DISABLE_MON_CONFIG) #if !defined(DISABLE_MON_CONFIG)
.mon_register_intr_ops = dp_mon_register_intr_ops_1_0, .mon_register_intr_ops = dp_mon_register_intr_ops_1_0,
#endif #endif
.mon_register_feature_ops = dp_mon_register_feature_ops_1_0, .mon_register_feature_ops = dp_mon_register_feature_ops_1_0,
#ifdef WLAN_TX_PKT_CAPTURE_ENH
.mon_tx_ppdu_stats_attach = dp_tx_ppdu_stats_attach_1_0,
.mon_tx_ppdu_stats_detach = dp_tx_ppdu_stats_detach_1_0,
.mon_peer_tx_capture_filter_check = dp_peer_tx_capture_filter_check_1_0,
#endif
#if (defined(WIFI_MONITOR_SUPPORT) && !defined(WLAN_TX_PKT_CAPTURE_ENH))
.mon_tx_ppdu_stats_attach = NULL,
.mon_tx_ppdu_stats_detach = NULL,
.mon_peer_tx_capture_filter_check = NULL,
#endif
.mon_lite_mon_alloc = NULL, .mon_lite_mon_alloc = NULL,
.mon_lite_mon_dealloc = NULL, .mon_lite_mon_dealloc = NULL,
.mon_lite_mon_vdev_delete = NULL, .mon_lite_mon_vdev_delete = NULL,
@@ -1527,6 +1469,9 @@ struct cdp_mon_ops dp_ops_mon_1_0 = {
#endif #endif
.txrx_set_mon_pdev_params_rssi_dbm_conv = .txrx_set_mon_pdev_params_rssi_dbm_conv =
dp_mon_pdev_params_rssi_dbm_conv, dp_mon_pdev_params_rssi_dbm_conv,
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
.start_local_pkt_capture = dp_mon_start_local_pkt_capture,
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
}; };
#ifdef QCA_MONITOR_OPS_PER_SOC_SUPPORT #ifdef QCA_MONITOR_OPS_PER_SOC_SUPPORT
@@ -1547,6 +1492,7 @@ void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc)
qdf_mem_copy(mon_ops, &monitor_ops_1_0, sizeof(struct dp_mon_ops)); qdf_mem_copy(mon_ops, &monitor_ops_1_0, sizeof(struct dp_mon_ops));
mon_soc->mon_ops = mon_ops; mon_soc->mon_ops = mon_ops;
dp_mon_register_lpc_ops_1_0(mon_ops);
} }
void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops) void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops)
@@ -1571,6 +1517,7 @@ void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops)
void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc) void dp_mon_ops_register_1_0(struct dp_mon_soc *mon_soc)
{ {
mon_soc->mon_ops = &monitor_ops_1_0; mon_soc->mon_ops = &monitor_ops_1_0;
dp_mon_register_lpc_ops_1_0(mon_soc->mon_ops);
} }
void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops) void dp_mon_cdp_ops_register_1_0(struct cdp_ops *ops)

View File

@@ -26,6 +26,77 @@
void dp_flush_monitor_rings(struct dp_soc *soc); void dp_flush_monitor_rings(struct dp_soc *soc);
#if !defined(DISABLE_MON_CONFIG)
/**
* dp_mon_htt_srng_setup_1_0() - Prepare HTT messages for Monitor rings
* @soc: soc handle
* @pdev: physical device handle
* @mac_id: ring number
* @mac_for_pdev: mac_id
*
* Return: non-zero for failure, zero for success
*/
QDF_STATUS dp_mon_htt_srng_setup_1_0(struct dp_soc *soc,
struct dp_pdev *pdev,
int mac_id,
int mac_for_pdev);
/**
* dp_mon_rings_alloc_1_0() - DP monitor rings allocation
* @pdev: physical device handle
*
* Return: non-zero for failure, zero for success
*/
QDF_STATUS dp_mon_rings_alloc_1_0(struct dp_pdev *pdev);
/**
* dp_mon_rings_free_1_0() - DP monitor rings deallocation
* @pdev: physical device handle
*
* Return: non-zero for failure, zero for success
*/
void dp_mon_rings_free_1_0(struct dp_pdev *pdev);
/**
* dp_mon_rings_init_1_0() - DP monitor rings initialization
* @pdev: physical device handle
*
* Return: non-zero for failure, zero for success
*/
QDF_STATUS dp_mon_rings_init_1_0(struct dp_pdev *pdev);
/**
* dp_mon_rings_deinit_1_0() - DP monitor rings deinitialization
* @pdev: physical device handle
*
* Return: non-zero for failure, zero for success
*/
void dp_mon_rings_deinit_1_0(struct dp_pdev *pdev);
#else
static inline
void dp_mon_rings_deinit_1_0(struct dp_pdev *pdev)
{
}
static inline
void dp_mon_rings_free_1_0(struct dp_pdev *pdev)
{
}
static inline
QDF_STATUS dp_mon_rings_init_1_0(struct dp_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
static inline
QDF_STATUS dp_mon_rings_alloc_1_0(struct dp_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
#endif
/* MCL specific functions */ /* MCL specific functions */
#if defined(DP_CON_MON) #if defined(DP_CON_MON)

View File

@@ -527,6 +527,14 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, struct dp_intr *int_ctx,
pdev, ppdu_info, status_nbuf); pdev, ppdu_info, status_nbuf);
if (smart_mesh_status) if (smart_mesh_status)
qdf_nbuf_free(status_nbuf); qdf_nbuf_free(status_nbuf);
} else if (qdf_unlikely(IS_LOCAL_PKT_CAPTURE_RUNNING(mon_pdev,
is_local_pkt_capture_running))) {
int ret;
ret = dp_rx_handle_local_pkt_capture(pdev, ppdu_info,
status_nbuf);
if (ret)
qdf_nbuf_free(status_nbuf);
} else if (qdf_unlikely(mon_pdev->mcopy_mode)) { } else if (qdf_unlikely(mon_pdev->mcopy_mode)) {
dp_rx_process_mcopy_mode(soc, pdev, dp_rx_process_mcopy_mode(soc, pdev,
ppdu_info, tlv_status, ppdu_info, tlv_status,

View File

@@ -1209,10 +1209,6 @@ dp_mon_register_feature_ops_2_0(struct dp_soc *soc)
mon_ops->mon_pdev_get_filter_non_data = mon_ops->mon_pdev_get_filter_non_data =
dp_lite_mon_get_filter_non_data; dp_lite_mon_get_filter_non_data;
mon_ops->mon_neighbour_peer_add_ast = NULL; mon_ops->mon_neighbour_peer_add_ast = NULL;
#ifndef DISABLE_MON_CONFIG
mon_ops->mon_tx_process = dp_tx_mon_process_2_0;
mon_ops->print_txmon_ring_stat = dp_tx_mon_print_ring_stat_2_0;
#endif
#ifdef WLAN_TX_PKT_CAPTURE_ENH_BE #ifdef WLAN_TX_PKT_CAPTURE_ENH_BE
mon_ops->mon_peer_tid_peer_id_update = NULL; mon_ops->mon_peer_tid_peer_id_update = NULL;
mon_ops->mon_tx_capture_debugfs_init = NULL; mon_ops->mon_tx_capture_debugfs_init = NULL;
@@ -1284,11 +1280,13 @@ dp_mon_register_feature_ops_2_0(struct dp_soc *soc)
dp_mon_filter_setup_rx_pkt_log_cbf_2_0; dp_mon_filter_setup_rx_pkt_log_cbf_2_0;
mon_ops->mon_filter_reset_rx_pkt_log_cbf = mon_ops->mon_filter_reset_rx_pkt_log_cbf =
dp_mon_filter_reset_rx_pktlog_cbf_2_0; dp_mon_filter_reset_rx_pktlog_cbf_2_0;
#ifdef BE_PKTLOG_SUPPORT
mon_ops->mon_filter_setup_pktlog_hybrid = mon_ops->mon_filter_setup_pktlog_hybrid =
dp_mon_filter_setup_pktlog_hybrid_2_0; dp_mon_filter_setup_pktlog_hybrid_2_0;
mon_ops->mon_filter_reset_pktlog_hybrid = mon_ops->mon_filter_reset_pktlog_hybrid =
dp_mon_filter_reset_pktlog_hybrid_2_0; dp_mon_filter_reset_pktlog_hybrid_2_0;
#endif #endif
#endif
#if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG) #if defined(DP_CON_MON) && !defined(REMOVE_PKT_LOG)
mon_ops->mon_pktlogmod_exit = dp_pktlogmod_exit; mon_ops->mon_pktlogmod_exit = dp_pktlogmod_exit;
#endif #endif
@@ -1325,10 +1323,14 @@ dp_mon_register_feature_ops_2_0(struct dp_soc *soc)
struct dp_mon_ops monitor_ops_2_0 = { struct dp_mon_ops monitor_ops_2_0 = {
.mon_soc_cfg_init = dp_mon_soc_cfg_init, .mon_soc_cfg_init = dp_mon_soc_cfg_init,
.mon_soc_attach = dp_mon_soc_attach_2_0, .mon_soc_attach[0] = NULL,
.mon_soc_detach = dp_mon_soc_detach_2_0, .mon_soc_attach[1] = dp_mon_soc_attach_2_0,
.mon_soc_init = dp_mon_soc_init_2_0, .mon_soc_detach[0] = NULL,
.mon_soc_deinit = dp_mon_soc_deinit_2_0, .mon_soc_detach[1] = dp_mon_soc_detach_2_0,
.mon_soc_init[0] = NULL,
.mon_soc_init[1] = dp_mon_soc_init_2_0,
.mon_soc_deinit[0] = NULL,
.mon_soc_deinit[1] = dp_mon_soc_deinit_2_0,
.mon_pdev_alloc = dp_mon_pdev_alloc_2_0, .mon_pdev_alloc = dp_mon_pdev_alloc_2_0,
.mon_pdev_free = dp_mon_pdev_free_2_0, .mon_pdev_free = dp_mon_pdev_free_2_0,
.mon_pdev_attach = dp_mon_pdev_attach, .mon_pdev_attach = dp_mon_pdev_attach,
@@ -1347,7 +1349,8 @@ struct dp_mon_ops monitor_ops_2_0 = {
.mon_peer_get_stats_param = dp_mon_peer_get_stats_param, .mon_peer_get_stats_param = dp_mon_peer_get_stats_param,
.mon_flush_rings = NULL, .mon_flush_rings = NULL,
#if !defined(DISABLE_MON_CONFIG) #if !defined(DISABLE_MON_CONFIG)
.mon_pdev_htt_srng_setup = dp_mon_pdev_htt_srng_setup_2_0, .mon_pdev_htt_srng_setup[0] = NULL,
.mon_pdev_htt_srng_setup[1] = dp_mon_pdev_htt_srng_setup_2_0,
.mon_soc_htt_srng_setup = dp_mon_soc_htt_srng_setup_2_0, .mon_soc_htt_srng_setup = dp_mon_soc_htt_srng_setup_2_0,
#endif #endif
#if defined(DP_CON_MON) #if defined(DP_CON_MON)
@@ -1367,19 +1370,16 @@ struct dp_mon_ops monitor_ops_2_0 = {
.mon_reap_timer_start = NULL, .mon_reap_timer_start = NULL,
.mon_reap_timer_stop = NULL, .mon_reap_timer_stop = NULL,
.mon_reap_timer_deinit = NULL, .mon_reap_timer_deinit = NULL,
.mon_filter_setup_rx_mon_mode = dp_mon_filter_setup_rx_mon_mode_2_0,
.mon_filter_reset_rx_mon_mode = dp_mon_filter_reset_rx_mon_mode_2_0,
.mon_filter_setup_tx_mon_mode = dp_mon_filter_setup_tx_mon_mode_2_0, .mon_filter_setup_tx_mon_mode = dp_mon_filter_setup_tx_mon_mode_2_0,
.mon_filter_reset_tx_mon_mode = dp_mon_filter_reset_tx_mon_mode_2_0, .mon_filter_reset_tx_mon_mode = dp_mon_filter_reset_tx_mon_mode_2_0,
.tx_mon_filter_update = dp_tx_mon_filter_update_2_0, .mon_rings_alloc[0] = NULL,
.rx_mon_filter_update = dp_rx_mon_filter_update_2_0, .mon_rings_free[0] = NULL,
.set_mon_mode_buf_rings_tx = dp_vdev_set_monitor_mode_buf_rings_tx_2_0, .mon_rings_init[0] = NULL,
.tx_mon_filter_alloc = dp_mon_filter_alloc_2_0, .mon_rings_deinit[0] = NULL,
.tx_mon_filter_dealloc = dp_mon_filter_dealloc_2_0, .mon_rings_alloc[1] = dp_pdev_mon_rings_alloc_2_0,
.mon_rings_alloc = dp_pdev_mon_rings_alloc_2_0, .mon_rings_free[1] = dp_pdev_mon_rings_free_2_0,
.mon_rings_free = dp_pdev_mon_rings_free_2_0, .mon_rings_init[1] = dp_pdev_mon_rings_init_2_0,
.mon_rings_init = dp_pdev_mon_rings_init_2_0, .mon_rings_deinit[1] = dp_pdev_mon_rings_deinit_2_0,
.mon_rings_deinit = dp_pdev_mon_rings_deinit_2_0,
.rx_mon_desc_pool_init = NULL, .rx_mon_desc_pool_init = NULL,
.rx_mon_desc_pool_deinit = NULL, .rx_mon_desc_pool_deinit = NULL,
.rx_mon_desc_pool_alloc = NULL, .rx_mon_desc_pool_alloc = NULL,
@@ -1453,6 +1453,9 @@ struct cdp_mon_ops dp_ops_mon_2_0 = {
dp_pdev_update_telemetry_airtime_stats, dp_pdev_update_telemetry_airtime_stats,
#endif #endif
.txrx_update_mon_mac_filter = NULL, .txrx_update_mon_mac_filter = NULL,
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
.start_local_pkt_capture = NULL,
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
}; };
#ifdef WLAN_PKT_CAPTURE_TX_2_0 #ifdef WLAN_PKT_CAPTURE_TX_2_0
@@ -1590,3 +1593,23 @@ dp_disable_enhanced_stats_2_0(struct cdp_soc_t *soc, uint8_t pdev_id)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
#endif #endif
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev)
{
struct dp_soc *soc = pdev->soc;
struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
uint16_t num_buffers;
QDF_STATUS status;
soc_cfg_ctx = soc->wlan_cfg_ctx;
num_buffers = wlan_cfg_get_dp_soc_tx_mon_buf_ring_size(soc_cfg_ctx);
status = dp_vdev_set_monitor_mode_buf_rings_tx_2_0(pdev, num_buffers);
if (QDF_IS_STATUS_ERROR(status))
dp_mon_err("Tx monitor buffer allocation failed");
return status;
}
#endif

View File

@@ -3402,4 +3402,77 @@ void dp_cfr_filter_register_2_0(struct cdp_ops *ops)
{ {
ops->mon_ops->txrx_cfr_filter = dp_cfr_filter_2_0; ops->mon_ops->txrx_cfr_filter = dp_cfr_filter_2_0;
} }
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
void dp_mon_filter_setup_local_pkt_capture_tx(struct dp_pdev *pdev)
{
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 =
DP_MON_FILTER_SRNG_TYPE_TXMON_DEST;
struct dp_mon_pdev_be *mon_pdev_be = NULL;
struct dp_mon_filter_be filter = {0};
struct htt_tx_ring_tlv_filter *tx_tlv_filter = &filter.tx_tlv_filter;
struct dp_pdev_tx_monitor_be *tx_mon_be;
mon_pdev_be = dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
tx_mon_be = &mon_pdev_be->tx_monitor_be;
tx_mon_be->mode = TX_MON_BE_FULL_CAPTURE;
mon_pdev_be->tx_mon_mode = 1;
mon_pdev_be->tx_mon_filter_length = DMA_LENGTH_256B;
filter.tx_valid = true;
tx_tlv_filter->enable = 1;
dp_tx_mon_filter_set_downstream_tlvs(tx_tlv_filter);
dp_tx_mon_filter_set_upstream_tlvs(tx_tlv_filter);
dp_tx_mon_filter_set_word_mask(pdev, tx_tlv_filter);
if (mon_pdev->fp_mgmt_filter) {
tx_tlv_filter->mgmt_filter = FILTER_MGMT_ALL;
tx_tlv_filter->mgmt_mpdu_end = 1;
tx_tlv_filter->mgmt_msdu_end = 1;
tx_tlv_filter->mgmt_msdu_start = 1;
tx_tlv_filter->mgmt_mpdu_start = 1;
tx_tlv_filter->mgmt_mpdu_log = 1;
tx_tlv_filter->mgmt_dma_length = DMA_LENGTH_256B;
}
if (mon_pdev->fp_ctrl_filter) {
tx_tlv_filter->ctrl_filter = FILTER_CTRL_ALL;
tx_tlv_filter->ctrl_mpdu_end = 1;
tx_tlv_filter->ctrl_msdu_end = 1;
tx_tlv_filter->ctrl_msdu_start = 1;
tx_tlv_filter->ctrl_mpdu_start = 1;
tx_tlv_filter->ctrl_mpdu_log = 1;
tx_tlv_filter->ctrl_dma_length = DMA_LENGTH_256B;
}
if (mon_pdev->fp_data_filter) {
tx_tlv_filter->data_filter = FILTER_DATA_ALL;
tx_tlv_filter->data_mpdu_end = 1;
tx_tlv_filter->data_msdu_end = 1;
tx_tlv_filter->data_msdu_start = 1;
tx_tlv_filter->data_mpdu_start = 1;
tx_tlv_filter->data_mpdu_log = 1;
tx_tlv_filter->data_dma_length = DMA_LENGTH_256B;
}
dp_mon_filter_show_tx_filter_be(mode, &filter);
mon_pdev_be->filter_be[mode][srng_type] = filter;
}
void dp_mon_filter_reset_local_pkt_capture_tx(struct dp_pdev *pdev)
{
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
enum dp_mon_filter_mode mode = DP_MON_FILTER_MONITOR_MODE;
struct dp_mon_filter_be filter = {0};
enum dp_mon_filter_srng_type srng_type =
DP_MON_FILTER_SRNG_TYPE_TXMON_DEST;
struct dp_mon_pdev_be *mon_pdev_be = NULL;
mon_pdev_be = dp_get_be_mon_pdev_from_dp_mon_pdev(mon_pdev);
filter.tx_valid = true;
mon_pdev_be->filter_be[mode][srng_type] = filter;
}
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
#endif #endif

View File

@@ -303,4 +303,24 @@ void dp_mon_filter_reset_tx_lite_mon(struct dp_mon_pdev_be *be_mon_pdev);
*/ */
void dp_mon_filter_setup_tx_lite_mon(struct dp_pdev *pdev); void dp_mon_filter_setup_tx_lite_mon(struct dp_pdev *pdev);
#endif #endif
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
/**
* dp_mon_filter_setup_local_pkt_capture_tx() - Setup local packet capture
* tx monitor filter
* @pdev: physical device handle
*
* Return: void
*/
void dp_mon_filter_setup_local_pkt_capture_tx(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_local_pkt_capture_tx() - Reset local packet capture
* tx monitor filter
* @pdev: physical device handle
*
* Return: void
*/
void dp_mon_filter_reset_local_pkt_capture_tx(struct dp_pdev *pdev);
#endif
#endif /* _DP_MON_FILTER_2_0_H_ */ #endif /* _DP_MON_FILTER_2_0_H_ */

View File

@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#include "qdf_types.h"
#include "hal_be_hw_headers.h" #include "hal_be_hw_headers.h"
#include "dp_types.h" #include "dp_types.h"
#include "hal_be_rx.h" #include "hal_be_rx.h"

View File

@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#include "qdf_types.h"
#include "hal_be_hw_headers.h" #include "hal_be_hw_headers.h"
#include "dp_types.h" #include "dp_types.h"
#include "hal_be_tx.h" #include "hal_be_tx.h"
@@ -29,9 +30,7 @@
#include <dp_be.h> #include <dp_be.h>
#include <hal_be_api_mon.h> #include <hal_be_api_mon.h>
#include <dp_mon_filter_2.0.h> #include <dp_mon_filter_2.0.h>
#ifdef FEATURE_PERPKT_INFO
#include "dp_ratetable.h" #include "dp_ratetable.h"
#endif
#ifdef QCA_SUPPORT_LITE_MONITOR #ifdef QCA_SUPPORT_LITE_MONITOR
#include "dp_lite_mon.h" #include "dp_lite_mon.h"
#endif #endif
@@ -950,6 +949,33 @@ dp_tx_lite_mon_filtering(struct dp_pdev *pdev,
} }
#endif #endif
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
static int
dp_tx_handle_local_pkt_capture(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
{
struct dp_mon_vdev *mon_vdev;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
if (!mon_pdev->mvdev) {
dp_mon_err("Monitor vdev is NULL !!");
return 1;
}
mon_vdev = mon_pdev->mvdev->monitor_vdev;
if (mon_vdev && mon_vdev->osif_rx_mon)
mon_vdev->osif_rx_mon(mon_pdev->mvdev->osif_vdev, nbuf, NULL);
return 0;
}
#else
static int
dp_tx_handle_local_pkt_capture(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
{
return 0;
}
#endif
/** /**
* dp_tx_mon_send_to_stack() - API to send to stack * dp_tx_mon_send_to_stack() - API to send to stack
* @pdev: pdev Handle * @pdev: pdev Handle
@@ -975,7 +1001,19 @@ dp_tx_mon_send_to_stack(struct dp_pdev *pdev, qdf_nbuf_t mpdu,
tx_capture_info.radiotap_done = 1; tx_capture_info.radiotap_done = 1;
tx_capture_info.mpdu_nbuf = mpdu; tx_capture_info.mpdu_nbuf = mpdu;
tx_capture_info.mpdu_info.ppdu_id = ppdu_id; tx_capture_info.mpdu_info.ppdu_id = ppdu_id;
if (!dp_lite_mon_is_tx_enabled(mon_pdev)) {
if (qdf_unlikely(IS_LOCAL_PKT_CAPTURE_RUNNING(mon_pdev,
is_local_pkt_capture_running))) {
int ret = dp_tx_handle_local_pkt_capture(pdev, mpdu);
/*
* On error, free the memory here,
* otherwise it will be freed by the network stack
*/
if (ret)
qdf_nbuf_free(mpdu);
return;
} else if (!dp_lite_mon_is_tx_enabled(mon_pdev)) {
dp_wdi_event_handler(WDI_EVENT_TX_PKT_CAPTURE, dp_wdi_event_handler(WDI_EVENT_TX_PKT_CAPTURE,
pdev->soc, pdev->soc,
&tx_capture_info, &tx_capture_info,

View File

@@ -24,7 +24,9 @@
#include <dp_mon.h> #include <dp_mon.h>
#include <dp_tx_mon_2.0.h> #include <dp_tx_mon_2.0.h>
#include <dp_mon_2.0.h> #include <dp_mon_2.0.h>
#ifdef QCA_SUPPORT_LITE_MONITOR
#include <dp_lite_mon.h> #include <dp_lite_mon.h>
#endif
#define MAX_PPDU_INFO_LIST_DEPTH 64 #define MAX_PPDU_INFO_LIST_DEPTH 64
@@ -104,7 +106,8 @@ dp_tx_mon_status_free_packet_buf(struct dp_pdev *pdev,
} }
/* need api definition for hal_tx_status_get_next_tlv */ /* need api definition for hal_tx_status_get_next_tlv */
tx_tlv = hal_tx_status_get_next_tlv(tx_tlv); tx_tlv = hal_tx_status_get_next_tlv(tx_tlv,
mon_pdev->is_tlv_hdr_64_bit);
} while ((tx_tlv - tx_tlv_start) < end_offset); } while ((tx_tlv - tx_tlv_start) < end_offset);
} }
@@ -1468,6 +1471,8 @@ dp_tx_mon_process_tlv_2_0(struct dp_pdev *pdev,
tlv_status = hal_txmon_status_get_num_users(pdev->soc->hal_soc, tlv_status = hal_txmon_status_get_num_users(pdev->soc->hal_soc,
tx_tlv, &num_users); tx_tlv, &num_users);
if (tlv_status == HAL_MON_TX_STATUS_PPDU_NOT_DONE || !num_users) { if (tlv_status == HAL_MON_TX_STATUS_PPDU_NOT_DONE || !num_users) {
dp_tx_mon_free_ppdu_info(tx_prot_ppdu_info, tx_mon_be);
tx_mon_be->tx_prot_ppdu_info = NULL;
dp_mon_err("window open with tlv_tag[0x%x] num_users[%d]!\n", dp_mon_err("window open with tlv_tag[0x%x] num_users[%d]!\n",
hal_tx_status_get_tlv_tag(tx_tlv), num_users); hal_tx_status_get_tlv_tag(tx_tlv), num_users);
return QDF_STATUS_E_INVAL; return QDF_STATUS_E_INVAL;
@@ -1478,6 +1483,8 @@ dp_tx_mon_process_tlv_2_0(struct dp_pdev *pdev,
num_users, num_users,
tx_mon_be->be_ppdu_id); tx_mon_be->be_ppdu_id);
if (!tx_data_ppdu_info) { if (!tx_data_ppdu_info) {
dp_tx_mon_free_ppdu_info(tx_prot_ppdu_info, tx_mon_be);
tx_mon_be->tx_prot_ppdu_info = NULL;
dp_mon_info("tx prot ppdu info alloc got failed!!"); dp_mon_info("tx prot ppdu info alloc got failed!!");
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
} }
@@ -1518,7 +1525,8 @@ dp_tx_mon_process_tlv_2_0(struct dp_pdev *pdev,
mon_desc_list_ref); mon_desc_list_ref);
/* need api definition for hal_tx_status_get_next_tlv */ /* need api definition for hal_tx_status_get_next_tlv */
tx_tlv = hal_tx_status_get_next_tlv(tx_tlv); tx_tlv = hal_tx_status_get_next_tlv(tx_tlv,
mon_pdev->is_tlv_hdr_64_bit);
if ((tx_tlv - tx_tlv_start) >= end_offset) if ((tx_tlv - tx_tlv_start) >= end_offset)
break; break;
} while ((tx_tlv - tx_tlv_start) < end_offset); } while ((tx_tlv - tx_tlv_start) < end_offset);

View File

@@ -37,6 +37,11 @@
#ifdef QCA_SUPPORT_LITE_MONITOR #ifdef QCA_SUPPORT_LITE_MONITOR
#include "dp_lite_mon.h" #include "dp_lite_mon.h"
#endif #endif
#include "dp_mon_1.0.h"
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
#include "dp_mon_2.0.h"
#include "dp_mon_filter_2.0.h"
#endif
#define DP_INTR_POLL_TIMER_MS 5 #define DP_INTR_POLL_TIMER_MS 5
#define INVALID_FREE_BUFF 0xffffffff #define INVALID_FREE_BUFF 0xffffffff
@@ -5756,6 +5761,153 @@ QDF_STATUS dp_mon_pdev_detach(struct dp_pdev *pdev)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
static void dp_mon_pdev_filter_init(struct dp_mon_pdev *mon_pdev)
{
if (!mon_pdev)
return;
mon_pdev->mon_filter_mode = MON_FILTER_ALL;
mon_pdev->fp_mgmt_filter = FILTER_MGMT_ALL;
mon_pdev->fp_ctrl_filter = FILTER_CTRL_ALL;
mon_pdev->fp_data_filter = FILTER_DATA_ALL;
mon_pdev->mo_mgmt_filter = FILTER_MGMT_ALL;
mon_pdev->mo_ctrl_filter = FILTER_CTRL_ALL;
mon_pdev->mo_data_filter = FILTER_DATA_ALL;
}
#ifdef WLAN_TX_PKT_CAPTURE_ENH
void dp_mon_register_tx_pkt_enh_ops_1_0(struct dp_mon_ops *mon_ops)
{
mon_ops->mon_tx_ppdu_stats_attach = dp_tx_ppdu_stats_attach_1_0;
mon_ops->mon_tx_ppdu_stats_detach = dp_tx_ppdu_stats_detach_1_0;
mon_ops->mon_peer_tx_capture_filter_check =
dp_peer_tx_capture_filter_check_1_0;
}
#elif defined(WLAN_TX_PKT_CAPTURE_ENH_BE) && defined(WLAN_FEATURE_LOCAL_PKT_CAPTURE)
void dp_mon_register_tx_pkt_enh_ops_1_0(struct dp_mon_ops *mon_ops)
{
mon_ops->mon_tx_ppdu_stats_attach = dp_tx_ppdu_stats_attach_2_0;
mon_ops->mon_tx_ppdu_stats_detach = dp_tx_ppdu_stats_detach_2_0;
mon_ops->mon_peer_tx_capture_filter_check = NULL;
}
#elif (defined(WIFI_MONITOR_SUPPORT) && !defined(WLAN_TX_PKT_CAPTURE_ENH))
void dp_mon_register_tx_pkt_enh_ops_1_0(struct dp_mon_ops *mon_ops)
{
mon_ops->mon_tx_ppdu_stats_attach = NULL;
mon_ops->mon_tx_ppdu_stats_detach = NULL;
mon_ops->mon_peer_tx_capture_filter_check = NULL;
}
#endif
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
#if !defined(DISABLE_MON_CONFIG)
static inline void dp_mon_config_register_ops(struct dp_mon_ops *mon_ops)
{
mon_ops->mon_pdev_htt_srng_setup[0] = dp_mon_htt_srng_setup_1_0;
mon_ops->mon_pdev_htt_srng_setup[1] = dp_mon_pdev_htt_srng_setup_2_0;
mon_ops->mon_soc_htt_srng_setup = dp_mon_soc_htt_srng_setup_2_0;
}
#else
static inline void dp_mon_config_register_ops(struct dp_mon_ops *mon_ops)
{
}
#endif
void dp_mon_register_lpc_ops_1_0(struct dp_mon_ops *mon_ops)
{
mon_ops->mon_soc_attach[0] = NULL;
mon_ops->mon_soc_detach[0] = NULL;
mon_ops->mon_soc_init[0] = NULL;
mon_ops->mon_soc_deinit[0] = NULL;
mon_ops->mon_soc_attach[1] = dp_mon_soc_attach_2_0;
mon_ops->mon_soc_detach[1] = dp_mon_soc_detach_2_0;
mon_ops->mon_soc_init[1] = dp_mon_soc_init_2_0;
mon_ops->mon_soc_deinit[1] = dp_mon_soc_deinit_2_0;
dp_mon_config_register_ops(mon_ops);
mon_ops->mon_rings_alloc[0] = dp_mon_rings_alloc_1_0;
mon_ops->mon_rings_free[0] = dp_mon_rings_free_1_0;
mon_ops->mon_rings_init[0] = dp_mon_rings_init_1_0;
mon_ops->mon_rings_deinit[0] = dp_mon_rings_deinit_1_0;
mon_ops->mon_rings_alloc[1] = dp_pdev_mon_rings_alloc_2_0;
mon_ops->mon_rings_free[1] = dp_pdev_mon_rings_free_2_0;
mon_ops->mon_rings_init[1] = dp_pdev_mon_rings_init_2_0;
mon_ops->mon_rings_deinit[1] = dp_pdev_mon_rings_deinit_2_0;
mon_ops->mon_filter_setup_tx_mon_mode =
dp_mon_filter_setup_local_pkt_capture_tx;
mon_ops->mon_filter_reset_tx_mon_mode =
dp_mon_filter_reset_local_pkt_capture_tx;
mon_ops->tx_mon_filter_update = dp_tx_mon_filter_update_2_0;
mon_ops->rx_hdr_length_set = dp_rx_mon_hdr_length_set;
dp_mon_register_tx_pkt_enh_ops_1_0(mon_ops);
}
static void dp_mon_pdev_filter_lpc_init(struct dp_mon_pdev *mon_pdev)
{
if (!mon_pdev)
return;
mon_pdev->mon_filter_mode = MON_FILTER_PASS;
mon_pdev->fp_mgmt_filter = FILTER_MGMT_ALL;
mon_pdev->fp_ctrl_filter = FILTER_CTRL_ALL;
mon_pdev->fp_data_filter = FILTER_DATA_ALL;
mon_pdev->mo_mgmt_filter = 0;
mon_pdev->mo_ctrl_filter = 0;
mon_pdev->mo_data_filter = 0;
}
#else
#if !defined(DISABLE_MON_CONFIG)
static inline void dp_mon_config_register_ops(struct dp_mon_ops *mon_ops)
{
mon_ops->mon_pdev_htt_srng_setup[0] = dp_mon_htt_srng_setup_1_0;
mon_ops->mon_pdev_htt_srng_setup[1] = NULL;
mon_ops->mon_soc_htt_srng_setup = NULL;
}
#else
static inline void dp_mon_config_register_ops(struct dp_mon_ops *mon_ops)
{
}
#endif
void dp_mon_register_lpc_ops_1_0(struct dp_mon_ops *mon_ops)
{
mon_ops->mon_soc_attach[0] = NULL;
mon_ops->mon_soc_detach[0] = NULL;
mon_ops->mon_soc_init[0] = NULL;
mon_ops->mon_soc_deinit[0] = NULL;
mon_ops->mon_soc_attach[1] = NULL;
mon_ops->mon_soc_detach[1] = NULL;
mon_ops->mon_soc_init[1] = NULL;
mon_ops->mon_soc_deinit[1] = NULL;
dp_mon_config_register_ops(mon_ops);
mon_ops->mon_rings_alloc[0] = dp_mon_rings_alloc_1_0;
mon_ops->mon_rings_free[0] = dp_mon_rings_free_1_0;
mon_ops->mon_rings_init[0] = dp_mon_rings_init_1_0;
mon_ops->mon_rings_deinit[0] = dp_mon_rings_deinit_1_0;
mon_ops->mon_rings_alloc[1] = NULL;
mon_ops->mon_rings_free[1] = NULL;
mon_ops->mon_rings_init[1] = NULL;
mon_ops->mon_rings_deinit[1] = NULL;
mon_ops->mon_filter_setup_tx_mon_mode = NULL;
mon_ops->mon_filter_reset_tx_mon_mode = NULL;
mon_ops->tx_mon_filter_update = NULL;
mon_ops->rx_hdr_length_set = NULL;
dp_mon_register_tx_pkt_enh_ops_1_0(mon_ops);
}
static void dp_mon_pdev_filter_lpc_init(struct dp_mon_pdev *mon_pdev)
{
dp_mon_pdev_filter_init(mon_pdev);
}
#endif
QDF_STATUS dp_mon_pdev_init(struct dp_pdev *pdev) QDF_STATUS dp_mon_pdev_init(struct dp_pdev *pdev)
{ {
struct dp_mon_pdev *mon_pdev; struct dp_mon_pdev *mon_pdev;
@@ -5804,15 +5956,12 @@ QDF_STATUS dp_mon_pdev_init(struct dp_pdev *pdev)
TAILQ_INIT(&mon_pdev->neighbour_peers_list); TAILQ_INIT(&mon_pdev->neighbour_peers_list);
mon_pdev->neighbour_peers_added = false; mon_pdev->neighbour_peers_added = false;
mon_pdev->monitor_configured = false; mon_pdev->monitor_configured = false;
/* Monitor filter init */
mon_pdev->mon_filter_mode = MON_FILTER_ALL;
mon_pdev->fp_mgmt_filter = FILTER_MGMT_ALL;
mon_pdev->fp_ctrl_filter = FILTER_CTRL_ALL;
mon_pdev->fp_data_filter = FILTER_DATA_ALL;
mon_pdev->mo_mgmt_filter = FILTER_MGMT_ALL;
mon_pdev->mo_ctrl_filter = FILTER_CTRL_ALL;
mon_pdev->mo_data_filter = FILTER_DATA_ALL;
/* Monitor filter init */
if (wlan_cfg_get_local_pkt_capture(pdev->soc->wlan_cfg_ctx))
dp_mon_pdev_filter_lpc_init(mon_pdev);
else
dp_mon_pdev_filter_init(mon_pdev);
/* /*
* initialize ppdu tlv list * initialize ppdu tlv list
*/ */
@@ -6690,13 +6839,20 @@ void dp_mon_feature_ops_deregister(struct dp_soc *soc)
QDF_STATUS dp_mon_soc_attach(struct dp_soc *soc) QDF_STATUS dp_mon_soc_attach(struct dp_soc *soc)
{ {
struct dp_mon_soc *mon_soc; struct dp_mon_soc *mon_soc;
qdf_size_t soc_context_size;
if (!soc) { if (!soc) {
dp_mon_err("dp_soc is NULL"); dp_mon_err("dp_soc is NULL");
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
if (soc->arch_ops.txrx_get_mon_context_size) {
soc_context_size = soc->arch_ops.txrx_get_mon_context_size(DP_CONTEXT_TYPE_MON_SOC);
mon_soc = dp_context_alloc_mem(soc, DP_MON_SOC_TYPE,
soc_context_size);
} else {
mon_soc = (struct dp_mon_soc *)qdf_mem_malloc(sizeof(*mon_soc)); mon_soc = (struct dp_mon_soc *)qdf_mem_malloc(sizeof(*mon_soc));
}
if (!mon_soc) { if (!mon_soc) {
dp_mon_err("%pK: mem allocation failed", soc); dp_mon_err("%pK: mem allocation failed", soc);
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
@@ -6707,6 +6863,7 @@ QDF_STATUS dp_mon_soc_attach(struct dp_soc *soc)
dp_mon_register_intr_ops(soc); dp_mon_register_intr_ops(soc);
dp_mon_cdp_ops_register(soc); dp_mon_cdp_ops_register(soc);
dp_monitor_soc_attach(soc);
dp_mon_register_feature_ops(soc); dp_mon_register_feature_ops(soc);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -6723,6 +6880,7 @@ QDF_STATUS dp_mon_soc_detach(struct dp_soc *soc)
mon_soc = soc->monitor_soc; mon_soc = soc->monitor_soc;
dp_monitor_vdev_timer_deinit(soc); dp_monitor_vdev_timer_deinit(soc);
dp_mon_cdp_ops_deregister(soc); dp_mon_cdp_ops_deregister(soc);
dp_monitor_soc_detach(soc);
soc->monitor_soc = NULL; soc->monitor_soc = NULL;
qdf_mem_free(mon_soc); qdf_mem_free(mon_soc);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;

View File

@@ -62,6 +62,12 @@
#define dp_mon_info_rl(params...) \ #define dp_mon_info_rl(params...) \
__QDF_TRACE_RL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_MON, ## params) __QDF_TRACE_RL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_MON, ## params)
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
#define IS_LOCAL_PKT_CAPTURE_RUNNING(var, field) ((var)->field)
#else
#define IS_LOCAL_PKT_CAPTURE_RUNNING(var, field) 0
#endif
#ifdef QCA_ENHANCED_STATS_SUPPORT #ifdef QCA_ENHANCED_STATS_SUPPORT
typedef struct dp_peer_extd_tx_stats dp_mon_peer_tx_stats; typedef struct dp_peer_extd_tx_stats dp_mon_peer_tx_stats;
typedef struct dp_peer_extd_rx_stats dp_mon_peer_rx_stats; typedef struct dp_peer_extd_rx_stats dp_mon_peer_rx_stats;
@@ -866,6 +872,9 @@ struct dp_mon_ops {
void (*mon_rx_ppdu_info_cache_destroy)(struct dp_pdev *pdev); void (*mon_rx_ppdu_info_cache_destroy)(struct dp_pdev *pdev);
void (*mon_mac_filter_set)(uint32_t *msg_word, void (*mon_mac_filter_set)(uint32_t *msg_word,
struct htt_rx_ring_tlv_filter *tlv_filter); struct htt_rx_ring_tlv_filter *tlv_filter);
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
QDF_STATUS (*start_local_pkt_capture)(struct dp_pdev *pdev);
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
}; };
/** /**
@@ -4747,4 +4756,41 @@ dp_mon_rx_print_advanced_stats(struct dp_soc *soc,
QDF_STATUS dp_pdev_update_telemetry_airtime_stats(struct cdp_soc_t *soc, QDF_STATUS dp_pdev_update_telemetry_airtime_stats(struct cdp_soc_t *soc,
uint8_t pdev_id); uint8_t pdev_id);
#endif #endif
/*
* dp_mon_register_lpc_ops_1_0() - set local packet capture 1_0 mon ops
* @mon_ops: monitor ops
*
* This function initializes the mon_ops callbacks.
* index [0] is for Monitor 1.0 and index [1] is for Monitor 2.0
* based on the @WLAN_FEATURE_LOCAL_PKT_CAPTURE macro, it sets the
* appropriate callbacks
*
* Return: None
*/
void dp_mon_register_lpc_ops_1_0(struct dp_mon_ops *mon_ops);
/*
* dp_mon_register_tx_pkt_enh_ops_1_0() - set tx pkt enh mon ops
* @mon_ops: monitor ops
*
* Return: None
*/
void dp_mon_register_tx_pkt_enh_ops_1_0(struct dp_mon_ops *mon_ops);
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
/*
* dp_local_pkt_capture_tx_config() - local packet capture tx config
* @pdev: physical device handle
*
* Return: QDF_STATUS
*/
QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev);
#else
static inline
QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev)
{
return QDF_STATUS_SUCCESS;
}
#endif
#endif /* _DP_MON_H_ */ #endif /* _DP_MON_H_ */

View File

@@ -54,6 +54,23 @@ int8_t *dp_mon_filter_mode_type_to_str[DP_MON_FILTER_MAX_MODE] = {
#endif #endif
}; };
#if defined(WLAN_PKT_CAPTURE_RX_2_0) || defined(CONFIG_WORD_BASED_TLV) || \
defined(WLAN_FEATURE_LOCAL_PKT_CAPTURE)
static inline
void dp_mon_filter_show_filter_1(struct htt_rx_ring_tlv_filter *tlv_filter)
{
DP_MON_FILTER_PRINT("rx_hdr_length: %d", tlv_filter->rx_hdr_length);
DP_MON_FILTER_PRINT("mgmt_dma_length: %d", tlv_filter->mgmt_dma_length);
DP_MON_FILTER_PRINT("ctrl_dma_length: %d", tlv_filter->ctrl_dma_length);
DP_MON_FILTER_PRINT("data_dma_length: %d", tlv_filter->data_dma_length);
}
#else
static inline
void dp_mon_filter_show_filter_1(struct htt_rx_ring_tlv_filter *tlv_filter)
{
}
#endif
void dp_mon_filter_show_filter(struct dp_mon_pdev *mon_pdev, void dp_mon_filter_show_filter(struct dp_mon_pdev *mon_pdev,
enum dp_mon_filter_mode mode, enum dp_mon_filter_mode mode,
struct dp_mon_filter *filter) struct dp_mon_filter *filter)
@@ -63,6 +80,7 @@ void dp_mon_filter_show_filter(struct dp_mon_pdev *mon_pdev,
DP_MON_FILTER_PRINT("[%s]: Valid: %d", DP_MON_FILTER_PRINT("[%s]: Valid: %d",
dp_mon_filter_mode_type_to_str[mode], dp_mon_filter_mode_type_to_str[mode],
filter->valid); filter->valid);
dp_mon_filter_show_filter_1(tlv_filter);
DP_MON_FILTER_PRINT("mpdu_start: %d", tlv_filter->mpdu_start); DP_MON_FILTER_PRINT("mpdu_start: %d", tlv_filter->mpdu_start);
DP_MON_FILTER_PRINT("msdu_start: %d", tlv_filter->msdu_start); DP_MON_FILTER_PRINT("msdu_start: %d", tlv_filter->msdu_start);
DP_MON_FILTER_PRINT("packet: %d", tlv_filter->packet); DP_MON_FILTER_PRINT("packet: %d", tlv_filter->packet);
@@ -258,6 +276,10 @@ void dp_mon_filter_h2t_setup(struct dp_soc *soc, struct dp_pdev *pdev,
dp_mon_set_fp_phy_err_filter(tlv_filter, mon_filter); dp_mon_set_fp_phy_err_filter(tlv_filter, mon_filter);
tlv_filter->enable_mon_mac_filter = tlv_filter->enable_mon_mac_filter =
mon_filter->tlv_filter.enable_mon_mac_filter; mon_filter->tlv_filter.enable_mon_mac_filter;
DP_RX_MON_FILTER_SET_RX_HDR_LEN(tlv_filter,
mon_filter->tlv_filter);
DP_RX_MON_FILTER_SET_RX_HDR_LEN(tlv_filter,
mon_filter->tlv_filter);
} }
dp_mon_filter_show_filter(mon_pdev, 0, filter); dp_mon_filter_show_filter(mon_pdev, 0, filter);
@@ -487,6 +509,15 @@ void dp_mon_filter_setup_tx_mon_mode(struct dp_pdev *pdev)
mon_ops->mon_filter_setup_tx_mon_mode(pdev); mon_ops->mon_filter_setup_tx_mon_mode(pdev);
} }
void dp_mon_filter_reset_tx_mon_mode(struct dp_pdev *pdev)
{
struct dp_mon_ops *mon_ops = NULL;
mon_ops = dp_mon_ops_get(pdev->soc);
if (mon_ops && mon_ops->mon_filter_reset_tx_mon_mode)
mon_ops->mon_filter_reset_tx_mon_mode(pdev);
}
void dp_mon_filter_reset_mon_mode(struct dp_pdev *pdev) void dp_mon_filter_reset_mon_mode(struct dp_pdev *pdev)
{ {
struct dp_mon_ops *mon_ops = NULL; struct dp_mon_ops *mon_ops = NULL;
@@ -861,3 +892,122 @@ fail:
dp_mon_filter_dealloc(mon_pdev); dp_mon_filter_dealloc(mon_pdev);
return NULL; return NULL;
} }
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
static void
dp_mon_set_local_pkt_capture_rx_filter(struct dp_pdev *pdev,
struct cdp_monitor_filter *src_filter)
{
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;
struct dp_mon_filter dst_filter = {0};
struct dp_soc *soc = pdev->soc;
srng_type = ((soc->wlan_cfg_ctx->rxdma1_enable) ?
DP_MON_FILTER_SRNG_TYPE_RXDMA_MON_BUF :
DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF);
dst_filter.valid = true;
dp_mon_filter_set_mon_cmn(pdev, &dst_filter);
dp_mon_filter_show_filter(mon_pdev, mode, &dst_filter);
mon_pdev->filter[mode][srng_type] = dst_filter;
qdf_mem_zero(&dst_filter, sizeof(struct dp_mon_filter));
dst_filter.valid = true;
dp_mon_filter_set_status_cmn(mon_pdev, &dst_filter);
dst_filter.tlv_filter.packet_header = 1;
dst_filter.tlv_filter.header_per_msdu = 1;
dst_filter.tlv_filter.rx_hdr_length = RX_HDR_DMA_LENGTH_256B;
dst_filter.tlv_filter.fp_mgmt_filter = src_filter->fp_mgmt;
dst_filter.tlv_filter.fp_ctrl_filter = src_filter->fp_ctrl;
dst_filter.tlv_filter.fp_data_filter = src_filter->fp_data;
dst_filter.tlv_filter.enable_fp = src_filter->mode;
dst_filter.tlv_filter.enable_md = 0;
dst_filter.tlv_filter.enable_mo = 0;
dp_mon_filter_show_filter(mon_pdev, mode, &dst_filter);
/* Store the above filter */
srng_type = DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
mon_pdev->filter[mode][srng_type] = dst_filter;
}
static void dp_mon_clear_local_pkt_capture_rx_filter(struct dp_pdev *pdev)
{
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 =
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
struct dp_mon_filter filter = {0};
mon_pdev->filter[mode][srng_type] = filter;
}
static void dp_mon_reset_local_pkt_capture_rx_filter(struct dp_pdev *pdev)
{
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 =
DP_MON_FILTER_SRNG_TYPE_RXDMA_MONITOR_STATUS;
struct dp_mon_filter filter = {0};
filter.valid = true;
mon_pdev->filter[mode][srng_type] = filter;
}
QDF_STATUS dp_mon_start_local_pkt_capture(struct cdp_soc_t *cdp_soc,
uint8_t pdev_id,
struct cdp_monitor_filter *filter)
{
bool local_pkt_capture_running;
struct dp_soc *soc = cdp_soc_t_to_dp_soc(cdp_soc);
struct dp_pdev *pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
struct dp_mon_pdev *mon_pdev;
QDF_STATUS status = QDF_STATUS_SUCCESS;
if (!pdev) {
dp_mon_filter_err("pdev Context is null");
return QDF_STATUS_E_INVAL;
}
mon_pdev = pdev->monitor_pdev;
local_pkt_capture_running = dp_mon_get_local_pkt_capture_running(cdp_soc,
pdev_id);
if (local_pkt_capture_running) {
dp_mon_filter_err("Can't start local pkt capture. Already running");
return QDF_STATUS_E_ALREADY;
}
mon_pdev->mon_filter_mode = filter->mode;
mon_pdev->fp_mgmt_filter = filter->fp_mgmt;
mon_pdev->fp_ctrl_filter = filter->fp_ctrl;
mon_pdev->fp_data_filter = filter->fp_data;
qdf_spin_lock_bh(&mon_pdev->mon_lock);
dp_mon_set_local_pkt_capture_rx_filter(pdev, filter);
status = dp_mon_filter_update(pdev);
if (QDF_IS_STATUS_ERROR(status)) {
dp_mon_clear_local_pkt_capture_rx_filter(pdev);
qdf_spin_unlock_bh(&mon_pdev->mon_lock);
dp_mon_filter_err("local pkt capture set rx filter failed");
return status;
}
dp_mon_filter_setup_tx_mon_mode(pdev);
status = dp_tx_mon_filter_update(pdev);
if (QDF_IS_STATUS_ERROR(status)) {
qdf_spin_unlock_bh(&mon_pdev->mon_lock);
dp_mon_filter_err("local pkt capture set tx filter failed");
return status;
}
qdf_spin_unlock_bh(&mon_pdev->mon_lock);
dp_mon_filter_debug("local pkt capture tx filter set");
return status;
}
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */

View File

@@ -76,6 +76,16 @@ do { \
*val |= ((value) << DP_MON_ ## field ## _LSB); \ *val |= ((value) << DP_MON_ ## field ## _LSB); \
} while (0) } while (0)
#if defined(WLAN_PKT_CAPTURE_RX_2_0) || defined(CONFIG_WORD_BASED_TLV) || \
defined(WLAN_FEATURE_LOCAL_PKT_CAPTURE)
#define DP_RX_MON_FILTER_SET_RX_HDR_LEN(dst, src) \
do { \
(dst)->rx_hdr_length = src.rx_hdr_length; \
} while (0)
#else
#define DP_RX_MON_FILTER_SET_RX_HDR_LEN(dst, src)
#endif
#define DP_MON_FILTER_PRINT(fmt, args ...) \ #define DP_MON_FILTER_PRINT(fmt, args ...) \
QDF_TRACE(QDF_MODULE_ID_MON_FILTER, QDF_TRACE_LEVEL_DEBUG, \ QDF_TRACE(QDF_MODULE_ID_MON_FILTER, QDF_TRACE_LEVEL_DEBUG, \
fmt, ## args) fmt, ## args)
@@ -476,6 +486,12 @@ void dp_mon_filter_setup_mon_mode(struct dp_pdev *pdev);
*/ */
void dp_mon_filter_setup_tx_mon_mode(struct dp_pdev *pdev); void dp_mon_filter_setup_tx_mon_mode(struct dp_pdev *pdev);
/**
* dp_mon_filter_reset_tx_mon_mode() - Reset the Tx monitor mode filter
* @pdev: DP pdev handle
*/
void dp_mon_filter_reset_tx_mon_mode(struct dp_pdev *pdev);
/** /**
* dp_mon_filter_reset_mon_mode() - Reset the Rx monitor mode filter * dp_mon_filter_reset_mon_mode() - Reset the Rx monitor mode filter
* @pdev: DP pdev handle * @pdev: DP pdev handle
@@ -538,4 +554,33 @@ dp_mon_ht2_rx_ring_cfg(struct dp_soc *soc,
struct dp_pdev *pdev, struct dp_pdev *pdev,
enum dp_mon_filter_srng_type srng_type, enum dp_mon_filter_srng_type srng_type,
struct htt_rx_ring_tlv_filter *tlv_filter); struct htt_rx_ring_tlv_filter *tlv_filter);
/**
* dp_rx_mon_hdr_length_set() - Setup rx monitor hdr tlv length
* @msg_word: msg word
* @tlv_filter: rx ring filter configuration
*/
void
dp_rx_mon_hdr_length_set(uint32_t *msg_word,
struct htt_rx_ring_tlv_filter *tlv_filter);
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
/**
* dp_mon_start_local_pkt_capture() - start local packet capture
* @cdp_soc: cdp soc
* @pdev_id: pdev id
* @filter: filter configuration
*/
QDF_STATUS dp_mon_start_local_pkt_capture(struct cdp_soc_t *cdp_soc,
uint8_t pdev_id,
struct cdp_monitor_filter *filter);
#else
static inline
QDF_STATUS dp_mon_start_local_pkt_capture(struct cdp_soc_t *cdp_soc,
uint8_t pdev_id,
struct cdp_monitor_filter *filter)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif /* WLAN_FEATURE_LOCAL_PKT_CAPTURE */
#endif /* #ifndef _DP_MON_FILTER_H_ */ #endif /* #ifndef _DP_MON_FILTER_H_ */

View File

@@ -1712,6 +1712,54 @@ dp_rx_handle_smart_mesh_mode(struct dp_soc *soc, struct dp_pdev *pdev,
return 0; return 0;
} }
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
int dp_rx_handle_local_pkt_capture(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info,
qdf_nbuf_t nbuf)
{
uint8_t size;
struct dp_mon_vdev *mon_vdev;
struct dp_mon_pdev *mon_pdev = pdev->monitor_pdev;
if (!mon_pdev->mvdev) {
dp_info_rl("Monitor vdev is NULL !!");
return 1;
}
mon_vdev = mon_pdev->mvdev->monitor_vdev;
if (!ppdu_info->msdu_info.first_msdu_payload) {
dp_info_rl("First msdu payload not present");
return 1;
}
/* Adding 8 bytes to get to start of 802.11 frame after phy_ppdu_id */
size = (ppdu_info->msdu_info.first_msdu_payload -
qdf_nbuf_data(nbuf)) + mon_pdev->phy_ppdu_id_size;
ppdu_info->msdu_info.first_msdu_payload = NULL;
if (!qdf_nbuf_pull_head(nbuf, size)) {
dp_info_rl("No header present");
return 1;
}
/* Only retain RX MSDU payload in the skb */
qdf_nbuf_trim_tail(nbuf, qdf_nbuf_len(nbuf) -
ppdu_info->msdu_info.payload_len +
mon_pdev->phy_ppdu_id_size);
if (!qdf_nbuf_update_radiotap(&mon_pdev->ppdu_info.rx_status, nbuf,
qdf_nbuf_headroom(nbuf))) {
DP_STATS_INC(pdev, dropped.mon_radiotap_update_err, 1);
return 1;
}
if (mon_vdev && mon_vdev->osif_rx_mon)
mon_vdev->osif_rx_mon(mon_pdev->mvdev->osif_vdev, nbuf, NULL);
return 0;
}
#endif
qdf_nbuf_t qdf_nbuf_t
dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev) dp_rx_nbuf_prepare(struct dp_soc *soc, struct dp_pdev *pdev)
{ {

View File

@@ -806,4 +806,27 @@ uint32_t dp_mon_rx_add_tlv(uint8_t id, uint16_t len, void *value,
void void
dp_mon_rx_stats_update_rssi_dbm_params(struct dp_mon_pdev *mon_pdev, dp_mon_rx_stats_update_rssi_dbm_params(struct dp_mon_pdev *mon_pdev,
struct hal_rx_ppdu_info *ppdu_info); struct hal_rx_ppdu_info *ppdu_info);
#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
/**
* dp_rx_handle_local_pkt_capture() - Rx handle for local packet capture
* @pdev: Datapath PDEV handle
* @ppdu_info: Structure for rx ppdu info
* @nbuf: Qdf nbuf abstraction for linux skb
*
* Return: 0 on success, 1 on failure
*/
int
dp_rx_handle_local_pkt_capture(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info,
qdf_nbuf_t nbuf);
#else
static inline int
dp_rx_handle_local_pkt_capture(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info,
qdf_nbuf_t nbuf)
{
return 0;
}
#endif
#endif /* _DP_RX_MON_H_ */ #endif /* _DP_RX_MON_H_ */

View File

@@ -1353,18 +1353,22 @@ struct hal_tx_ppdu_info {
/** /**
* hal_tx_status_get_next_tlv() - get next tx status TLV * hal_tx_status_get_next_tlv() - get next tx status TLV
* @tx_tlv: pointer to TLV header * @tx_tlv: pointer to TLV header
* @is_tlv_hdr_64_bit: Flag to indicate tlv hdr 64 bit
* *
* Return: pointer to next tlv info * Return: pointer to next tlv info
*/ */
static inline uint8_t* static inline uint8_t*
hal_tx_status_get_next_tlv(uint8_t *tx_tlv) { hal_tx_status_get_next_tlv(uint8_t *tx_tlv, bool is_tlv_hdr_64_bit) {
uint32_t tlv_len, tlv_tag; uint32_t tlv_len, tlv_hdr_size;
tlv_len = HAL_RX_GET_USER_TLV32_LEN(tx_tlv); tlv_len = HAL_RX_GET_USER_TLV32_LEN(tx_tlv);
tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(tx_tlv); tlv_hdr_size = is_tlv_hdr_64_bit ? HAL_RX_TLV64_HDR_SIZE :
HAL_RX_TLV32_HDR_SIZE;
return (uint8_t *)(((unsigned long)(tx_tlv + tlv_len + return (uint8_t *)(uintptr_t)qdf_align((uint64_t)((uintptr_t)tx_tlv +
HAL_RX_TLV32_HDR_SIZE + 7)) & (~7)); tlv_len +
tlv_hdr_size),
tlv_hdr_size);
} }
/** /**

View File

@@ -1653,7 +1653,6 @@ hal_txmon_status_parse_tlv_generic_be(void *data_ppdu_info,
* reference of the status buffer will be held in * reference of the status buffer will be held in
* dp_tx_update_ppdu_info_status() * dp_tx_update_ppdu_info_status()
*/ */
status = HAL_MON_TX_DATA;
SHOW_DEFINED(WIFITX_DATA_E); SHOW_DEFINED(WIFITX_DATA_E);
break; break;
} }

View File

@@ -683,7 +683,7 @@ struct hal_rx_ppdu_common_info {
*/ */
struct hal_rx_msdu_payload_info { struct hal_rx_msdu_payload_info {
uint8_t *first_msdu_payload; uint8_t *first_msdu_payload;
uint8_t payload_len; uint16_t payload_len;
}; };
/** /**

View File

@@ -536,7 +536,7 @@ void hal_srng_dst_hw_init_generic(struct hal_soc *hal,
* (when SRNG_ENABLE field for the MISC register is available in fw_api) * (when SRNG_ENABLE field for the MISC register is available in fw_api)
* (WCSS_UMAC_CE_0_SRC_WFSS_CE_CHANNEL_SRC_R0_SRC_RING_MISC) * (WCSS_UMAC_CE_0_SRC_WFSS_CE_CHANNEL_SRC_R0_SRC_RING_MISC)
*/ */
reg_val |= 0x40; reg_val |= SRNG_ENABLE_BIT;
SRNG_DST_REG_WRITE(srng, MISC, reg_val); SRNG_DST_REG_WRITE(srng, MISC, reg_val);

View File

@@ -121,11 +121,14 @@
#include "hal_be_rx_tlv.h" #include "hal_be_rx_tlv.h"
#include <hal_generic_api.h> #include <hal_generic_api.h>
#include <hal_be_generic_api.h>
#include "hal_be_api_mon.h" #include "hal_be_api_mon.h"
#include <hal_be_generic_api.h>
#define LINK_DESC_SIZE (NUM_OF_DWORDS_RX_MSDU_LINK << 2) #define LINK_DESC_SIZE (NUM_OF_DWORDS_RX_MSDU_LINK << 2)
/* For Berryllium sw2rxdma ring size increased to 20 bits */
#define HAL_RXDMA_MAX_RING_SIZE_BE 0xFFFFF
#ifdef QCA_GET_TSF_VIA_REG #ifdef QCA_GET_TSF_VIA_REG
#define PCIE_PCIE_MHI_TIME_LOW 0xA28 #define PCIE_PCIE_MHI_TIME_LOW 0xA28
#define PCIE_PCIE_MHI_TIME_HIGH 0xA2C #define PCIE_PCIE_MHI_TIME_HIGH 0xA2C
@@ -2356,6 +2359,16 @@ static void hal_hw_txrx_ops_attach_kiwi(struct hal_soc *hal_soc)
#endif #endif
hal_soc->ops->hal_rx_en_mcast_fp_data_filter = hal_soc->ops->hal_rx_en_mcast_fp_data_filter =
hal_rx_en_mcast_fp_data_filter_kiwi; hal_rx_en_mcast_fp_data_filter_kiwi;
#ifdef WLAN_PKT_CAPTURE_TX_2_0
hal_soc->ops->hal_txmon_is_mon_buf_addr_tlv =
hal_txmon_is_mon_buf_addr_tlv_generic_be;
hal_soc->ops->hal_txmon_populate_packet_info =
hal_txmon_populate_packet_info_generic_be;
hal_soc->ops->hal_txmon_status_parse_tlv =
hal_txmon_status_parse_tlv_generic_be;
hal_soc->ops->hal_txmon_status_get_num_users =
hal_txmon_status_get_num_users_generic_be;
#endif /* WLAN_PKT_CAPTURE_TX_2_0 */
}; };
struct hal_hw_srng_config hw_srng_table_kiwi[] = { struct hal_hw_srng_config hw_srng_table_kiwi[] = {
@@ -2776,8 +2789,37 @@ struct hal_hw_srng_config hw_srng_table_kiwi[] = {
{ /* REO2PPE */ 0}, { /* REO2PPE */ 0},
{ /* PPE2TCL */ 0}, { /* PPE2TCL */ 0},
{ /* PPE_RELEASE */ 0}, { /* PPE_RELEASE */ 0},
{ /* TX_MONITOR_BUF */ 0}, #ifdef WLAN_PKT_CAPTURE_TX_2_0
{ /* TX_MONITOR_DST */ 0}, { /* TX_MONITOR_BUF */
.start_ring_id = HAL_SRNG_SW2TXMON_BUF0,
.max_rings = 1,
.entry_size = sizeof(struct mon_ingress_ring) >> 2,
.lmac_ring = TRUE,
.ring_dir = HAL_SRNG_SRC_RING,
/* reg_start is not set because LMAC rings are not accessed
* from host
*/
.reg_start = {},
.reg_size = {},
.max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
},
{ /* TX_MONITOR_DST */
.start_ring_id = HAL_SRNG_WMAC1_TXMON2SW0,
.max_rings = 2,
.entry_size = sizeof(struct mon_destination_ring) >> 2,
.lmac_ring = TRUE,
.ring_dir = HAL_SRNG_DST_RING,
/* reg_start is not set because LMAC rings are not accessed
* from host
*/
.reg_start = {},
.reg_size = {},
.max_size = HAL_RXDMA_MAX_RING_SIZE_BE,
},
#else
{0},
{0},
#endif
{ /* SW2RXDMA_NEW */ 0}, { /* SW2RXDMA_NEW */ 0},
}; };