xref: /wlan-driver/qca-wifi-host-cmn/umac/wifi_pos/src/wifi_pos_main_i.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2017, 2019-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022 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_main_i.h
22  * This file prototyps the important functions pertinent to wifi positioning
23  * component.
24  */
25 
26 #ifndef _WIFI_POS_MAIN_H_
27 #define _WIFI_POS_MAIN_H_
28 
29 #ifdef CNSS_GENL
30 #define ENHNC_FLAGS_LEN 4
31 #define NL_ENABLE_OEM_REQ_RSP 0x00000001
32 #endif
33 
34 /* forward reference */
35 struct wlan_objmgr_psoc;
36 
37 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
38 /**
39  * wifi_pos_init_11az_context  - Initialize 11az context
40  * @vdev_pos_obj: Vdev private object of WIFI Pos component
41  *
42  * Return: None
43  */
44 void
45 wifi_pos_init_11az_context(struct wifi_pos_vdev_priv_obj *vdev_pos_obj);
46 #else
47 static inline void
wifi_pos_init_11az_context(struct wifi_pos_vdev_priv_obj * vdev_pos_obj)48 wifi_pos_init_11az_context(struct wifi_pos_vdev_priv_obj *vdev_pos_obj)
49 {}
50 #endif
51 
52 /**
53  * wifi_pos_psoc_obj_created_notification: callback registered to be called when
54  * psoc object is created.
55  * @psoc: pointer to psoc object just created
56  * @arg_list: argument list
57  *
58  * This function will:
59  *         create WIFI POS psoc object and attach to psoc
60  *         register TLV vs nonTLV callbacks
61  * Return: status of operation
62  */
63 QDF_STATUS wifi_pos_psoc_obj_created_notification(
64 		struct wlan_objmgr_psoc *psoc, void *arg_list);
65 
66 /**
67  * wifi_pos_psoc_obj_destroyed_notification: callback registered to be called
68  * when psoc object is destroyed.
69  * @psoc: pointer to psoc object just about to be destroyed
70  * @arg_list: argument list
71  *
72  * This function will:
73  *         detach WIFI POS from psoc object and free
74  * Return: status of operation
75  */
76 QDF_STATUS  wifi_pos_psoc_obj_destroyed_notification(
77 				struct wlan_objmgr_psoc *psoc, void *arg_list);
78 
79 /**
80  * wifi_pos_vdev_created_notification() - Vdev created notification callback
81  * @vdev: Vdev object
82  * @arg_list: argument list
83  *
84  * Return: QDF_STATUS
85  */
86 QDF_STATUS
87 wifi_pos_vdev_created_notification(struct wlan_objmgr_vdev *vdev,
88 				   void *arg_list);
89 
90 /**
91  * wifi_pos_vdev_destroyed_notification() - Wifi Pos vdev destroyed callback
92  * @vdev: Vdev object
93  * @arg_list: argument list
94  *
95  * This function will detach the Wifi Pos vdev private object and free it
96  *
97  * Return: QDF_STATUS
98  */
99 QDF_STATUS
100 wifi_pos_vdev_destroyed_notification(struct wlan_objmgr_vdev *vdev,
101 				     void *arg_list);
102 
103 /**
104  * wifi_pos_peer_object_created_notification() - Handle peer object created
105  * notification.
106  * @peer: Objmgr peer
107  * @arg: Argument
108  *
109  * Return: QDF_STATUS
110  */
111 QDF_STATUS
112 wifi_pos_peer_object_created_notification(struct wlan_objmgr_peer *peer,
113 					  void *arg);
114 
115 /**
116  * wifi_pos_peer_object_destroyed_notification() - Handler for peer object
117  * deleted notification
118  * @peer: Objmgr peer
119  * @arg: Argument
120  *
121  * Return: QDF_STATUS
122  */
123 QDF_STATUS
124 wifi_pos_peer_object_destroyed_notification(struct wlan_objmgr_peer *peer,
125 					    void *arg);
126 
127 /**
128  * wifi_pos_oem_rsp_handler: lmac rx ops registered
129  * @psoc: pointer to psoc object
130  * @oem_rsp: response from firmware
131  *
132  * Return: status of operation
133  */
134 int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc,
135 			     struct oem_data_rsp *oem_rsp);
136 #endif
137