drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c- Extension
.c- Size
- 31379 bytes
- Lines
- 1213
- 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.
- 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
htc.h
Detected Declarations
function get_hw_qnumfunction ath9k_htc_check_stop_queuesfunction ath9k_htc_check_wake_queuesfunction ath9k_htc_tx_get_slotfunction ath9k_htc_tx_clear_slotfunction get_htc_epidfunction get_htc_epid_queuefunction strip_drv_headerfunction ath_htc_txq_updatefunction ath9k_htc_tx_mgmtfunction ath9k_htc_tx_datafunction ieee80211_is_data_qosfunction ath9k_htc_tx_startfunction __ath9k_htc_check_tx_aggrfunction ath9k_htc_check_tx_aggrfunction ath9k_htc_tx_processfunction ath9k_htc_tx_drainqfunction ath9k_htc_tx_drainfunction ath9k_tx_failed_taskletfunction check_cookiefunction ath9k_htc_tx_get_packetfunction ath9k_htc_txstatusfunction ath9k_htc_txepfunction check_packetfunction ath9k_htc_tx_cleanup_queuefunction ath9k_htc_tx_cleanup_timerfunction ath9k_tx_initfunction ath9k_tx_cleanupfunction ath9k_htc_cabq_setupfunction ath9k_htc_calcrxfilterfunction ath9k_htc_opmode_initfunction ath9k_host_rx_initfunction convert_htc_flagfunction rx_status_htc_to_athfunction ath9k_rx_preparefunction PHY_ERRORfunction ath9k_rx_taskletfunction list_for_each_entryfunction ath9k_htc_rxepfunction ath9k_rx_cleanupfunction list_for_each_entry_safefunction ath9k_rx_init
Annotated Snippet
ieee80211_is_data_qos(hdr->frame_control)) {
qc = ieee80211_get_qos_ctl(hdr);
tx_hdr.tidno = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
}
/* Check for RTS protection */
if (priv->hw->wiphy->rts_threshold != (u32) -1)
if (skb->len > priv->hw->wiphy->rts_threshold)
flags |= ATH9K_HTC_TX_RTSCTS;
/* CTS-to-self */
if (!(flags & ATH9K_HTC_TX_RTSCTS) &&
(vif && vif->bss_conf.use_cts_prot))
flags |= ATH9K_HTC_TX_CTSONLY;
tx_hdr.flags = cpu_to_be32(flags);
tx_hdr.key_type = ath9k_cmn_get_hw_crypto_keytype(skb);
if (tx_hdr.key_type == ATH9K_KEY_TYPE_CLEAR)
tx_hdr.keyix = (u8) ATH9K_TXKEYIX_INVALID;
else
tx_hdr.keyix = tx_info->control.hw_key->hw_key_idx;
tx_fhdr = skb_push(skb, sizeof(tx_hdr));
memcpy(tx_fhdr, (u8 *) &tx_hdr, sizeof(tx_hdr));
if (is_cab) {
CAB_STAT_INC(priv);
tx_ctl->epid = priv->cab_ep;
return;
}
qnum = skb_get_queue_mapping(skb);
tx_ctl->epid = get_htc_epid(priv, qnum);
}
int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
struct ieee80211_sta *sta,
struct sk_buff *skb,
u8 slot, bool is_cab)
{
struct ieee80211_hdr *hdr;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_vif *vif = tx_info->control.vif;
struct ath9k_htc_sta *ista;
struct ath9k_htc_vif *avp = NULL;
u8 sta_idx, vif_idx;
hdr = (struct ieee80211_hdr *) skb->data;
/*
* Find out on which interface this packet has to be
* sent out.
*/
if (vif) {
avp = (struct ath9k_htc_vif *) vif->drv_priv;
vif_idx = avp->index;
} else {
if (!priv->ah->is_monitoring) {
ath_dbg(ath9k_hw_common(priv->ah), XMIT,
"VIF is null, but no monitor interface !\n");
return -EINVAL;
}
vif_idx = priv->mon_vif_idx;
}
/*
* Find out which station this packet is destined for.
*/
if (sta) {
ista = (struct ath9k_htc_sta *) sta->drv_priv;
sta_idx = ista->index;
} else {
sta_idx = priv->vif_sta_pos[vif_idx];
}
if (ieee80211_is_data(hdr->frame_control))
ath9k_htc_tx_data(priv, vif, skb,
sta_idx, vif_idx, slot, is_cab);
else
ath9k_htc_tx_mgmt(priv, avp, skb,
sta_idx, vif_idx, slot);
return htc_send(priv->htc, skb);
}
static inline bool __ath9k_htc_check_tx_aggr(struct ath9k_htc_priv *priv,
struct ath9k_htc_sta *ista, u8 tid)
{
Annotation
- Immediate include surface: `htc.h`.
- Detected declarations: `function get_hw_qnum`, `function ath9k_htc_check_stop_queues`, `function ath9k_htc_check_wake_queues`, `function ath9k_htc_tx_get_slot`, `function ath9k_htc_tx_clear_slot`, `function get_htc_epid`, `function get_htc_epid_queue`, `function strip_drv_header`, `function ath_htc_txq_update`, `function ath9k_htc_tx_mgmt`.
- 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.
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.