drivers/net/wireless/ath/ath10k/debugfs_sta.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath10k/debugfs_sta.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath10k/debugfs_sta.c- Extension
.c- Size
- 21545 bytes
- Lines
- 779
- 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
core.hwmi-ops.htxrx.hdebug.h
Detected Declarations
function Copyrightfunction ath10k_rx_stats_update_ampdu_subfrmfunction ath10k_sta_update_rx_tid_stats_ampdufunction ath10k_sta_update_rx_tid_statsfunction ath10k_sta_update_extd_stats_rx_durationfunction ath10k_sta_update_stats_rx_durationfunction ath10k_sta_update_rx_durationfunction ath10k_dbg_sta_read_aggr_modefunction ath10k_dbg_sta_write_aggr_modefunction ath10k_dbg_sta_write_addbafunction ath10k_dbg_sta_write_addba_respfunction ath10k_dbg_sta_write_delbafunction ath10k_dbg_sta_read_peer_debug_triggerfunction ath10k_dbg_sta_write_peer_debug_triggerfunction ath10k_dbg_sta_read_peer_ps_statefunction ath10k_dbg_sta_read_tid_statsfunction ath10k_dbg_sta_dump_tx_statsfunction ath10k_sta_add_debugfs
Annotated Snippet
static const struct file_operations fops_aggr_mode = {
.read = ath10k_dbg_sta_read_aggr_mode,
.write = ath10k_dbg_sta_write_aggr_mode,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
static ssize_t ath10k_dbg_sta_write_addba(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ieee80211_sta *sta = file->private_data;
struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
struct ath10k *ar = arsta->arvif->ar;
u32 tid, buf_size;
int ret;
char buf[64] = {};
ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos,
user_buf, count);
if (ret <= 0)
return ret;
ret = sscanf(buf, "%u %u", &tid, &buf_size);
if (ret != 2)
return -EINVAL;
/* Valid TID values are 0 through 15 */
if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2)
return -EINVAL;
mutex_lock(&ar->conf_mutex);
if ((ar->state != ATH10K_STATE_ON) ||
(arsta->aggr_mode != ATH10K_DBG_AGGR_MODE_MANUAL)) {
ret = count;
goto out;
}
ret = ath10k_wmi_addba_send(ar, arsta->arvif->vdev_id, sta->addr,
tid, buf_size);
if (ret) {
ath10k_warn(ar, "failed to send addba request: vdev_id %u peer %pM tid %u buf_size %u\n",
arsta->arvif->vdev_id, sta->addr, tid, buf_size);
}
ret = count;
out:
mutex_unlock(&ar->conf_mutex);
return ret;
}
static const struct file_operations fops_addba = {
.write = ath10k_dbg_sta_write_addba,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
static ssize_t ath10k_dbg_sta_write_addba_resp(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct ieee80211_sta *sta = file->private_data;
struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv;
struct ath10k *ar = arsta->arvif->ar;
u32 tid, status;
int ret;
char buf[64] = {};
ret = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos,
user_buf, count);
if (ret <= 0)
return ret;
ret = sscanf(buf, "%u %u", &tid, &status);
if (ret != 2)
return -EINVAL;
/* Valid TID values are 0 through 15 */
if (tid > HTT_DATA_TX_EXT_TID_MGMT - 2)
return -EINVAL;
mutex_lock(&ar->conf_mutex);
if ((ar->state != ATH10K_STATE_ON) ||
(arsta->aggr_mode != ATH10K_DBG_AGGR_MODE_MANUAL)) {
ret = count;
goto out;
}
Annotation
- Immediate include surface: `core.h`, `wmi-ops.h`, `txrx.h`, `debug.h`.
- Detected declarations: `function Copyright`, `function ath10k_rx_stats_update_ampdu_subfrm`, `function ath10k_sta_update_rx_tid_stats_ampdu`, `function ath10k_sta_update_rx_tid_stats`, `function ath10k_sta_update_extd_stats_rx_duration`, `function ath10k_sta_update_stats_rx_duration`, `function ath10k_sta_update_rx_duration`, `function ath10k_dbg_sta_read_aggr_mode`, `function ath10k_dbg_sta_write_aggr_mode`, `function ath10k_dbg_sta_write_addba`.
- 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.