xref: /wlan-driver/qca-wifi-host-cmn/umac/cp_stats/dispatcher/src/wlan_cp_stats_ucfg_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2018, 2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2024 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_ucfg_api.c
22  *
23  * This file provide API definitions required for northbound interaction
24  */
25 
26 #include <wlan_cp_stats_utils_api.h>
27 #include <wlan_cp_stats_ucfg_api.h>
28 #include "../../core/src/wlan_cp_stats_obj_mgr_handler.h"
29 #include <wlan_cp_stats_chipset_stats.h>
30 
31 #ifdef WLAN_SUPPORT_INFRA_CTRL_PATH_STATS
32 QDF_STATUS
ucfg_infra_cp_stats_register_resp_cb(struct wlan_objmgr_psoc * psoc,struct infra_cp_stats_cmd_info * req)33 ucfg_infra_cp_stats_register_resp_cb(struct wlan_objmgr_psoc *psoc,
34 				     struct infra_cp_stats_cmd_info *req)
35 {
36 	return wlan_cp_stats_infra_cp_register_resp_cb(psoc, req);
37 }
38 
39 QDF_STATUS
ucfg_infra_cp_stats_deregister_resp_cb(struct wlan_objmgr_psoc * psoc)40 ucfg_infra_cp_stats_deregister_resp_cb(struct wlan_objmgr_psoc *psoc)
41 {
42 	return wlan_cp_stats_infra_cp_deregister_resp_cb(psoc);
43 }
44 
45 QDF_STATUS
ucfg_send_infra_cp_stats_request(struct wlan_objmgr_vdev * vdev,struct infra_cp_stats_cmd_info * req)46 ucfg_send_infra_cp_stats_request(struct wlan_objmgr_vdev *vdev,
47 				 struct infra_cp_stats_cmd_info *req)
48 {
49 	return wlan_cp_stats_send_infra_cp_req(wlan_vdev_get_psoc(vdev), req);
50 }
51 #endif /* WLAN_SUPPORT_INFRA_CTRL_PATH_STATS */
52 
53 #ifdef WLAN_CONFIG_TELEMETRY_AGENT
54 QDF_STATUS
ucfg_send_telemetry_cp_stats_request(struct wlan_objmgr_pdev * pdev,struct infra_cp_stats_cmd_info * req)55 ucfg_send_telemetry_cp_stats_request(struct wlan_objmgr_pdev *pdev,
56 				     struct infra_cp_stats_cmd_info *req)
57 {
58 	return wlan_cp_stats_send_telemetry_cp_req(pdev, req);
59 }
60 
61 qdf_export_symbol(ucfg_send_telemetry_cp_stats_request);
62 #endif
63 
64 #if defined(WLAN_SUPPORT_TWT) && defined (WLAN_TWT_CONV_SUPPORTED)
ucfg_cp_stats_twt_get_peer_session_params(struct wlan_objmgr_psoc * psoc_obj,struct twt_session_stats_info * params)65 int ucfg_cp_stats_twt_get_peer_session_params(
66 					struct wlan_objmgr_psoc *psoc_obj,
67 					struct twt_session_stats_info *params)
68 {
69 	return wlan_cp_stats_twt_get_peer_session_params(psoc_obj, params);
70 }
71 
72 #ifdef WLAN_CHIPSET_STATS
ucfg_cp_stats_get_chipset_stats_enable(struct wlan_objmgr_psoc * psoc)73 bool ucfg_cp_stats_get_chipset_stats_enable(struct wlan_objmgr_psoc *psoc)
74 {
75 	return wlan_cp_stats_get_chipset_stats_enable(psoc);
76 }
77 #endif
78 #endif
79 
ucfg_cp_stats_cstats_register_tx_rx_ops(struct cstats_tx_rx_ops * ops)80 void ucfg_cp_stats_cstats_register_tx_rx_ops(struct cstats_tx_rx_ops *ops)
81 {
82 	wlan_cp_stats_cstats_register_tx_rx_ops(ops);
83 }
84 
ucfg_cp_stats_cstats_send_buffer_to_user(enum cstats_types type)85 int ucfg_cp_stats_cstats_send_buffer_to_user(enum cstats_types type)
86 {
87 	return wlan_cp_stats_cstats_send_buffer_to_user(type);
88 }
89