1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
3 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
7 #ifndef ATH11K_SPECTRAL_H
8 #define ATH11K_SPECTRAL_H
10 #include "../spectral_common.h"
13 /* enum ath11k_spectral_mode:
15 * @SPECTRAL_DISABLED: spectral mode is disabled
16 * @SPECTRAL_BACKGROUND: hardware sends samples when it is not busy with
18 * @SPECTRAL_MANUAL: spectral scan is enabled, triggering for samples
19 * is performed manually.
21 enum ath11k_spectral_mode
{
22 ATH11K_SPECTRAL_DISABLED
= 0,
23 ATH11K_SPECTRAL_BACKGROUND
,
24 ATH11K_SPECTRAL_MANUAL
,
27 struct ath11k_spectral
{
28 struct ath11k_dbring rx_ring
;
29 /* Protects enabled */
31 struct rchan
*rfs_scan
; /* relay(fs) channel for spectral scan */
32 struct dentry
*scan_ctl
;
33 struct dentry
*scan_count
;
34 struct dentry
*scan_bins
;
35 enum ath11k_spectral_mode mode
;
42 #ifdef CONFIG_ATH11K_SPECTRAL
44 int ath11k_spectral_init(struct ath11k_base
*ab
);
45 void ath11k_spectral_deinit(struct ath11k_base
*ab
);
46 int ath11k_spectral_vif_stop(struct ath11k_vif
*arvif
);
47 void ath11k_spectral_reset_buffer(struct ath11k
*ar
);
48 enum ath11k_spectral_mode
ath11k_spectral_get_mode(struct ath11k
*ar
);
49 struct ath11k_dbring
*ath11k_spectral_get_dbring(struct ath11k
*ar
);
53 static inline int ath11k_spectral_init(struct ath11k_base
*ab
)
58 static inline void ath11k_spectral_deinit(struct ath11k_base
*ab
)
62 static inline int ath11k_spectral_vif_stop(struct ath11k_vif
*arvif
)
67 static inline void ath11k_spectral_reset_buffer(struct ath11k
*ar
)
72 enum ath11k_spectral_mode
ath11k_spectral_get_mode(struct ath11k
*ar
)
74 return ATH11K_SPECTRAL_DISABLED
;
78 struct ath11k_dbring
*ath11k_spectral_get_dbring(struct ath11k
*ar
)
83 #endif /* CONFIG_ATH11K_SPECTRAL */
84 #endif /* ATH11K_SPECTRAL_H */