xref: /wlan-driver/qca-wifi-host-cmn/umac/wifi_pos/inc/wifi_pos_ucfg_i.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2017, 2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4*5113495bSYour Name  *
5*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
6*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
7*5113495bSYour Name  * above copyright notice and this permission notice appear in all
8*5113495bSYour Name  * copies.
9*5113495bSYour Name  *
10*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
18*5113495bSYour Name  */
19*5113495bSYour Name 
20*5113495bSYour Name /**
21*5113495bSYour Name  * DOC: wifi_pos_ucfg_i.h
22*5113495bSYour Name  * This file prototyps the important functions pertinent to wifi positioning
23*5113495bSYour Name  * component.
24*5113495bSYour Name  */
25*5113495bSYour Name 
26*5113495bSYour Name #ifndef _WIFI_POS_UCFG_H_
27*5113495bSYour Name #define _WIFI_POS_UCFG_H_
28*5113495bSYour Name 
29*5113495bSYour Name #include "qdf_types.h"
30*5113495bSYour Name #include "qdf_status.h"
31*5113495bSYour Name #include "os_if_wifi_pos_utils.h"
32*5113495bSYour Name #include "wifi_pos_pasn_api.h"
33*5113495bSYour Name #include "wifi_pos_api.h"
34*5113495bSYour Name 
35*5113495bSYour Name struct wlan_objmgr_psoc;
36*5113495bSYour Name struct wifi_pos_req_msg;
37*5113495bSYour Name 
38*5113495bSYour Name /**
39*5113495bSYour Name  * ucfg_wifi_pos_process_req: ucfg API to be called from HDD/OS_IF to process a
40*5113495bSYour Name  * wifi_pos request from userspace
41*5113495bSYour Name  * @psoc: pointer to psoc object
42*5113495bSYour Name  * @req: wifi_pos request msg
43*5113495bSYour Name  * @send_rsp_cb: callback pointer required to send msg to userspace
44*5113495bSYour Name  *
45*5113495bSYour Name  * Return: status of operation
46*5113495bSYour Name  */
47*5113495bSYour Name QDF_STATUS ucfg_wifi_pos_process_req(struct wlan_objmgr_psoc *psoc,
48*5113495bSYour Name 				     struct wifi_pos_req_msg *req,
49*5113495bSYour Name 				     wifi_pos_send_rsp_handler send_rsp_cb);
50*5113495bSYour Name 
51*5113495bSYour Name #ifdef WIFI_POS_CONVERGED
52*5113495bSYour Name /**
53*5113495bSYour Name  * ucfg_wifi_pos_register_osif_callbacks() - Register WIFI pos module OSIF
54*5113495bSYour Name  * callbacks
55*5113495bSYour Name  * @psoc: Pointer to PSOC object
56*5113495bSYour Name  * @osif_ops: Pointer to OSIF callbacks
57*5113495bSYour Name  *
58*5113495bSYour Name  * Return: QDF_STATUS
59*5113495bSYour Name  */
60*5113495bSYour Name static inline QDF_STATUS
ucfg_wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc * psoc,struct wifi_pos_osif_ops * osif_ops)61*5113495bSYour Name ucfg_wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
62*5113495bSYour Name 				      struct wifi_pos_osif_ops *osif_ops)
63*5113495bSYour Name {
64*5113495bSYour Name 	return wifi_pos_register_osif_callbacks(osif_ops);
65*5113495bSYour Name }
66*5113495bSYour Name 
67*5113495bSYour Name /**
68*5113495bSYour Name  * ucfg_wifi_pos_deregister_osif_callbacks() - De-Register WIFI pos module OSIF
69*5113495bSYour Name  * callbacks
70*5113495bSYour Name  * @psoc: Pointer to PSOC object
71*5113495bSYour Name  *
72*5113495bSYour Name  * Return: QDF_STATUS
73*5113495bSYour Name  */
74*5113495bSYour Name static inline QDF_STATUS
ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc * psoc)75*5113495bSYour Name ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc *psoc)
76*5113495bSYour Name {
77*5113495bSYour Name 	return wifi_pos_register_osif_callbacks(NULL);
78*5113495bSYour Name }
79*5113495bSYour Name #else
80*5113495bSYour Name static inline QDF_STATUS
ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc * psoc)81*5113495bSYour Name ucfg_wifi_pos_deregister_osif_callbacks(struct wlan_objmgr_psoc *psoc)
82*5113495bSYour Name {
83*5113495bSYour Name 	return QDF_STATUS_SUCCESS;
84*5113495bSYour Name }
85*5113495bSYour Name #endif /* WIFI_POS_CONVERGED */
86*5113495bSYour Name 
87*5113495bSYour Name #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
88*5113495bSYour Name static inline bool
ucfg_wifi_pos_is_ltf_keyseed_required_for_peer(struct wlan_objmgr_peer * peer)89*5113495bSYour Name ucfg_wifi_pos_is_ltf_keyseed_required_for_peer(struct wlan_objmgr_peer *peer)
90*5113495bSYour Name {
91*5113495bSYour Name 	return wifi_pos_is_ltf_keyseed_required_for_peer(peer);
92*5113495bSYour Name }
93*5113495bSYour Name 
94*5113495bSYour Name static inline
ucfg_wifi_pos_get_rsta_11az_ranging_cap(void)95*5113495bSYour Name uint32_t ucfg_wifi_pos_get_rsta_11az_ranging_cap(void)
96*5113495bSYour Name {
97*5113495bSYour Name 	return wifi_pos_get_rsta_11az_ranging_cap();
98*5113495bSYour Name }
99*5113495bSYour Name #endif
100*5113495bSYour Name #endif /* _WIFI_POS_UCFG_H_ */
101