wifi_pos_api.h 19 KB

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