drivers/net/wireless/ath/ath9k/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/main.c- Extension
.c- Size
- 70625 bytes
- Lines
- 2843
- 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/nl80211.hlinux/delay.hath9k.hbtcoex.h
Detected Declarations
function ath9k_parse_mpdudensityfunction ath9k_has_pending_framesfunction ath9k_setpowerfunction ath_ps_full_sleepfunction ath9k_ps_wakeupfunction ath9k_ps_restorefunction __ath_cancel_workfunction ath_cancel_workfunction ath_restart_workfunction ath_prepare_resetfunction ath_complete_resetfunction ath_reset_internalfunction ath_node_attachfunction ath_node_detachfunction ath9k_taskletfunction ath_isrfunction ath_resetfunction ath9k_queue_resetfunction ath_reset_workfunction ath9k_startfunction ath9k_txfunction ath9k_txq_list_has_keyfunction list_for_each_entryfunction ath9k_txq_has_keyfunction ath9k_pending_key_delfunction ath9k_stopfunction ath9k_uses_beaconsfunction ath9k_vif_iter_set_beaconfunction ath9k_vif_iterfunction ath9k_update_bssid_maskfunction list_for_each_entryfunction ath9k_calculate_iter_datafunction ath9k_set_assoc_statefunction ath9k_set_offchannel_statefunction ath9k_calculate_summary_statefunction ath9k_tpc_vif_iterfunction ath9k_set_txpowerfunction ath9k_assign_hw_queuesfunction ath9k_add_interfacefunction ath9k_change_interfacefunction ath9k_remove_interfacefunction ath9k_enable_psfunction ath9k_disable_psfunction ath9k_configfunction ath9k_configure_filterfunction ath9k_sta_addfunction ath9k_del_ps_keyfunction ath9k_sta_remove
Annotated Snippet
if (sc->cur_chan->tsf_val) {
u32 offset;
offset = ath9k_hw_get_tsf_offset(sc->cur_chan->tsf_ts, 0);
ath9k_hw_settsf64(ah, sc->cur_chan->tsf_val + offset);
}
if (!test_bit(ATH_OP_BEACONS, &common->op_flags))
goto work;
if (ah->opmode == NL80211_IFTYPE_STATION &&
test_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags)) {
spin_lock_irqsave(&sc->sc_pm_lock, flags);
sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
} else {
ath9k_set_beacon(sc);
}
work:
ath_restart_work(sc);
ath_txq_schedule_all(sc);
}
sc->gtt_cnt = 0;
ath9k_hw_set_interrupts(ah);
ath9k_hw_enable_interrupts(ah);
ieee80211_wake_queues(sc->hw);
ath9k_p2p_ps_timer(sc);
return true;
}
static int ath_reset_internal(struct ath_softc *sc, struct ath9k_channel *hchan)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_hw_cal_data *caldata = NULL;
bool fastcc = true;
int r;
__ath_cancel_work(sc);
disable_irq(sc->irq);
tasklet_disable(&sc->intr_tq);
tasklet_disable(&sc->bcon_tasklet);
spin_lock_bh(&sc->sc_pcu_lock);
if (!sc->cur_chan->offchannel) {
fastcc = false;
caldata = &sc->cur_chan->caldata;
}
if (!hchan) {
fastcc = false;
hchan = ah->curchan;
}
if (!hchan) {
fastcc = false;
hchan = ath9k_cmn_get_channel(sc->hw, ah, &sc->cur_chan->chandef);
}
if (!ath_prepare_reset(sc))
fastcc = false;
if (ath9k_is_chanctx_enabled())
fastcc = false;
spin_lock_bh(&sc->chan_lock);
sc->cur_chandef = sc->cur_chan->chandef;
spin_unlock_bh(&sc->chan_lock);
ath_dbg(common, CONFIG, "Reset to %u MHz, HT40: %d fastcc: %d\n",
hchan->channel, IS_CHAN_HT40(hchan), fastcc);
r = ath9k_hw_reset(ah, hchan, caldata, fastcc);
if (r) {
ath_err(common,
"Unable to reset channel, reset status %d\n", r);
ath9k_hw_enable_interrupts(ah);
ath9k_queue_reset(sc, RESET_TYPE_BB_HANG);
goto out;
}
if (ath9k_hw_mci_is_enabled(sc->sc_ah) &&
sc->cur_chan->offchannel)
Annotation
- Immediate include surface: `linux/nl80211.h`, `linux/delay.h`, `ath9k.h`, `btcoex.h`.
- Detected declarations: `function ath9k_parse_mpdudensity`, `function ath9k_has_pending_frames`, `function ath9k_setpower`, `function ath_ps_full_sleep`, `function ath9k_ps_wakeup`, `function ath9k_ps_restore`, `function __ath_cancel_work`, `function ath_cancel_work`, `function ath_restart_work`, `function ath_prepare_reset`.
- 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.