dispatcher_init_deinit.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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_psoc_open(): API to trigger PSOC open for all new components
  60. * @psoc: psoc context
  61. *
  62. * This API calls all new components PSOC OPEN APIs. This is invoked from
  63. * HDD/OS_If layer during:
  64. * 1) Driver load sequence
  65. * 2) PSOC object is created
  66. * 3) FW is not yet ready
  67. * 4) WMI channel is not yet established with FW
  68. *
  69. * PSOC open happens before FW WMI ready and hence a component can't
  70. * communicate with FW during PSOC open sequence.
  71. *
  72. * Return: none
  73. */
  74. QDF_STATUS dispatcher_psoc_open(struct wlan_objmgr_psoc *psoc);
  75. /**
  76. * dispatcher_psoc_close(): API to trigger PSOC close for all new components
  77. * @psoc: psoc context
  78. *
  79. * This API calls all new components PSOC CLOSE APIs. This is invoked from
  80. * HDD/OS_If layer during:
  81. * 1) Driver unload sequence
  82. * 2) PSOC object is destroyed
  83. * 3) FW is already dead(PDEV suspended)
  84. * 4) WMI channel is destroyed with FW
  85. *
  86. * A component can't communicate with FW during PSOC close.
  87. *
  88. * Return: none
  89. */
  90. QDF_STATUS dispatcher_psoc_close(struct wlan_objmgr_psoc *psoc);
  91. /**
  92. * dispatcher_psoc_enable(): API to trigger PSOC enable(start) for all new
  93. * components
  94. * @psoc: psoc context
  95. *
  96. * This API calls all new components PSOC enable(start) APIs. This is invoked
  97. * from HDD/OS_If layer during:
  98. * 1) Driver load sequence
  99. * 2) PSOC object is created
  100. * 3) WMI endpoint and WMI channel is ready with FW
  101. * 4) WMI FW ready event is also received from FW.
  102. *
  103. * FW is already ready and WMI channel is established by this time so a
  104. * component can communicate with FW during PSOC enable sequence.
  105. *
  106. * Return: none
  107. */
  108. QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc);
  109. /**
  110. * dispatcher_psoc_disable(): API to trigger PSOC disable(stop) for all new
  111. * components
  112. * @psoc: psoc context
  113. *
  114. * This API calls all new components PSOC disable(stop) APIs. This is invoked
  115. * from HDD/OS_If layer during:
  116. * 1) Driver unload sequence
  117. * 2) WMI channel is still available
  118. * 3) FW is still running and up
  119. * 4) PSOC object is not destroyed
  120. *
  121. * A component should abort all its ongign transaction with FW at this stage
  122. * for example scan component needs to abort all its ongoing scan in FW because
  123. * is goign to be stopped very soon.
  124. *
  125. * Return: none
  126. */
  127. QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc);
  128. #endif /* End of !defined(__DISPATCHER_INIT_H) */