qcacmn: Scan radio special vap stats support

-Add flag to inidicate special vap configuration
-Add frame type counters while processing tlv
 WIFIRX_MPDU_START_E
-Add function to update special vap rx stats
-Add dp pdev param to enable/disable special vap
 stats reset
-Add function to reset special vap stats
-Add fucntion to get special vap stats
-Add CDP function to retreive special vap stats

Change-Id: Ia5de6743e472dc86c9e66b9e789c909a57025e35
CRs-Fixed: 3005425
This commit is contained in:
Jeevan Kukkalli
2021-08-02 14:58:21 +05:30
committed by Madan Koyyalamudi
parent 693dbbdf2f
commit 1665e7c8e5
10 changed files with 215 additions and 0 deletions

View File

@@ -610,6 +610,25 @@ dp_deliver_tx_mgmt(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf)
return QDF_STATUS_SUCCESS;
}
/**
* dp_reset_spcl_vap_stats() - reset spcl vap rx stats
* @vdev: Datapath VDEV handle
*
* Return: void
*/
static inline void
dp_reset_spcl_vap_stats(struct dp_vdev *vdev)
{
struct dp_mon_vdev *mon_vdev;
mon_vdev = vdev->monitor_vdev;
if (!mon_vdev)
return;
qdf_mem_zero(&mon_vdev->spcl_vap_stats,
sizeof(mon_vdev->spcl_vap_stats));
}
/**
* dp_vdev_set_monitor_mode() - Set DP VDEV to monitor mode
* @vdev_handle: Datapath VDEV handle
@@ -657,6 +676,10 @@ static QDF_STATUS dp_vdev_set_monitor_mode(struct cdp_soc_t *dp_soc,
goto fail;
}
if (mon_pdev->spcl_vap_configured &&
mon_pdev->reset_spcl_vap_stats_enable)
dp_reset_spcl_vap_stats(vdev);
/*Check if current pdev's monitor_vdev exists */
if (mon_pdev->monitor_configured) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_DEBUG,
@@ -5251,6 +5274,29 @@ static void dp_iterate_update_peer_list(struct cdp_pdev *pdev_hdl)
}
#endif
static QDF_STATUS
dp_get_spcl_vap_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
struct cdp_spcl_vap_stats *stats)
{
struct dp_mon_vdev *mon_vdev = NULL;
struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
struct dp_vdev *vdev = dp_vdev_get_ref_by_id(soc, vdev_id,
DP_MOD_ID_CDP);
if (!vdev || !stats)
return QDF_STATUS_E_INVAL;
mon_vdev = vdev->monitor_vdev;
if (!mon_vdev)
return QDF_STATUS_E_INVAL;
qdf_mem_copy(stats, &mon_vdev->spcl_vap_stats,
sizeof(struct cdp_spcl_vap_stats));
dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP);
return QDF_STATUS_SUCCESS;
}
QDF_STATUS dp_mon_soc_cfg_init(struct dp_soc *soc)
{
int target_type;
@@ -5670,6 +5716,8 @@ void dp_mon_cdp_ops_register(struct dp_soc *soc)
#ifdef WDI_EVENT_ENABLE
ops->ctrl_ops->txrx_get_pldev = dp_get_pldev;
#endif
ops->host_stats_ops->txrx_get_spcl_vap_stats =
dp_get_spcl_vap_stats;
return;
}

View File

@@ -351,11 +351,16 @@ struct dp_mon_pdev {
qdf_nbuf_t mcopy_status_nbuf;
bool is_dp_mon_pdev_initialized;
/* indicates if spcl vap is configured */
bool spcl_vap_configured;
/* enable spcl vap stats reset on ch change */
bool reset_spcl_vap_stats_enable;
};
struct dp_mon_vdev {
/* callback to hand rx monitor 802.11 MPDU to the OS shim */
ol_txrx_rx_mon_fp osif_rx_mon;
struct cdp_spcl_vap_stats spcl_vap_stats;
};
struct dp_mon_peer {
@@ -2261,6 +2266,25 @@ void monitor_pdev_set_mon_vdev(struct dp_vdev *vdev)
mon_pdev->mvdev = vdev;
}
static inline
void dp_monitor_pdev_config_spcl_vap(struct dp_pdev *pdev, bool val)
{
if (!pdev || !pdev->monitor_pdev)
return;
pdev->monitor_pdev->spcl_vap_configured = val;
}
static inline
void dp_monitor_pdev_reset_spcl_vap_stats_enable(struct dp_pdev *pdev,
bool val)
{
if (!pdev || !pdev->monitor_pdev)
return;
pdev->monitor_pdev->reset_spcl_vap_stats_enable = val;
}
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);

View File

@@ -1730,6 +1730,51 @@ dp_rx_mon_handle_mu_ul_info(struct hal_rx_ppdu_info *ppdu_info)
}
#endif
/**
* dp_rx_mon_update_spcl_vap_stats() - Update special vap stats
* @pdev: dp pdev context
* @ppdu_info: ppdu info structure from ppdu ring
*
* Return: none
*/
static inline void
dp_rx_mon_update_spcl_vap_stats(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info)
{
struct mon_rx_user_status *rx_user_status = NULL;
struct dp_mon_pdev *mon_pdev = NULL;
struct dp_mon_vdev *mon_vdev = NULL;
uint32_t num_users = 0;
uint32_t user = 0;
mon_pdev = pdev->monitor_pdev;
if (!mon_pdev || !mon_pdev->mvdev)
return;
mon_vdev = mon_pdev->mvdev->monitor_vdev;
if (!mon_vdev)
return;
num_users = ppdu_info->com_info.num_users;
for (user = 0; user < num_users; user++) {
rx_user_status = &ppdu_info->rx_user_status[user];
mon_vdev->spcl_vap_stats.rx_ok_pkts +=
rx_user_status->mpdu_cnt_fcs_ok;
mon_vdev->spcl_vap_stats.rx_ok_bytes +=
rx_user_status->mpdu_ok_byte_count;
mon_vdev->spcl_vap_stats.rx_err_pkts +=
rx_user_status->mpdu_cnt_fcs_err;
mon_vdev->spcl_vap_stats.rx_err_bytes +=
rx_user_status->mpdu_err_byte_count;
}
mon_vdev->spcl_vap_stats.rx_mgmt_pkts +=
ppdu_info->frm_type_info.rx_mgmt_cnt;
mon_vdev->spcl_vap_stats.rx_ctrl_pkts +=
ppdu_info->frm_type_info.rx_ctrl_cnt;
mon_vdev->spcl_vap_stats.rx_data_pkts +=
ppdu_info->frm_type_info.rx_data_cnt;
}
/**
* dp_rx_mon_status_process_tlv() - Process status TLV in status
* buffer on Rx status Queue posted by status SRNG processing.
@@ -1873,6 +1918,11 @@ dp_rx_mon_status_process_tlv(struct dp_soc *soc, struct dp_intr *int_ctx,
mon_pdev->mon_ppdu_status = DP_PPDU_STATUS_DONE;
/* Collect spcl vap stats if configured */
if (mon_pdev->spcl_vap_configured)
dp_rx_mon_update_spcl_vap_stats(pdev,
ppdu_info);
/*
* if chan_num is not fetched correctly from ppdu RX TLV,
* get it from pdev saved.