wlan_p2p_ucfg_api.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. /*
  2. * Copyright (c) 2017 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() - 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(struct wlan_objmgr_vdev *vdev);
  193. /**
  194. * ucfg_p2p_mgmt_tx() - Mgmt frame tx request
  195. * @soc: soc context
  196. * @mgmt_frm: TX mgmt frame parameters
  197. * @cookie: Return the cookie to caller
  198. *
  199. * This function delivers mgmt frame tx request to P2P component.
  200. *
  201. * Return: QDF_STATUS_SUCCESS - in case of success
  202. */
  203. QDF_STATUS ucfg_p2p_mgmt_tx(struct wlan_objmgr_psoc *soc,
  204. struct p2p_mgmt_tx *mgmt_frm, uint64_t *cookie);
  205. /**
  206. * ucfg_p2p_mgmt_tx_cancel() - Cancel mgmt frame tx request
  207. * @soc: soc context
  208. * @cookie: Find out the mgmt tx request by cookie
  209. *
  210. * This function delivers cancel mgmt frame tx request request to P2P
  211. * component.
  212. *
  213. * Return: QDF_STATUS_SUCCESS - in case of success
  214. */
  215. QDF_STATUS ucfg_p2p_mgmt_tx_cancel(struct wlan_objmgr_psoc *soc,
  216. uint64_t cookie);
  217. /**
  218. * ucfg_p2p_set_ps() - P2P set power save
  219. * @soc: soc context
  220. * @ps_config: power save configure
  221. *
  222. * This function delivers p2p power save request to P2P component.
  223. *
  224. * Return: QDF_STATUS_SUCCESS - in case of success
  225. */
  226. QDF_STATUS ucfg_p2p_set_ps(struct wlan_objmgr_psoc *soc,
  227. struct p2p_ps_config *ps_config);
  228. /**
  229. * ucfg_p2p_lo_start() - Listen offload start request
  230. * @soc: soc context
  231. * @p2p_lo_start: lo start parameters
  232. *
  233. * This function delivers listen offload start request to P2P
  234. * component.
  235. *
  236. * Return: QDF_STATUS_SUCCESS - in case of success
  237. */
  238. QDF_STATUS ucfg_p2p_lo_start(struct wlan_objmgr_psoc *soc,
  239. struct p2p_lo_start *p2p_lo_start);
  240. /**
  241. * ucfg_p2p_lo_stop() - Listen offload stop request
  242. * @soc: soc context
  243. * @vdev_id: vdev id
  244. *
  245. * This function delivers listen offload stop request to P2P component.
  246. *
  247. * Return: QDF_STATUS_SUCCESS - in case of success
  248. */
  249. QDF_STATUS ucfg_p2p_lo_stop(struct wlan_objmgr_psoc *soc,
  250. uint32_t vdev_id);
  251. /**
  252. * p2p_peer_authorized() - Process peer authorized event
  253. * @vdev: vdev structure to which peer is associated
  254. * @mac_addr: peer mac address
  255. *
  256. * This function handles disables noa whenever a legacy station
  257. * complete 4-way handshake after association.
  258. *
  259. * Return: void
  260. */
  261. void p2p_peer_authorized(struct wlan_objmgr_vdev *vdev, uint8_t *mac_addr);
  262. /**
  263. * ucfg_p2p_set_noa() - Disable/Enable NOA
  264. * @soc: soc context
  265. * @vdev_id: vdev id
  266. * @disable_noa: TRUE - Disable NoA, FALSE - Enable NoA
  267. *
  268. * This function send wmi command to enable / disable NoA.
  269. *
  270. * Return: QDF_STATUS_SUCCESS - in case of success
  271. */
  272. QDF_STATUS ucfg_p2p_set_noa(struct wlan_objmgr_psoc *soc,
  273. uint32_t vdev_id, bool disable_noa);
  274. /**
  275. * ucfg_p2p_status_scan() - Show P2P connection status when scanning
  276. * @vdev: vdev context
  277. *
  278. * This function shows P2P connection status when scanning.
  279. *
  280. * Return: QDF_STATUS_SUCCESS - in case of success
  281. */
  282. QDF_STATUS ucfg_p2p_status_scan(struct wlan_objmgr_vdev *vdev);
  283. /**
  284. * ucfg_p2p_status_connect() - Update P2P connection status
  285. * @vdev: vdev context
  286. *
  287. * Updates P2P connection status by up layer when connecting.
  288. *
  289. * Return: QDF_STATUS_SUCCESS - in case of success
  290. */
  291. QDF_STATUS ucfg_p2p_status_connect(struct wlan_objmgr_vdev *vdev);
  292. /**
  293. * ucfg_p2p_status_disconnect() - Update P2P connection status
  294. * @vdev: vdev context
  295. *
  296. * Updates P2P connection status by up layer when disconnecting.
  297. *
  298. * Return: QDF_STATUS_SUCCESS - in case of success
  299. */
  300. QDF_STATUS ucfg_p2p_status_disconnect(struct wlan_objmgr_vdev *vdev);
  301. /**
  302. * ucfg_p2p_status_start_bss() - Update P2P connection status
  303. * @vdev: vdev context
  304. *
  305. * Updates P2P connection status by up layer when starting bss.
  306. *
  307. * Return: QDF_STATUS_SUCCESS - in case of success
  308. */
  309. QDF_STATUS ucfg_p2p_status_start_bss(struct wlan_objmgr_vdev *vdev);
  310. /**
  311. * ucfg_p2p_status_stop_bss() - Update P2P connection status
  312. * @vdev: vdev context
  313. *
  314. * Updates P2P connection status by up layer when stopping bss.
  315. *
  316. * Return: QDF_STATUS_SUCCESS - in case of success
  317. */
  318. QDF_STATUS ucfg_p2p_status_stop_bss(struct wlan_objmgr_vdev *vdev);
  319. #endif /* _WLAN_P2P_UCFG_API_H_ */