wlan_spectral_utils_api.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  3. *
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. #ifndef _WLAN_SPECTRAL_UTILS_API_H_
  20. #define _WLAN_SPECTRAL_UTILS_API_H_
  21. #include <wlan_objmgr_cmn.h>
  22. #include <wlan_lmac_if_def.h>
  23. /* Forward declaration */
  24. struct direct_buf_rx_data;
  25. /**
  26. * wlan_spectral_init() - API to init spectral component
  27. *
  28. * This API is invoked from dispatcher init during all component init.
  29. * This API will register all required handlers for pdev and peer object
  30. * create/delete notification.
  31. *
  32. * Return: SUCCESS,
  33. * Failure
  34. */
  35. QDF_STATUS wlan_spectral_init(void);
  36. /**
  37. * wlan_spectral_deinit() - API to deinit spectral component
  38. *
  39. * This API is invoked from dispatcher deinit during all component deinit.
  40. * This API will unregister all registered handlers for pdev and peer object
  41. * create/delete notification.
  42. *
  43. * Return: SUCCESS,
  44. * Failure
  45. */
  46. QDF_STATUS wlan_spectral_deinit(void);
  47. /**
  48. * wlan_lmac_if_sptrl_register_rx_ops() - Register lmac interface Rx operations
  49. * @rx_ops: Pointer to lmac interface Rx operations structure
  50. *
  51. * API to register spectral related lmac interface Rx operations
  52. *
  53. * Return: None
  54. */
  55. void
  56. wlan_lmac_if_sptrl_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
  57. /**
  58. * wlan_register_wmi_spectral_cmd_ops() - Register operations related to wmi
  59. * commands on spectral parameters
  60. * @pdev - the physical device object
  61. * @cmd_ops - pointer to the structure holding the operations
  62. * related to wmi commands on spectral parameters
  63. *
  64. * API to register operations related to wmi commands on spectral parameters
  65. *
  66. * Return: None
  67. */
  68. void
  69. wlan_register_wmi_spectral_cmd_ops(struct wlan_objmgr_pdev *pdev,
  70. struct wmi_spectral_cmd_ops *cmd_ops);
  71. /**
  72. * struct spectral_legacy_cbacks - Spectral legacy callbacks
  73. * @vdev_get_chan_freq: Get channel frequency
  74. * @vdev_get_ch_width: Get channel width
  75. * @vdev_get_sec20chan_freq_mhz: Get seconadry 20 frequency
  76. */
  77. struct spectral_legacy_cbacks {
  78. int16_t (*vdev_get_chan_freq)(struct wlan_objmgr_vdev *vdev);
  79. enum phy_ch_width (*vdev_get_ch_width)(struct wlan_objmgr_vdev *vdev);
  80. int (*vdev_get_sec20chan_freq_mhz)(struct wlan_objmgr_vdev *vdev,
  81. uint16_t *sec20chan_freq);
  82. };
  83. /**
  84. * spectral_vdev_get_chan_freq - Get vdev channel frequency
  85. * @vdev: vdev object
  86. *
  87. * Return: vdev operating frequency
  88. */
  89. int16_t spectral_vdev_get_chan_freq(struct wlan_objmgr_vdev *vdev);
  90. /**
  91. * spectral_vdev_get_sec20chan_freq_mhz - Get vdev secondary channel frequncy
  92. * @vdev: vdev object
  93. * @sec20chan_freq: secondary channel frequency
  94. *
  95. * Return: secondary channel freq
  96. */
  97. int spectral_vdev_get_sec20chan_freq_mhz(struct wlan_objmgr_vdev *vdev,
  98. uint16_t *sec20chan_freq);
  99. /**
  100. * spectral_register_legacy_cb() - Register spectral legacy callbacks
  101. * commands on spectral parameters
  102. * @psoc - the physical device object
  103. * @legacy_cbacks - Reference to struct spectral_legacy_cbacks from which
  104. * function pointers need to be copied
  105. *
  106. * API to register spectral related legacy callbacks
  107. *
  108. * Return: QDF_STATUS_SUCCESS upon successful registration,
  109. * QDF_STATUS_E_FAILURE upon failure
  110. */
  111. QDF_STATUS spectral_register_legacy_cb(
  112. struct wlan_objmgr_psoc *psoc,
  113. struct spectral_legacy_cbacks *legacy_cbacks);
  114. /**
  115. * spectral_vdev_get_ch_width() - Get the channel bandwidth
  116. * @vdev - Pointer to vdev
  117. *
  118. * API to get the channel bandwidth of a given vdev
  119. *
  120. * Return: Enumeration corresponding to the channel bandwidth
  121. */
  122. enum phy_ch_width
  123. spectral_vdev_get_ch_width(struct wlan_objmgr_vdev *vdev);
  124. /**
  125. * spectral_pdev_open() - Spectral pdev open handler
  126. * @pdev: pointer to pdev object
  127. *
  128. * API to execute operations on pdev open
  129. *
  130. * Return: QDF_STATUS_SUCCESS upon successful registration,
  131. * QDF_STATUS_E_FAILURE upon failure
  132. */
  133. QDF_STATUS spectral_pdev_open(struct wlan_objmgr_pdev *pdev);
  134. #ifdef DIRECT_BUF_RX_ENABLE
  135. /**
  136. * spectral_dbr_event_handler() - Spectral dbr event handler
  137. * @pdev: pointer to pdev object
  138. * @payload: dbr event buffer
  139. *
  140. * API to handle spectral dbr event
  141. *
  142. * Return: status
  143. */
  144. int spectral_dbr_event_handler(struct wlan_objmgr_pdev *pdev,
  145. struct direct_buf_rx_data *payload);
  146. #endif
  147. #endif /* _WLAN_SPECTRAL_UTILS_API_H_*/