target_if_spectral_sim.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (c) 2015,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 _SPECTRAL_SIM_H_
  20. #define _SPECTRAL_SIM_H_
  21. #ifdef QCA_SUPPORT_SPECTRAL_SIMULATION
  22. #include "target_if_spectral.h"
  23. /**
  24. * @brief Initialize Spectral Simulation functionality
  25. * @details
  26. * Setup data structures to be used for serving out data corresponding to
  27. * various bandwidths and configurations.
  28. *
  29. * @param spectral - ath_spectral structure
  30. * @return Integer status value. 0:Success, -1:Failure
  31. */
  32. int target_if_spectral_sim_attach(struct target_if_spectral *spectral);
  33. /**
  34. * @brief De-initialize Spectral Simulation functionality
  35. * @details
  36. * Free up data structures used for serving out data corresponding to various
  37. * bandwidths and configurations.
  38. *
  39. * @param spectral - ath_spectral structure
  40. */
  41. void target_if_spectral_sim_detach(struct target_if_spectral *spectral);
  42. /**
  43. * @brief Check if Spectral (simulated) is active
  44. *
  45. * @param arg - pointer to ath_spectral structure
  46. * @return Integer status value. 0: Not active, 1: Active
  47. */
  48. u_int32_t tif_spectral_sim_is_spectral_active(void *arg);
  49. /**
  50. * @brief Check if Spectral (simulated) is enabled
  51. *
  52. * @param arg - pointer to ath_spectral structure
  53. * @return Integer status value. 0: Not enabled, 1: Enabled
  54. */
  55. u_int32_t tif_spectral_sim_is_spectral_enabled(void *arg);
  56. /**
  57. * @brief Start Spectral simulation
  58. *
  59. * @param arg - pointer to ath_spectral structure
  60. * @return Integer status value. 0: Failure, 1: Success
  61. */
  62. u_int32_t tif_spectral_sim_start_spectral_scan(void *arg);
  63. /**
  64. * @brief Stop Spectral simulation
  65. *
  66. * @param arg - pointer to ath_spectral structure
  67. * @return Integer status value. 0: Failure, 1: Success
  68. */
  69. u_int32_t tif_spectral_sim_stop_spectral_scan(void *arg);
  70. /**
  71. * @brief Configure Spectral parameters into simulation
  72. * @details
  73. * Internally, this function actually searches if a record set with the desired
  74. * configuration has been loaded. If so, it points to the record set for
  75. * later usage when the simulation is started. If not, it returns an error.
  76. *
  77. * @param arg - pointer to ath_spectral structure
  78. * @param params - pointer to struct spectral_config structure bearing Spectral
  79. * configuration
  80. * @return Integer status value. 0: Failure, 1: Success
  81. */
  82. u_int32_t tif_spectral_sim_configure_params(
  83. void *arg,
  84. struct spectral_config *params);
  85. /**
  86. * @brief Get Spectral parameters configured into simulation
  87. *
  88. * @param arg - pointer to ath_spectral structure
  89. * @param params - pointer to struct spectral_config structure which should be
  90. * populated with Spectral configuration
  91. * @return Integer status value. 0: Failure, 1: Success
  92. */
  93. u_int32_t tif_spectral_sim_get_params(
  94. void *arg,
  95. struct spectral_config *params);
  96. #endif /* QCA_SUPPORT_SPECTRAL_SIMULATION */
  97. #endif /* _SPECTRAL_SIM_H_ */