dispatcher_init_deinit.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. * Copyright (c) 2016-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: This file provides various init/deinit trigger point for new
  20. * components.
  21. */
  22. #if !defined(__DISPATCHER_INIT_H)
  23. #define __DISPATCHER_INIT_H
  24. #include <qdf_types.h>
  25. #include <wlan_objmgr_cmn.h>
  26. #include <wlan_objmgr_psoc_obj.h>
  27. #include <wlan_objmgr_global_obj.h>
  28. /**
  29. * dispatcher_init(): API to init all new components
  30. *
  31. * This API calls all new components init APIs. This is invoked
  32. * from HDD/OS_If layer during:
  33. * 1) Driver load sequence
  34. * 2) before probing the attached device.
  35. * 3) FW is not ready
  36. * 4) WMI channel is not established
  37. *
  38. * A component can't communicate with FW during init stage.
  39. *
  40. * Return: none
  41. */
  42. QDF_STATUS dispatcher_init(void);
  43. /**
  44. * dispatcher_deinit(): API to de-init all new components
  45. *
  46. * This API calls all new components de-init APIs. This is invoked
  47. * from HDD/OS_If layer during:
  48. * 1) Driver unload sequence
  49. * 2) FW is dead
  50. * 3) WMI channel is destroyed
  51. * 4) all PDEV and PSOC objects are destroyed
  52. *
  53. * A component can't communicate with FW during de-init stage.
  54. *
  55. * Return: none
  56. */
  57. QDF_STATUS dispatcher_deinit(void);
  58. /**
  59. * dispatcher_enable(): global (above psoc) level component start
  60. *
  61. * Prepare components to service requests. Must only be called after
  62. * dispatcher_init().
  63. *
  64. * Return: QDF_STATUS
  65. */
  66. QDF_STATUS dispatcher_enable(void);
  67. /**
  68. * dispatcher_disable(): global (above psoc) level component stop
  69. *
  70. * Stop components from servicing requests. Must be called before
  71. * scheduler_deinit().
  72. *
  73. * Return: QDF_STATUS
  74. */
  75. QDF_STATUS dispatcher_disable(void);
  76. /**
  77. * dispatcher_psoc_open(): API to trigger PSOC open for all new components
  78. * @psoc: psoc context
  79. *
  80. * This API calls all new components PSOC OPEN APIs. This is invoked from
  81. * HDD/OS_If layer during:
  82. * 1) Driver load sequence
  83. * 2) PSOC object is created
  84. * 3) FW is not yet ready
  85. * 4) WMI channel is not yet established with FW
  86. *
  87. * PSOC open happens before FW WMI ready and hence a component can't
  88. * communicate with FW during PSOC open sequence.
  89. *
  90. * Return: none
  91. */
  92. QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc);
  93. /**
  94. * dispatcher_psoc_close(): API to trigger PSOC close for all new components
  95. * @psoc: psoc context
  96. *
  97. * This API calls all new components PSOC CLOSE APIs. This is invoked from
  98. * HDD/OS_If layer during:
  99. * 1) Driver unload sequence
  100. * 2) PSOC object is destroyed
  101. * 3) FW is already dead(PDEV suspended)
  102. * 4) WMI channel is destroyed with FW
  103. *
  104. * A component can't communicate with FW during PSOC close.
  105. *
  106. * Return: none
  107. */
  108. QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc);
  109. /**
  110. * dispatcher_psoc_enable(): API to trigger PSOC enable(start) for all new
  111. * components
  112. * @psoc: psoc context
  113. *
  114. * This API calls all new components PSOC enable(start) APIs. This is invoked
  115. * from HDD/OS_If layer during:
  116. * 1) Driver load sequence
  117. * 2) PSOC object is created
  118. * 3) WMI endpoint and WMI channel is ready with FW
  119. * 4) WMI FW ready event is also received from FW.
  120. *
  121. * FW is already ready and WMI channel is established by this time so a
  122. * component can communicate with FW during PSOC enable sequence.
  123. *
  124. * Return: none
  125. */
  126. QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc);
  127. /**
  128. * dispatcher_psoc_disable(): API to trigger PSOC disable(stop) for all new
  129. * components
  130. * @psoc: psoc context
  131. *
  132. * This API calls all new components PSOC disable(stop) APIs. This is invoked
  133. * from HDD/OS_If layer during:
  134. * 1) Driver unload sequence
  135. * 2) WMI channel is still available
  136. * 3) FW is still running and up
  137. * 4) PSOC object is not destroyed
  138. *
  139. * A component should abort all its ongign transaction with FW at this stage
  140. * for example scan component needs to abort all its ongoing scan in FW because
  141. * is goign to be stopped very soon.
  142. *
  143. * Return: none
  144. */
  145. QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc);
  146. #endif /* End of !defined(__DISPATCHER_INIT_H) */