1 /* 2 * Copyright (c) 2018, 2021 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved. 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /** 21 * DOC: wlan_cp_stats_mc_tgt_api.h 22 * 23 * This header file provide with API declarations to interface with Southbound 24 */ 25 #ifndef __WLAN_CP_STATS_MC_TGT_API_H__ 26 #define __WLAN_CP_STATS_MC_TGT_API_H__ 27 28 #ifdef QCA_SUPPORT_CP_STATS 29 #include "wlan_cp_stats_mc_defs.h" 30 31 //TODO - Check if this is true for hamilton 32 #ifdef QCA_WIFI_QCA6490 33 #define TGT_MAC_ID_24G 2 34 #define TGT_MAC_ID_5G 1 35 #else 36 #define TGT_MAC_ID_24G 0 37 #define TGT_MAC_ID_5G 0 38 #endif 39 40 /** 41 * target_if_mc_cp_get_mac_id(): API to get mac id 42 * @vdev_mlme: vdev mlme pointer 43 * 44 * Return: mac id 45 */ 46 uint8_t target_if_mc_cp_get_mac_id(struct vdev_mlme_obj *vdev_mlme); 47 48 /** 49 * tgt_mc_cp_stats_process_stats_event(): API to process stats event 50 * @psoc: pointer to psoc object 51 * @ev: event parameters 52 * 53 * Return: QDF_STATUS_SUCCESS on Success, other QDF_STATUS error codes on 54 * failure 55 */ 56 QDF_STATUS 57 tgt_mc_cp_stats_process_stats_event(struct wlan_objmgr_psoc *psoc, 58 struct stats_event *ev); 59 60 #ifdef WLAN_SUPPORT_INFRA_CTRL_PATH_STATS 61 /** 62 * tgt_mc_cp_stats_process_infra_stats_event(): API to process event from 63 * cp stats infrastructure 64 * @psoc: pointer to psoc object 65 * @infra_event: infra cp stats event parameters 66 * 67 * Return: status of operation 68 */ 69 QDF_STATUS tgt_mc_cp_stats_process_infra_stats_event( 70 struct wlan_objmgr_psoc *psoc, 71 struct infra_cp_stats_event *infra_event); 72 73 #endif 74 75 #ifdef WLAN_FEATURE_BIG_DATA_STATS 76 /** 77 * tgt_mc_cp_stats_process_big_data_stats_event(): API to process big data 78 * stats event 79 * @psoc: pointer to psoc object 80 * @event: big data stats event parameters 81 * 82 * Return: status of operation 83 */ 84 QDF_STATUS 85 tgt_mc_cp_stats_process_big_data_stats_event( 86 struct wlan_objmgr_psoc *psoc, 87 struct big_data_stats_event *event); 88 #endif 89 90 /** 91 * tgt_send_mc_cp_stats_req(): API to send stats request to lmac 92 * @psoc: pointer to psoc object 93 * @type: specific type of stats requested 94 * @req: pointer to stats request 95 * 96 * Return: status of operation 97 */ 98 QDF_STATUS tgt_send_mc_cp_stats_req(struct wlan_objmgr_psoc *psoc, 99 enum stats_req_type type, 100 struct request_info *req); 101 102 /** 103 * tgt_set_pdev_stats_update_period(): API to set pdev stats update 104 * period to FW 105 * @psoc: pointer to psoc object 106 * @pdev_id: pdev id 107 * @val: pdev stats update period, 0: disabled periodical stats report. 108 * 109 * Return: status of operation 110 */ 111 QDF_STATUS tgt_set_pdev_stats_update_period(struct wlan_objmgr_psoc *psoc, 112 uint8_t pdev_id, uint32_t val); 113 114 /** 115 * tgt_mc_cp_stats_inc_wake_lock_stats() : API to increment wake lock stats 116 * given the wake reason code 117 * @psoc: pointer to psoc object 118 * @reason: wake reason 119 * @stats: vdev wow stats to update 120 * @unspecified_wake_count: unspecified wake count to update 121 * 122 * Return : status of operation 123 */ 124 QDF_STATUS tgt_mc_cp_stats_inc_wake_lock_stats(struct wlan_objmgr_psoc *psoc, 125 uint32_t reason, struct wake_lock_stats *stats, 126 uint32_t *unspecified_wake_count); 127 128 #endif /* QCA_SUPPORT_CP_STATS */ 129 #endif /* __WLAN_CP_STATS_MC_TGT_API_H__ */ 130