xref: /wlan-dirver/qca-wifi-host-cmn/target_if/wifi_pos/inc/target_if_wifi_pos.h (revision 503663c6daafffe652fa360bde17243568cd6d2a)
1 /*
2  * Copyright (c) 2017, 2019 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_wifi_pos.h
21  * This file declares the functions pertinent to wifi positioning component's
22  * target if layer.
23  */
24 #ifndef _WIFI_POS_TGT_IF_H_
25 #define _WIFI_POS_TGT_IF_H_
26 
27 #include "qdf_types.h"
28 #include "qdf_status.h"
29 struct oem_data_req;
30 struct oem_data_rsp;
31 struct wlan_objmgr_psoc;
32 struct wlan_soc_southbound_cb;
33 struct wlan_lmac_if_tx_ops;
34 struct wlan_lmac_if_rx_ops;
35 
36 #ifdef WIFI_POS_CONVERGED
37 
38 /**
39  * target_if_wifi_pos_get_rxops: api to get rx ops
40  * @psoc: pointer to psoc object
41  *
42  * Return: rx ops
43  */
44 struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops(
45 						struct wlan_objmgr_psoc *psoc);
46 
47 /**
48  * target_if_wifi_pos_register_events: function to register with wmi event
49  * @psoc: pointer to psoc object
50  *
51  * Return: status of operation
52  */
53 QDF_STATUS target_if_wifi_pos_register_events(struct wlan_objmgr_psoc *psoc);
54 
55 /**
56  * target_if_wifi_pos_deregister_events: function to deregister wmi event
57  * @psoc: pointer to psoc object
58  *
59  * Return: status of operation
60  */
61 QDF_STATUS target_if_wifi_pos_deregister_events(struct wlan_objmgr_psoc *psoc);
62 
63 
64 /**
65  * target_if_wifi_pos_register_tx_ops: function to register with lmac tx ops
66  * @tx_ops: lmac tx ops struct object
67  *
68  * Return: none
69  */
70 void target_if_wifi_pos_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
71 
72 #else
73 static inline struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops(
74 						struct wlan_objmgr_psoc *psoc)
75 {
76 	return NULL;
77 }
78 
79 static inline void target_if_wifi_pos_register_tx_ops(
80 					struct wlan_lmac_if_tx_ops *tx_ops)
81 {
82 }
83 
84 #endif
85 
86 #if defined(WLAN_FEATURE_CIF_CFR) && defined(WIFI_POS_CONVERGED)
87 /**
88  * target_if_wifi_pos_init_cir_cfr_rings: set DMA ring cap in psoc private
89  * object
90  * @psoc: pointer to psoc object
91  * @hal_soc: pointer to hal soc
92  * @num_mac: number of mac
93  * @buf: buffer containing DMA ring cap
94  *
95  * Return: status of operation
96  */
97 QDF_STATUS target_if_wifi_pos_init_cir_cfr_rings(struct wlan_objmgr_psoc *psoc,
98 					     void *hal_soc, uint8_t num_mac,
99 					     void *buf);
100 /**
101  * target_if_wifi_pos_deinit_dma_rings: frees up DMA rings
102  * @psoc: pointer to psoc
103  *
104  * Return: status of operation
105  */
106 QDF_STATUS target_if_wifi_pos_deinit_dma_rings(struct wlan_objmgr_psoc *psoc);
107 #else
108 static inline QDF_STATUS target_if_wifi_pos_init_cir_cfr_rings(
109 				struct wlan_objmgr_psoc *psoc, void *hal_soc,
110 				uint8_t num_mac, void *buf)
111 {
112 	return QDF_STATUS_SUCCESS;
113 }
114 
115 static inline QDF_STATUS target_if_wifi_pos_deinit_dma_rings(
116 				struct wlan_objmgr_psoc *psoc)
117 {
118 	return QDF_STATUS_SUCCESS;
119 }
120 #endif
121 
122 #endif /* _WIFI_POS_TGT_IF_H_ */
123