drivers/net/wireless/ath/ath9k/common-spectral.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/common-spectral.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/common-spectral.c- Extension
.c- Size
- 30146 bytes
- Lines
- 1086
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/relay.hlinux/random.hath9k.h
Detected Declarations
function Copyrightfunction ath_debug_send_fft_samplefunction ath_cmn_max_idx_verify_ht20_fftfunction ath_cmn_max_idx_verify_ht20_40_fftfunction ath_cmn_process_ht20_fftfunction onefunction ath_cmn_process_ht20_40_fftfunction onefunction ath_cmn_copy_fft_framefunction ath_cmn_is_fft_buf_fullfunction for_each_possible_cpufunction ath_cmn_process_fftfunction bytefunction read_file_spec_scan_ctlfunction ath9k_cmn_spectral_scan_triggerfunction ath9k_cmn_spectral_scan_configfunction write_file_spec_scan_ctlfunction read_file_spectral_short_repeatfunction write_file_spectral_short_repeatfunction read_file_spectral_countfunction write_file_spectral_countfunction read_file_spectral_periodfunction write_file_spectral_periodfunction read_file_spectral_fft_periodfunction write_file_spectral_fft_periodfunction remove_buf_file_handlerfunction ath9k_cmn_spectral_deinit_debugfunction ath9k_cmn_spectral_init_debugexport ath_cmn_process_fftexport ath9k_cmn_spectral_scan_triggerexport ath9k_cmn_spectral_scan_configexport ath9k_cmn_spectral_deinit_debugexport ath9k_cmn_spectral_init_debug
Annotated Snippet
static const struct file_operations fops_spec_scan_ctl = {
.read = read_file_spec_scan_ctl,
.write = write_file_spec_scan_ctl,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
/*************************/
/* spectral_short_repeat */
/*************************/
static ssize_t read_file_spectral_short_repeat(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_spec_scan_priv *spec_priv = file->private_data;
char buf[32];
unsigned int len;
len = sprintf(buf, "%d\n", spec_priv->spec_config.short_repeat);
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
static ssize_t write_file_spectral_short_repeat(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_spec_scan_priv *spec_priv = file->private_data;
unsigned long val;
ssize_t ret;
ret = kstrtoul_from_user(user_buf, count, 0, &val);
if (ret)
return ret;
if (val > 1)
return -EINVAL;
spec_priv->spec_config.short_repeat = val;
return count;
}
static const struct file_operations fops_spectral_short_repeat = {
.read = read_file_spectral_short_repeat,
.write = write_file_spectral_short_repeat,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
/******************/
/* spectral_count */
/******************/
static ssize_t read_file_spectral_count(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_spec_scan_priv *spec_priv = file->private_data;
char buf[32];
unsigned int len;
len = sprintf(buf, "%d\n", spec_priv->spec_config.count);
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
static ssize_t write_file_spectral_count(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ath_spec_scan_priv *spec_priv = file->private_data;
unsigned long val;
ssize_t ret;
ret = kstrtoul_from_user(user_buf, count, 0, &val);
if (ret)
return ret;
if (val > 255)
return -EINVAL;
spec_priv->spec_config.count = val;
return count;
}
static const struct file_operations fops_spectral_count = {
.read = read_file_spectral_count,
.write = write_file_spectral_count,
.open = simple_open,
.owner = THIS_MODULE,
Annotation
- Immediate include surface: `linux/export.h`, `linux/relay.h`, `linux/random.h`, `ath9k.h`.
- Detected declarations: `function Copyright`, `function ath_debug_send_fft_sample`, `function ath_cmn_max_idx_verify_ht20_fft`, `function ath_cmn_max_idx_verify_ht20_40_fft`, `function ath_cmn_process_ht20_fft`, `function one`, `function ath_cmn_process_ht20_40_fft`, `function one`, `function ath_cmn_copy_fft_frame`, `function ath_cmn_is_fft_buf_full`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.