drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c- Extension
.c- Size
- 178680 bytes
- Lines
- 4905
- 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.hcore.hdp_tx.hdp_rx.hdebug.hdebugfs_htt_stats.h
Detected Declarations
function htt_print_stats_string_tlvfunction htt_print_tx_pdev_stats_cmn_tlvfunction htt_print_tx_pdev_stats_urrn_tlv_vfunction htt_print_tx_pdev_stats_flush_tlv_vfunction htt_print_tx_pdev_stats_sifs_tlv_vfunction htt_print_tx_pdev_stats_phy_err_tlv_vfunction htt_print_tx_pdev_stats_sifs_hist_tlv_vfunction htt_print_tx_pdev_stats_tx_ppdu_stats_tlv_vfunction htt_print_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_vfunction htt_print_hw_stats_intr_misc_tlvfunction htt_print_hw_stats_wd_timeout_tlvfunction htt_print_hw_stats_pdev_errs_tlvfunction htt_print_msdu_flow_stats_tlvfunction htt_print_tx_tid_stats_tlvfunction htt_print_tx_tid_stats_v1_tlvfunction htt_print_rx_tid_stats_tlvfunction htt_print_counter_tlvfunction htt_print_peer_stats_cmn_tlvfunction htt_print_peer_details_tlvfunction htt_print_tx_peer_rate_stats_tlvfunction htt_print_rx_peer_rate_stats_tlvfunction htt_print_tx_hwq_mu_mimo_sch_stats_tlvfunction htt_print_tx_hwq_mu_mimo_mpdu_stats_tlvfunction htt_print_tx_hwq_mu_mimo_cmn_stats_tlvfunction htt_print_tx_hwq_stats_cmn_tlvfunction htt_print_tx_hwq_difs_latency_stats_tlv_vfunction htt_print_tx_hwq_cmd_result_stats_tlv_vfunction htt_print_tx_hwq_cmd_stall_stats_tlv_vfunction htt_print_tx_hwq_fes_result_stats_tlv_vfunction htt_print_tx_hwq_tried_mpdu_cnt_hist_tlv_vfunction htt_print_tx_hwq_txop_used_cnt_hist_tlv_vfunction htt_print_tx_sounding_stats_tlvfunction htt_print_tx_selfgen_cmn_stats_tlvfunction htt_print_tx_selfgen_ac_stats_tlvfunction htt_print_tx_selfgen_ax_stats_tlvfunction htt_print_tx_selfgen_ac_err_stats_tlvfunction htt_print_tx_selfgen_ax_err_stats_tlvfunction htt_print_tx_pdev_mu_mimo_sch_stats_tlvfunction htt_print_tx_pdev_mu_mimo_mpdu_stats_tlvfunction htt_print_sched_txq_cmd_posted_tlv_vfunction htt_print_sched_txq_cmd_reaped_tlv_vfunction htt_print_sched_txq_sched_order_su_tlv_vfunction htt_print_sched_txq_sched_ineligibility_tlv_vfunction htt_print_tx_pdev_stats_sched_per_txq_tlvfunction htt_print_stats_tx_sched_cmn_tlvfunction htt_print_tx_tqm_gen_mpdu_stats_tlv_vfunction htt_print_tx_tqm_list_mpdu_stats_tlv_vfunction htt_print_tx_tqm_list_mpdu_cnt_tlv_v
Annotated Snippet
static const struct file_operations fops_htt_stats_type = {
.read = ath11k_read_htt_stats_type,
.write = ath11k_write_htt_stats_type,
.open = simple_open,
.owner = THIS_MODULE,
.llseek = default_llseek,
};
static int ath11k_prep_htt_stats_cfg_params(struct ath11k *ar, u8 type,
const u8 *mac_addr,
struct htt_ext_stats_cfg_params *cfg_params)
{
if (!cfg_params)
return -EINVAL;
switch (type) {
case ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_HWQ:
case ATH11K_DBG_HTT_EXT_STATS_TX_MU_HWQ:
cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_ALL_HWQS;
break;
case ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_SCHED:
cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_ALL_TXQS;
break;
case ATH11K_DBG_HTT_EXT_STATS_TQM_CMDQ:
cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_ALL_CMDQS;
break;
case ATH11K_DBG_HTT_EXT_STATS_PEER_INFO:
cfg_params->cfg0 = HTT_STAT_PEER_INFO_MAC_ADDR;
cfg_params->cfg0 |= FIELD_PREP(GENMASK(15, 1),
HTT_PEER_STATS_REQ_MODE_FLUSH_TQM);
cfg_params->cfg1 = HTT_STAT_DEFAULT_PEER_REQ_TYPE;
cfg_params->cfg2 |= FIELD_PREP(GENMASK(7, 0), mac_addr[0]);
cfg_params->cfg2 |= FIELD_PREP(GENMASK(15, 8), mac_addr[1]);
cfg_params->cfg2 |= FIELD_PREP(GENMASK(23, 16), mac_addr[2]);
cfg_params->cfg2 |= FIELD_PREP(GENMASK(31, 24), mac_addr[3]);
cfg_params->cfg3 |= FIELD_PREP(GENMASK(7, 0), mac_addr[4]);
cfg_params->cfg3 |= FIELD_PREP(GENMASK(15, 8), mac_addr[5]);
break;
case ATH11K_DBG_HTT_EXT_STATS_RING_IF_INFO:
case ATH11K_DBG_HTT_EXT_STATS_SRNG_INFO:
cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_ALL_RINGS;
break;
case ATH11K_DBG_HTT_EXT_STATS_ACTIVE_PEERS_LIST:
cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_ACTIVE_PEERS;
break;
case ATH11K_DBG_HTT_EXT_STATS_PDEV_CCA_STATS:
cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_CCA_CUMULATIVE;
break;
case ATH11K_DBG_HTT_EXT_STATS_TX_SOUNDING_INFO:
cfg_params->cfg0 = HTT_STAT_DEFAULT_CFG0_ACTIVE_VDEVS;
break;
case ATH11K_DBG_HTT_EXT_STATS_PEER_CTRL_PATH_TXRX_STATS:
cfg_params->cfg0 = HTT_STAT_PEER_INFO_MAC_ADDR;
cfg_params->cfg1 |= FIELD_PREP(GENMASK(7, 0), mac_addr[0]);
cfg_params->cfg1 |= FIELD_PREP(GENMASK(15, 8), mac_addr[1]);
cfg_params->cfg1 |= FIELD_PREP(GENMASK(23, 16), mac_addr[2]);
cfg_params->cfg1 |= FIELD_PREP(GENMASK(31, 24), mac_addr[3]);
cfg_params->cfg2 |= FIELD_PREP(GENMASK(7, 0), mac_addr[4]);
cfg_params->cfg2 |= FIELD_PREP(GENMASK(15, 8), mac_addr[5]);
break;
default:
break;
}
return 0;
}
int ath11k_debugfs_htt_stats_req(struct ath11k *ar)
{
struct debug_htt_stats_req *stats_req = ar->debug.htt_stats.stats_req;
u8 type = stats_req->type;
u64 cookie = 0;
int ret, pdev_id = ar->pdev->pdev_id;
struct htt_ext_stats_cfg_params cfg_params = {};
init_completion(&stats_req->cmpln);
stats_req->done = false;
stats_req->pdev_id = pdev_id;
cookie = FIELD_PREP(HTT_STATS_COOKIE_MSB, HTT_STATS_MAGIC_VALUE) |
FIELD_PREP(HTT_STATS_COOKIE_LSB, pdev_id);
ret = ath11k_prep_htt_stats_cfg_params(ar, type, stats_req->peer_addr,
&cfg_params);
if (ret) {
ath11k_warn(ar->ab, "failed to set htt stats cfg params: %d\n", ret);
return ret;
}
Annotation
- Immediate include surface: `linux/vmalloc.h`, `core.h`, `dp_tx.h`, `dp_rx.h`, `debug.h`, `debugfs_htt_stats.h`.
- Detected declarations: `function htt_print_stats_string_tlv`, `function htt_print_tx_pdev_stats_cmn_tlv`, `function htt_print_tx_pdev_stats_urrn_tlv_v`, `function htt_print_tx_pdev_stats_flush_tlv_v`, `function htt_print_tx_pdev_stats_sifs_tlv_v`, `function htt_print_tx_pdev_stats_phy_err_tlv_v`, `function htt_print_tx_pdev_stats_sifs_hist_tlv_v`, `function htt_print_tx_pdev_stats_tx_ppdu_stats_tlv_v`, `function htt_print_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v`, `function htt_print_hw_stats_intr_misc_tlv`.
- 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.