xref: /wlan-dirver/qca-wifi-host-cmn/os_if/linux/wifi_pos/inc/os_if_wifi_pos.h (revision 4865edfd190c086bbe2c69aae12a8226f877b91e)
1 /*
2  * Copyright (c) 2012-2017 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: os_if_wifi_pos.h
21  * This file provide declaration of wifi_pos's os_if APIs
22  */
23 #ifndef _OS_IF_WIFI_POS_H_
24 #define _OS_IF_WIFI_POS_H_
25 
26 #include "qdf_types.h"
27 #include "qdf_status.h"
28 
29 
30 /* forward declaration */
31 struct wifi_pos_ch_info;
32 struct wlan_objmgr_psoc;
33 struct wifi_pos_driver_caps;
34 
35 #ifdef WIFI_POS_CONVERGED
36 /**
37  * os_if_wifi_pos_register_nl() - abstration API to register callback with GENL
38  * socket.
39  *
40  * Return: status of operation
41  */
42 int os_if_wifi_pos_register_nl(void);
43 
44 /**
45  * os_if_wifi_pos_deregister_nl() - abstration API to deregister callback with
46  * GENL socket.
47  *
48  * Return: status of operation
49  */
50 int os_if_wifi_pos_deregister_nl(void);
51 
52 /**
53  * os_if_wifi_pos_send_peer_status() - Function to send peer status to a
54  * registered application
55  * @peer_mac: MAC address of peer
56  * @peer_status: ePeerConnected or ePeerDisconnected
57  * @peer_timing_meas_cap: 0: RTT/RTT2, 1: RTT3. Default is 0
58  * @session_id: SME session id, i.e. vdev_id
59  * @chan_info: operating channel information
60  * @dev_mode: dev mode for which indication is sent
61  *
62  * Return: none
63  */
64 void os_if_wifi_pos_send_peer_status(struct qdf_mac_addr *peer_mac,
65 				uint8_t peer_status,
66 				uint8_t peer_timing_meas_cap,
67 				uint8_t session_id,
68 				struct wifi_pos_ch_info *chan_info,
69 				enum QDF_OPMODE dev_mode);
70 
71 /**
72  * os_if_wifi_pos_populate_caps() - populate oem capabilities
73  * @psoc: psoc object
74  * @caps: pointer to populate the capabilities
75  *
76  * Return: error code
77  */
78 int os_if_wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc,
79 				struct wifi_pos_driver_caps *caps);
80 #else
81 static inline int os_if_wifi_pos_register_nl(void)
82 {
83 	return 0;
84 }
85 
86 static inline int os_if_wifi_pos_deregister_nl(void)
87 {
88 	return 0;
89 }
90 
91 static inline void os_if_wifi_pos_send_peer_status(
92 		struct qdf_mac_addr *peer_mac,
93 		uint8_t peer_status,
94 		uint8_t peer_timing_meas_cap,
95 		uint8_t session_id,
96 		struct wifi_pos_ch_info *chan_info,
97 		enum QDF_OPMODE dev_mode)
98 {
99 }
100 
101 static inline int os_if_wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc,
102 					struct wifi_pos_driver_caps *caps)
103 {
104 	return 0;
105 }
106 #endif
107 
108 #endif /* _OS_IF_WIFI_POS_H_ */
109