Linux Audio

Check our new training course

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