From 96afb7f2747c07feee17309e33d1cbc40c8e16b2 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Fri, 13 Apr 2018 16:38:36 -0700 Subject: [PATCH] qcacmn: Add target_if/wmi implementation of get congestion stats Add changes to support get congestion stats(arp stats) from within cp_stats component. Change-Id: Ic3b2f020c0169c9113c1b40738f782cbb3b8f6c5 CRs-Fixed: 2222781 --- wmi_unified_api.h | 14 ++++++++++++++ wmi_unified_param.h | 15 +++++++++++++++ wmi_unified_priv.h | 5 +++++ 3 files changed, 34 insertions(+) diff --git a/wmi_unified_api.h b/wmi_unified_api.h index d087cc4b68..59808cdf60 100644 --- a/wmi_unified_api.h +++ b/wmi_unified_api.h @@ -2252,4 +2252,18 @@ QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl, wmi_host_channel_width wmi_get_ch_width_from_phy_mode(void *wmi_hdl, WMI_HOST_WLAN_PHY_MODE phymode); +#ifdef QCA_SUPPORT_CP_STATS +/** + * wmi_extract_cca_stats() - api to extract congestion stats from event buffer + * @wmi_handle: wma handle + * @evt_buf: event buffer + * @datalen: length of buffer + * @stats: buffer to populated after stats extraction + * + * Return: status of operation + */ +QDF_STATUS wmi_extract_cca_stats(wmi_unified_t wmi_handle, void *evt_buf, + struct wmi_host_congestion_stats *stats); +#endif /* QCA_SUPPORT_CP_STATS */ + #endif /* _WMI_UNIFIED_API_H_ */ diff --git a/wmi_unified_param.h b/wmi_unified_param.h index 73c19aa940..6dc74be636 100644 --- a/wmi_unified_param.h +++ b/wmi_unified_param.h @@ -8391,4 +8391,19 @@ struct wmi_obss_color_collision_info { uint32_t obss_color_bitmap_bit0to31; uint32_t obss_color_bitmap_bit32to63; }; + +#ifdef QCA_SUPPORT_CP_STATS +/** + * struct wmi_host_congestion_stats - host definition of congestion stats + * @vdev_id: ID of the vdev to which this info belongs. + * @congestion: This field holds the congestion percentage = + * (busy_time/total_time)*100 + * for the interval from when the vdev was started to the current time + * (or the time at which the vdev was stopped). + */ +struct wmi_host_congestion_stats { + uint32_t vdev_id; + uint32_t congestion; +}; +#endif #endif /* _WMI_UNIFIED_PARAM_H_ */ diff --git a/wmi_unified_priv.h b/wmi_unified_priv.h index 6a6d122196..56b9ae6dba 100644 --- a/wmi_unified_priv.h +++ b/wmi_unified_priv.h @@ -1616,6 +1616,11 @@ QDF_STATUS (*extract_twt_resume_dialog_comp_event)(wmi_unified_t wmi_handle, uint8_t *evt_buf, struct wmi_twt_resume_dialog_complete_event_param *params); #endif + +#ifdef QCA_SUPPORT_CP_STATS +QDF_STATUS (*extract_cca_stats)(wmi_unified_t wmi_handle, void *evt_buf, + struct wmi_host_congestion_stats *stats); +#endif /* QCA_SUPPORT_CP_STATS */ }; /* Forward declartion for psoc*/