drivers/net/wireless/ath/ath9k/xmit.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/xmit.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/xmit.c- Extension
.c- Size
- 76469 bytes
- Lines
- 2958
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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
linux/dma-mapping.hath9k.har9003_mac.h
Detected Declarations
function ath_tx_statusfunction ath_txq_unlock_completefunction ath_tx_queue_tidfunction ath9k_wake_tx_queuefunction ath_send_barfunction ath_merge_ratetblfunction ath_set_ratesfunction ath_txq_skb_donefunction ath_get_skb_tidfunction ath_tid_pullfunction ath_tid_dequeuefunction ath_tx_flush_tidfunction ath_tx_update_bawfunction ath_tx_addto_bawfunction ath_tid_drainfunction ath_tx_set_retryfunction ath_tx_return_bufferfunction ath_clone_txbuffunction ath_tx_count_framesfunction ath_tx_complete_aggrfunction bf_is_ampdu_not_probingfunction ath_tx_count_airtimefunction ath_tx_process_bufferfunction ath_lookup_legacyfunction ath_lookup_ratefunction ath_compute_num_delimsfunction ath_tx_get_tid_subframefunction ath_tx_form_aggrfunction ath_pkt_durationfunction ath_max_framelenfunction ath_update_max_aggr_framelenfunction ath_get_rate_txpowerfunction ath_buf_set_ratefunction get_hw_packet_typefunction ath_tx_fill_descfunction ath_tx_form_burstfunction ath_tx_sched_aggrfunction ath_tx_aggr_startfunction ath_tx_aggr_stopfunction ath_tx_aggr_sleepfunction ath_tx_aggr_wakeupfunction ath9k_set_moredatafunction ath9k_release_buffered_framesfunction ath_txq_updatefunction ath_cabq_updatefunction ath_drain_txq_listfunction queuefunction ath_drain_all_txq
Annotated Snippet
if (!bf) {
ath_txq_skb_done(sc, skb);
ieee80211_free_txskb(sc->hw, skb);
continue;
}
if (fi->baw_tracked) {
ath_tx_update_baw(tid, bf);
sendbar = true;
}
list_add_tail(&bf->list, &bf_head);
ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0);
}
if (sendbar) {
ath_txq_unlock(sc, txq);
ath_send_bar(tid, tid->seq_start);
ath_txq_lock(sc, txq);
}
}
static void ath_tx_update_baw(struct ath_atx_tid *tid, struct ath_buf *bf)
{
struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
u16 seqno = bf->bf_state.seqno;
int index, cindex;
if (!fi->baw_tracked)
return;
index = ATH_BA_INDEX(tid->seq_start, seqno);
cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
__clear_bit(cindex, tid->tx_buf);
while (tid->baw_head != tid->baw_tail && !test_bit(tid->baw_head, tid->tx_buf)) {
INCR(tid->seq_start, IEEE80211_SEQ_MAX);
INCR(tid->baw_head, ATH_TID_MAX_BUFS);
if (tid->bar_index >= 0)
tid->bar_index--;
}
}
static void ath_tx_addto_baw(struct ath_atx_tid *tid, struct ath_buf *bf)
{
struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
u16 seqno = bf->bf_state.seqno;
int index, cindex;
if (fi->baw_tracked)
return;
index = ATH_BA_INDEX(tid->seq_start, seqno);
cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
__set_bit(cindex, tid->tx_buf);
fi->baw_tracked = 1;
if (index >= ((tid->baw_tail - tid->baw_head) &
(ATH_TID_MAX_BUFS - 1))) {
tid->baw_tail = cindex;
INCR(tid->baw_tail, ATH_TID_MAX_BUFS);
}
}
static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq,
struct ath_atx_tid *tid)
{
struct sk_buff *skb;
struct ath_buf *bf;
struct list_head bf_head;
struct ath_tx_status ts;
struct ath_frame_info *fi;
memset(&ts, 0, sizeof(ts));
INIT_LIST_HEAD(&bf_head);
while (ath_tid_dequeue(tid, &skb) == 0) {
fi = get_frame_info(skb);
bf = fi->bf;
if (!bf) {
ath_tx_complete(sc, skb, ATH_TX_ERROR, txq, NULL);
continue;
}
list_add_tail(&bf->list, &bf_head);
ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0);
}
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `ath9k.h`, `ar9003_mac.h`.
- Detected declarations: `function ath_tx_status`, `function ath_txq_unlock_complete`, `function ath_tx_queue_tid`, `function ath9k_wake_tx_queue`, `function ath_send_bar`, `function ath_merge_ratetbl`, `function ath_set_rates`, `function ath_txq_skb_done`, `function ath_get_skb_tid`, `function ath_tid_pull`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.