Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
0002 /*
0003  * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
0004  */
0005 
0006 #ifndef ATH11K_SPECTRAL_H
0007 #define ATH11K_SPECTRAL_H
0008 
0009 #include "../spectral_common.h"
0010 #include "dbring.h"
0011 
0012 /* enum ath11k_spectral_mode:
0013  *
0014  * @SPECTRAL_DISABLED: spectral mode is disabled
0015  * @SPECTRAL_BACKGROUND: hardware sends samples when it is not busy with
0016  *  something else.
0017  * @SPECTRAL_MANUAL: spectral scan is enabled, triggering for samples
0018  *  is performed manually.
0019  */
0020 enum ath11k_spectral_mode {
0021     ATH11K_SPECTRAL_DISABLED = 0,
0022     ATH11K_SPECTRAL_BACKGROUND,
0023     ATH11K_SPECTRAL_MANUAL,
0024 };
0025 
0026 struct ath11k_spectral {
0027     struct ath11k_dbring rx_ring;
0028     /* Protects enabled */
0029     spinlock_t lock;
0030     struct rchan *rfs_scan; /* relay(fs) channel for spectral scan */
0031     struct dentry *scan_ctl;
0032     struct dentry *scan_count;
0033     struct dentry *scan_bins;
0034     enum ath11k_spectral_mode mode;
0035     u16 count;
0036     u8 fft_size;
0037     bool enabled;
0038 };
0039 
0040 #ifdef CONFIG_ATH11K_SPECTRAL
0041 
0042 int ath11k_spectral_init(struct ath11k_base *ab);
0043 void ath11k_spectral_deinit(struct ath11k_base *ab);
0044 int ath11k_spectral_vif_stop(struct ath11k_vif *arvif);
0045 void ath11k_spectral_reset_buffer(struct ath11k *ar);
0046 enum ath11k_spectral_mode ath11k_spectral_get_mode(struct ath11k *ar);
0047 struct ath11k_dbring *ath11k_spectral_get_dbring(struct ath11k *ar);
0048 
0049 #else
0050 
0051 static inline int ath11k_spectral_init(struct ath11k_base *ab)
0052 {
0053     return 0;
0054 }
0055 
0056 static inline void ath11k_spectral_deinit(struct ath11k_base *ab)
0057 {
0058 }
0059 
0060 static inline int ath11k_spectral_vif_stop(struct ath11k_vif *arvif)
0061 {
0062     return 0;
0063 }
0064 
0065 static inline void ath11k_spectral_reset_buffer(struct ath11k *ar)
0066 {
0067 }
0068 
0069 static inline
0070 enum ath11k_spectral_mode ath11k_spectral_get_mode(struct ath11k *ar)
0071 {
0072     return ATH11K_SPECTRAL_DISABLED;
0073 }
0074 
0075 static inline
0076 struct ath11k_dbring *ath11k_spectral_get_dbring(struct ath11k *ar)
0077 {
0078     return NULL;
0079 }
0080 
0081 #endif /* CONFIG_ATH11K_SPECTRAL */
0082 #endif /* ATH11K_SPECTRAL_H */