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