drivers/net/wireless/ath/ath11k/debugfs_sta.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/debugfs_sta.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath11k/debugfs_sta.c- Extension
.c- Size
- 31909 bytes
- Lines
- 1031
- 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/vmalloc.hdebugfs_sta.hcore.hpeer.hdebug.hdp_tx.hdebugfs_htt_stats.h
Detected Declarations
function Copyrightfunction ath11k_debugfs_sta_update_txcomplfunction ath11k_dbg_sta_dump_tx_statsfunction ath11k_dbg_sta_write_cfr_capturefunction ath11k_dbg_sta_read_cfr_capturefunction ath11k_dbg_sta_dump_rx_statsfunction ath11k_dbg_sta_open_htt_peer_statsfunction ath11k_dbg_sta_release_htt_peer_statsfunction ath11k_dbg_sta_read_htt_peer_statsfunction ath11k_dbg_sta_write_peer_pktlogfunction ath11k_dbg_sta_read_peer_pktlogfunction ath11k_dbg_sta_write_delbafunction ath11k_dbg_sta_write_addba_respfunction ath11k_dbg_sta_write_addbafunction ath11k_dbg_sta_read_aggr_modefunction ath11k_dbg_sta_write_aggr_modefunction ath11k_write_htt_peer_stats_resetfunction ath11k_dbg_sta_read_peer_ps_statefunction ath11k_dbg_sta_read_current_ps_durationfunction ath11k_dbg_sta_read_total_ps_durationfunction ath11k_debugfs_sta_op_add
Annotated Snippet
static const struct file_operations fops_tx_stats = {
.read = ath11k_dbg_sta_dump_tx_stats,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
#ifdef CONFIG_ATH11K_CFR
static ssize_t ath11k_dbg_sta_write_cfr_capture(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ieee80211_sta *sta = file->private_data;
struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta);
struct ath11k *ar = arsta->arvif->ar;
struct ath11k_cfr *cfr = &ar->cfr;
struct wmi_peer_cfr_capture_conf_arg arg;
u32 cfr_capture_enable = 0, cfr_capture_bw = 0;
u32 cfr_capture_method = 0, cfr_capture_period = 0;
char buf[64] = {};
int ret;
simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
guard(mutex)(&ar->conf_mutex);
if (ar->state != ATH11K_STATE_ON)
return -ENETDOWN;
if (!ar->cfr_enabled)
return -EINVAL;
ret = sscanf(buf, "%u %u %u %u", &cfr_capture_enable, &cfr_capture_bw,
&cfr_capture_period, &cfr_capture_method);
if (ret < 1 || (cfr_capture_enable && ret != 4))
return -EINVAL;
if (cfr_capture_enable == arsta->cfr_capture.cfr_enable &&
(cfr_capture_period &&
cfr_capture_period == arsta->cfr_capture.cfr_period) &&
cfr_capture_bw == arsta->cfr_capture.cfr_bw &&
cfr_capture_method == arsta->cfr_capture.cfr_method)
return count;
if (!cfr_capture_enable &&
cfr_capture_enable == arsta->cfr_capture.cfr_enable)
return count;
if (cfr_capture_enable > WMI_PEER_CFR_CAPTURE_ENABLE ||
cfr_capture_bw > WMI_PEER_CFR_CAPTURE_BW_80 ||
cfr_capture_method > ATH11K_CFR_CAPTURE_METHOD_NULL_FRAME_WITH_PHASE ||
cfr_capture_period > WMI_PEER_CFR_PERIODICITY_MAX)
return -EINVAL;
/* Target expects cfr period in multiple of 10 */
if (cfr_capture_period % 10) {
ath11k_err(ar->ab, "periodicity should be 10x\n");
return -EINVAL;
}
if (ar->cfr.cfr_enabled_peer_cnt >= ATH11K_MAX_CFR_ENABLED_CLIENTS &&
!arsta->cfr_capture.cfr_enable) {
ath11k_err(ar->ab, "CFR enable peer threshold reached %u\n",
ar->cfr.cfr_enabled_peer_cnt);
return -EINVAL;
}
if (!cfr_capture_enable) {
cfr_capture_bw = arsta->cfr_capture.cfr_bw;
cfr_capture_period = arsta->cfr_capture.cfr_period;
cfr_capture_method = arsta->cfr_capture.cfr_method;
}
arg.request = cfr_capture_enable;
arg.periodicity = cfr_capture_period;
arg.bw = cfr_capture_bw;
arg.method = cfr_capture_method;
ret = ath11k_wmi_peer_set_cfr_capture_conf(ar, arsta->arvif->vdev_id,
sta->addr, &arg);
if (ret) {
ath11k_warn(ar->ab,
"failed to send cfr capture info: vdev_id %u peer %pM: %d\n",
arsta->arvif->vdev_id, sta->addr, ret);
return ret;
}
spin_lock_bh(&ar->cfr.lock);
Annotation
- Immediate include surface: `linux/vmalloc.h`, `debugfs_sta.h`, `core.h`, `peer.h`, `debug.h`, `dp_tx.h`, `debugfs_htt_stats.h`.
- Detected declarations: `function Copyright`, `function ath11k_debugfs_sta_update_txcompl`, `function ath11k_dbg_sta_dump_tx_stats`, `function ath11k_dbg_sta_write_cfr_capture`, `function ath11k_dbg_sta_read_cfr_capture`, `function ath11k_dbg_sta_dump_rx_stats`, `function ath11k_dbg_sta_open_htt_peer_stats`, `function ath11k_dbg_sta_release_htt_peer_stats`, `function ath11k_dbg_sta_read_htt_peer_stats`, `function ath11k_dbg_sta_write_peer_pktlog`.
- 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.