xref: /wlan-dirver/qca-wifi-host-cmn/target_if/cp_stats/src/target_if_cp_stats.c (revision 6ecd284e5a94a1c96e26d571dd47419ac305990d)
1 /*
2  * Copyright (c) 2018 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 /**
20  * DOC: target_if_cp_stats.c
21  *
22  * This file provide definition for APIs registered through lmac Tx Ops
23  */
24 
25 #include <qdf_mem.h>
26 #include <qdf_status.h>
27 #include <target_if_cp_stats.h>
28 #include <wmi_unified_priv.h>
29 #include <wmi_unified_param.h>
30 #include <target_if.h>
31 #include <wlan_tgt_def_config.h>
32 #include <wmi_unified_api.h>
33 #include <wlan_osif_priv.h>
34 #include <wlan_cp_stats_utils_api.h>
35 
36 static QDF_STATUS
37 target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)
38 {
39 	if (!psoc) {
40 		cp_stats_err("PSOC is NULL!");
41 		return QDF_STATUS_E_INVAL;
42 	}
43 
44 	return QDF_STATUS_SUCCESS;
45 }
46 
47 static QDF_STATUS
48 target_if_cp_stats_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
49 {
50 	if (!psoc) {
51 		cp_stats_err("PSOC is NULL!");
52 		return QDF_STATUS_E_INVAL;
53 	}
54 
55 	return QDF_STATUS_SUCCESS;
56 }
57 
58 QDF_STATUS
59 target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
60 {
61 	struct wlan_lmac_if_cp_stats_tx_ops *cp_stats_tx_ops;
62 
63 	if (!tx_ops) {
64 		cp_stats_err("lmac tx ops is NULL!");
65 		return QDF_STATUS_E_INVAL;
66 	}
67 
68 	cp_stats_tx_ops = &tx_ops->cp_stats_tx_ops;
69 	if (!cp_stats_tx_ops) {
70 		cp_stats_err("lmac tx ops is NULL!");
71 		return QDF_STATUS_E_FAILURE;
72 	}
73 
74 	cp_stats_tx_ops->cp_stats_attach =
75 		target_if_cp_stats_register_event_handler;
76 	cp_stats_tx_ops->cp_stats_detach =
77 		target_if_cp_stats_unregister_event_handler;
78 
79 	return QDF_STATUS_SUCCESS;
80 }
81 
82 QDF_STATUS
83 target_if_cp_stats_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
84 {
85 	return QDF_STATUS_SUCCESS;
86 }
87