1*4882a593Smuzhiyun /* SPDX-License-Identifier: ISC */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun * Copyright (c) 2013-2015 Qualcomm Atheros, Inc.
4*4882a593Smuzhiyun */
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun #ifndef SPECTRAL_H
7*4882a593Smuzhiyun #define SPECTRAL_H
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun #include "../spectral_common.h"
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun /**
12*4882a593Smuzhiyun * struct ath10k_spec_scan - parameters for Atheros spectral scan
13*4882a593Smuzhiyun *
14*4882a593Smuzhiyun * @count: number of scan results requested for manual mode
15*4882a593Smuzhiyun * @fft_size: number of bins to be requested = 2^(fft_size - bin_scale)
16*4882a593Smuzhiyun */
17*4882a593Smuzhiyun struct ath10k_spec_scan {
18*4882a593Smuzhiyun u8 count;
19*4882a593Smuzhiyun u8 fft_size;
20*4882a593Smuzhiyun };
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun /* enum ath10k_spectral_mode:
23*4882a593Smuzhiyun *
24*4882a593Smuzhiyun * @SPECTRAL_DISABLED: spectral mode is disabled
25*4882a593Smuzhiyun * @SPECTRAL_BACKGROUND: hardware sends samples when it is not busy with
26*4882a593Smuzhiyun * something else.
27*4882a593Smuzhiyun * @SPECTRAL_MANUAL: spectral scan is enabled, triggering for samples
28*4882a593Smuzhiyun * is performed manually.
29*4882a593Smuzhiyun */
30*4882a593Smuzhiyun enum ath10k_spectral_mode {
31*4882a593Smuzhiyun SPECTRAL_DISABLED = 0,
32*4882a593Smuzhiyun SPECTRAL_BACKGROUND,
33*4882a593Smuzhiyun SPECTRAL_MANUAL,
34*4882a593Smuzhiyun };
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun #ifdef CONFIG_ATH10K_SPECTRAL
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun int ath10k_spectral_process_fft(struct ath10k *ar,
39*4882a593Smuzhiyun struct wmi_phyerr_ev_arg *phyerr,
40*4882a593Smuzhiyun const struct phyerr_fft_report *fftr,
41*4882a593Smuzhiyun size_t bin_len, u64 tsf);
42*4882a593Smuzhiyun int ath10k_spectral_start(struct ath10k *ar);
43*4882a593Smuzhiyun int ath10k_spectral_vif_stop(struct ath10k_vif *arvif);
44*4882a593Smuzhiyun int ath10k_spectral_create(struct ath10k *ar);
45*4882a593Smuzhiyun void ath10k_spectral_destroy(struct ath10k *ar);
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun #else
48*4882a593Smuzhiyun
49*4882a593Smuzhiyun static inline int
ath10k_spectral_process_fft(struct ath10k * ar,struct wmi_phyerr_ev_arg * phyerr,const struct phyerr_fft_report * fftr,size_t bin_len,u64 tsf)50*4882a593Smuzhiyun ath10k_spectral_process_fft(struct ath10k *ar,
51*4882a593Smuzhiyun struct wmi_phyerr_ev_arg *phyerr,
52*4882a593Smuzhiyun const struct phyerr_fft_report *fftr,
53*4882a593Smuzhiyun size_t bin_len, u64 tsf)
54*4882a593Smuzhiyun {
55*4882a593Smuzhiyun return 0;
56*4882a593Smuzhiyun }
57*4882a593Smuzhiyun
ath10k_spectral_start(struct ath10k * ar)58*4882a593Smuzhiyun static inline int ath10k_spectral_start(struct ath10k *ar)
59*4882a593Smuzhiyun {
60*4882a593Smuzhiyun return 0;
61*4882a593Smuzhiyun }
62*4882a593Smuzhiyun
ath10k_spectral_vif_stop(struct ath10k_vif * arvif)63*4882a593Smuzhiyun static inline int ath10k_spectral_vif_stop(struct ath10k_vif *arvif)
64*4882a593Smuzhiyun {
65*4882a593Smuzhiyun return 0;
66*4882a593Smuzhiyun }
67*4882a593Smuzhiyun
ath10k_spectral_create(struct ath10k * ar)68*4882a593Smuzhiyun static inline int ath10k_spectral_create(struct ath10k *ar)
69*4882a593Smuzhiyun {
70*4882a593Smuzhiyun return 0;
71*4882a593Smuzhiyun }
72*4882a593Smuzhiyun
ath10k_spectral_destroy(struct ath10k * ar)73*4882a593Smuzhiyun static inline void ath10k_spectral_destroy(struct ath10k *ar)
74*4882a593Smuzhiyun {
75*4882a593Smuzhiyun }
76*4882a593Smuzhiyun
77*4882a593Smuzhiyun #endif /* CONFIG_ATH10K_SPECTRAL */
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun #endif /* SPECTRAL_H */
80