wlan_spectral_utils_api.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright (c) 2017 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. /**
  24. * wlan_spectral_init(): API to init spectral component
  25. *
  26. * This API is invoked from dispatcher init during all component init.
  27. * This API will register all required handlers for pdev and peer object
  28. * create/delete notification.
  29. *
  30. * Return: SUCCESS,
  31. * Failure
  32. */
  33. QDF_STATUS wlan_spectral_init(void);
  34. /**
  35. * wlan_spectral_deinit(): API to deinit spectral component
  36. *
  37. * This API is invoked from dispatcher deinit during all component deinit.
  38. * This API will unregister all registered handlers for pdev and peer object
  39. * create/delete notification.
  40. *
  41. * Return: SUCCESS,
  42. * Failure
  43. */
  44. QDF_STATUS wlan_spectral_deinit(void);
  45. /**
  46. * wlan_lmac_if_sptrl_register_rx_ops(): Register lmac interface Rx operations
  47. * @rx_ops: Pointer to lmac interface Rx operations structure
  48. *
  49. * Return: None
  50. */
  51. void wlan_lmac_if_sptrl_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops);
  52. /**
  53. * wlan_register_wmi_spectral_cmd_ops(): Register operations related to wmi
  54. commands on spectral parameters
  55. * @pdev - the physical device object
  56. * @cmd_ops - pointer to the structure holding the operations
  57. * related to wmi commands on spectral parameters
  58. *
  59. * Return: None
  60. */
  61. void wlan_register_wmi_spectral_cmd_ops(
  62. struct wlan_objmgr_pdev *pdev,
  63. struct wmi_spectral_cmd_ops *cmd_ops);
  64. /**
  65. * struct spectral_legacy_cbacks - Spectral legacy callbacks
  66. * @vdev_get_chan_freq: Get channel frequency
  67. * @vdev_get_ch_width: Get channel width
  68. * @vdev_get_sec20chan_freq_mhz: Get seconadry 20 frequency
  69. */
  70. struct spectral_legacy_cbacks {
  71. int16_t (*vdev_get_chan_freq)(struct wlan_objmgr_vdev *vdev);
  72. enum phy_ch_width (*vdev_get_ch_width)(struct wlan_objmgr_vdev *vdev);
  73. int (*vdev_get_sec20chan_freq_mhz)(struct wlan_objmgr_vdev *vdev,
  74. uint16_t *sec20chan_freq);
  75. };
  76. /**
  77. * spectral_register_legacy_cb - Register legacy callbacks
  78. * @psoc: psoc object
  79. * @legacy_cbacks: legacy callback structure
  80. *
  81. * Return: SUCCESS,
  82. * Failure
  83. */
  84. QDF_STATUS spectral_register_legacy_cb(struct wlan_objmgr_psoc *psoc,
  85. struct spectral_legacy_cbacks *legacy_cbacks);
  86. /**
  87. * spectral_vdev_get_chan_freq - Get vdev channel frequency
  88. * @vdev: vdev object
  89. *
  90. * Return: vdev operating frequency
  91. */
  92. int16_t spectral_vdev_get_chan_freq(struct wlan_objmgr_vdev *vdev);
  93. /**
  94. * spectral_vdev_get_ch_width - Get vdev channel band width
  95. * @vdev: vdev object
  96. *
  97. * Return: phy channel width
  98. */
  99. enum phy_ch_width spectral_vdev_get_ch_width(struct wlan_objmgr_vdev *vdev);
  100. /**
  101. * spectral_vdev_get_sec20chan_freq_mhz - Get vdev secondary channel frequncy
  102. * @vdev: vdev object
  103. * @sec20chan_freq: secondary channel frequency
  104. *
  105. * Return: secondary channel freq
  106. */
  107. int spectral_vdev_get_sec20chan_freq_mhz(struct wlan_objmgr_vdev *vdev,
  108. uint16_t *sec20chan_freq);
  109. #endif /* _WLAN_SPECTRAL_UTILS_API_H_*/