xref: /wlan-driver/qca-wifi-host-cmn/umac/wifi_pos/inc/wifi_pos_ucfg_i.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017, 2020 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: wifi_pos_ucfg_i.h
22  * This file prototyps the important functions pertinent to wifi positioning
23  * component.
24  */
25 
26 #ifndef _WIFI_POS_UCFG_H_
27 #define _WIFI_POS_UCFG_H_
28 
29 #include "qdf_types.h"
30 #include "qdf_status.h"
31 #include "os_if_wifi_pos_utils.h"
32 #include "wifi_pos_pasn_api.h"
33 #include "wifi_pos_api.h"
34 
35 struct wlan_objmgr_psoc;
36 struct wifi_pos_req_msg;
37 
38 /**
39  * ucfg_wifi_pos_process_req: ucfg API to be called from HDD/OS_IF to process a
40  * wifi_pos request from userspace
41  * @psoc: pointer to psoc object
42  * @req: wifi_pos request msg
43  * @send_rsp_cb: callback pointer required to send msg to userspace
44  *
45  * Return: status of operation
46  */
47 QDF_STATUS ucfg_wifi_pos_process_req(struct wlan_objmgr_psoc *psoc,
48 				     struct wifi_pos_req_msg *req,
49 				     wifi_pos_send_rsp_handler send_rsp_cb);
50 
51 #ifdef WIFI_POS_CONVERGED
52 /**
53  * ucfg_wifi_pos_register_osif_callbacks() - Register WIFI pos module OSIF
54  * callbacks
55  * @psoc: Pointer to PSOC object
56  * @osif_ops: Pointer to OSIF callbacks
57  *
58  * Return: QDF_STATUS
59  */
60 static inline QDF_STATUS
ucfg_wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc * psoc,struct wifi_pos_osif_ops * osif_ops)61 ucfg_wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
62 				      struct wifi_pos_osif_ops *osif_ops)
63 {
64 	return wifi_pos_register_osif_callbacks(osif_ops);
65 }
66 
67 /**
68  * ucfg_wifi_pos_deregister_osif_callbacks() - De-Register WIFI pos module OSIF
69  * callbacks
70  * @psoc: Pointer to PSOC object
71  *
72  * Return: QDF_STATUS
73  */
74 static inline QDF_STATUS
ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc * psoc)75 ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc *psoc)
76 {
77 	return wifi_pos_register_osif_callbacks(NULL);
78 }
79 #else
80 static inline QDF_STATUS
ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc * psoc)81 ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc *psoc)
82 {
83 	return QDF_STATUS_SUCCESS;
84 }
85 #endif /* WIFI_POS_CONVERGED */
86 
87 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
88 static inline bool
ucfg_wifi_pos_is_ltf_keyseed_required_for_peer(struct wlan_objmgr_peer * peer)89 ucfg_wifi_pos_is_ltf_keyseed_required_for_peer(struct wlan_objmgr_peer *peer)
90 {
91 	return wifi_pos_is_ltf_keyseed_required_for_peer(peer);
92 }
93 
94 static inline
ucfg_wifi_pos_get_rsta_11az_ranging_cap(void)95 uint32_t ucfg_wifi_pos_get_rsta_11az_ranging_cap(void)
96 {
97 	return wifi_pos_get_rsta_11az_ranging_cap();
98 }
99 #endif
100 #endif /* _WIFI_POS_UCFG_H_ */
101