linux/drivers/net/wireless/ath/ath11k/spectral.c

// SPDX-License-Identifier: BSD-3-Clause-Clear
/*
 * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/relay.h>
#include "core.h"
#include "debug.h"

#define ATH11K_SPECTRAL_NUM_RESP_PER_EVENT
#define ATH11K_SPECTRAL_EVENT_TIMEOUT_MS

#define ATH11K_SPECTRAL_DWORD_SIZE
#define ATH11K_SPECTRAL_MIN_BINS
#define ATH11K_SPECTRAL_MIN_IB_BINS
#define ATH11K_SPECTRAL_MAX_IB_BINS(x)

#define ATH11K_SPECTRAL_SCAN_COUNT_MAX

/* Max channel computed by sum of 2g and 5g band channels */
#define ATH11K_SPECTRAL_TOTAL_CHANNEL
#define ATH11K_SPECTRAL_SAMPLES_PER_CHANNEL
#define ATH11K_SPECTRAL_PER_SAMPLE_SIZE(x)
#define ATH11K_SPECTRAL_TOTAL_SAMPLE
#define ATH11K_SPECTRAL_SUB_BUFF_SIZE(x)
#define ATH11K_SPECTRAL_NUM_SUB_BUF

#define ATH11K_SPECTRAL_20MHZ
#define ATH11K_SPECTRAL_40MHZ
#define ATH11K_SPECTRAL_80MHZ
#define ATH11K_SPECTRAL_160MHZ

#define ATH11K_SPECTRAL_SIGNATURE

#define ATH11K_SPECTRAL_TAG_RADAR_SUMMARY
#define ATH11K_SPECTRAL_TAG_RADAR_FFT
#define ATH11K_SPECTRAL_TAG_SCAN_SUMMARY
#define ATH11K_SPECTRAL_TAG_SCAN_SEARCH

#define SPECTRAL_TLV_HDR_LEN
#define SPECTRAL_TLV_HDR_TAG
#define SPECTRAL_TLV_HDR_SIGN

#define SPECTRAL_SUMMARY_INFO0_AGC_TOTAL_GAIN
#define SPECTRAL_SUMMARY_INFO0_OB_FLAG
#define SPECTRAL_SUMMARY_INFO0_GRP_IDX
#define SPECTRAL_SUMMARY_INFO0_RECENT_RFSAT
#define SPECTRAL_SUMMARY_INFO0_INBAND_PWR_DB
#define SPECTRAL_SUMMARY_INFO0_FALSE_SCAN
#define SPECTRAL_SUMMARY_INFO0_DETECTOR_ID
#define SPECTRAL_SUMMARY_INFO0_PRI80

#define SPECTRAL_SUMMARY_INFO2_PEAK_SIGNED_IDX
#define SPECTRAL_SUMMARY_INFO2_PEAK_MAGNITUDE
#define SPECTRAL_SUMMARY_INFO2_NARROWBAND_MASK
#define SPECTRAL_SUMMARY_INFO2_GAIN_CHANGE

struct spectral_tlv {} __packed;

struct spectral_summary_fft_report {} __packed;

struct ath11k_spectral_summary_report {};

#define SPECTRAL_FFT_REPORT_INFO0_DETECTOR_ID
#define SPECTRAL_FFT_REPORT_INFO0_FFT_NUM
#define SPECTRAL_FFT_REPORT_INFO0_RADAR_CHECK
#define SPECTRAL_FFT_REPORT_INFO0_PEAK_SIGNED_IDX
#define SPECTRAL_FFT_REPORT_INFO0_CHAIN_IDX

#define SPECTRAL_FFT_REPORT_INFO1_BASE_PWR_DB
#define SPECTRAL_FFT_REPORT_INFO1_TOTAL_GAIN_DB

#define SPECTRAL_FFT_REPORT_INFO2_NUM_STRONG_BINS
#define SPECTRAL_FFT_REPORT_INFO2_PEAK_MAGNITUDE
#define SPECTRAL_FFT_REPORT_INFO2_AVG_PWR_DB
#define SPECTRAL_FFT_REPORT_INFO2_REL_PWR_DB

struct spectral_search_fft_report {} __packed;

struct ath11k_spectral_search_report {};

static struct dentry *create_buf_file_handler(const char *filename,
					      struct dentry *parent,
					      umode_t mode,
					      struct rchan_buf *buf,
					      int *is_global)
{}

static int remove_buf_file_handler(struct dentry *dentry)
{}

static const struct rchan_callbacks rfs_scan_cb =;

static struct ath11k_vif *ath11k_spectral_get_vdev(struct ath11k *ar)
{}

static int ath11k_spectral_scan_trigger(struct ath11k *ar)
{}

static int ath11k_spectral_scan_config(struct ath11k *ar,
				       enum ath11k_spectral_mode mode)
{}

static ssize_t ath11k_read_file_spec_scan_ctl(struct file *file,
					      char __user *user_buf,
					      size_t count, loff_t *ppos)
{}

static ssize_t ath11k_write_file_spec_scan_ctl(struct file *file,
					       const char __user *user_buf,
					       size_t count, loff_t *ppos)
{}

static const struct file_operations fops_scan_ctl =;

static ssize_t ath11k_read_file_spectral_count(struct file *file,
					       char __user *user_buf,
					       size_t count, loff_t *ppos)
{}

static ssize_t ath11k_write_file_spectral_count(struct file *file,
						const char __user *user_buf,
						size_t count, loff_t *ppos)
{}

static const struct file_operations fops_scan_count =;

static ssize_t ath11k_read_file_spectral_bins(struct file *file,
					      char __user *user_buf,
					      size_t count, loff_t *ppos)
{}

static ssize_t ath11k_write_file_spectral_bins(struct file *file,
					       const char __user *user_buf,
					       size_t count, loff_t *ppos)
{}

static const struct file_operations fops_scan_bins =;

static int ath11k_spectral_pull_summary(struct ath11k *ar,
					struct wmi_dma_buf_release_meta_data *meta,
					struct spectral_summary_fft_report *summary,
					struct ath11k_spectral_summary_report *report)
{}

static int ath11k_spectral_pull_search(struct ath11k *ar,
				       struct spectral_search_fft_report *search,
				       struct ath11k_spectral_search_report *report)
{}

static u8 ath11k_spectral_get_max_exp(s8 max_index, u8 max_magnitude,
				      int bin_len, u8 *bins)
{}

static void ath11k_spectral_parse_fft(u8 *outbins, u8 *inbins, int num_bins, u8 fft_sz)
{}

static
int ath11k_spectral_process_fft(struct ath11k *ar,
				struct ath11k_spectral_summary_report *summary,
				void *data,
				struct fft_sample_ath11k *fft_sample,
				u32 data_len)
{}

static int ath11k_spectral_process_data(struct ath11k *ar,
					struct ath11k_dbring_data *param)
{}

static int ath11k_spectral_ring_alloc(struct ath11k *ar,
				      struct ath11k_dbring_cap *db_cap)
{}

static inline void ath11k_spectral_ring_free(struct ath11k *ar)
{}

static inline void ath11k_spectral_debug_unregister(struct ath11k *ar)
{}

int ath11k_spectral_vif_stop(struct ath11k_vif *arvif)
{}

void ath11k_spectral_reset_buffer(struct ath11k *ar)
{}

void ath11k_spectral_deinit(struct ath11k_base *ab)
{}

static inline int ath11k_spectral_debug_register(struct ath11k *ar)
{}

int ath11k_spectral_init(struct ath11k_base *ab)
{}

enum ath11k_spectral_mode ath11k_spectral_get_mode(struct ath11k *ar)
{}

struct ath11k_dbring *ath11k_spectral_get_dbring(struct ath11k *ar)
{}