drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c- Extension
.c- Size
- 14104 bytes
- Lines
- 528
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
htc.h
Detected Declarations
function Copyrightfunction ath9k_htc_beacon_initfunction ath9k_htc_beacon_config_stafunction ath9k_htc_beacon_config_apfunction ath9k_htc_beacon_config_adhocfunction ath9k_htc_beaconepfunction ath9k_htc_send_bufferedfunction ath9k_htc_send_beaconfunction ath9k_htc_choose_bslotfunction ath9k_htc_swbafunction ath9k_htc_assign_bslotfunction ath9k_htc_remove_bslotfunction ath9k_htc_set_tsfadjustfunction ath9k_htc_beacon_iterfunction ath9k_htc_check_beacon_configfunction ath9k_htc_beacon_configfunction ath9k_htc_beacon_reconfigfunction ath9k_htc_csa_is_finished
Annotated Snippet
if (padsize && skb->len > padpos) {
if (skb_headroom(skb) < padsize) {
dev_kfree_skb_any(skb);
goto next;
}
skb_push(skb, padsize);
memmove(skb->data, skb->data + padsize, padpos);
}
tx_slot = ath9k_htc_tx_get_slot(priv);
if (tx_slot < 0) {
ath_dbg(common, XMIT, "No free CAB slot\n");
dev_kfree_skb_any(skb);
goto next;
}
ret = ath9k_htc_tx_start(priv, NULL, skb, tx_slot, true);
if (ret != 0) {
ath9k_htc_tx_clear_slot(priv, tx_slot);
dev_kfree_skb_any(skb);
ath_dbg(common, XMIT, "Failed to send CAB frame\n");
} else {
spin_lock_bh(&priv->tx.tx_lock);
priv->tx.queued_cnt++;
spin_unlock_bh(&priv->tx.tx_lock);
}
next:
skb = ieee80211_get_buffered_bc(priv->hw, vif);
}
spin_unlock_bh(&priv->beacon_lock);
}
static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,
int slot)
{
struct ath_common *common = ath9k_hw_common(priv->ah);
struct ieee80211_vif *vif;
struct ath9k_htc_vif *avp;
struct tx_beacon_header beacon_hdr;
struct ath9k_htc_tx_ctl *tx_ctl;
struct ieee80211_tx_info *info;
struct ieee80211_mgmt *mgmt;
struct sk_buff *beacon;
u8 *tx_fhdr;
int ret;
memset(&beacon_hdr, 0, sizeof(struct tx_beacon_header));
spin_lock_bh(&priv->beacon_lock);
vif = priv->beacon.bslot[slot];
avp = (struct ath9k_htc_vif *)vif->drv_priv;
if (unlikely(test_bit(ATH_OP_SCANNING, &common->op_flags))) {
spin_unlock_bh(&priv->beacon_lock);
return;
}
/* Get a new beacon */
beacon = ieee80211_beacon_get(priv->hw, vif, 0);
if (!beacon) {
spin_unlock_bh(&priv->beacon_lock);
return;
}
/*
* Update the TSF adjust value here, the HW will
* add this value for every beacon.
*/
mgmt = (struct ieee80211_mgmt *)beacon->data;
mgmt->u.beacon.timestamp = avp->tsfadjust;
info = IEEE80211_SKB_CB(beacon);
if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
struct ieee80211_hdr *hdr =
(struct ieee80211_hdr *) beacon->data;
avp->seq_no += 0x10;
hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
}
tx_ctl = HTC_SKB_CB(beacon);
memset(tx_ctl, 0, sizeof(*tx_ctl));
tx_ctl->type = ATH9K_HTC_BEACON;
tx_ctl->epid = priv->beacon_ep;
beacon_hdr.vif_index = avp->index;
Annotation
- Immediate include surface: `htc.h`.
- Detected declarations: `function Copyright`, `function ath9k_htc_beacon_init`, `function ath9k_htc_beacon_config_sta`, `function ath9k_htc_beacon_config_ap`, `function ath9k_htc_beacon_config_adhoc`, `function ath9k_htc_beaconep`, `function ath9k_htc_send_buffered`, `function ath9k_htc_send_beacon`, `function ath9k_htc_choose_bslot`, `function ath9k_htc_swba`.
- 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.