drivers/net/wireless/ath/ath12k/dp_mon.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/dp_mon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/dp_mon.c- Extension
.c- Size
- 32883 bytes
- Lines
- 1126
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
dp_mon.hdebug.hdp_tx.hpeer.h
Detected Declarations
function Copyrightfunction ath12k_dp_mon_comp_ppduidfunction ath12k_dp_mon_fill_rx_ratefunction ath12k_dp_mon_rx_msdus_set_payloadfunction ath12k_dp_mon_rx_merg_msdusfunction ath12k_dp_mon_rx_update_radiotap_hefunction ath12k_dp_mon_rx_update_radiotap_he_mufunction ath12k_dp_mon_update_radiotapfunction ath12k_dp_mon_rx_deliver_msdufunction ath12k_dp_pkt_set_pktlenfunction ath12k_dp_mon_parse_status_buffunction ath12k_dp_mon_buf_replenishfunction ath12k_dp_mon_status_bufs_replenishfunction ath12k_dp_mon_rx_update_peer_rate_table_statsfunction ath12k_dp_mon_rx_update_peer_su_statsfunction ath12k_dp_mon_rx_process_ulofdmafunction ath12k_dp_mon_rx_update_user_statsfunction ath12k_dp_mon_rx_update_peer_mu_statsexport ath12k_dp_rx_alloc_mon_status_bufexport ath12k_dp_mon_comp_ppduidexport ath12k_dp_mon_rx_merg_msdusexport ath12k_dp_mon_update_radiotapexport ath12k_dp_mon_rx_deliver_msduexport ath12k_dp_pkt_set_pktlenexport ath12k_dp_mon_parse_status_bufexport ath12k_dp_mon_buf_replenishexport ath12k_dp_mon_rx_update_peer_su_statsexport ath12k_dp_mon_rx_process_ulofdmaexport ath12k_dp_mon_rx_update_peer_mu_stats
Annotated Snippet
if (rx_status->band < NUM_NL80211_BANDS) {
struct ath12k *ar = ath12k_pdev_dp_to_ar(dp_pdev);
sband = &ar->mac.sbands[rx_status->band];
rx_status->rate_idx = ath12k_mac_hw_rate_to_idx(sband, rate_mcs,
is_cck);
}
break;
case RX_MSDU_START_PKT_TYPE_11N:
rx_status->encoding = RX_ENC_HT;
if (rate_mcs > ATH12K_HT_MCS_MAX) {
ath12k_warn(ab,
"Received with invalid mcs in HT mode %d\n",
rate_mcs);
break;
}
rx_status->rate_idx = rate_mcs + (8 * (nss - 1));
if (sgi)
rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
break;
case RX_MSDU_START_PKT_TYPE_11AC:
rx_status->encoding = RX_ENC_VHT;
rx_status->rate_idx = rate_mcs;
if (rate_mcs > ATH12K_VHT_MCS_MAX) {
ath12k_warn(ab,
"Received with invalid mcs in VHT mode %d\n",
rate_mcs);
break;
}
if (sgi)
rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI;
break;
case RX_MSDU_START_PKT_TYPE_11AX:
rx_status->rate_idx = rate_mcs;
if (rate_mcs > ATH12K_HE_MCS_MAX) {
ath12k_warn(ab,
"Received with invalid mcs in HE mode %d\n",
rate_mcs);
break;
}
rx_status->encoding = RX_ENC_HE;
rx_status->he_gi = ath12k_he_gi_to_nl80211_he_gi(sgi);
break;
case RX_MSDU_START_PKT_TYPE_11BE:
rx_status->rate_idx = rate_mcs;
if (rate_mcs > ATH12K_EHT_MCS_MAX) {
ath12k_warn(ab,
"Received with invalid mcs in EHT mode %d\n",
rate_mcs);
break;
}
rx_status->encoding = RX_ENC_EHT;
rx_status->he_gi = ath12k_he_gi_to_nl80211_he_gi(sgi);
break;
default:
ath12k_dbg(ab, ATH12K_DBG_DATA,
"monitor receives invalid preamble type %d",
pkt_type);
break;
}
}
static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k_base *ab,
struct sk_buff *head_msdu,
struct sk_buff *tail_msdu)
{
u32 rx_pkt_offset, l2_hdr_offset, total_offset;
rx_pkt_offset = ab->hal.hal_desc_sz;
l2_hdr_offset =
ath12k_dp_rx_h_l3pad(ab, (struct hal_rx_desc *)tail_msdu->data);
if (ab->hw_params->rxdma1_enable)
total_offset = ATH12K_MON_RX_PKT_OFFSET;
else
total_offset = rx_pkt_offset + l2_hdr_offset;
skb_pull(head_msdu, total_offset);
}
struct sk_buff *
ath12k_dp_mon_rx_merg_msdus(struct ath12k_pdev_dp *dp_pdev,
struct dp_mon_mpdu *mon_mpdu,
struct hal_rx_mon_ppdu_info *ppdu_info,
struct ieee80211_rx_status *rxs)
{
struct ath12k_dp *dp = dp_pdev->dp;
struct ath12k_base *ab = dp->ab;
struct sk_buff *msdu, *mpdu_buf, *prev_buf, *head_frag_list;
struct sk_buff *head_msdu, *tail_msdu;
Annotation
- Immediate include surface: `dp_mon.h`, `debug.h`, `dp_tx.h`, `peer.h`.
- Detected declarations: `function Copyright`, `function ath12k_dp_mon_comp_ppduid`, `function ath12k_dp_mon_fill_rx_rate`, `function ath12k_dp_mon_rx_msdus_set_payload`, `function ath12k_dp_mon_rx_merg_msdus`, `function ath12k_dp_mon_rx_update_radiotap_he`, `function ath12k_dp_mon_rx_update_radiotap_he_mu`, `function ath12k_dp_mon_update_radiotap`, `function ath12k_dp_mon_rx_deliver_msdu`, `function ath12k_dp_pkt_set_pktlen`.
- 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.