wlan_p2p_ucfg_api.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. /*
  2. * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: Contains p2p north bound interface definitions
  20. */
  21. #ifndef _WLAN_P2P_UCFG_API_H_
  22. #define _WLAN_P2P_UCFG_API_H_
  23. #include <qdf_types.h>
  24. struct wlan_objmgr_psoc;
  25. struct p2p_roc_req;
  26. struct p2p_event;
  27. struct p2p_rx_mgmt_frame;
  28. struct p2p_tx_cnf;
  29. struct p2p_mgmt_tx;
  30. struct p2p_ps_config;
  31. struct p2p_lo_start;
  32. struct p2p_lo_event;
  33. /**
  34. * p2p_rx_callback() - Callback for rx mgmt frame
  35. * @user_data: user data associated to this rx mgmt frame.
  36. * @rx_frame: RX mgmt frame
  37. *
  38. * This callback will be used to give rx frames to hdd.
  39. *
  40. * Return: None
  41. */
  42. typedef void (*p2p_rx_callback)(void *user_data,
  43. struct p2p_rx_mgmt_frame *rx_frame);
  44. /**
  45. * p2p_action_tx_cnf_callback() - Callback for tx confirmation
  46. * @user_data: user data associated to this tx confirmation
  47. * @tx_cnf: tx confirmation information
  48. *
  49. * This callback will be used to give tx mgmt frame confirmation to
  50. * hdd.
  51. *
  52. * Return: None
  53. */
  54. typedef void (*p2p_action_tx_cnf_callback)(void *user_data,
  55. struct p2p_tx_cnf *tx_cnf);
  56. /**
  57. * p2p_lo_event_callback() - Callback for listen offload event
  58. * @user_data: user data associated to this lo event
  59. * @p2p_lo_event: listen offload event information
  60. *
  61. * This callback will be used to give listen offload event to hdd.
  62. *
  63. * Return: None
  64. */
  65. typedef void (*p2p_lo_event_callback)(void *user_data,
  66. struct p2p_lo_event *p2p_lo_event);
  67. /**
  68. * p2p_event_callback() - Callback for P2P event
  69. * @user_data: user data associated to this p2p event
  70. * @p2p_event: p2p event information
  71. *
  72. * This callback will be used to give p2p event to hdd.
  73. *
  74. * Return: None
  75. */
  76. typedef void (*p2p_event_callback)(void *user_data,
  77. struct p2p_event *p2p_event);
  78. /**
  79. * struct p2p_start_param - p2p soc start parameters. Below callbacks
  80. * will be registered by the HDD
  81. * @rx_callback: Function pointer to hdd rx callback. This
  82. * function will be used to give rx frames to hdd
  83. * @rx_cb_data: RX callback user data
  84. * @event_cb: Founction pointer to hdd p2p event callback.
  85. * This function will be used to give p2p event
  86. * to hdd
  87. * @event_cb_data: Pointer to p2p event callback user data
  88. * @tx_cnf_cb: Function pointer to hdd tx confirm callback.
  89. * This function will be used to give tx confirm
  90. * to hdd
  91. * @tx_cnf_cb_data: Pointer to p2p tx confirm callback user data
  92. * @lo_event_cb: Founction pointer to p2p listen offload
  93. * callback. This function will be used to give
  94. * listen offload stopped event to hdd
  95. * @lo_event_cb_data: Pointer to p2p listen offload callback user data
  96. */
  97. struct p2p_start_param {
  98. p2p_rx_callback rx_cb;
  99. void *rx_cb_data;
  100. p2p_event_callback event_cb;
  101. void *event_cb_data;
  102. p2p_action_tx_cnf_callback tx_cnf_cb;
  103. void *tx_cnf_cb_data;
  104. p2p_lo_event_callback lo_event_cb;
  105. void *lo_event_cb_data;
  106. };
  107. /**
  108. * ucfg_p2p_init() - P2P component initialization
  109. *
  110. * This function gets called when dispatcher initializing.
  111. *
  112. * Return: QDF_STATUS_SUCCESS - in case of success
  113. */
  114. QDF_STATUS ucfg_p2p_init(void);
  115. /**
  116. * ucfg_p2p_deinit() - P2P component de-init
  117. *
  118. * This function gets called when dispatcher de-init.
  119. *
  120. * Return: QDF_STATUS_SUCCESS - in case of success
  121. */
  122. QDF_STATUS ucfg_p2p_deinit(void);
  123. /**
  124. * ucfg_p2p_psoc_open() - Open P2P component
  125. * @soc: soc context
  126. *
  127. * This function gets called when dispatcher opening.
  128. *
  129. * Return: QDF_STATUS_SUCCESS - in case of success
  130. */
  131. QDF_STATUS ucfg_p2p_psoc_open(struct wlan_objmgr_psoc *soc);
  132. /**
  133. * ucfg_p2p_psoc_close() - Close P2P component
  134. * @soc: soc context
  135. *
  136. * This function gets called when dispatcher closing.
  137. *
  138. * Return: QDF_STATUS_SUCCESS - in case of success
  139. */
  140. QDF_STATUS ucfg_p2p_psoc_close(struct wlan_objmgr_psoc *soc);
  141. /**
  142. * ucfg_p2p_psoc_start() - Start P2P component
  143. * @soc: soc context
  144. * @req: P2P start parameters
  145. *
  146. * This function gets called when up layer starting up.
  147. *
  148. * Return: QDF_STATUS_SUCCESS - in case of success
  149. */
  150. QDF_STATUS ucfg_p2p_psoc_start(struct wlan_objmgr_psoc *soc,
  151. struct p2p_start_param *req);
  152. /**
  153. * ucfg_p2p_psoc_stop() - Stop P2P component
  154. * @soc: soc context
  155. *
  156. * This function gets called when up layer exit.
  157. *
  158. * Return: QDF_STATUS_SUCCESS - in case of success
  159. */
  160. QDF_STATUS ucfg_p2p_psoc_stop(struct wlan_objmgr_psoc *soc);
  161. /**
  162. * ucfg_p2p_roc_req() - Roc request
  163. * @soc: soc context
  164. * @roc_req: Roc request parameters
  165. * @cookie: return cookie to caller
  166. *
  167. * This function delivers roc request to P2P component.
  168. *
  169. * Return: QDF_STATUS_SUCCESS - in case of success
  170. */
  171. QDF_STATUS ucfg_p2p_roc_req(struct wlan_objmgr_psoc *soc,
  172. struct p2p_roc_req *roc_req, uint64_t *cookie);
  173. /**
  174. * ucfg_p2p_roc_cancel_req() - Cancel roc request
  175. * @soc: soc context
  176. * @cookie: Find out the roc request by cookie
  177. *
  178. * This function delivers cancel roc request to P2P component.
  179. *
  180. * Return: QDF_STATUS_SUCCESS - in case of success
  181. */
  182. QDF_STATUS ucfg_p2p_roc_cancel_req(struct wlan_objmgr_psoc *soc,
  183. uint64_t cookie);
  184. /**
  185. * ucfg_p2p_cleanup_roc_by_vdev() - Cleanup roc request by vdev
  186. * @vdev: pointer to vdev object
  187. *
  188. * This function call P2P API to cleanup roc request by vdev
  189. *
  190. * Return: QDF_STATUS_SUCCESS - in case of success
  191. */
  192. QDF_STATUS ucfg_p2p_cleanup_roc_by_vdev(struct wlan_objmgr_vdev *vdev);
  193. /**
  194. * ucfg_p2p_cleanup_roc_by_poc() - Cleanup roc request by psoc
  195. * @psoc: pointer to psoc object
  196. *
  197. * This function call P2P API to cleanup roc request by psoc
  198. *
  199. * Return: QDF_STATUS_SUCCESS - in case of success
  200. */
  201. QDF_STATUS ucfg_p2p_cleanup_roc_by_psoc(struct wlan_objmgr_psoc *psoc);
  202. /**
  203. * ucfg_p2p_cleanup_tx_by_vdev() - Cleanup tx request by vdev
  204. * @vdev: pointer to vdev object
  205. *
  206. * This function call P2P API to cleanup tx action frame request by vdev
  207. *
  208. * Return: QDF_STATUS_SUCCESS - in case of success
  209. */
  210. QDF_STATUS ucfg_p2p_cleanup_tx_by_vdev(struct wlan_objmgr_vdev *vdev);
  211. /**
  212. * ucfg_p2p_cleanup_tx_by_poc() - Cleanup tx request by psoc
  213. * @psoc: pointer to psoc object
  214. *
  215. * This function call P2P API to cleanup tx action frame request by psoc
  216. *
  217. * Return: QDF_STATUS_SUCCESS - in case of success
  218. */
  219. QDF_STATUS ucfg_p2p_cleanup_tx_by_psoc(struct wlan_objmgr_psoc *psoc);
  220. /**
  221. * ucfg_p2p_mgmt_tx() - Mgmt frame tx request
  222. * @soc: soc context
  223. * @mgmt_frm: TX mgmt frame parameters
  224. * @cookie: Return the cookie to caller
  225. *
  226. * This function delivers mgmt frame tx request to P2P component.
  227. *
  228. * Return: QDF_STATUS_SUCCESS - in case of success
  229. */
  230. QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
  231. struct p2p_mgmt_tx *mgmt_frm, uint64_t *cookie);
  232. /**
  233. * ucfg_p2p_mgmt_tx_cancel() - Cancel mgmt frame tx request
  234. * @soc: soc context
  235. * @cookie: Find out the mgmt tx request by cookie
  236. *
  237. * This function delivers cancel mgmt frame tx request request to P2P
  238. * component.
  239. *
  240. * Return: QDF_STATUS_SUCCESS - in case of success
  241. */
  242. QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
  243. uint64_t cookie);
  244. /**
  245. * ucfg_p2p_set_ps() - P2P set power save
  246. * @soc: soc context
  247. * @ps_config: power save configure
  248. *
  249. * This function delivers p2p power save request to P2P component.
  250. *
  251. * Return: QDF_STATUS_SUCCESS - in case of success
  252. */
  253. QDF_STATUS ucfg_p2p_set_ps(struct wlan_objmgr_psoc *soc,
  254. struct p2p_ps_config *ps_config);
  255. /**
  256. * ucfg_p2p_lo_start() - Listen offload start request
  257. * @soc: soc context
  258. * @p2p_lo_start: lo start parameters
  259. *
  260. * This function delivers listen offload start request to P2P
  261. * component.
  262. *
  263. * Return: QDF_STATUS_SUCCESS - in case of success
  264. */
  265. QDF_STATUS ucfg_p2p_lo_start(struct wlan_objmgr_psoc *soc,
  266. struct p2p_lo_start *p2p_lo_start);
  267. /**
  268. * ucfg_p2p_lo_stop() - Listen offload stop request
  269. * @soc: soc context
  270. * @vdev_id: vdev id
  271. *
  272. * This function delivers listen offload stop request to P2P component.
  273. *
  274. * Return: QDF_STATUS_SUCCESS - in case of success
  275. */
  276. QDF_STATUS ucfg_p2p_lo_stop(struct wlan_objmgr_psoc *soc,
  277. uint32_t vdev_id);
  278. /**
  279. * p2p_peer_authorized() - Process peer authorized event
  280. * @vdev: vdev structure to which peer is associated
  281. * @mac_addr: peer mac address
  282. *
  283. * This function handles disables noa whenever a legacy station
  284. * complete 4-way handshake after association.
  285. *
  286. * Return: void
  287. */
  288. void p2p_peer_authorized(struct wlan_objmgr_vdev *vdev, uint8_t *mac_addr);
  289. /**
  290. * ucfg_p2p_set_noa() - Disable/Enable NOA
  291. * @soc: soc context
  292. * @vdev_id: vdev id
  293. * @disable_noa: TRUE - Disable NoA, FALSE - Enable NoA
  294. *
  295. * This function send wmi command to enable / disable NoA.
  296. *
  297. * Return: QDF_STATUS_SUCCESS - in case of success
  298. */
  299. QDF_STATUS ucfg_p2p_set_noa(struct wlan_objmgr_psoc *soc,
  300. uint32_t vdev_id, bool disable_noa);
  301. /**
  302. * ucfg_p2p_register_callbacks() - register p2p callbacks
  303. * @soc: soc context
  304. * @cb_obj: p2p_protocol_callbacks struct
  305. *
  306. * This function registers lim callbacks to p2p components to provide
  307. * protocol information.
  308. *
  309. * Return: QDF_STATUS_SUCCESS - in case of success
  310. */
  311. QDF_STATUS ucfg_p2p_register_callbacks(struct wlan_objmgr_psoc *soc,
  312. struct p2p_protocol_callbacks *cb_obj);
  313. /**
  314. * ucfg_p2p_status_scan() - Show P2P connection status when scanning
  315. * @vdev: vdev context
  316. *
  317. * This function shows P2P connection status when scanning.
  318. *
  319. * Return: QDF_STATUS_SUCCESS - in case of success
  320. */
  321. QDF_STATUS ucfg_p2p_status_scan(struct wlan_objmgr_vdev *vdev);
  322. /**
  323. * ucfg_p2p_status_connect() - Update P2P connection status
  324. * @vdev: vdev context
  325. *
  326. * Updates P2P connection status by up layer when connecting.
  327. *
  328. * Return: QDF_STATUS_SUCCESS - in case of success
  329. */
  330. QDF_STATUS ucfg_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
  331. /**
  332. * ucfg_p2p_status_disconnect() - Update P2P connection status
  333. * @vdev: vdev context
  334. *
  335. * Updates P2P connection status by up layer when disconnecting.
  336. *
  337. * Return: QDF_STATUS_SUCCESS - in case of success
  338. */
  339. QDF_STATUS ucfg_p2p_status_disconnect(struct wlan_objmgr_vdev *vdev);
  340. /**
  341. * ucfg_p2p_status_start_bss() - Update P2P connection status
  342. * @vdev: vdev context
  343. *
  344. * Updates P2P connection status by up layer when starting bss.
  345. *
  346. * Return: QDF_STATUS_SUCCESS - in case of success
  347. */
  348. QDF_STATUS ucfg_p2p_status_start_bss(struct wlan_objmgr_vdev *vdev);
  349. /**
  350. * ucfg_p2p_status_stop_bss() - Update P2P connection status
  351. * @vdev: vdev context
  352. *
  353. * Updates P2P connection status by up layer when stopping bss.
  354. *
  355. * Return: QDF_STATUS_SUCCESS - in case of success
  356. */
  357. QDF_STATUS ucfg_p2p_status_stop_bss(struct wlan_objmgr_vdev *vdev);
  358. #endif /* _WLAN_P2P_UCFG_API_H_ */