wlan_mlme_cmn.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /*
  2. * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. /**
  17. * DOC: Define Common MLME structure and APIs
  18. */
  19. #ifndef _WLAN_MLME_CMN_H_
  20. #define _WLAN_MLME_CMN_H_
  21. #include <include/wlan_psoc_mlme.h>
  22. #include <include/wlan_pdev_mlme.h>
  23. #include <include/wlan_vdev_mlme.h>
  24. /**
  25. * struct vdev_mlme_ext_ops - VDEV MLME legacy callbacks structure
  26. * @mlme_psoc_ext_hdl_create: callback to invoke creation of legacy
  27. * psoc object
  28. * @mlme_psoc_ext_hdl_destroy: callback to invoke destroy of legacy
  29. * psoc object
  30. * @mlme_pdev_ext_hdl_create: callback to invoke creation of legacy
  31. * pdev object
  32. * @mlme_pdev_ext_hdl_destroy: callback to invoke destroy of legacy
  33. * pdev object
  34. * @mlme_vdev_ext_hdl_create: callback to invoke creation of legacy
  35. * vdev object
  36. * @mlme_vdev_ext_hdl_post_create: callback to invoke post creation actions
  37. * of legacy vdev object
  38. * @mlme_vdev_ext_hdl_destroy: callback to invoke destroy of legacy
  39. * vdev object
  40. * @mlme_vdev_start_fw_send: callback to invoke vdev start command
  41. * @mlme_vdev_stop_fw_send: callback to invoke vdev stop command
  42. * @mlme_vdev_down_fw_send: callback to invoke vdev down command
  43. * @mlme_multivdev_restart_fw_send: callback to invoke multivdev restart
  44. * command
  45. * @mlme_vdev_enqueue_exp_cmd: callback to enqueue exception command
  46. * required by serialization
  47. * @mlme_multi_vdev_restart_resp: callback to process multivdev restart
  48. * response
  49. */
  50. struct mlme_ext_ops {
  51. QDF_STATUS (*mlme_psoc_ext_hdl_create)(
  52. struct psoc_mlme_obj *psoc_mlme);
  53. QDF_STATUS (*mlme_psoc_ext_hdl_destroy)(
  54. struct psoc_mlme_obj *pdev_mlme);
  55. QDF_STATUS (*mlme_pdev_ext_hdl_create)(
  56. struct pdev_mlme_obj *pdev_mlme);
  57. QDF_STATUS (*mlme_pdev_ext_hdl_destroy)(
  58. struct pdev_mlme_obj *pdev_mlme);
  59. QDF_STATUS (*mlme_vdev_ext_hdl_create)(
  60. struct vdev_mlme_obj *vdev_mlme);
  61. QDF_STATUS (*mlme_vdev_ext_hdl_post_create)(
  62. struct vdev_mlme_obj *vdev_mlme);
  63. QDF_STATUS (*mlme_vdev_ext_hdl_destroy)(
  64. struct vdev_mlme_obj *vdev_mlme);
  65. QDF_STATUS (*mlme_vdev_start_fw_send)(
  66. struct wlan_objmgr_vdev *vdev, uint8_t restart);
  67. QDF_STATUS (*mlme_vdev_stop_fw_send)(struct wlan_objmgr_vdev *vdev);
  68. QDF_STATUS (*mlme_vdev_down_fw_send)(struct wlan_objmgr_vdev *vdev);
  69. QDF_STATUS (*mlme_multivdev_restart_fw_send)(
  70. struct wlan_objmgr_pdev *pdev);
  71. QDF_STATUS (*mlme_vdev_enqueue_exp_cmd)(
  72. struct vdev_mlme_obj *vdev_mlme,
  73. uint8_t cmd_type);
  74. QDF_STATUS (*mlme_vdev_ext_delete_rsp)(
  75. struct wlan_objmgr_psoc *psoc,
  76. struct vdev_delete_response *rsp);
  77. QDF_STATUS (*mlme_multi_vdev_restart_resp)(
  78. struct wlan_objmgr_psoc *psoc,
  79. struct multi_vdev_restart_resp *resp);
  80. };
  81. /**
  82. * mlme_psoc_ops_ext_hdl_create() - Alloc PSOC mlme ext handle
  83. * @psoc_mlme: PSOC MLME comp object
  84. *
  85. * API to allocate PSOC MLME ext handle
  86. *
  87. * Return: SUCCESS on successful allocation
  88. * Else FAILURE
  89. */
  90. QDF_STATUS mlme_psoc_ops_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme);
  91. /**
  92. * mlme_psoc_ops_ext_hdl_destroy() - Destroy PSOC mlme ext handle
  93. * @psoc_mlme: PSOC MLME comp object
  94. *
  95. * API to free psoc MLME ext handle
  96. *
  97. * Return: SUCCESS on successful free
  98. * Else FAILURE
  99. */
  100. QDF_STATUS mlme_psoc_ops_ext_hdl_destroy(struct psoc_mlme_obj *psoc_mlme);
  101. /**
  102. * mlme_pdev_ops_ext_hdl_create - Alloc PDEV mlme ext handle
  103. * @pdev_mlme_obj: PDEV MLME comp object
  104. *
  105. * API to allocate PDEV MLME ext handle
  106. *
  107. * Return: SUCCESS on successful allocation
  108. * Else FAILURE
  109. */
  110. QDF_STATUS mlme_pdev_ops_ext_hdl_create(struct pdev_mlme_obj *pdev_mlme);
  111. /**
  112. * mlme_pdev_ops_ext_hdl_destroy - Destroy PDEV mlme ext handle
  113. * @pdev_mlme_obj: PDEV MLME comp object
  114. *
  115. * API to free pdev MLME ext handle
  116. *
  117. * Return: SUCCESS on successful free
  118. * Else FAILURE
  119. */
  120. QDF_STATUS mlme_pdev_ops_ext_hdl_destroy(struct pdev_mlme_obj *pdev_mlme);
  121. /**
  122. * mlme_vdev_ops_ext_hdl_create - Alloc VDEV mlme ext handle
  123. * @vdev_mlme_obj: VDEV MLME comp object
  124. *
  125. * API to allocate VDEV MLME ext handle
  126. *
  127. * Return: SUCCESS on successful allocation
  128. * Else FAILURE
  129. */
  130. QDF_STATUS mlme_vdev_ops_ext_hdl_create(struct vdev_mlme_obj *vdev_mlme);
  131. /**
  132. * mlme_vdev_ops_ext_hdl_post_create - Perform post VDEV mlme ext handle alloc
  133. * operations
  134. * @vdev_mlme_obj: VDEV MLME comp object
  135. *
  136. * API to perform post vdev MLME ext handle allocation operations
  137. *
  138. * Return: SUCCESS on initialization successful
  139. * Else FAILURE
  140. */
  141. QDF_STATUS mlme_vdev_ops_ext_hdl_post_create(struct vdev_mlme_obj *vdev_mlme);
  142. /**
  143. * mlme_vdev_ops_ext_hdl_destroy - Destroy VDEV mlme ext handle
  144. * @vdev_mlme_obj: VDEV MLME comp object
  145. *
  146. * API to free vdev MLME ext handle
  147. *
  148. * Return: SUCCESS on successful free
  149. * Else FAILURE
  150. */
  151. QDF_STATUS mlme_vdev_ops_ext_hdl_destroy(struct vdev_mlme_obj *vdev_mlme);
  152. /**
  153. * mlme_vdev_enqueue_exp_ser_cmd - Enqueue exception serialization cmd
  154. * @vdev_mlme_obj: VDEV MLME comp object
  155. * @cmd_type: Serialization command type
  156. *
  157. * API to enqueue the exception serialization command, used by
  158. * mlme-serialization wrapper layer
  159. *
  160. * Return: SUCCESS on successful enqueuing the command
  161. * Else FAILURE
  162. */
  163. QDF_STATUS mlme_vdev_enqueue_exp_ser_cmd(struct vdev_mlme_obj *vdev_mlme,
  164. uint8_t cmd_type);
  165. /**
  166. * mlme_vdev_ops_start_fw_send - Send WMI START/RESTART commmand to FW
  167. * @vdev: VDEV object
  168. *
  169. * API to send WMI start/restart command to FW
  170. *
  171. * Return: SUCCESS on successful sending the command
  172. * Else FAILURE
  173. */
  174. QDF_STATUS mlme_vdev_ops_start_fw_send(struct wlan_objmgr_vdev *vdev,
  175. uint8_t restart);
  176. /**
  177. * mlme_vdev_ops_multivdev_restart_fw_cmd_send - Send WMI Multivdev restart
  178. * commmand to FW
  179. * @pdev: PDEV object
  180. *
  181. * API to send WMI multivdev restart command to FW
  182. *
  183. * Return: SUCCESS on successful sending the command
  184. * Else FAILURE
  185. */
  186. QDF_STATUS mlme_vdev_ops_multivdev_restart_fw_cmd_send(
  187. struct wlan_objmgr_pdev *pdev);
  188. /**
  189. * mlme_vdev_ops_stop_fw_send - Send WMI STOP commmand to FW
  190. * @vdev: VDEV object
  191. *
  192. * API to send WMI stop command to FW
  193. *
  194. * Return: SUCCESS on successful sending the command
  195. * Else FAILURE
  196. */
  197. QDF_STATUS mlme_vdev_ops_stop_fw_send(struct wlan_objmgr_vdev *vdev);
  198. /**
  199. * mlme_vdev_ops_down_fw_send - Send WMI Down commmand to FW
  200. * @vdev: VDEV object
  201. *
  202. * API to send WMI down command to FW
  203. *
  204. * Return: SUCCESS on successful sending the command
  205. * Else FAILURE
  206. */
  207. QDF_STATUS mlme_vdev_ops_down_fw_send(struct wlan_objmgr_vdev *vdev);
  208. /*
  209. * mlme_vdev_ops_ext_hdl_multivdev_restart_resp() - Handler multivdev restart
  210. * response event
  211. * @psoc: PSOC object manager handle
  212. * @resp: Restart response event
  213. *
  214. * Return: Success on successful handling of the response event,
  215. * Else failure
  216. */
  217. QDF_STATUS mlme_vdev_ops_ext_hdl_multivdev_restart_resp(
  218. struct wlan_objmgr_psoc *psoc,
  219. struct multi_vdev_restart_resp *resp);
  220. /**
  221. * mlme_set_ops_register_cb - Sets ops registration callback
  222. * @ops_cb: Function pointer
  223. *
  224. * API to set ops registration call back
  225. *
  226. * Return: void
  227. */
  228. typedef struct mlme_ext_ops *(*mlme_get_global_ops_cb)(void);
  229. void mlme_set_ops_register_cb(mlme_get_global_ops_cb ops_cb);
  230. /**
  231. * wlan_cmn_mlme_init - Initializes MLME component
  232. *
  233. * Registers callbacks with object manager for create/destroy
  234. *
  235. * Return: SUCCESS on successful registration
  236. * FAILURE, if registration fails
  237. */
  238. QDF_STATUS wlan_cmn_mlme_init(void);
  239. /**
  240. * wlan_cmn_mlme_deinit - Uninitializes MLME component
  241. *
  242. * Unregisters callbacks with object manager for create/destroy
  243. *
  244. * Return: SUCCESS on successful registration
  245. * FAILURE, if registration fails
  246. */
  247. QDF_STATUS wlan_cmn_mlme_deinit(void);
  248. /**
  249. * mlme_vdev_ops_ext_hdl_delete_rsp - Vdev Delete response ext handler
  250. * @psoc: PSOC object
  251. * @rsp: Vdev delete response received from the firmware
  252. *
  253. * API to invoke the legacy delete response handler for legacy cleanup
  254. *
  255. * Return: SUCCESS on successful deletion
  256. * FAILURE, if deletion fails
  257. */
  258. QDF_STATUS mlme_vdev_ops_ext_hdl_delete_rsp(struct wlan_objmgr_psoc *psoc,
  259. struct vdev_delete_response *rsp);
  260. #endif