wifi_pos_api.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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. * @psoc: PSOC pointer
  387. *
  388. * Return: Pointer to legacy ops
  389. */
  390. struct wifi_pos_legacy_ops *
  391. wifi_pos_get_legacy_ops(struct wlan_objmgr_psoc *psoc);
  392. /**
  393. * wifi_pos_set_legacy_ops() - Set Wifi Pos legacy ops
  394. * @psoc: PSOC pointer
  395. * @legacy_ops: Legacy ops
  396. *
  397. * Return: QDF_STATUS
  398. */
  399. QDF_STATUS
  400. wifi_pos_set_legacy_ops(struct wlan_objmgr_psoc *psoc,
  401. struct wifi_pos_legacy_ops *legacy_ops);
  402. #else
  403. static inline QDF_STATUS wifi_pos_init(void)
  404. {
  405. return QDF_STATUS_SUCCESS;
  406. }
  407. static inline QDF_STATUS wifi_pos_deinit(void)
  408. {
  409. return QDF_STATUS_SUCCESS;
  410. }
  411. static inline QDF_STATUS wifi_pos_psoc_enable(struct wlan_objmgr_psoc *psoc)
  412. {
  413. return QDF_STATUS_SUCCESS;
  414. }
  415. static inline QDF_STATUS wifi_pos_psoc_disable(struct wlan_objmgr_psoc *psoc)
  416. {
  417. return QDF_STATUS_SUCCESS;
  418. }
  419. #endif
  420. #if defined(WLAN_FEATURE_CIF_CFR) && defined(WIFI_POS_CONVERGED)
  421. /**
  422. * wifi_pos_init_cir_cfr_rings: API to set DMA ring cap in wifi pos psoc private
  423. * object
  424. * @psoc: pointer to psoc object
  425. * @hal_soc: hal soc pointer
  426. * @num_mac: number of macs
  427. * @buf: buffer containing dma ring cap
  428. *
  429. * Return: status of operation.
  430. */
  431. QDF_STATUS wifi_pos_init_cir_cfr_rings(struct wlan_objmgr_psoc *psoc,
  432. void *hal_soc, uint8_t num_mac, void *buf);
  433. #else
  434. static inline QDF_STATUS wifi_pos_init_cir_cfr_rings(
  435. struct wlan_objmgr_psoc *psoc,
  436. void *hal_soc, uint8_t num_mac, void *buf)
  437. {
  438. return QDF_STATUS_SUCCESS;
  439. }
  440. #endif
  441. /**
  442. * wifi_pos_register_get_fw_phy_mode_for_freq_cb: API to register callback
  443. * to get current PHY mode
  444. * @psoc: pointer to psoc object
  445. * @handler: callback to be registered
  446. *
  447. * Return: QDF_STATUS_SUCCESS in case of success, error codes in
  448. * case of failure
  449. */
  450. QDF_STATUS wifi_pos_register_get_fw_phy_mode_for_freq_cb(
  451. struct wlan_objmgr_psoc *psoc,
  452. void (*handler)(uint32_t, uint32_t, uint32_t *));
  453. /**
  454. * wifi_pos_register_get_phy_mode_cb: API to register callback to get
  455. * current PHY mode
  456. * @psoc: pointer to psoc object
  457. * @handler: callback to be registered
  458. *
  459. * Return: QDF_STATUS_SUCCESS in case of success, error codes in
  460. * case of failure
  461. */
  462. QDF_STATUS wifi_pos_register_get_phy_mode_cb(
  463. struct wlan_objmgr_psoc *psoc,
  464. void (*handler)(qdf_freq_t, uint32_t, uint32_t *));
  465. /**
  466. * wifi_pos_register_send_action: API to register callback to send
  467. * action frames
  468. * @psoc: pointer to psoc object
  469. * @handler: callback to be registered
  470. *
  471. * Return: QDF_STATUS_SUCCESS in case of success, error codes in
  472. * case of failure
  473. */
  474. QDF_STATUS wifi_pos_register_send_action(
  475. struct wlan_objmgr_psoc *psoc,
  476. void (*handler)(struct wlan_objmgr_psoc *psoc,
  477. uint32_t sub_type,
  478. uint8_t *buf,
  479. uint32_t buf_len));
  480. #ifndef CNSS_GENL
  481. /**
  482. * ucfg_wifi_psoc_get_pdev_id_by_dev_name: ucfg API to get pdev_id and psoc from
  483. * devname.
  484. * @dev_name: dev name received from LOWI application
  485. * @pdev_id: get pdev_id from dev_name
  486. * @psoc: get psoc corresponding psoc from dev_name
  487. */
  488. QDF_STATUS ucfg_wifi_psoc_get_pdev_id_by_dev_name(
  489. char *dev_name, uint8_t *pdev_id,
  490. struct wlan_objmgr_psoc **psoc);
  491. /**
  492. * wifi_pos_register_get_pdev_id_by_dev_name: API to register callback to get
  493. * pdev_id from dev name
  494. * @psoc: pointer to global psoc object
  495. * @handler: callback to be registered
  496. *
  497. * Return: QDF_STATUS_SUCCESS in case of success, error codes in
  498. * case of failure
  499. */
  500. QDF_STATUS wifi_pos_register_get_pdev_id_by_dev_name(
  501. struct wlan_objmgr_psoc *psoc,
  502. QDF_STATUS (*handler)(char *dev_name, uint8_t *pdev_id,
  503. struct wlan_objmgr_psoc **psoc));
  504. /**
  505. * wifi_pos_register_get_max_fw_phymode_for_channels: API to register callback
  506. * to get FW phymode for the given channels.
  507. * @psoc: pointer to global psoc object
  508. * @handler: callback to be registered
  509. *
  510. * Return: QDF_STATUS_SUCCESS in case of success, error codes in case of failure
  511. */
  512. QDF_STATUS wifi_pos_register_get_max_fw_phymode_for_channels(
  513. struct wlan_objmgr_psoc *psoc,
  514. QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
  515. struct wifi_pos_channel_power *chan_list,
  516. uint16_t wifi_pos_num_chans));
  517. #endif /* CNSS_GENL */
  518. #if !defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)
  519. /**
  520. * ucfg_wifi_pos_measurement_request_notification: ucfg API to notify
  521. * measurement request received from the LOWI application
  522. * @pdev: Pointer to pdev structure
  523. * @req: Pointer to wifi_pos_req_msg structure
  524. *
  525. * Return: QDF_STATUS_SUCCESS in case of success, error codes in
  526. * case of failure
  527. */
  528. QDF_STATUS ucfg_wifi_pos_measurement_request_notification(
  529. struct wlan_objmgr_pdev *pdev,
  530. struct wifi_pos_req_msg *req);
  531. /**
  532. * wifi_pos_register_measurement_request_notification: API to register a
  533. * callback that needs to be called when the driver receives a measurement
  534. * request from the LOWI application.
  535. * @psoc: pointer to global psoc object
  536. * @handler: callback to be registered
  537. *
  538. * Return: QDF_STATUS_SUCCESS in case of success, error codes in case of
  539. * failure.
  540. */
  541. QDF_STATUS wifi_pos_register_measurement_request_notification(
  542. struct wlan_objmgr_psoc *psoc,
  543. QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
  544. struct rtt_channel_info *chinfo));
  545. #else
  546. static inline QDF_STATUS ucfg_wifi_pos_measurement_request_notification(
  547. struct wlan_objmgr_pdev *pdev,
  548. struct wifi_pos_req_msg *req)
  549. {
  550. return QDF_STATUS_SUCCESS;
  551. }
  552. static inline QDF_STATUS wifi_pos_register_measurement_request_notification(
  553. struct wlan_objmgr_psoc *psoc,
  554. QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
  555. struct rtt_channel_info *chinfo))
  556. {
  557. return QDF_STATUS_SUCCESS;
  558. }
  559. #endif /*!defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)*/
  560. /**
  561. * wifi_pos_send_report_resp: Send report to osif
  562. * @psoc: pointer to psoc object
  563. * @req_id: Request id
  564. * @dest_mac: destination mac address
  565. * @err_code: Error code to be sent
  566. *
  567. * Return: QDF_STATUS_SUCCESS in case of success, error codes in
  568. * case of failure
  569. */
  570. QDF_STATUS wifi_pos_send_report_resp(struct wlan_objmgr_psoc *psoc,
  571. int req_id, uint8_t *dest_mac,
  572. int err_code);
  573. /**
  574. * wifi_pos_convert_host_pdev_id_to_target: convert host pdev_id to target
  575. * pdev_id
  576. * @psoc: pointer to psoc object
  577. * @host_pdev_id: host pdev id
  578. * @target_pdev_id: target pdev id
  579. *
  580. * Return: QDF_STATUS_SUCCESS in case of success, error codes in
  581. * case of failure
  582. */
  583. QDF_STATUS wifi_pos_convert_host_pdev_id_to_target(
  584. struct wlan_objmgr_psoc *psoc, uint32_t host_pdev_id,
  585. uint32_t *target_pdev_id);
  586. #ifdef WIFI_POS_CONVERGED
  587. /**
  588. * wifi_pos_register_osif_callbacks() - Register OSIF callbacks
  589. * @psoc: Pointer to psoc object
  590. * @ops: Osif callbacks pointer
  591. *
  592. * Return: QDF_STATUS
  593. */
  594. QDF_STATUS
  595. wifi_pos_register_osif_callbacks(struct wlan_objmgr_psoc *psoc,
  596. struct wifi_pos_osif_ops *ops);
  597. /**
  598. * wifi_pos_get_osif_callbacks() - Get OS IF callbacks
  599. * @psoc: Pointer to PSOC object
  600. *
  601. * Return: struct wifi_pos_osif_ops pointer
  602. */
  603. struct wifi_pos_osif_ops *
  604. wifi_pos_get_osif_callbacks(struct wlan_objmgr_psoc *psoc);
  605. #endif /* WIFI_POS_CONVERGED */
  606. #endif /* _WIFI_POS_API_H_ */