drivers/net/wireless/ath/ath12k/dp_htt.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/dp_htt.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/dp_htt.c- Extension
.c- Size
- 42566 bytes
- Lines
- 1356
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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.hpeer.hhtc.hdp_htt.hdebugfs_htt_stats.hdebugfs.h
Detected Declarations
function Copyrightfunction ath12k_dp_htt_connectfunction ath12k_get_ppdu_user_indexfunction ath12k_htt_tlv_ppdu_stats_parsefunction ath12k_dp_htt_tlv_iterfunction ath12k_update_per_peer_tx_statsfunction ath12k_htt_update_ppdu_statsfunction list_for_each_entryfunction ath12k_copy_to_delay_statsfunction ath12k_copy_to_barfunction ath12k_htt_pull_ppdu_statsfunction ath12k_htt_mlo_offset_event_handlerfunction ath12k_dp_htt_htc_t2h_msg_handlerfunction ath12k_dp_tx_get_ring_id_typefunction ath12k_dp_tx_htt_srng_setupfunction ath12k_dp_tx_htt_h2t_ver_req_msgfunction ath12k_dp_tx_htt_h2t_ppdu_stats_reqfunction ath12k_dp_tx_htt_rx_filter_setupfunction ath12k_dp_tx_htt_h2t_ext_stats_reqfunction ath12k_dp_tx_htt_monitor_mode_ring_configfunction ath12k_dp_tx_htt_rx_monitor_mode_ring_configfunction ath12k_dp_tx_htt_tx_filter_setupexport ath12k_dp_htt_htc_t2h_msg_handlerexport ath12k_dp_tx_htt_rx_filter_setup
Annotated Snippet
if (ppdu_stats->user_stats[i].is_valid_peer_id) {
if (peer_id == ppdu_stats->user_stats[i].peer_id)
return i;
} else {
return i;
}
}
return -EINVAL;
}
static int ath12k_htt_tlv_ppdu_stats_parse(struct ath12k_base *ab,
u16 tag, u16 len, const void *ptr,
void *data)
{
const struct htt_ppdu_stats_usr_cmpltn_ack_ba_status *ba_status;
const struct htt_ppdu_stats_usr_cmpltn_cmn *cmplt_cmn;
const struct htt_ppdu_stats_user_rate *user_rate;
struct htt_ppdu_stats_info *ppdu_info;
struct htt_ppdu_user_stats *user_stats;
int cur_user;
u16 peer_id;
ppdu_info = data;
switch (tag) {
case HTT_PPDU_STATS_TAG_COMMON:
if (len < sizeof(struct htt_ppdu_stats_common)) {
ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n",
len, tag);
return -EINVAL;
}
memcpy(&ppdu_info->ppdu_stats.common, ptr,
sizeof(struct htt_ppdu_stats_common));
break;
case HTT_PPDU_STATS_TAG_USR_RATE:
if (len < sizeof(struct htt_ppdu_stats_user_rate)) {
ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n",
len, tag);
return -EINVAL;
}
user_rate = ptr;
peer_id = le16_to_cpu(user_rate->sw_peer_id);
cur_user = ath12k_get_ppdu_user_index(&ppdu_info->ppdu_stats,
peer_id);
if (cur_user < 0)
return -EINVAL;
user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user];
user_stats->peer_id = peer_id;
user_stats->is_valid_peer_id = true;
memcpy(&user_stats->rate, ptr,
sizeof(struct htt_ppdu_stats_user_rate));
user_stats->tlv_flags |= BIT(tag);
break;
case HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON:
if (len < sizeof(struct htt_ppdu_stats_usr_cmpltn_cmn)) {
ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n",
len, tag);
return -EINVAL;
}
cmplt_cmn = ptr;
peer_id = le16_to_cpu(cmplt_cmn->sw_peer_id);
cur_user = ath12k_get_ppdu_user_index(&ppdu_info->ppdu_stats,
peer_id);
if (cur_user < 0)
return -EINVAL;
user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user];
user_stats->peer_id = peer_id;
user_stats->is_valid_peer_id = true;
memcpy(&user_stats->cmpltn_cmn, ptr,
sizeof(struct htt_ppdu_stats_usr_cmpltn_cmn));
user_stats->tlv_flags |= BIT(tag);
break;
case HTT_PPDU_STATS_TAG_USR_COMPLTN_ACK_BA_STATUS:
if (len <
sizeof(struct htt_ppdu_stats_usr_cmpltn_ack_ba_status)) {
ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n",
len, tag);
return -EINVAL;
}
ba_status = ptr;
peer_id = le16_to_cpu(ba_status->sw_peer_id);
cur_user = ath12k_get_ppdu_user_index(&ppdu_info->ppdu_stats,
peer_id);
if (cur_user < 0)
return -EINVAL;
user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user];
user_stats->peer_id = peer_id;
Annotation
- Immediate include surface: `core.h`, `peer.h`, `htc.h`, `dp_htt.h`, `debugfs_htt_stats.h`, `debugfs.h`.
- Detected declarations: `function Copyright`, `function ath12k_dp_htt_connect`, `function ath12k_get_ppdu_user_index`, `function ath12k_htt_tlv_ppdu_stats_parse`, `function ath12k_dp_htt_tlv_iter`, `function ath12k_update_per_peer_tx_stats`, `function ath12k_htt_update_ppdu_stats`, `function list_for_each_entry`, `function ath12k_copy_to_delay_stats`, `function ath12k_copy_to_bar`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.