1 /* 2 * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for any 6 * purpose with or without fee is hereby granted, provided that the above 7 * copyright notice and this permission notice appear in all copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 */ 17 /** 18 * DOC: Implement API's specific to control path stats component. 19 */ 20 21 #ifndef _WMI_UNIFIED_MC_CP_STATS_API_H_ 22 #define _WMI_UNIFIED_MC_CP_STATS_API_H_ 23 24 #include <wlan_cp_stats_mc_defs.h> 25 26 /** 27 * wmi_extract_per_chain_rssi_stats() - extract rssi stats from event 28 * @wmi_handle: wmi handle 29 * @evt_buf: pointer to event buffer 30 * @index: Index into rssi stats 31 * @rssi_stats: Pointer to hold rssi stats 32 * 33 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 34 */ 35 QDF_STATUS 36 wmi_extract_per_chain_rssi_stats(wmi_unified_t wmi_handle, void *evt_buf, 37 uint32_t index, 38 struct wmi_host_per_chain_rssi_stats *rssi_stats); 39 40 /** 41 * wmi_extract_peer_adv_stats() - extract advance (extd2) peer stats from event 42 * @wmi_handle: wmi handle 43 * @evt_buf: pointer to event buffer 44 * @peer_adv_stats: Pointer to hold extended peer stats 45 * 46 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 47 */ 48 QDF_STATUS 49 wmi_extract_peer_adv_stats(wmi_unified_t wmi_handle, void *evt_buf, 50 struct wmi_host_peer_adv_stats *peer_adv_stats); 51 52 #ifdef WLAN_FEATURE_MIB_STATS 53 /** 54 * wmi_extract_mib_stats() - extract mib stats from event 55 * @wmi_handle: wmi handle 56 * @evt_buf: pointer to event buffer 57 * @mib_stats: pointer to hold mib stats 58 * 59 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 60 */ 61 QDF_STATUS wmi_extract_mib_stats(wmi_unified_t wmi_handle, void *evt_buf, 62 struct mib_stats_metrics *mib_stats); 63 #endif 64 65 /** 66 * wmi_unified_peer_stats_request_send() - send peer stats request to fw 67 * @wmi_handle: wmi handle 68 * @param: pointer to peer stats request parameters 69 * 70 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 71 */ 72 QDF_STATUS 73 wmi_unified_peer_stats_request_send(wmi_unified_t wmi_handle, 74 struct peer_stats_request_params *param); 75 76 /** 77 * wmi_extract_peer_stats_param() - extract all stats count from event 78 * @wmi_handle: wmi handle 79 * @evt_buf: pointer to event buffer 80 * @stats_param: Pointer to hold stats count 81 * 82 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 83 */ 84 QDF_STATUS 85 wmi_extract_peer_stats_param(wmi_unified_t wmi_handle, void *evt_buf, 86 wmi_host_stats_event *stats_param); 87 88 /** 89 * wmi_extract_peer_stats_info() - extract peer stats info from event 90 * @wmi_handle: wmi handle 91 * @evt_buf: pointer to event buffer 92 * @index: Index into beacon stats 93 * @peer_stats_info: Pointer to hold peer stats info 94 * 95 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 96 */ 97 QDF_STATUS 98 wmi_extract_peer_stats_info(wmi_unified_t wmi_handle, void *evt_buf, 99 uint32_t index, 100 wmi_host_peer_stats_info *peer_stats_info); 101 102 /** 103 * wmi_extract_peer_tx_pkt_per_mcs() - extract peer tx packets per MCS 104 * from event 105 * @wmi_handle: wmi handle 106 * @evt_buf: pointer to event buffer 107 * @index: Index to tx packets per MCS for current peer 108 * @peer_stats_info: Pointer to hold peer stats info 109 * 110 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 111 */ 112 QDF_STATUS 113 wmi_extract_peer_tx_pkt_per_mcs(wmi_unified_t wmi_handle, void *evt_buf, 114 uint32_t index, 115 wmi_host_peer_stats_info *peer_stats_info); 116 117 /** 118 * wmi_extract_peer_rx_pkt_per_mcs() - extract peer rx packets per MCS 119 * from event 120 * @wmi_handle: wmi handle 121 * @evt_buf: pointer to event buffer 122 * @index: Index to tx rate count for current peer 123 * @peer_stats_info: Pointer to hold peer stats info 124 * 125 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 126 */ 127 QDF_STATUS 128 wmi_extract_peer_rx_pkt_per_mcs(wmi_unified_t wmi_handle, void *evt_buf, 129 uint32_t index, 130 wmi_host_peer_stats_info *peer_stats_info); 131 132 #ifdef WLAN_FEATURE_BIG_DATA_STATS 133 /** 134 * wmi_extract_big_data_stats_param() - extract big data statsfrom event 135 * @wmi_handle: wmi handle 136 * @evt_buf: pointer to event buffer 137 * @stats_param: Pointer to hold stats 138 * 139 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 140 */ 141 QDF_STATUS 142 wmi_extract_big_data_stats_param(wmi_unified_t wmi_handle, void *evt_buf, 143 struct big_data_stats_event *stats_param); 144 #endif 145 146 #endif /* _WMI_UNIFIED_MC_CP_STATS_API_H_ */ 147