wlan_mlme_cmn.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. /*
  2. * Copyright (c) 2019 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. */
  48. struct mlme_ext_ops {
  49. QDF_STATUS (*mlme_psoc_ext_hdl_create)(
  50. struct psoc_mlme_obj *psoc_mlme);
  51. QDF_STATUS (*mlme_psoc_ext_hdl_destroy)(
  52. struct psoc_mlme_obj *pdev_mlme);
  53. QDF_STATUS (*mlme_pdev_ext_hdl_create)(
  54. struct pdev_mlme_obj *pdev_mlme);
  55. QDF_STATUS (*mlme_pdev_ext_hdl_destroy)(
  56. struct pdev_mlme_obj *pdev_mlme);
  57. QDF_STATUS (*mlme_vdev_ext_hdl_create)(
  58. struct vdev_mlme_obj *vdev_mlme);
  59. QDF_STATUS (*mlme_vdev_ext_hdl_post_create)(
  60. struct vdev_mlme_obj *vdev_mlme);
  61. QDF_STATUS (*mlme_vdev_ext_hdl_destroy)(
  62. struct vdev_mlme_obj *vdev_mlme);
  63. QDF_STATUS (*mlme_vdev_start_fw_send)(
  64. struct wlan_objmgr_vdev *vdev, uint8_t restart);
  65. QDF_STATUS (*mlme_vdev_stop_fw_send)(struct wlan_objmgr_vdev *vdev);
  66. QDF_STATUS (*mlme_vdev_down_fw_send)(struct wlan_objmgr_vdev *vdev);
  67. QDF_STATUS (*mlme_multivdev_restart_fw_send)(
  68. struct wlan_objmgr_pdev *pdev);
  69. QDF_STATUS (*mlme_vdev_enqueue_exp_cmd)(
  70. struct vdev_mlme_obj *vdev_mlme,
  71. uint8_t cmd_type);
  72. QDF_STATUS (*mlme_vdev_ext_delete_rsp)(
  73. struct wlan_objmgr_psoc *psoc,
  74. struct vdev_delete_response *rsp);
  75. };
  76. /**
  77. * mlme_psoc_ops_ext_hdl_create() - Alloc PSOC mlme ext handle
  78. * @psoc_mlme: PSOC MLME comp object
  79. *
  80. * API to allocate PSOC MLME ext handle
  81. *
  82. * Return: SUCCESS on successful allocation
  83. * Else FAILURE
  84. */
  85. QDF_STATUS mlme_psoc_ops_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme);
  86. /**
  87. * mlme_psoc_ops_ext_hdl_destroy() - Destroy PSOC mlme ext handle
  88. * @psoc_mlme: PSOC MLME comp object
  89. *
  90. * API to free psoc MLME ext handle
  91. *
  92. * Return: SUCCESS on successful free
  93. * Else FAILURE
  94. */
  95. QDF_STATUS mlme_psoc_ops_ext_hdl_destroy(struct psoc_mlme_obj *psoc_mlme);
  96. /**
  97. * mlme_pdev_ops_ext_hdl_create - Alloc PDEV mlme ext handle
  98. * @pdev_mlme_obj: PDEV MLME comp object
  99. *
  100. * API to allocate PDEV MLME ext handle
  101. *
  102. * Return: SUCCESS on successful allocation
  103. * Else FAILURE
  104. */
  105. QDF_STATUS mlme_pdev_ops_ext_hdl_create(struct pdev_mlme_obj *pdev_mlme);
  106. /**
  107. * mlme_pdev_ops_ext_hdl_destroy - Destroy PDEV mlme ext handle
  108. * @pdev_mlme_obj: PDEV MLME comp object
  109. *
  110. * API to free pdev MLME ext handle
  111. *
  112. * Return: SUCCESS on successful free
  113. * Else FAILURE
  114. */
  115. QDF_STATUS mlme_pdev_ops_ext_hdl_destroy(struct pdev_mlme_obj *pdev_mlme);
  116. /**
  117. * mlme_vdev_ops_ext_hdl_create - Alloc VDEV mlme ext handle
  118. * @vdev_mlme_obj: VDEV MLME comp object
  119. *
  120. * API to allocate VDEV MLME ext handle
  121. *
  122. * Return: SUCCESS on successful allocation
  123. * Else FAILURE
  124. */
  125. QDF_STATUS mlme_vdev_ops_ext_hdl_create(struct vdev_mlme_obj *vdev_mlme);
  126. /**
  127. * mlme_vdev_ops_ext_hdl_post_create - Perform post VDEV mlme ext handle alloc
  128. * operations
  129. * @vdev_mlme_obj: VDEV MLME comp object
  130. *
  131. * API to perform post vdev MLME ext handle allocation operations
  132. *
  133. * Return: SUCCESS on initialization successful
  134. * Else FAILURE
  135. */
  136. QDF_STATUS mlme_vdev_ops_ext_hdl_post_create(struct vdev_mlme_obj *vdev_mlme);
  137. /**
  138. * mlme_vdev_ops_ext_hdl_destroy - Destroy VDEV mlme ext handle
  139. * @vdev_mlme_obj: VDEV MLME comp object
  140. *
  141. * API to free vdev MLME ext handle
  142. *
  143. * Return: SUCCESS on successful free
  144. * Else FAILURE
  145. */
  146. QDF_STATUS mlme_vdev_ops_ext_hdl_destroy(struct vdev_mlme_obj *vdev_mlme);
  147. /**
  148. * mlme_vdev_enqueue_exp_ser_cmd - Enqueue exception serialization cmd
  149. * @vdev_mlme_obj: VDEV MLME comp object
  150. * @cmd_type: Serialization command type
  151. *
  152. * API to enqueue the exception serialization command, used by
  153. * mlme-serialization wrapper layer
  154. *
  155. * Return: SUCCESS on successful enqueuing the command
  156. * Else FAILURE
  157. */
  158. QDF_STATUS mlme_vdev_enqueue_exp_ser_cmd(struct vdev_mlme_obj *vdev_mlme,
  159. uint8_t cmd_type);
  160. /**
  161. * mlme_vdev_ops_start_fw_send - Send WMI START/RESTART commmand to FW
  162. * @vdev: VDEV object
  163. *
  164. * API to send WMI start/restart command to FW
  165. *
  166. * Return: SUCCESS on successful sending the command
  167. * Else FAILURE
  168. */
  169. QDF_STATUS mlme_vdev_ops_start_fw_send(struct wlan_objmgr_vdev *vdev,
  170. uint8_t restart);
  171. /**
  172. * mlme_vdev_ops_multivdev_restart_fw_cmd_send - Send WMI Multivdev restart
  173. * commmand to FW
  174. * @pdev: PDEV object
  175. *
  176. * API to send WMI multivdev restart command to FW
  177. *
  178. * Return: SUCCESS on successful sending the command
  179. * Else FAILURE
  180. */
  181. QDF_STATUS mlme_vdev_ops_multivdev_restart_fw_cmd_send(
  182. struct wlan_objmgr_pdev *pdev);
  183. /**
  184. * mlme_vdev_ops_stop_fw_send - Send WMI STOP commmand to FW
  185. * @vdev: VDEV object
  186. *
  187. * API to send WMI stop command to FW
  188. *
  189. * Return: SUCCESS on successful sending the command
  190. * Else FAILURE
  191. */
  192. QDF_STATUS mlme_vdev_ops_stop_fw_send(struct wlan_objmgr_vdev *vdev);
  193. /**
  194. * mlme_vdev_ops_down_fw_send - Send WMI Down commmand to FW
  195. * @vdev: VDEV object
  196. *
  197. * API to send WMI down command to FW
  198. *
  199. * Return: SUCCESS on successful sending the command
  200. * Else FAILURE
  201. */
  202. QDF_STATUS mlme_vdev_ops_down_fw_send(struct wlan_objmgr_vdev *vdev);
  203. /**
  204. * mlme_set_ops_register_cb - Sets ops registration callback
  205. * @ops_cb: Function pointer
  206. *
  207. * API to set ops registration call back
  208. *
  209. * Return: void
  210. */
  211. typedef struct mlme_ext_ops *(*mlme_get_global_ops_cb)(void);
  212. void mlme_set_ops_register_cb(mlme_get_global_ops_cb ops_cb);
  213. /**
  214. * wlan_cmn_mlme_init - Initializes MLME component
  215. *
  216. * Registers callbacks with object manager for create/destroy
  217. *
  218. * Return: SUCCESS on successful registration
  219. * FAILURE, if registration fails
  220. */
  221. QDF_STATUS wlan_cmn_mlme_init(void);
  222. /**
  223. * wlan_cmn_mlme_deinit - Uninitializes MLME component
  224. *
  225. * Unregisters callbacks with object manager for create/destroy
  226. *
  227. * Return: SUCCESS on successful registration
  228. * FAILURE, if registration fails
  229. */
  230. QDF_STATUS wlan_cmn_mlme_deinit(void);
  231. /**
  232. * mlme_vdev_ops_ext_hdl_delete_rsp - Vdev Delete response ext handler
  233. * @psoc: PSOC object
  234. * @rsp: Vdev delete response received from the firmware
  235. *
  236. * API to invoke the legacy delete response handler for legacy cleanup
  237. *
  238. * Return: SUCCESS on successful deletion
  239. * FAILURE, if deletion fails
  240. */
  241. QDF_STATUS mlme_vdev_ops_ext_hdl_delete_rsp(struct wlan_objmgr_psoc *psoc,
  242. struct vdev_delete_response *rsp);
  243. #endif