qcacmn: Conditionally compile scan radio special vap stats

Conditionally compile scan radio special vap stats.
Also rename spcl_vap to scan_spcl_vap to better reflect
funtionality.

Change-Id: I7d7f636209f6aa12cca0a3e808d7ae1fac9f397d
CRs-Fixed: 3009837
This commit is contained in:
Jeevan Kukkalli
2021-08-09 13:38:44 +05:30
committed by Madan Koyyalamudi
parent 7469335fa4
commit 8fd6fe32e8
10 changed files with 211 additions and 90 deletions

View File

@@ -1115,7 +1115,7 @@ enum cdp_peer_param_type {
* @CDP_CONFIG_BSS_COLOR: configure bss color
* @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
* @CDP_CONFIG_SPECIAL_VAP: Configure Special vap
* @CDP_RESET_SPCL_VAP_STATS_ENABLE: Enable spcl vap stats reset
* @CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE: Enable scan spcl vap stats reset
*/
enum cdp_pdev_param_type {
CDP_CONFIG_DEBUG_SNIFFER,
@@ -1147,7 +1147,7 @@ enum cdp_pdev_param_type {
CDP_CONFIG_BSS_COLOR,
CDP_SET_ATF_STATS_ENABLE,
CDP_CONFIG_SPECIAL_VAP,
CDP_RESET_SPCL_VAP_STATS_ENABLE,
CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE,
};
/*
@@ -1281,7 +1281,7 @@ typedef union cdp_config_param_t {
uint32_t cdp_pdev_param_tx_pending;
bool cdp_pdev_param_atf_stats_enable;
bool cdp_pdev_param_config_special_vap;
bool cdp_pdev_param_reset_spcl_vap_stats_enable;
bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable;
/* psoc params */
bool cdp_psoc_param_en_rate_stats;
@@ -2571,8 +2571,9 @@ struct cdp_rx_flow_info {
uint16_t fse_metadata;
};
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
/**
* cdp_spcl_vap_stats - Special vap statistics info
* cdp_scan_spcl_vap_stats - Special vap statistics info
* @rx_ok_pkts: rx fcs ok pkts count
* @rx_ok_bytes: rx fcs ok bytes count
* @rx_err_pkts: rx fcs err pkts count
@@ -2581,7 +2582,7 @@ struct cdp_rx_flow_info {
* @rx_ctrl_pkts: rx ctrl pkts count
* @rx_data_pkts: rx data pkts count
*/
struct cdp_spcl_vap_stats {
struct cdp_scan_spcl_vap_stats {
uint64_t rx_ok_pkts;
uint64_t rx_ok_bytes;
uint64_t rx_err_pkts;
@@ -2591,3 +2592,4 @@ struct cdp_spcl_vap_stats {
uint64_t rx_data_pkts;
};
#endif
#endif

View File

@@ -734,10 +734,11 @@ cdp_host_get_radio_stats(ol_txrx_soc_handle soc,
buf);
}
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
static inline int
cdp_get_spcl_vap_stats(ol_txrx_soc_handle soc,
cdp_get_scan_spcl_vap_stats(ol_txrx_soc_handle soc,
uint8_t vdev_id,
struct cdp_spcl_vap_stats *stats)
struct cdp_scan_spcl_vap_stats *stats)
{
if (!soc || !soc->ops) {
dp_cdp_debug("Invalid Instance");
@@ -746,10 +747,12 @@ cdp_get_spcl_vap_stats(ol_txrx_soc_handle soc,
}
if (!soc->ops->host_stats_ops ||
!soc->ops->host_stats_ops->txrx_get_spcl_vap_stats)
!soc->ops->host_stats_ops->txrx_get_scan_spcl_vap_stats)
return QDF_STATUS_E_FAILURE;
return soc->ops->host_stats_ops->txrx_get_spcl_vap_stats(soc, vdev_id,
return soc->ops->host_stats_ops->txrx_get_scan_spcl_vap_stats(soc,
vdev_id,
stats);
}
#endif
#endif /* _CDP_TXRX_HOST_STATS_H_ */

View File

@@ -987,9 +987,11 @@ struct cdp_host_stats_ops {
uint32_t last_tx_rate_mcs,
uint32_t stats_id);
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
QDF_STATUS
(*txrx_get_spcl_vap_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
struct cdp_spcl_vap_stats *stats);
(*txrx_get_scan_spcl_vap_stats)(struct cdp_soc_t *soc, uint8_t vdev_id,
struct cdp_scan_spcl_vap_stats *stats);
#endif
};
struct cdp_wds_ops {

View File

@@ -606,12 +606,12 @@ static inline bool dp_monitor_is_enable_enhanced_stats(struct dp_pdev *pdev)
}
static inline
void dp_monitor_pdev_config_spcl_vap(struct dp_pdev *pdev)
void dp_monitor_pdev_config_scan_spcl_vap(struct dp_pdev *pdev)
{
}
static inline
void dp_monitor_pdev_reset_spcl_vap_stats_enable(struct dp_pdev *pdev,
void dp_monitor_pdev_reset_scan_spcl_vap_stats_enable(struct dp_pdev *pdev,
bool val)
{
}

View File

@@ -8528,13 +8528,13 @@ static QDF_STATUS dp_set_pdev_param(struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
val.cdp_pdev_param_atf_stats_enable);
break;
case CDP_CONFIG_SPECIAL_VAP:
dp_monitor_pdev_config_spcl_vap(pdev,
dp_monitor_pdev_config_scan_spcl_vap(pdev,
val.cdp_pdev_param_config_special_vap);
dp_monitor_vdev_set_monitor_mode_buf_rings(pdev);
break;
case CDP_RESET_SPCL_VAP_STATS_ENABLE:
dp_monitor_pdev_reset_spcl_vap_stats_enable(pdev,
val.cdp_pdev_param_reset_spcl_vap_stats_enable);
case CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE:
dp_monitor_pdev_reset_scan_spcl_vap_stats_enable(pdev,
val.cdp_pdev_param_reset_scan_spcl_vap_stats_enable);
break;
default:
return QDF_STATUS_E_INVAL;

View File

@@ -606,25 +606,114 @@ dp_deliver_tx_mgmt(struct cdp_soc_t *cdp_soc, uint8_t pdev_id, qdf_nbuf_t nbuf)
return QDF_STATUS_SUCCESS;
}
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
/**
* dp_reset_spcl_vap_stats() - reset spcl vap rx stats
* dp_scan_spcl_vap_stats_attach() - alloc spcl vap stats struct
* @mon_vdev: Datapath mon VDEV handle
*
* Return: 0 on success, not 0 on failure
*/
static inline QDF_STATUS
dp_scan_spcl_vap_stats_attach(struct dp_mon_vdev *mon_vdev)
{
mon_vdev->scan_spcl_vap_stats =
qdf_mem_malloc(sizeof(struct cdp_scan_spcl_vap_stats));
if (!mon_vdev->scan_spcl_vap_stats) {
dp_mon_err("scan spcl vap stats attach fail");
return QDF_STATUS_E_NOMEM;
}
return QDF_STATUS_SUCCESS;
}
/**
* dp_scan_spcl_vap_stats_detach() - free spcl vap stats struct
* @mon_vdev: Datapath mon VDEV handle
*
* Return: void
*/
static inline void
dp_scan_spcl_vap_stats_detach(struct dp_mon_vdev *mon_vdev)
{
if (mon_vdev->scan_spcl_vap_stats) {
qdf_mem_free(mon_vdev->scan_spcl_vap_stats);
mon_vdev->scan_spcl_vap_stats = NULL;
}
}
/**
* dp_reset_scan_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)
dp_reset_scan_spcl_vap_stats(struct dp_vdev *vdev)
{
struct dp_mon_vdev *mon_vdev;
struct dp_mon_pdev *mon_pdev;
mon_vdev = vdev->monitor_vdev;
if (!mon_vdev)
mon_pdev = vdev->pdev->monitor_pdev;
if (!mon_pdev || !mon_pdev->reset_scan_spcl_vap_stats_enable)
return;
qdf_mem_zero(&mon_vdev->spcl_vap_stats,
sizeof(mon_vdev->spcl_vap_stats));
mon_vdev = vdev->monitor_vdev;
if (!mon_vdev || !mon_vdev->scan_spcl_vap_stats)
return;
qdf_mem_zero(mon_vdev->scan_spcl_vap_stats,
sizeof(struct cdp_scan_spcl_vap_stats));
}
/**
* dp_get_scan_spcl_vap_stats() - get spcl vap rx stats
* @soc_hdl: Datapath soc handle
* @vdev_id: vdev id
* @stats: structure to hold spcl vap stats
*
* Return: 0 on success, not 0 on failure
*/
static QDF_STATUS
dp_get_scan_spcl_vap_stats(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
struct cdp_scan_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 || !mon_vdev->scan_spcl_vap_stats)
return QDF_STATUS_E_INVAL;
qdf_mem_copy(stats, mon_vdev->scan_spcl_vap_stats,
sizeof(struct cdp_scan_spcl_vap_stats));
dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_CDP);
return QDF_STATUS_SUCCESS;
}
#else
static inline void
dp_reset_scan_spcl_vap_stats(struct dp_vdev *vdev)
{
}
static inline QDF_STATUS
dp_scan_spcl_vap_stats_attach(struct dp_mon_vdev *mon_vdev)
{
return QDF_STATUS_SUCCESS;
}
static inline void
dp_scan_spcl_vap_stats_detach(struct dp_mon_vdev *mon_vdev)
{
}
#endif
/**
* dp_vdev_set_monitor_mode() - Set DP VDEV to monitor mode
* @vdev_handle: Datapath VDEV handle
@@ -672,9 +761,8 @@ 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);
if (mon_pdev->scan_spcl_vap_configured)
dp_reset_scan_spcl_vap_stats(vdev);
/*Check if current pdev's monitor_vdev exists */
if (mon_pdev->monitor_configured) {
@@ -5296,29 +5384,6 @@ 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;
@@ -5533,6 +5598,7 @@ QDF_STATUS dp_mon_pdev_deinit(struct dp_pdev *pdev)
static QDF_STATUS dp_mon_vdev_attach(struct dp_vdev *vdev)
{
struct dp_mon_vdev *mon_vdev;
struct dp_pdev *pdev = vdev->pdev;
mon_vdev = (struct dp_mon_vdev *)qdf_mem_malloc(sizeof(*mon_vdev));
if (!mon_vdev) {
@@ -5540,6 +5606,9 @@ static QDF_STATUS dp_mon_vdev_attach(struct dp_vdev *vdev)
return QDF_STATUS_E_NOMEM;
}
if (pdev->monitor_pdev->scan_spcl_vap_configured)
dp_scan_spcl_vap_stats_attach(mon_vdev);
vdev->monitor_vdev = mon_vdev;
return QDF_STATUS_SUCCESS;
@@ -5553,6 +5622,9 @@ static QDF_STATUS dp_mon_vdev_detach(struct dp_vdev *vdev)
if (!mon_vdev)
return QDF_STATUS_E_FAILURE;
if (pdev->monitor_pdev->scan_spcl_vap_configured)
dp_scan_spcl_vap_stats_detach(mon_vdev);
qdf_mem_free(mon_vdev);
vdev->monitor_vdev = NULL;
pdev->monitor_pdev->mvdev = NULL;
@@ -5741,8 +5813,10 @@ 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;
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
ops->host_stats_ops->txrx_get_scan_spcl_vap_stats =
dp_get_scan_spcl_vap_stats;
#endif
return;
}

View File

@@ -365,15 +365,19 @@ 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;
bool scan_spcl_vap_configured;
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
/* enable spcl vap stats reset on ch change */
bool reset_spcl_vap_stats_enable;
bool reset_scan_spcl_vap_stats_enable;
#endif
};
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;
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
struct cdp_scan_spcl_vap_stats *scan_spcl_vap_stats;
#endif
};
struct dp_mon_peer {
@@ -2592,23 +2596,31 @@ void dp_monitor_pdev_set_mon_vdev(struct dp_vdev *vdev)
}
static inline
void dp_monitor_pdev_config_spcl_vap(struct dp_pdev *pdev, bool val)
void dp_monitor_pdev_config_scan_spcl_vap(struct dp_pdev *pdev, bool val)
{
if (!pdev || !pdev->monitor_pdev)
return;
pdev->monitor_pdev->spcl_vap_configured = val;
pdev->monitor_pdev->scan_spcl_vap_configured = val;
}
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
static inline
void dp_monitor_pdev_reset_spcl_vap_stats_enable(struct dp_pdev *pdev,
void dp_monitor_pdev_reset_scan_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;
pdev->monitor_pdev->reset_scan_spcl_vap_stats_enable = val;
}
#else
static inline
void dp_monitor_pdev_reset_scan_spcl_vap_stats_enable(struct dp_pdev *pdev,
bool val)
{
}
#endif
QDF_STATUS dp_mon_soc_attach(struct dp_soc *soc);
QDF_STATUS dp_mon_soc_detach(struct dp_soc *soc);

View File

@@ -1705,15 +1705,16 @@ dp_rx_mon_handle_mu_ul_info(struct hal_rx_ppdu_info *ppdu_info)
}
#endif
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
/**
* dp_rx_mon_update_spcl_vap_stats() - Update special vap stats
* dp_rx_mon_update_scan_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,
dp_rx_mon_update_scan_spcl_vap_stats(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info)
{
struct mon_rx_user_status *rx_user_status = NULL;
@@ -1727,28 +1728,35 @@ dp_rx_mon_update_spcl_vap_stats(struct dp_pdev *pdev,
return;
mon_vdev = mon_pdev->mvdev->monitor_vdev;
if (!mon_vdev)
if (!mon_vdev || !mon_vdev->scan_spcl_vap_stats)
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 +=
mon_vdev->scan_spcl_vap_stats->rx_ok_pkts +=
rx_user_status->mpdu_cnt_fcs_ok;
mon_vdev->spcl_vap_stats.rx_ok_bytes +=
mon_vdev->scan_spcl_vap_stats->rx_ok_bytes +=
rx_user_status->mpdu_ok_byte_count;
mon_vdev->spcl_vap_stats.rx_err_pkts +=
mon_vdev->scan_spcl_vap_stats->rx_err_pkts +=
rx_user_status->mpdu_cnt_fcs_err;
mon_vdev->spcl_vap_stats.rx_err_bytes +=
mon_vdev->scan_spcl_vap_stats->rx_err_bytes +=
rx_user_status->mpdu_err_byte_count;
}
mon_vdev->spcl_vap_stats.rx_mgmt_pkts +=
mon_vdev->scan_spcl_vap_stats->rx_mgmt_pkts +=
ppdu_info->frm_type_info.rx_mgmt_cnt;
mon_vdev->spcl_vap_stats.rx_ctrl_pkts +=
mon_vdev->scan_spcl_vap_stats->rx_ctrl_pkts +=
ppdu_info->frm_type_info.rx_ctrl_cnt;
mon_vdev->spcl_vap_stats.rx_data_pkts +=
mon_vdev->scan_spcl_vap_stats->rx_data_pkts +=
ppdu_info->frm_type_info.rx_data_cnt;
}
#else
static inline void
dp_rx_mon_update_scan_spcl_vap_stats(struct dp_pdev *pdev,
struct hal_rx_ppdu_info *ppdu_info)
{
}
#endif
/**
* dp_rx_mon_status_process_tlv() - Process status TLV in status
@@ -1894,8 +1902,8 @@ 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,
if (mon_pdev->scan_spcl_vap_configured)
dp_rx_mon_update_scan_spcl_vap_stats(pdev,
ppdu_info);
/*

View File

@@ -663,11 +663,15 @@ struct mon_rx_user_info {
uint8_t qos_control_info_valid;
};
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
struct hal_rx_frm_type_info {
uint32_t rx_mgmt_cnt;
uint32_t rx_ctrl_cnt;
uint32_t rx_data_cnt;
};
#else
struct hal_rx_frm_type_info {};
#endif
struct hal_rx_ppdu_info {
struct hal_rx_ppdu_common_info com_info;

View File

@@ -487,6 +487,35 @@ hal_get_mac_addr1(uint8_t *rx_mpdu_start,
}
#endif
#ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
static inline void
hal_update_frame_type_cnt(uint8_t *rx_mpdu_start,
struct hal_rx_ppdu_info *ppdu_info)
{
uint16_t frame_ctrl;
uint8_t fc_type;
if (HAL_RX_GET_FC_VALID(rx_mpdu_start)) {
frame_ctrl = HAL_RX_GET(rx_mpdu_start,
RX_MPDU_INFO_14,
MPDU_FRAME_CONTROL_FIELD);
fc_type = HAL_RX_GET_FRAME_CTRL_TYPE(frame_ctrl);
if (fc_type == HAL_RX_FRAME_CTRL_TYPE_MGMT)
ppdu_info->frm_type_info.rx_mgmt_cnt++;
else if (fc_type == HAL_RX_FRAME_CTRL_TYPE_CTRL)
ppdu_info->frm_type_info.rx_ctrl_cnt++;
else if (fc_type == HAL_RX_FRAME_CTRL_TYPE_DATA)
ppdu_info->frm_type_info.rx_data_cnt++;
}
}
#else
static inline void
hal_update_frame_type_cnt(uint8_t *rx_mpdu_start,
struct hal_rx_ppdu_info *ppdu_info)
{
}
#endif
/**
* hal_rx_status_get_tlv_info() - process receive info TLV
* @rx_tlv_hdr: pointer to TLV header
@@ -1494,21 +1523,8 @@ hal_rx_status_get_tlv_info_generic_li(void *rx_tlv_hdr, void *ppduinfo,
uint8_t *rx_mpdu_start = (uint8_t *)rx_tlv;
uint32_t ppdu_id = HAL_RX_GET_PPDU_ID(rx_mpdu_start);
uint8_t filter_category = 0;
uint16_t frame_ctrl;
uint8_t fc_type;
if (HAL_RX_GET_FC_VALID(rx_mpdu_start)) {
frame_ctrl = HAL_RX_GET(rx_mpdu_start,
RX_MPDU_INFO_14,
MPDU_FRAME_CONTROL_FIELD);
fc_type = HAL_RX_GET_FRAME_CTRL_TYPE(frame_ctrl);
if (fc_type == HAL_RX_FRAME_CTRL_TYPE_MGMT)
ppdu_info->frm_type_info.rx_mgmt_cnt++;
else if (fc_type == HAL_RX_FRAME_CTRL_TYPE_CTRL)
ppdu_info->frm_type_info.rx_ctrl_cnt++;
else if (fc_type == HAL_RX_FRAME_CTRL_TYPE_DATA)
ppdu_info->frm_type_info.rx_data_cnt++;
}
hal_update_frame_type_cnt(rx_mpdu_start, ppdu_info);
ppdu_info->nac_info.fc_valid =
HAL_RX_GET_FC_VALID(rx_mpdu_start);