diff --git a/spectral/dispatcher/inc/wlan_spectral_public_structs.h b/spectral/dispatcher/inc/wlan_spectral_public_structs.h index b89c3ae3bc..a99cf02917 100644 --- a/spectral/dispatcher/inc/wlan_spectral_public_structs.h +++ b/spectral/dispatcher/inc/wlan_spectral_public_structs.h @@ -469,6 +469,23 @@ struct spectral_cp_request { }; }; +/** + * struct spectral_data_stats - Spectral data stats + * @spectral_rx_events: Number of Spectral rx events + * @consume_spectral_calls: Number of consume_spectral_report() invocations + * @fill_samp_msg_calls: Number of fill_samp_msg() invocations + * @msgs_ready_for_user: Number of SAMP messages that are ready to be sent to + * user-space + * @msgs_queued_to_user: Number of SAMP messages queued to the user-space + */ +struct spectral_data_stats { + uint32_t spectral_rx_events; + uint32_t consume_spectral_calls; + uint32_t fill_samp_msg_calls; + uint32_t msgs_ready_for_user; + uint32_t msgs_queued_to_user; +}; + #ifndef __KERNEL__ static inline int16_t diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h index 6702d1d26f..a4b3cc4c34 100644 --- a/target_if/spectral/target_if_spectral.h +++ b/target_if/spectral/target_if_spectral.h @@ -1259,6 +1259,7 @@ int get_supported_sscan_bw_pos(enum phy_ch_width sscan_bw); * @supported_bws: Supported sscan bandwidths for all sscan modes and * operating widths * @supported_sscan_bw_list: List of supported sscan widths for all sscan modes + * @data_stats: stats in Spectral data path */ struct target_if_spectral { struct wlan_objmgr_pdev *pdev_obj; @@ -1392,6 +1393,7 @@ struct target_if_spectral { supported_bws[SPECTRAL_SCAN_MODE_MAX][CH_WIDTH_MAX]; /* Whether a given sscan BW is supported on a given smode */ bool supported_sscan_bw_list[SPECTRAL_SCAN_MODE_MAX][CH_WIDTH_MAX]; + struct spectral_data_stats data_stats; }; /** diff --git a/target_if/spectral/target_if_spectral_netlink.c b/target_if/spectral/target_if_spectral_netlink.c index 2b1b3d4636..a144c69d12 100644 --- a/target_if/spectral/target_if_spectral_netlink.c +++ b/target_if/spectral/target_if_spectral_netlink.c @@ -42,12 +42,16 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral, uint16_t dest_det_idx; enum spectral_scan_mode spectral_mode; uint16_t pwr_format; + struct spectral_data_stats *spectral_dp_stats; if (!spectral) { spectral_err_rl("Spectral LMAC object is null"); return QDF_STATUS_E_NULL_VALUE; } + spectral_dp_stats = &spectral->data_stats; + spectral_dp_stats->fill_samp_msg_calls++; + if (!params) { spectral_err_rl("SAMP msg params structure is null"); return QDF_STATUS_E_NULL_VALUE; @@ -281,9 +285,12 @@ target_if_spectral_fill_samp_msg(struct target_if_spectral *spectral, if (spectral_debug_level & DEBUG_SPECTRAL4) target_if_dbg_print_samp_msg(spec_samp_msg); + spectral_dp_stats->msgs_ready_for_user++; if (spectral->send_phy_data(spectral->pdev_obj, - msg_type) == 0) + msg_type) == 0) { spectral->spectral_sent_msg++; + spectral_dp_stats->msgs_queued_to_user++; + } if (spectral->spectral_gen == SPECTRAL_GEN3) reset_160mhz_delivery_state_machine(spectral, spectral_mode); diff --git a/target_if/spectral/target_if_spectral_phyerr.c b/target_if/spectral/target_if_spectral_phyerr.c index 36e48d0190..7cdddf6c32 100644 --- a/target_if/spectral/target_if_spectral_phyerr.c +++ b/target_if/spectral/target_if_spectral_phyerr.c @@ -3445,12 +3445,16 @@ target_if_consume_spectral_report_gen3( bool finite_scan = false; int det = 0; struct sscan_detector_list *det_list; + struct spectral_data_stats *spectral_dp_stats; if (!spectral) { spectral_err_rl("Spectral LMAC object is null"); goto fail_no_print; } + spectral_dp_stats = &spectral->data_stats; + spectral_dp_stats->consume_spectral_calls++; + if (!report) { spectral_err_rl("Spectral report is null"); goto fail_no_print; @@ -4041,6 +4045,7 @@ int target_if_spectral_process_report_gen3( struct target_if_spectral *spectral; struct spectral_report report; int samp_msg_index; + struct spectral_data_stats *spectral_dp_stats; spectral = get_target_if_spectral_handle_from_pdev(pdev); if (!spectral) { @@ -4048,6 +4053,9 @@ int target_if_spectral_process_report_gen3( return -EINVAL; } + spectral_dp_stats = &spectral->data_stats; + spectral_dp_stats->spectral_rx_events++; + report.data = payload->vaddr; if (payload->meta_data_valid) { qdf_mem_copy(report.noisefloor, payload->meta_data.noisefloor,