xref: /wlan-driver/qca-wifi-host-cmn/umac/wifi_pos/inc/wifi_pos_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-2024 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_api.h
22  * This file declares public APIs of wifi positioning component
23  */
24 #ifndef _WIFI_POS_API_H_
25 #define _WIFI_POS_API_H_
26 
27 /* Include files */
28 #include "wifi_pos_utils_pub.h"
29 #include "wifi_pos_utils_i.h"
30 
31 /* forward reference */
32 struct wlan_objmgr_psoc;
33 struct wifi_pos_driver_caps;
34 
35 #ifdef WIFI_POS_CONVERGED
36 struct wifi_pos_osif_ops;
37 #endif
38 
39 /**
40  * enum RTT_FIELD_ID - identifies which field is being specified
41  * @META_DATA_SUB_TYPE: oem data req sub type
42  * @META_DATA_CHANNEL_MHZ: channel mhz info
43  * @META_DATA_PDEV: pdev info
44  */
45 enum RTT_FIELD_ID {
46 	META_DATA_SUB_TYPE,
47 	META_DATA_CHANNEL_MHZ,
48 	META_DATA_PDEV,
49 };
50 
51 /**
52  * struct wifi_pos_field - wifi positioning field element
53  * @id: RTT field id
54  * @offset: data offset in field info buffer
55  * @length: length of related data in field info buffer
56  */
57 struct wifi_pos_field {
58 	uint32_t id;
59 	uint32_t offset;
60 	uint32_t length;
61 };
62 
63 /**
64  * struct wifi_pos_field_info - wifi positioning field info buffer
65  * @count: number of @wifi_pos_field elements
66  * @fields: buffer to hold @wifi_pos_field elements
67  */
68 struct wifi_pos_field_info {
69 	uint32_t count;
70 	QDF_FLEX_ARRAY(struct wifi_pos_field, fields);
71 };
72 
73 /* Length of interface name */
74 #define INTERFACE_LEN 16
75 /**
76  * struct wifi_pos_interface - wifi positioning interface structure
77  * @length: interface length
78  * @dev_name: device name
79  */
80 struct wifi_pos_interface {
81 	uint8_t length;
82 	char dev_name[INTERFACE_LEN];
83 };
84 
85 #ifdef WIFI_POS_CONVERGED
86 /**
87  * enum oem_err_msg - err msg returned to user space
88  * @OEM_ERR_NULL_CONTEXT: NULL context
89  * @OEM_ERR_APP_NOT_REGISTERED: OEM App is not registered
90  * @OEM_ERR_INVALID_SIGNATURE: Invalid signature
91  * @OEM_ERR_NULL_MESSAGE_HEADER: Invalid message header
92  * @OEM_ERR_INVALID_MESSAGE_TYPE: Invalid message type
93  * @OEM_ERR_INVALID_MESSAGE_LENGTH: Invalid length in message body
94  * @OEM_ERR_REQUEST_REJECTED: Request is rejected by the driver
95  */
96 enum oem_err_msg {
97 	OEM_ERR_NULL_CONTEXT = 1,
98 	OEM_ERR_APP_NOT_REGISTERED,
99 	OEM_ERR_INVALID_SIGNATURE,
100 	OEM_ERR_NULL_MESSAGE_HEADER,
101 	OEM_ERR_INVALID_MESSAGE_TYPE,
102 	OEM_ERR_INVALID_MESSAGE_LENGTH,
103 	OEM_ERR_REQUEST_REJECTED
104 };
105 
106 /* this struct is needed since MLME is not converged yet */
107 struct wifi_pos_ch_info {
108 	uint8_t chan_id;
109 	uint32_t mhz;
110 	uint32_t band_center_freq1;
111 	uint32_t band_center_freq2;
112 	uint32_t info;
113 	uint32_t reg_info_1;
114 	uint32_t reg_info_2;
115 	uint8_t nss;
116 	uint32_t rate_flags;
117 	uint8_t sec_ch_offset;
118 	uint32_t ch_width;
119 };
120 
121 /**
122  * struct wifi_pos_ch_info_rsp - Channel information
123  * @chan_id: channel id
124  * @reserved0: reserved for padding and future use
125  * @mhz: primary 20 MHz channel frequency in Mhz
126  * @band_center_freq1: Center frequency 1 in MHz
127  * @band_center_freq2: Center frequency 2 in MHz, valid only for 11ac
128  *      VHT 80+80 mode
129  * @info: channel info
130  * @reg_info_1: regulatory information field 1 which contains min power,
131  *      max power, reg power and reg class id
132  * @reg_info_2: regulatory information field 2 which contains antennamax
133  */
134 struct wifi_pos_ch_info_rsp {
135 	uint32_t chan_id;
136 	uint32_t reserved0;
137 	uint32_t mhz;
138 	uint32_t band_center_freq1;
139 	uint32_t band_center_freq2;
140 	uint32_t info;
141 	uint32_t reg_info_1;
142 	uint32_t reg_info_2;
143 } qdf_packed;
144 
145 /**
146  * struct wifi_pos_peer_status_info - Status information for a given peer
147  * @peer_mac_addr: peer mac address
148  * @peer_status: peer status: 1: CONNECTED, 2: DISCONNECTED
149  * @vdev_id: vdev_id for the peer mac
150  * @peer_capability: peer capability: 0: RTT/RTT2, 1: RTT3. Default is 0
151  * @reserved0: reserved0
152  * @peer_chan_info: channel info on which peer is connected
153  */
154 struct wifi_pos_peer_status_info {
155 	uint8_t peer_mac_addr[ETH_ALEN];
156 	uint8_t peer_status;
157 	uint8_t vdev_id;
158 	uint32_t peer_capability;
159 	uint32_t reserved0;
160 	struct wifi_pos_ch_info_rsp peer_chan_info;
161 } qdf_packed;
162 
163 /**
164  * struct wifi_pos_req_msg - wifi pos request struct
165  * @msg_type: message type
166  * @pid: process id
167  * @buf: request buffer
168  * @buf_len: request buffer length
169  * @field_info_buf: buffer containing field info
170  * @field_info_buf_len: length of field info buffer
171  * @rsp_version: nl type or ani type
172  * @interface: contains interface name and length
173  */
174 struct wifi_pos_req_msg {
175 	enum wifi_pos_cmd_ids msg_type;
176 	uint32_t pid;
177 	uint8_t *buf;
178 	uint32_t buf_len;
179 	struct wifi_pos_field_info *field_info_buf;
180 	uint32_t field_info_buf_len;
181 	uint32_t rsp_version;
182 	struct wifi_pos_interface interface;
183 };
184 
185 /**
186  * ucfg_wifi_pos_process_req: ucfg API to be called from HDD/OS_IF to process a
187  * wifi_pos request from userspace
188  * @psoc: pointer to psoc object
189  * @req: wifi_pos request msg
190  * @send_rsp_cb: callback pointer required to send msg to userspace
191  *
192  * Return: status of operation
193  */
194 QDF_STATUS ucfg_wifi_pos_process_req(struct wlan_objmgr_psoc *psoc,
195 				     struct wifi_pos_req_msg *req,
196 				     wifi_pos_send_rsp_handler send_rsp_cb);
197 
198 /**
199  * wifi_pos_init: initializes WIFI POS component, called by dispatcher init
200  *
201  * Return: status of operation
202  */
203 QDF_STATUS wifi_pos_init(void);
204 
205 /**
206  * wifi_pos_deinit: de-initializes WIFI POS component, called by dispatcher init
207  *
208  * Return: status of operation
209  */
210 QDF_STATUS wifi_pos_deinit(void);
211 
212 /**
213  * wifi_pos_psoc_enable: psoc enable API for wifi positioning component
214  * @psoc: pointer to PSOC
215  *
216  * Return: status of operation
217  */
218 QDF_STATUS wifi_pos_psoc_enable(struct wlan_objmgr_psoc *psoc);
219 
220 /**
221  * wifi_pos_psoc_disable: psoc disable API for wifi positioning component
222  * @psoc: pointer to PSOC
223  *
224  * Return: status of operation
225  */
226 QDF_STATUS wifi_pos_psoc_disable(struct wlan_objmgr_psoc *psoc);
227 
228 /**
229  * wifi_pos_set_oem_target_type: public API to set param in wifi_pos private
230  * object
231  * @psoc: pointer to PSOC
232  * @val: value to set
233  *
234  * Return: None
235  */
236 void wifi_pos_set_oem_target_type(struct wlan_objmgr_psoc *psoc, uint32_t val);
237 
238 /**
239  * wifi_pos_set_oem_fw_version: public API to set param in wifi_pos private
240  * object
241  * @psoc: pointer to PSOC
242  * @val: value to set
243  *
244  * Return: None
245  */
246 void wifi_pos_set_oem_fw_version(struct wlan_objmgr_psoc *psoc, uint32_t val);
247 
248 /**
249  * wifi_pos_set_drv_ver_major: public API to set param in wifi_pos private
250  * object
251  * @psoc: pointer to PSOC
252  * @val: value to set
253  *
254  * Return: None
255  */
256 void wifi_pos_set_drv_ver_major(struct wlan_objmgr_psoc *psoc, uint8_t val);
257 
258 /**
259  * wifi_pos_set_drv_ver_minor: public API to set param in wifi_pos private
260  * object
261  * @psoc: pointer to PSOC
262  * @val: value to set
263  *
264  * Return: None
265  */
266 void wifi_pos_set_drv_ver_minor(struct wlan_objmgr_psoc *psoc, uint8_t val);
267 
268 /**
269  * wifi_pos_set_drv_ver_patch: public API to set param in wifi_pos private
270  * object
271  * @psoc: pointer to PSOC
272  * @val: value to set
273  *
274  * Return: None
275  */
276 void wifi_pos_set_drv_ver_patch(struct wlan_objmgr_psoc *psoc, uint8_t val);
277 
278 /**
279  * wifi_pos_set_drv_ver_build: public API to set param in wifi_pos private
280  * object
281  * @psoc: pointer to PSOC
282  * @val: value to set
283  *
284  * Return: None
285  */
286 void wifi_pos_set_drv_ver_build(struct wlan_objmgr_psoc *psoc, uint8_t val);
287 
288 /**
289  * wifi_pos_set_dwell_time_min: public API to set param in wifi_pos private
290  * object
291  * @psoc: pointer to PSOC
292  * @val: value to set
293  *
294  * Return: None
295  */
296 void wifi_pos_set_dwell_time_min(struct wlan_objmgr_psoc *psoc, uint16_t val);
297 
298 /**
299  * wifi_pos_set_dwell_time_max: public API to set param in wifi_pos private
300  * object
301  * @psoc: pointer to PSOC
302  * @val: value to set
303  *
304  * Return: None
305  */
306 void wifi_pos_set_dwell_time_max(struct wlan_objmgr_psoc *psoc, uint16_t val);
307 
308 /**
309  * wifi_pos_set_current_dwell_time_min: public API to set param in wifi_pos
310  * private object
311  * @psoc: pointer to PSOC
312  * @val: value to set
313  *
314  * Return: None
315  */
316 void wifi_pos_set_current_dwell_time_min(struct wlan_objmgr_psoc *psoc,
317 					 uint16_t val);
318 
319 /**
320  * wifi_pos_set_current_dwell_time_max: public API to set param in wifi_pos
321  * private object
322  * @psoc: pointer to PSOC
323  * @val: value to set
324  *
325  * Return: None
326  */
327 void wifi_pos_set_current_dwell_time_max(struct wlan_objmgr_psoc *psoc,
328 					 uint16_t val);
329 
330 /**
331  * wifi_pos_populate_caps() - populate oem capabilities
332  * @psoc: psoc object
333  * @caps: pointer to populate the capabilities
334  *
335  * Return: error code
336  */
337 QDF_STATUS wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc,
338 			   struct wifi_pos_driver_caps *caps);
339 
340 struct wlan_lmac_if_rx_ops;
341 /**
342  * wifi_pos_register_rx_ops: function to register with lmac rx ops
343  * @rx_ops: lmac rx ops struct object
344  *
345  * Return: None
346  */
347 void wifi_pos_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
348 
349 /**
350  * wifi_pos_get_tx_ops: api to get tx ops
351  * @psoc: pointer to psoc object
352  *
353  * Return: tx ops
354  */
355 struct wlan_lmac_if_wifi_pos_tx_ops *
356 wifi_pos_get_tx_ops(struct wlan_objmgr_psoc *psoc);
357 
358 /**
359  * wifi_pos_get_rx_ops: api to get rx ops
360  * @psoc: pointer to psoc object
361  *
362  * Return: rx ops
363  */
364 struct wlan_lmac_if_wifi_pos_rx_ops *
365 wifi_pos_get_rx_ops(struct wlan_objmgr_psoc *psoc);
366 
367 /**
368  * ucfg_wifi_pos_get_ftm_cap: API to get fine timing measurement caps
369  * @psoc: psoc object
370  *
371  * Return: FTM value
372  */
373 uint32_t ucfg_wifi_pos_get_ftm_cap(struct wlan_objmgr_psoc *psoc);
374 
375 /**
376  * ucfg_wifi_pos_set_ftm_cap: API to set fine timing measurement caps
377  * @psoc: psoc object
378  * @val: value to set
379  *
380  * Return: None
381  */
382 void ucfg_wifi_pos_set_ftm_cap(struct wlan_objmgr_psoc *psoc, uint32_t val);
383 
384 /**
385  * ucfg_wifi_pos_set_oem_6g_supported: API to set oem target 6g enabled/disabled
386  * @psoc: psoc object
387  * @val: value to set
388  *
389  * Return: None
390  */
391 void ucfg_wifi_pos_set_oem_6g_supported(struct wlan_objmgr_psoc *psoc,
392 					bool val);
393 
394 /**
395  * ucfg_wifi_pos_is_nl_rsp: API to check if response is nl or ani type
396  * @psoc: psoc object
397  *
398  * Return: true if response is nl type
399  */
400 bool ucfg_wifi_pos_is_nl_rsp(struct wlan_objmgr_psoc *psoc);
401 
402 /**
403  * wifi_pos_get_app_pid: returns oem app pid.
404  * @psoc: pointer to psoc object
405  *
406  * Return: oem app pid
407  */
408 uint32_t wifi_pos_get_app_pid(struct wlan_objmgr_psoc *psoc);
409 
410 /**
411  * wifi_pos_is_app_registered: indicates if oem app is registered.
412  * @psoc: pointer to psoc object
413  *
414  * Return: true if app is registered, false otherwise
415  */
416 bool wifi_pos_is_app_registered(struct wlan_objmgr_psoc *psoc);
417 
418 /**
419  * wifi_pos_get_psoc: API to get global PSOC object
420  *
421  * Since request from userspace is not associated with any vdev/pdev/psoc, this
422  * API is used to get global psoc object.
423  * Return: global psoc object.
424  */
425 struct wlan_objmgr_psoc *wifi_pos_get_psoc(void);
426 
427 /**
428  * wifi_pos_get_legacy_ops() - Get wifi pos legacy ops
429  *
430  * Return: Pointer to legacy ops
431  */
432 struct wifi_pos_legacy_ops *wifi_pos_get_legacy_ops(void);
433 
434 /**
435  * wifi_pos_set_legacy_ops() - Set Wifi Pos legacy ops
436  * @psoc: PSOC pointer
437  * @legacy_ops: Legacy ops
438  *
439  * Return: QDF_STATUS
440  */
441 QDF_STATUS
442 wifi_pos_set_legacy_ops(struct wlan_objmgr_psoc *psoc,
443 			struct wifi_pos_legacy_ops *legacy_ops);
444 #else
wifi_pos_init(void)445 static inline QDF_STATUS wifi_pos_init(void)
446 {
447 	return QDF_STATUS_SUCCESS;
448 }
449 
wifi_pos_deinit(void)450 static inline QDF_STATUS wifi_pos_deinit(void)
451 {
452 	return QDF_STATUS_SUCCESS;
453 }
454 
wifi_pos_psoc_enable(struct wlan_objmgr_psoc * psoc)455 static inline QDF_STATUS wifi_pos_psoc_enable(struct wlan_objmgr_psoc *psoc)
456 {
457 	return QDF_STATUS_SUCCESS;
458 }
459 
wifi_pos_psoc_disable(struct wlan_objmgr_psoc * psoc)460 static inline QDF_STATUS wifi_pos_psoc_disable(struct wlan_objmgr_psoc *psoc)
461 {
462 	return QDF_STATUS_SUCCESS;
463 }
464 #endif
465 
466 #if defined(WLAN_FEATURE_CIF_CFR) && defined(WIFI_POS_CONVERGED)
467 /**
468  * wifi_pos_init_cir_cfr_rings: API to set DMA ring cap in wifi pos psoc private
469  * object
470  * @psoc: pointer to psoc object
471  * @hal_soc: hal soc pointer
472  * @num_mac: number of macs
473  * @buf: buffer containing dma ring cap
474  *
475  * Return: status of operation.
476  */
477 QDF_STATUS wifi_pos_init_cir_cfr_rings(struct wlan_objmgr_psoc *psoc,
478 				   void *hal_soc, uint8_t num_mac, void *buf);
479 #else
wifi_pos_init_cir_cfr_rings(struct wlan_objmgr_psoc * psoc,void * hal_soc,uint8_t num_mac,void * buf)480 static inline QDF_STATUS wifi_pos_init_cir_cfr_rings(
481 				struct wlan_objmgr_psoc *psoc,
482 				void *hal_soc, uint8_t num_mac, void *buf)
483 {
484 	return QDF_STATUS_SUCCESS;
485 }
486 #endif
487 
488 /**
489  * wifi_pos_register_get_fw_phy_mode_for_freq_cb: API to register callback
490  * to get current PHY mode
491  * @psoc: pointer to psoc object
492  * @handler: callback to be registered
493  *
494  * Return: QDF_STATUS_SUCCESS in case of success, error codes in
495  * case of failure
496  */
497 QDF_STATUS wifi_pos_register_get_fw_phy_mode_for_freq_cb(
498 			struct wlan_objmgr_psoc *psoc,
499 			void (*handler)(uint32_t, uint32_t, uint32_t *));
500 
501 /**
502  * wifi_pos_register_get_phy_mode_cb: API to register callback to get
503  * current PHY mode
504  * @psoc: pointer to psoc object
505  * @handler: callback to be registered
506  *
507  * Return: QDF_STATUS_SUCCESS in case of success, error codes in
508  * case of failure
509  */
510 QDF_STATUS wifi_pos_register_get_phy_mode_cb(
511 			struct wlan_objmgr_psoc *psoc,
512 			void (*handler)(qdf_freq_t, uint32_t, uint32_t *));
513 
514 /**
515  * wifi_pos_register_send_action: API to register callback to send
516  * action frames
517  * @psoc: pointer to psoc object
518  * @handler: callback to be registered
519  *
520  * Return: QDF_STATUS_SUCCESS in case of success, error codes in
521  * case of failure
522  */
523 QDF_STATUS wifi_pos_register_send_action(
524 				struct wlan_objmgr_psoc *psoc,
525 				void (*handler)(struct wlan_objmgr_psoc *psoc,
526 						uint32_t sub_type,
527 						uint8_t *buf,
528 						uint32_t buf_len));
529 
530 #ifndef CNSS_GENL
531 /**
532  * ucfg_wifi_psoc_get_pdev_id_by_dev_name: ucfg API to get pdev_id and psoc from
533  *                                         devname.
534  * @dev_name: dev name received from LOWI application
535  * @pdev_id: get pdev_id from dev_name
536  * @psoc: get psoc corresponding psoc from dev_name
537  */
538 QDF_STATUS ucfg_wifi_psoc_get_pdev_id_by_dev_name(
539 		char *dev_name, uint8_t *pdev_id,
540 		struct wlan_objmgr_psoc **psoc);
541 
542 /**
543  * wifi_pos_register_get_pdev_id_by_dev_name: API to register callback to get
544  * pdev_id from dev name
545  * @psoc: pointer to global psoc object
546  * @handler: callback to be registered
547  *
548  * Return: QDF_STATUS_SUCCESS in case of success, error codes in
549  * case of failure
550  */
551 QDF_STATUS wifi_pos_register_get_pdev_id_by_dev_name(
552 		struct wlan_objmgr_psoc *psoc,
553 		QDF_STATUS (*handler)(char *dev_name, uint8_t *pdev_id,
554 				      struct wlan_objmgr_psoc **psoc));
555 
556 /**
557  * wifi_pos_register_get_max_fw_phymode_for_channels: API to register callback
558  * to get FW phymode for the given channels.
559  * @psoc:  pointer to global psoc object
560  * @handler: callback to be registered
561  *
562  * Return: QDF_STATUS_SUCCESS in case of success, error codes in case of failure
563  */
564 QDF_STATUS wifi_pos_register_get_max_fw_phymode_for_channels(
565 		struct wlan_objmgr_psoc *psoc,
566 		QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
567 				      struct wifi_pos_channel_power *chan_list,
568 				      uint16_t wifi_pos_num_chans));
569 #endif /* CNSS_GENL */
570 
571 #if !defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)
572 /**
573  * ucfg_wifi_pos_measurement_request_notification: ucfg API to notify
574  * measurement request received from the LOWI application
575  * @pdev: Pointer to pdev structure
576  * @req: Pointer to wifi_pos_req_msg structure
577  *
578  * Return: QDF_STATUS_SUCCESS in case of success, error codes in
579  * case of failure
580  */
581 QDF_STATUS ucfg_wifi_pos_measurement_request_notification(
582 		struct wlan_objmgr_pdev *pdev,
583 		struct wifi_pos_req_msg *req);
584 
585 /**
586  * wifi_pos_register_measurement_request_notification: API to register a
587  * callback that needs to be called when the driver receives a measurement
588  * request from the LOWI application.
589  * @psoc: pointer to global psoc object
590  * @handler: callback to be registered
591  *
592  * Return: QDF_STATUS_SUCCESS in case of success, error codes in case of
593  * failure.
594  */
595 QDF_STATUS wifi_pos_register_measurement_request_notification(
596 		struct wlan_objmgr_psoc *psoc,
597 		QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
598 				      struct rtt_channel_info *chinfo));
599 #else
ucfg_wifi_pos_measurement_request_notification(struct wlan_objmgr_pdev * pdev,struct wifi_pos_req_msg * req)600 static inline QDF_STATUS ucfg_wifi_pos_measurement_request_notification(
601 		struct wlan_objmgr_pdev *pdev,
602 		struct wifi_pos_req_msg *req)
603 {
604 	return QDF_STATUS_SUCCESS;
605 }
606 
wifi_pos_register_measurement_request_notification(struct wlan_objmgr_psoc * psoc,QDF_STATUS (* handler)(struct wlan_objmgr_pdev * pdev,struct rtt_channel_info * chinfo))607 static inline QDF_STATUS wifi_pos_register_measurement_request_notification(
608 		struct wlan_objmgr_psoc *psoc,
609 		QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
610 				      struct rtt_channel_info *chinfo))
611 {
612 	return QDF_STATUS_SUCCESS;
613 }
614 #endif /*!defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)*/
615 
616 /**
617  * wifi_pos_send_report_resp: Send report to osif
618  * @psoc: pointer to psoc object
619  * @req_id: Request id
620  * @dest_mac: destination mac address
621  * @err_code: Error code to be sent
622  *
623  * Return: QDF_STATUS_SUCCESS in case of success, error codes in
624  * case of failure
625  */
626 QDF_STATUS wifi_pos_send_report_resp(struct wlan_objmgr_psoc *psoc,
627 				     int req_id, uint8_t *dest_mac,
628 				     int err_code);
629 
630 /**
631  * wifi_pos_convert_host_pdev_id_to_target: convert host pdev_id to target
632  * pdev_id
633  * @psoc: pointer to psoc object
634  * @host_pdev_id: host pdev id
635  * @target_pdev_id: target pdev id
636  *
637  * Return: QDF_STATUS_SUCCESS in case of success, error codes in
638  * case of failure
639  */
640 QDF_STATUS wifi_pos_convert_host_pdev_id_to_target(
641 	struct wlan_objmgr_psoc *psoc, uint32_t host_pdev_id,
642 	uint32_t *target_pdev_id);
643 
644 #ifdef WIFI_POS_CONVERGED
645 /**
646  * wifi_pos_get_peer_private_object() - Wifi Pos get peer private object
647  * @peer: Peer object pointer
648  *
649  * Return: Peer private object pointer
650  */
651 struct wlan_wifi_pos_peer_priv_obj *
652 wifi_pos_get_peer_private_object(struct wlan_objmgr_peer *peer);
653 
654 /**
655  * wifi_pos_register_osif_callbacks() - Register OSIF callbacks
656  * @ops: Osif callbacks pointer
657  *
658  * Return: QDF_STATUS
659  */
660 QDF_STATUS wifi_pos_register_osif_callbacks(struct wifi_pos_osif_ops *ops);
661 
662 /**
663  * wifi_pos_get_osif_callbacks() - Get OS IF callbacks
664  *
665  * Return: struct wifi_pos_osif_ops pointer
666  */
667 struct wifi_pos_osif_ops *wifi_pos_get_osif_callbacks(void);
668 #endif /* WIFI_POS_CONVERGED */
669 
670 #if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
671 /**
672  * wifi_pos_set_rsta_sec_ltf_cap() - Set RSTA secure LTF capability
673  * @val: Value
674  *
675  * Return: None
676  **/
677 void
678 wifi_pos_set_rsta_sec_ltf_cap(bool val);
679 
680 /**
681  * wifi_pos_get_rsta_sec_ltf_cap  - Get RSTA secure LTF capability
682  *
683  * Return: True or false
684  */
685 bool wifi_pos_get_rsta_sec_ltf_cap(void);
686 
687 /**
688  * wifi_pos_set_rsta_11az_ranging_cap() - Enable/Disable R-STA 11az ranging
689  * @val: Value to set
690  */
691 void wifi_pos_set_rsta_11az_ranging_cap(uint32_t val);
692 
693 /**
694  * wifi_pos_get_rsta_11az_ranging_cap() - Get if RSTA 11az ranging is enabled
695  *
696  * Return: value if 11az TB/NTB ranging is enabled
697  */
698 uint32_t wifi_pos_get_rsta_11az_ranging_cap(void);
699 #endif
700 #endif /* _WIFI_POS_API_H_ */
701