wifi_pos_api.h 19 KB

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