wlan_mlme_cmn.h 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. };
  73. /**
  74. * mlme_psoc_ops_ext_hdl_create() - Alloc PSOC mlme ext handle
  75. * @psoc_mlme: PSOC MLME comp object
  76. *
  77. * API to allocate PSOC MLME ext handle
  78. *
  79. * Return: SUCCESS on successful allocation
  80. * Else FAILURE
  81. */
  82. QDF_STATUS mlme_psoc_ops_ext_hdl_create(struct psoc_mlme_obj *psoc_mlme);
  83. /**
  84. * mlme_psoc_ops_ext_hdl_destroy() - Destroy PSOC mlme ext handle
  85. * @psoc_mlme: PSOC MLME comp object
  86. *
  87. * API to free psoc MLME ext handle
  88. *
  89. * Return: SUCCESS on successful free
  90. * Else FAILURE
  91. */
  92. QDF_STATUS mlme_psoc_ops_ext_hdl_destroy(struct psoc_mlme_obj *psoc_mlme);
  93. /**
  94. * mlme_pdev_ops_ext_hdl_create - Alloc PDEV mlme ext handle
  95. * @pdev_mlme_obj: PDEV MLME comp object
  96. *
  97. * API to allocate PDEV MLME ext handle
  98. *
  99. * Return: SUCCESS on successful allocation
  100. * Else FAILURE
  101. */
  102. QDF_STATUS mlme_pdev_ops_ext_hdl_create(struct pdev_mlme_obj *pdev_mlme);
  103. /**
  104. * mlme_pdev_ops_ext_hdl_destroy - Destroy PDEV mlme ext handle
  105. * @pdev_mlme_obj: PDEV MLME comp object
  106. *
  107. * API to free pdev MLME ext handle
  108. *
  109. * Return: SUCCESS on successful free
  110. * Else FAILURE
  111. */
  112. QDF_STATUS mlme_pdev_ops_ext_hdl_destroy(struct pdev_mlme_obj *pdev_mlme);
  113. /**
  114. * mlme_vdev_ops_ext_hdl_create - Alloc VDEV mlme ext handle
  115. * @vdev_mlme_obj: VDEV MLME comp object
  116. *
  117. * API to allocate VDEV MLME ext handle
  118. *
  119. * Return: SUCCESS on successful allocation
  120. * Else FAILURE
  121. */
  122. QDF_STATUS mlme_vdev_ops_ext_hdl_create(struct vdev_mlme_obj *vdev_mlme);
  123. /**
  124. * mlme_vdev_ops_ext_hdl_post_create - Perform post VDEV mlme ext handle alloc
  125. * operations
  126. * @vdev_mlme_obj: VDEV MLME comp object
  127. *
  128. * API to perform post vdev MLME ext handle allocation operations
  129. *
  130. * Return: SUCCESS on initialization successful
  131. * Else FAILURE
  132. */
  133. QDF_STATUS mlme_vdev_ops_ext_hdl_post_create(struct vdev_mlme_obj *vdev_mlme);
  134. /**
  135. * mlme_vdev_ops_ext_hdl_destroy - Destroy VDEV mlme ext handle
  136. * @vdev_mlme_obj: VDEV MLME comp object
  137. *
  138. * API to free vdev MLME ext handle
  139. *
  140. * Return: SUCCESS on successful free
  141. * Else FAILURE
  142. */
  143. QDF_STATUS mlme_vdev_ops_ext_hdl_destroy(struct vdev_mlme_obj *vdev_mlme);
  144. /**
  145. * mlme_vdev_enqueue_exp_ser_cmd - Enqueue exception serialization cmd
  146. * @vdev_mlme_obj: VDEV MLME comp object
  147. * @cmd_type: Serialization command type
  148. *
  149. * API to enqueue the exception serialization command, used by
  150. * mlme-serialization wrapper layer
  151. *
  152. * Return: SUCCESS on successful enqueuing the command
  153. * Else FAILURE
  154. */
  155. QDF_STATUS mlme_vdev_enqueue_exp_ser_cmd(struct vdev_mlme_obj *vdev_mlme,
  156. uint8_t cmd_type);
  157. /**
  158. * mlme_vdev_ops_start_fw_send - Send WMI START/RESTART commmand to FW
  159. * @vdev: VDEV object
  160. *
  161. * API to send WMI start/restart command to FW
  162. *
  163. * Return: SUCCESS on successful sending the command
  164. * Else FAILURE
  165. */
  166. QDF_STATUS mlme_vdev_ops_start_fw_send(struct wlan_objmgr_vdev *vdev,
  167. uint8_t restart);
  168. /**
  169. * mlme_vdev_ops_multivdev_restart_fw_cmd_send - Send WMI Multivdev restart
  170. * commmand to FW
  171. * @pdev: PDEV object
  172. *
  173. * API to send WMI multivdev restart command to FW
  174. *
  175. * Return: SUCCESS on successful sending the command
  176. * Else FAILURE
  177. */
  178. QDF_STATUS mlme_vdev_ops_multivdev_restart_fw_cmd_send(
  179. struct wlan_objmgr_pdev *pdev);
  180. /**
  181. * mlme_vdev_ops_stop_fw_send - Send WMI STOP commmand to FW
  182. * @vdev: VDEV object
  183. *
  184. * API to send WMI stop command to FW
  185. *
  186. * Return: SUCCESS on successful sending the command
  187. * Else FAILURE
  188. */
  189. QDF_STATUS mlme_vdev_ops_stop_fw_send(struct wlan_objmgr_vdev *vdev);
  190. /**
  191. * mlme_vdev_ops_down_fw_send - Send WMI Down commmand to FW
  192. * @vdev: VDEV object
  193. *
  194. * API to send WMI down command to FW
  195. *
  196. * Return: SUCCESS on successful sending the command
  197. * Else FAILURE
  198. */
  199. QDF_STATUS mlme_vdev_ops_down_fw_send(struct wlan_objmgr_vdev *vdev);
  200. /**
  201. * mlme_set_ops_register_cb - Sets ops registration callback
  202. * @ops_cb: Function pointer
  203. *
  204. * API to set ops registration call back
  205. *
  206. * Return: void
  207. */
  208. typedef struct mlme_ext_ops *(*mlme_get_global_ops_cb)(void);
  209. void mlme_set_ops_register_cb(mlme_get_global_ops_cb ops_cb);
  210. /**
  211. * wlan_cmn_mlme_init - Initializes MLME component
  212. *
  213. * Registers callbacks with object manager for create/destroy
  214. *
  215. * Return: SUCCESS on successful registration
  216. * FAILURE, if registration fails
  217. */
  218. QDF_STATUS wlan_cmn_mlme_init(void);
  219. /**
  220. * wlan_cmn_mlme_deinit - Uninitializes MLME component
  221. *
  222. * Unregisters callbacks with object manager for create/destroy
  223. *
  224. * Return: SUCCESS on successful registration
  225. * FAILURE, if registration fails
  226. */
  227. QDF_STATUS wlan_cmn_mlme_deinit(void);
  228. #endif