drivers/net/wireless/ath/ath11k/debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath11k/debugfs.c- Extension
.c- Size
- 46003 bytes
- Lines
- 1801
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/vmalloc.hdebugfs.hcore.hdebug.hwmi.hhal_rx.hdp_tx.hdebugfs_htt_stats.hpeer.hhif.h
Detected Declarations
function ath11k_debugfs_add_dbring_entryfunction ath11k_debugfs_fw_stats_processfunction ath11k_open_pdev_statsfunction ath11k_release_pdev_statsfunction ath11k_read_pdev_statsfunction ath11k_open_vdev_statsfunction ath11k_release_vdev_statsfunction ath11k_read_vdev_statsfunction ath11k_open_bcn_statsfunction ath11k_release_bcn_statsfunction ath11k_read_bcn_statsfunction ath11k_read_simulate_fw_crashfunction ath11k_write_simulate_fw_crashfunction ath11k_write_enable_extd_tx_statsfunction ath11k_read_enable_extd_tx_statsfunction ath11k_write_extd_rx_statsfunction ath11k_read_extd_rx_statsfunction ath11k_fill_bp_statsfunction ath11k_debugfs_dump_soc_ring_bp_statsfunction ath11k_debugfs_dump_soc_dp_statsfunction ath11k_write_fw_dbglogfunction ath11k_open_sram_dumpfunction ath11k_read_sram_dumpfunction ath11k_release_sram_dumpfunction ath11k_debugfs_pdev_createfunction ath11k_debugfs_pdev_destroyfunction ath11k_debugfs_soc_createfunction ath11k_debugfs_soc_destroyfunction ath11k_debugfs_fw_stats_initfunction ath11k_write_pktlog_filterfunction ath11k_read_pktlog_filterfunction ath11k_write_simulate_radarfunction ath11k_debug_dump_dbr_entriesfunction ath11k_debugfs_dbr_dbg_destroyfunction ath11k_debugfs_dbr_dbg_initfunction ath11k_debugfs_write_enable_dbr_dbgfunction ath11k_write_ps_timekeeper_enablefunction ath11k_read_ps_timekeeper_enablefunction ath11k_reset_peer_ps_durationfunction ath11k_write_reset_ps_durationfunction ath11k_peer_ps_state_disablefunction ath11k_write_ps_state_enablefunction ath11k_read_ps_state_enablefunction ath11k_debugfs_registerfunction ath11k_debugfs_unregisterfunction ath11k_write_twt_add_dialogfunction ath11k_write_twt_del_dialogfunction ath11k_write_twt_pause_dialog
Annotated Snippet
static const struct file_operations fops_pdev_stats = {
.open = ath11k_open_pdev_stats,
.release = ath11k_release_pdev_stats,
.read = ath11k_read_pdev_stats,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
static int ath11k_open_vdev_stats(struct inode *inode, struct file *file)
{
struct ath11k *ar = inode->i_private;
struct stats_request_params req_param;
void *buf = NULL;
int ret;
mutex_lock(&ar->conf_mutex);
if (ar->state != ATH11K_STATE_ON) {
ret = -ENETDOWN;
goto err_unlock;
}
buf = vmalloc(ATH11K_FW_STATS_BUF_SIZE);
if (!buf) {
ret = -ENOMEM;
goto err_unlock;
}
req_param.pdev_id = ar->pdev->pdev_id;
/* VDEV stats is always sent for all active VDEVs from FW */
req_param.vdev_id = 0;
req_param.stats_id = WMI_REQUEST_VDEV_STAT;
ret = ath11k_mac_fw_stats_request(ar, &req_param);
if (ret) {
ath11k_warn(ar->ab, "failed to request fw vdev stats: %d\n", ret);
goto err_free;
}
ath11k_wmi_fw_stats_fill(ar, &ar->fw_stats, req_param.stats_id, buf);
file->private_data = buf;
mutex_unlock(&ar->conf_mutex);
return 0;
err_free:
vfree(buf);
err_unlock:
mutex_unlock(&ar->conf_mutex);
return ret;
}
static int ath11k_release_vdev_stats(struct inode *inode, struct file *file)
{
vfree(file->private_data);
return 0;
}
static ssize_t ath11k_read_vdev_stats(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
{
const char *buf = file->private_data;
size_t len = strlen(buf);
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
static const struct file_operations fops_vdev_stats = {
.open = ath11k_open_vdev_stats,
.release = ath11k_release_vdev_stats,
.read = ath11k_read_vdev_stats,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
static int ath11k_open_bcn_stats(struct inode *inode, struct file *file)
{
struct ath11k *ar = inode->i_private;
struct ath11k_vif *arvif;
struct stats_request_params req_param;
void *buf = NULL;
int ret;
mutex_lock(&ar->conf_mutex);
if (ar->state != ATH11K_STATE_ON) {
Annotation
- Immediate include surface: `linux/export.h`, `linux/vmalloc.h`, `debugfs.h`, `core.h`, `debug.h`, `wmi.h`, `hal_rx.h`, `dp_tx.h`.
- Detected declarations: `function ath11k_debugfs_add_dbring_entry`, `function ath11k_debugfs_fw_stats_process`, `function ath11k_open_pdev_stats`, `function ath11k_release_pdev_stats`, `function ath11k_read_pdev_stats`, `function ath11k_open_vdev_stats`, `function ath11k_release_vdev_stats`, `function ath11k_read_vdev_stats`, `function ath11k_open_bcn_stats`, `function ath11k_release_bcn_stats`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.