spectral.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #ifndef SPECTRAL_H
  17. #define SPECTRAL_H
  18. #include "../spectral_common.h"
  19. /**
  20. * struct ath10k_spec_scan - parameters for Atheros spectral scan
  21. *
  22. * @count: number of scan results requested for manual mode
  23. * @fft_size: number of bins to be requested = 2^(fft_size - bin_scale)
  24. */
  25. struct ath10k_spec_scan {
  26. u8 count;
  27. u8 fft_size;
  28. };
  29. /* enum ath10k_spectral_mode:
  30. *
  31. * @SPECTRAL_DISABLED: spectral mode is disabled
  32. * @SPECTRAL_BACKGROUND: hardware sends samples when it is not busy with
  33. * something else.
  34. * @SPECTRAL_MANUAL: spectral scan is enabled, triggering for samples
  35. * is performed manually.
  36. */
  37. enum ath10k_spectral_mode {
  38. SPECTRAL_DISABLED = 0,
  39. SPECTRAL_BACKGROUND,
  40. SPECTRAL_MANUAL,
  41. };
  42. #ifdef CONFIG_ATH10K_DEBUGFS
  43. int ath10k_spectral_process_fft(struct ath10k *ar,
  44. struct wmi_phyerr_ev_arg *phyerr,
  45. const struct phyerr_fft_report *fftr,
  46. size_t bin_len, u64 tsf);
  47. int ath10k_spectral_start(struct ath10k *ar);
  48. int ath10k_spectral_vif_stop(struct ath10k_vif *arvif);
  49. int ath10k_spectral_create(struct ath10k *ar);
  50. void ath10k_spectral_destroy(struct ath10k *ar);
  51. #else
  52. static inline int
  53. ath10k_spectral_process_fft(struct ath10k *ar,
  54. struct wmi_phyerr_ev_arg *phyerr,
  55. const struct phyerr_fft_report *fftr,
  56. size_t bin_len, u64 tsf)
  57. {
  58. return 0;
  59. }
  60. static inline int ath10k_spectral_start(struct ath10k *ar)
  61. {
  62. return 0;
  63. }
  64. static inline int ath10k_spectral_vif_stop(struct ath10k_vif *arvif)
  65. {
  66. return 0;
  67. }
  68. static inline int ath10k_spectral_create(struct ath10k *ar)
  69. {
  70. return 0;
  71. }
  72. static inline void ath10k_spectral_destroy(struct ath10k *ar)
  73. {
  74. }
  75. #endif /* CONFIG_ATH10K_DEBUGFS */
  76. #endif /* SPECTRAL_H */