qcacmn: Add changes to distinguish between LPC and STA+MON

Currently there is no way to distinguish between
Local Packet Capture and STA+Mon mode as both mode
uses same monitor interface. So to distinguish between
two mode in local_packet_capture enable case use
mon_flags which can be passed during monitor interface
add time. If "flags otherbss" is passed during
monitor interface add driver will consider current mode
as STA+MON mode, LPC otherwise.

Change-Id: I56a724697bb187d0b809b6c43c7b5bf4b7d15ca7
CRs-Fixed: 3739438
This commit is contained in:
Amit Mehta
2024-02-02 02:46:46 -08:00
committed by Ravindra Konda
parent cbca127f90
commit 03f346bc1e
5 changed files with 40 additions and 8 deletions

View File

@@ -4804,7 +4804,7 @@ static QDF_STATUS dp_vdev_attach_wifi3(struct cdp_soc_t *cdp_soc,
} 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)) { !dp_mon_mode_local_pkt_capture(soc)) {
/* 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

@@ -264,7 +264,7 @@ static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
if (ring_type != RXDMA_MONITOR_STATUS) if (ring_type != RXDMA_MONITOR_STATUS)
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)) { !dp_mon_mode_local_pkt_capture(soc)) {
return true; return true;
} }
@@ -278,7 +278,7 @@ static inline bool dp_skip_msi_cfg(struct dp_soc *soc, int ring_type)
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)) { !dp_mon_mode_local_pkt_capture(soc)) {
return true; return true;
} }

View File

@@ -826,7 +826,7 @@ 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)); !dp_mon_mode_local_pkt_capture(soc));
} }
#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

@@ -4911,12 +4911,44 @@ void dp_mon_register_tx_pkt_enh_ops_1_0(struct dp_mon_ops *mon_ops);
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev); QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev);
/*
* dp_mon_mode_local_pkt_capture() - Check if in LPC mode
* @soc: DP SOC handle
*
* Return: True in case of LPC mode else false
*
*/
static inline bool
dp_mon_mode_local_pkt_capture(struct dp_soc *soc)
{
/* Currently there is no way to distinguish between
* Local Packet Capture and STA+Mon mode as both mode
* uses same monitor interface. So to distinguish between
* two mode in local_packet_capture enable case use
* mon_flags which can be passed during monitor interface
* add time. If "flags otherbss" is passed during
* monitor interface add driver will consider current mode
* as STA+MON mode, LPC otherwise.
*/
if (wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx) &&
!(soc->mon_flags & QDF_MONITOR_FLAG_OTHER_BSS))
return true;
return false;
}
#else #else
static inline static inline
QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev) QDF_STATUS dp_local_pkt_capture_tx_config(struct dp_pdev *pdev)
{ {
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
static inline bool
dp_mon_mode_local_pkt_capture(struct dp_soc *soc)
{
return false;
}
#endif #endif
#ifdef WIFI_MONITOR_SUPPORT #ifdef WIFI_MONITOR_SUPPORT

View File

@@ -284,18 +284,18 @@ void dp_mon_filter_h2t_setup(struct dp_soc *soc, struct dp_pdev *pdev,
} }
/** /**
* dp_mon_is_lpc_mode() - Check if it's local packets capturing mode * dp_mon_skip_filter_config() - Check if filter config need to be skipped
* @soc: DP soc context * @soc: DP soc context
* *
* Return: true if yes, false if not * Return: true if yes, false if not
*/ */
static inline static inline
bool dp_mon_is_lpc_mode(struct dp_soc *soc) bool dp_mon_skip_filter_config(struct dp_soc *soc)
{ {
if (soc->cdp_soc.ol_ops->get_con_mode && if (soc->cdp_soc.ol_ops->get_con_mode &&
soc->cdp_soc.ol_ops->get_con_mode() == soc->cdp_soc.ol_ops->get_con_mode() ==
QDF_GLOBAL_MISSION_MODE && QDF_GLOBAL_MISSION_MODE &&
wlan_cfg_get_local_pkt_capture(soc->wlan_cfg_ctx)) !(QDF_MONITOR_FLAG_OTHER_BSS & soc->mon_flags))
return true; return true;
else else
return false; return false;
@@ -313,7 +313,7 @@ dp_mon_ht2_rx_ring_cfg(struct dp_soc *soc,
uint32_t target_type = hal_get_target_type(soc->hal_soc); uint32_t target_type = hal_get_target_type(soc->hal_soc);
if (srng_type == DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF && if (srng_type == DP_MON_FILTER_SRNG_TYPE_RXDMA_BUF &&
dp_mon_is_lpc_mode(soc)) { dp_mon_skip_filter_config(soc)) {
dp_mon_filter_info("skip rxdma_buf filter cfg for lpc mode"); dp_mon_filter_info("skip rxdma_buf filter cfg for lpc mode");
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }