drivers/net/wireless/ath/ath9k/beacon.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/beacon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/beacon.c- Extension
.c- Size
- 20058 bytes
- Lines
- 719
- 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.h
Detected Declarations
function Copyrightfunction stationfunction ath9k_beacon_setupfunction ath9k_beacon_assign_slotfunction ath9k_beacon_remove_slotfunction ath9k_beacon_ensure_primary_slotfunction ath9k_beacon_choose_slotfunction ath9k_set_tsfadjustfunction ath9k_csa_is_finishedfunction ath9k_csa_update_viffunction ath9k_csa_updatefunction ath9k_beacon_taskletfunction ath9k_beacon_initfunction ath9k_beacon_stopfunction ath9k_beacon_config_apfunction ath9k_beacon_config_stafunction ath9k_beacon_config_adhocfunction ath9k_cache_beacon_configfunction ath9k_beacon_configfunction ath9k_set_beacon
Annotated Snippet
if (sc->cur_chan->nvifs > 1) {
ath_dbg(common, BEACON,
"Flushing previous cabq traffic\n");
ath_draintxq(sc, cabq);
}
}
ath9k_beacon_setup(sc, vif, bf, info->control.rates[0].idx);
if (skb)
ath_tx_cabq(hw, vif, skb);
return bf;
}
void ath9k_beacon_assign_slot(struct ath_softc *sc, struct ieee80211_vif *vif)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_vif *avp = (void *)vif->drv_priv;
int slot;
avp->av_bcbuf = list_first_entry(&sc->beacon.bbuf, struct ath_buf, list);
list_del(&avp->av_bcbuf->list);
for (slot = 0; slot < ATH_BCBUF; slot++) {
if (sc->beacon.bslot[slot] == NULL) {
avp->av_bslot = slot;
break;
}
}
sc->beacon.bslot[avp->av_bslot] = vif;
ath_dbg(common, CONFIG, "Added interface at beacon slot: %d\n",
avp->av_bslot);
}
void ath9k_beacon_remove_slot(struct ath_softc *sc, struct ieee80211_vif *vif)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_vif *avp = (void *)vif->drv_priv;
struct ath_buf *bf = avp->av_bcbuf;
ath_dbg(common, CONFIG, "Removing interface at beacon slot: %d\n",
avp->av_bslot);
tasklet_disable(&sc->bcon_tasklet);
if (bf && bf->bf_mpdu) {
struct sk_buff *skb = bf->bf_mpdu;
dma_unmap_single(sc->dev, bf->bf_buf_addr,
skb->len, DMA_TO_DEVICE);
dev_kfree_skb_any(skb);
bf->bf_mpdu = NULL;
bf->bf_buf_addr = 0;
}
avp->av_bcbuf = NULL;
sc->beacon.bslot[avp->av_bslot] = NULL;
list_add_tail(&bf->list, &sc->beacon.bbuf);
tasklet_enable(&sc->bcon_tasklet);
}
void ath9k_beacon_ensure_primary_slot(struct ath_softc *sc)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ieee80211_vif *vif;
struct ath_vif *avp;
s64 tsfadjust;
u32 offset;
int first_slot = ATH_BCBUF;
int slot;
tasklet_disable_in_atomic(&sc->bcon_tasklet);
/* Find first taken slot. */
for (slot = 0; slot < ATH_BCBUF; slot++) {
if (sc->beacon.bslot[slot]) {
first_slot = slot;
break;
}
}
if (first_slot == 0)
goto out;
/* Re-enumarate all slots, moving them forward. */
for (slot = 0; slot < ATH_BCBUF; slot++) {
if (slot + first_slot < ATH_BCBUF) {
vif = sc->beacon.bslot[slot + first_slot];
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `ath9k.h`.
- Detected declarations: `function Copyright`, `function station`, `function ath9k_beacon_setup`, `function ath9k_beacon_assign_slot`, `function ath9k_beacon_remove_slot`, `function ath9k_beacon_ensure_primary_slot`, `function ath9k_beacon_choose_slot`, `function ath9k_set_tsfadjust`, `function ath9k_csa_is_finished`, `function ath9k_csa_update_vif`.
- 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.