diff --git a/core/hdd/src/wlan_hdd_debugfs_llstat.c b/core/hdd/src/wlan_hdd_debugfs_llstat.c index f5557d673b77..e4ab8708f231 100644 --- a/core/hdd/src/wlan_hdd_debugfs_llstat.c +++ b/core/hdd/src/wlan_hdd_debugfs_llstat.c @@ -41,7 +41,7 @@ static DEFINE_MUTEX(llstats_mutex); void hdd_debugfs_process_iface_stats(struct hdd_adapter *adapter, void *data, uint32_t num_peers) { - tpSirWifiIfaceStat iface_stat; + struct wifi_interface_stats *iface_stat; struct wifi_interface_info *iface_info; wmi_iface_link_stats *link_stats; wmi_wmm_ac_stats *ac_stats; diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 503d5444eb38..aa8891722b91 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -419,7 +419,7 @@ static bool put_wifi_interface_info(struct wifi_interface_info *stats, * * Return: bool */ -static bool put_wifi_iface_stats(tpSirWifiIfaceStat if_stat, +static bool put_wifi_iface_stats(struct wifi_interface_stats *if_stat, u32 num_peers, struct sk_buff *vendor_event) { int i = 0; @@ -716,9 +716,10 @@ static void hdd_link_layer_process_peer_stats(struct hdd_adapter *adapter, * * Return: None */ -static void hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter, - tpSirWifiIfaceStat if_stat, - u32 num_peers) +static void +hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter, + struct wifi_interface_stats *if_stat, + u32 num_peers) { struct sk_buff *vendor_event; struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); @@ -732,7 +733,7 @@ static void hdd_link_layer_process_iface_stats(struct hdd_adapter *adapter, /* * Allocate a size of 4096 for the interface stats comprising - * sizeof (tpSirWifiIfaceStat).The size of 4096 is considered + * sizeof (struct wifi_interface_stats *).The size of 4096 is considered * assuming that all these fit with in the limit.Please take * a call on the limit based on the data requirements on * interface statistics. @@ -1041,14 +1042,13 @@ static void hdd_ll_process_radio_stats(struct hdd_adapter *adapter, * Return: None */ static void hdd_ll_process_iface_stats(struct hdd_adapter *adapter, - void *data, uint32_t num_peers, uint32_t resp_id) + void *data, uint32_t num_peers, + uint32_t resp_id) { if (DEBUGFS_LLSTATS_REQID == resp_id) - hdd_debugfs_process_iface_stats(adapter, - (tpSirWifiIfaceStat) data, num_peers); + hdd_debugfs_process_iface_stats(adapter, data, num_peers); else - hdd_link_layer_process_iface_stats(adapter, - (tpSirWifiIfaceStat) data, num_peers); + hdd_link_layer_process_iface_stats(adapter, data, num_peers); } /** diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index d73ded22c072..567424425ca3 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3696,27 +3696,32 @@ struct wifi_peer_info { struct wifi_rate_stat rate_stats[0]; }; -/* Interface statistics - corresponding to 2nd most - * LSB in wifi statistics bitmap for getting statistics +/** + * struct wifi_interface_stats - Interface statistics + * @info: struct containing the current state of the interface + * @rts_succ_cnt: number of RTS/CTS sequence success + * @rts_fail_cnt: number of RTS/CTS sequence failures + * @ppdu_succ_cnt: number of PPDUs transmitted + * @ppdu_fail_cnt: number of PPDUs that failed to transmit + * @link_stats: link-level statistics + * @ac_stats: per-Access Category statistics + * @num_offload_stats: @offload_stats record count + * @offload_stats: per-offload statistics + * + * Statistics corresponding to 2nd most LSB in wifi statistics bitmap + * for getting statistics */ -typedef struct { - /* current state of the interface */ +struct wifi_interface_stats { struct wifi_interface_info info; - uint32_t rts_succ_cnt; uint32_t rts_fail_cnt; uint32_t ppdu_succ_cnt; uint32_t ppdu_fail_cnt; - - /* link statistics */ wmi_iface_link_stats link_stats; - - /* per ac data packet statistics */ wmi_wmm_ac_stats ac_stats[WIFI_AC_MAX]; - uint32_t num_offload_stats; wmi_iface_offload_stats offload_stats[WMI_OFFLOAD_STATS_TYPE_MAX]; -} tSirWifiIfaceStat, *tpSirWifiIfaceStat; +}; /** * struct wifi_peer_stat - peer statistics @@ -3916,7 +3921,7 @@ struct sir_wifi_ll_ext_wmm_ac_stats { * struct sir_wifi_ll_ext_peer_stats - per peer stats * @peer_id: peer ID * @vdev_id: VDEV ID - * mac_address: MAC address + * @mac_address: MAC address * @sta_ps_inds: how many times STAs go to sleep * @sta_ps_durs: total sleep time of STAs (units in ms) * @rx_probe_reqs: number of probe requests received diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 651445821173..89c3b4e7ee00 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -2149,7 +2149,7 @@ int wma_unified_link_iface_stats_event_handler(void *handle, wmi_wmm_ac_stats *ac_stats, *iface_ac_stats; wmi_iface_offload_stats *offload_stats, *iface_offload_stats; tSirLLStatsResults *link_stats_results; - tSirWifiIfaceStat *iface_stat; + struct wifi_interface_stats *iface_stat; uint32_t count; size_t link_stats_size, ac_stats_size, iface_info_size; size_t link_stats_results_size, offload_stats_size; @@ -2205,7 +2205,7 @@ int wma_unified_link_iface_stats_event_handler(void *handle, return -EINVAL; } - link_stats_size = sizeof(tSirWifiIfaceStat); + link_stats_size = sizeof(struct wifi_interface_stats); iface_info_size = sizeof(struct wifi_interface_info); ac_stats_size = sizeof(wmi_wmm_ac_stats); @@ -2213,7 +2213,8 @@ int wma_unified_link_iface_stats_event_handler(void *handle, total_ac_size = ac_stats_size * WIFI_AC_MAX; total_offload_size = offload_stats_size * WMI_OFFLOAD_STATS_TYPE_MAX + - member_size(tSirWifiIfaceStat, num_offload_stats); + member_size(struct wifi_interface_stats, + num_offload_stats); link_stats_results_size = sizeof(*link_stats_results) + link_stats_size; @@ -2230,17 +2231,18 @@ int wma_unified_link_iface_stats_event_handler(void *handle, link_stats_results->peer_event_number = 0; link_stats_results->moreResultToFollow = 0; - /* results is copied to tSirWifiIfaceStat in upper layer - * tSirWifiIfaceStat + /* results is copied to struct wifi_interface_stats in upper layer + * struct wifi_interface_stats * - struct wifi_interface_info (all fields except roaming is * filled by host in the upper layer) - * - various members of tSirWifiIfaceStat (from wmi_iface_link_stats) + * - various members of struct wifi_interface_stats (from + * wmi_iface_link_stats) * - ACs information (from wmi_wmm_ac_stats) * - num_offload_stats (from fixed param) * - offload stats (from wmi_iface_offload_stats) */ - iface_stat = (tSirWifiIfaceStat *)link_stats_results->results; + iface_stat = (struct wifi_interface_stats *)link_stats_results->results; iface_link_stats = &iface_stat->link_stats; *iface_link_stats = *link_stats;