1*5113495bSYour Name /* 2*5113495bSYour Name * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. 3*5113495bSYour Name * Copyright (c) 2021,2023 Qualcomm Innovation Center, Inc. All rights reserved. 4*5113495bSYour Name * 5*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for any 6*5113495bSYour Name * purpose with or without fee is hereby granted, provided that the above 7*5113495bSYour Name * copyright notice and this permission notice appear in all copies. 8*5113495bSYour Name * 9*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10*5113495bSYour Name * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11*5113495bSYour Name * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12*5113495bSYour Name * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13*5113495bSYour Name * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14*5113495bSYour Name * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15*5113495bSYour Name * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16*5113495bSYour Name */ 17*5113495bSYour Name /** 18*5113495bSYour Name * DOC: Implement API's specific to cp stats component. 19*5113495bSYour Name */ 20*5113495bSYour Name 21*5113495bSYour Name #ifndef _WMI_UNIFIED_CP_STATS_API_H_ 22*5113495bSYour Name #define _WMI_UNIFIED_CP_STATS_API_H_ 23*5113495bSYour Name 24*5113495bSYour Name #ifdef QCA_SUPPORT_MC_CP_STATS 25*5113495bSYour Name #include <wmi_unified_mc_cp_stats_api.h> 26*5113495bSYour Name #endif 27*5113495bSYour Name #include <wlan_cp_stats_public_structs.h> 28*5113495bSYour Name 29*5113495bSYour Name #if defined(WLAN_SUPPORT_INFRA_CTRL_PATH_STATS) || \ 30*5113495bSYour Name defined(WLAN_CONFIG_TELEMETRY_AGENT) 31*5113495bSYour Name /** 32*5113495bSYour Name * wmi_unified_infra_cp_stats_request_send() - WMI request infra_cp_stats 33*5113495bSYour Name * function 34*5113495bSYour Name * @wmi_handle: wmi handle 35*5113495bSYour Name * @param: pointer to hold infra_cp_stats request parameters 36*5113495bSYour Name * 37*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error 38*5113495bSYour Name * codes on failure 39*5113495bSYour Name */ 40*5113495bSYour Name QDF_STATUS 41*5113495bSYour Name wmi_unified_infra_cp_stats_request_send( 42*5113495bSYour Name wmi_unified_t wmi_handle, 43*5113495bSYour Name struct infra_cp_stats_cmd_info *param); 44*5113495bSYour Name 45*5113495bSYour Name /** 46*5113495bSYour Name * wmi_unified_extract_infra_cp_stats() - extract various infra cp statistics 47*5113495bSYour Name * @wmi_handle: wmi handle 48*5113495bSYour Name * @evt_buf: event buffer 49*5113495bSYour Name * @evt_buf_len: length of event buffer 50*5113495bSYour Name * @params: pointer to store the extracted event info 51*5113495bSYour Name * 52*5113495bSYour Name * This function extracts the infra cp statistics from the event 53*5113495bSYour Name * 54*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 55*5113495bSYour Name */ 56*5113495bSYour Name QDF_STATUS 57*5113495bSYour Name wmi_unified_extract_infra_cp_stats(wmi_unified_t wmi_handle, 58*5113495bSYour Name void *evt_buf, uint32_t evt_buf_len, 59*5113495bSYour Name struct infra_cp_stats_event *params); 60*5113495bSYour Name 61*5113495bSYour Name /** 62*5113495bSYour Name * wmi_stats_handler() - parse the wmi event and fill the stats values 63*5113495bSYour Name * @wmi_handle: wmi handle 64*5113495bSYour Name * @buff: Buffer containing wmi event 65*5113495bSYour Name * @len: length of event buffer 66*5113495bSYour Name * @params: buffer to hold parameters extracted from response event 67*5113495bSYour Name * 68*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success, else other qdf error values 69*5113495bSYour Name */ 70*5113495bSYour Name QDF_STATUS wmi_stats_handler(wmi_unified_t wmi_handle, void *buff, int32_t len, 71*5113495bSYour Name struct infra_cp_stats_event *params); 72*5113495bSYour Name 73*5113495bSYour Name QDF_STATUS 74*5113495bSYour Name extract_infra_cp_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf, 75*5113495bSYour Name uint32_t evt_buf_len, 76*5113495bSYour Name struct infra_cp_stats_event *params); 77*5113495bSYour Name #endif /* WLAN_SUPPORT_INFRA_CTRL_PATH_STATS */ 78*5113495bSYour Name 79*5113495bSYour Name /** 80*5113495bSYour Name * wmi_unified_stats_request_send() - WMI request stats function 81*5113495bSYour Name * @wmi_handle: handle to WMI 82*5113495bSYour Name * @macaddr: MAC address 83*5113495bSYour Name * @param: pointer to hold stats request parameter 84*5113495bSYour Name * 85*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 86*5113495bSYour Name */ 87*5113495bSYour Name QDF_STATUS wmi_unified_stats_request_send(wmi_unified_t wmi_handle, 88*5113495bSYour Name uint8_t macaddr[QDF_MAC_ADDR_SIZE], 89*5113495bSYour Name struct stats_request_params *param); 90*5113495bSYour Name 91*5113495bSYour Name #ifdef WLAN_FEATURE_BIG_DATA_STATS 92*5113495bSYour Name /** 93*5113495bSYour Name * wmi_unified_big_data_stats_request_send() - WMI request big data stats 94*5113495bSYour Name * function 95*5113495bSYour Name * @wmi_handle: handle to WMI 96*5113495bSYour Name * @param: pointer to hold stats request parameter 97*5113495bSYour Name * 98*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 99*5113495bSYour Name */ 100*5113495bSYour Name QDF_STATUS 101*5113495bSYour Name wmi_unified_big_data_stats_request_send(wmi_unified_t wmi_handle, 102*5113495bSYour Name struct stats_request_params *param); 103*5113495bSYour Name #endif 104*5113495bSYour Name 105*5113495bSYour Name /** 106*5113495bSYour Name * wmi_extract_stats_param() - extract all stats count from event 107*5113495bSYour Name * @wmi_handle: wmi handle 108*5113495bSYour Name * @evt_buf: pointer to event buffer 109*5113495bSYour Name * @stats_param: Pointer to hold stats count 110*5113495bSYour Name * 111*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 112*5113495bSYour Name */ 113*5113495bSYour Name QDF_STATUS 114*5113495bSYour Name wmi_extract_stats_param(wmi_unified_t wmi_handle, void *evt_buf, 115*5113495bSYour Name wmi_host_stats_event *stats_param); 116*5113495bSYour Name 117*5113495bSYour Name /** 118*5113495bSYour Name * wmi_extract_pdev_stats() - extract pdev stats from event 119*5113495bSYour Name * @wmi_handle: wmi handle 120*5113495bSYour Name * @evt_buf: pointer to event buffer 121*5113495bSYour Name * @index: Index into pdev stats 122*5113495bSYour Name * @pdev_stats: Pointer to hold pdev stats 123*5113495bSYour Name * 124*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 125*5113495bSYour Name */ 126*5113495bSYour Name QDF_STATUS 127*5113495bSYour Name wmi_extract_pdev_stats(wmi_unified_t wmi_handle, void *evt_buf, 128*5113495bSYour Name uint32_t index, wmi_host_pdev_stats *pdev_stats); 129*5113495bSYour Name 130*5113495bSYour Name /** 131*5113495bSYour Name * wmi_extract_vdev_stats() - extract vdev stats from event 132*5113495bSYour Name * @wmi_handle: wmi handle 133*5113495bSYour Name * @evt_buf: pointer to event buffer 134*5113495bSYour Name * @index: Index into vdev stats 135*5113495bSYour Name * @vdev_stats: Pointer to hold vdev stats 136*5113495bSYour Name * 137*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 138*5113495bSYour Name */ 139*5113495bSYour Name QDF_STATUS 140*5113495bSYour Name wmi_extract_vdev_stats(wmi_unified_t wmi_handle, void *evt_buf, 141*5113495bSYour Name uint32_t index, wmi_host_vdev_stats *vdev_stats); 142*5113495bSYour Name 143*5113495bSYour Name /** 144*5113495bSYour Name * wmi_extract_peer_stats() - extract peer stats from event 145*5113495bSYour Name * @wmi_handle: wmi handle 146*5113495bSYour Name * @evt_buf: pointer to event buffer 147*5113495bSYour Name * @index: Index into peer stats 148*5113495bSYour Name * @peer_stats: Pointer to hold peer stats 149*5113495bSYour Name * 150*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 151*5113495bSYour Name */ 152*5113495bSYour Name QDF_STATUS 153*5113495bSYour Name wmi_extract_peer_stats(wmi_unified_t wmi_handle, void *evt_buf, 154*5113495bSYour Name uint32_t index, wmi_host_peer_stats *peer_stats); 155*5113495bSYour Name 156*5113495bSYour Name /** 157*5113495bSYour Name * wmi_extract_peer_extd_stats() - extract extended peer stats from event 158*5113495bSYour Name * @wmi_handle: wmi handle 159*5113495bSYour Name * @evt_buf: pointer to event buffer 160*5113495bSYour Name * @index: Index into extended peer stats 161*5113495bSYour Name * @peer_extd_stats: Pointer to hold extended peer stats 162*5113495bSYour Name * 163*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 164*5113495bSYour Name */ 165*5113495bSYour Name QDF_STATUS 166*5113495bSYour Name wmi_extract_peer_extd_stats(wmi_unified_t wmi_handle, void *evt_buf, 167*5113495bSYour Name uint32_t index, 168*5113495bSYour Name wmi_host_peer_extd_stats *peer_extd_stats); 169*5113495bSYour Name 170*5113495bSYour Name #ifdef WLAN_FEATURE_SON 171*5113495bSYour Name /** 172*5113495bSYour Name * wmi_extract_inst_rssi_stats_resp() - extract inst rssi stats from event 173*5113495bSYour Name * @wmi_handle: wmi handle 174*5113495bSYour Name * @evt_buf: pointer to event buffer 175*5113495bSYour Name * @inst_rssi_resp: pointer to hold inst rssi stats 176*5113495bSYour Name * 177*5113495bSYour Name * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure 178*5113495bSYour Name */ 179*5113495bSYour Name QDF_STATUS 180*5113495bSYour Name wmi_extract_inst_rssi_stats_resp(wmi_unified_t wmi_handle, void *evt_buf, 181*5113495bSYour Name struct wmi_host_inst_rssi_stats_resp *inst_rssi_resp); 182*5113495bSYour Name #endif 183*5113495bSYour Name #endif /* _WMI_UNIFIED_CP_STATS_API_H_ */ 184