drivers/net/wireless/ath/ath9k/mac.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath9k/mac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath9k/mac.c- Extension
.c- Size
- 29166 bytes
- Lines
- 1049
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
hw.hhw-ops.hlinux/export.h
Detected Declarations
function Copyrightfunction ath9k_hw_gettxbuffunction ath9k_hw_puttxbuffunction ath9k_hw_txstartfunction ath9k_hw_numtxpendingfunction ath9k_hw_updatetxtriglevelfunction ath9k_hw_abort_tx_dmafunction ath9k_hw_stop_dma_queuefunction ath9k_hw_set_txq_propsfunction ath9k_hw_get_txq_propsfunction ath9k_hw_setuptxqueuefunction ath9k_hw_clear_queue_interruptsfunction ath9k_hw_releasetxqueuefunction ath9k_hw_resettxqueuefunction ath9k_hw_rxprocdescfunction ath9k_hw_setrxabortfunction ath9k_hw_putrxbuffunction ath9k_hw_startpcureceivefunction ath9k_hw_abortpcurecvfunction ath9k_hw_stopdmarecvfunction ath9k_hw_beaconq_setupfunction ath9k_hw_intrpendfunction ath9k_hw_kill_interruptsfunction ath9k_hw_disable_interruptsfunction __ath9k_hw_enable_interruptsfunction ath9k_hw_resume_interruptsfunction ath9k_hw_enable_interruptsfunction ath9k_hw_set_interruptsfunction ath9k_hw_set_tx_filterexport ath9k_hw_gettxbufexport ath9k_hw_puttxbufexport ath9k_hw_txstartexport ath9k_hw_numtxpendingexport ath9k_hw_updatetxtriglevelexport ath9k_hw_abort_tx_dmaexport ath9k_hw_stop_dma_queueexport ath9k_hw_set_txq_propsexport ath9k_hw_get_txq_propsexport ath9k_hw_setuptxqueueexport ath9k_hw_releasetxqueueexport ath9k_hw_resettxqueueexport ath9k_hw_rxprocdescexport ath9k_hw_setrxabortexport ath9k_hw_putrxbufexport ath9k_hw_startpcureceiveexport ath9k_hw_abortpcurecvexport ath9k_hw_stopdmarecvexport ath9k_hw_beaconq_setup
Annotated Snippet
if (ads.ds_rxstatus8 & AR_PHYErr) {
rs->rs_status |= ATH9K_RXERR_PHY;
phyerr = MS(ads.ds_rxstatus8, AR_PHYErrCode);
rs->rs_phyerr = phyerr;
} else if (ads.ds_rxstatus8 & AR_CRCErr)
rs->rs_status |= ATH9K_RXERR_CRC;
else if (ads.ds_rxstatus8 & AR_DecryptCRCErr)
rs->rs_status |= ATH9K_RXERR_DECRYPT;
else if (ads.ds_rxstatus8 & AR_MichaelErr)
rs->rs_status |= ATH9K_RXERR_MIC;
} else {
if (ads.ds_rxstatus8 &
(AR_CRCErr | AR_PHYErr | AR_DecryptCRCErr | AR_MichaelErr))
rs->rs_status |= ATH9K_RXERR_CORRUPT_DESC;
/* Only up to MCS16 supported, everything above is invalid */
if (rs->rs_rate >= 0x90)
rs->rs_status |= ATH9K_RXERR_CORRUPT_DESC;
}
if (ads.ds_rxstatus8 & AR_KeyMiss)
rs->rs_status |= ATH9K_RXERR_KEYMISS;
return 0;
}
EXPORT_SYMBOL(ath9k_hw_rxprocdesc);
/*
* This can stop or re-enables RX.
*
* If bool is set this will kill any frame which is currently being
* transferred between the MAC and baseband and also prevent any new
* frames from getting started.
*/
bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set)
{
u32 reg;
if (set) {
REG_SET_BIT(ah, AR_DIAG_SW,
(AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
if (!ath9k_hw_wait(ah, AR_OBS_BUS_1, AR_OBS_BUS_1_RX_STATE,
0, AH_WAIT_TIMEOUT)) {
REG_CLR_BIT(ah, AR_DIAG_SW,
(AR_DIAG_RX_DIS |
AR_DIAG_RX_ABORT));
reg = REG_READ(ah, AR_OBS_BUS_1);
ath_err(ath9k_hw_common(ah),
"RX failed to go idle in 10 ms RXSM=0x%x\n",
reg);
return false;
}
} else {
REG_CLR_BIT(ah, AR_DIAG_SW,
(AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
}
return true;
}
EXPORT_SYMBOL(ath9k_hw_setrxabort);
void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp)
{
REG_WRITE(ah, AR_RXDP, rxdp);
}
EXPORT_SYMBOL(ath9k_hw_putrxbuf);
void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning)
{
ath9k_enable_mib_counters(ah);
ath9k_ani_reset(ah, is_scanning);
REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
}
EXPORT_SYMBOL(ath9k_hw_startpcureceive);
void ath9k_hw_abortpcurecv(struct ath_hw *ah)
{
REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS);
ath9k_hw_disable_mib_counters(ah);
}
EXPORT_SYMBOL(ath9k_hw_abortpcurecv);
bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
{
Annotation
- Immediate include surface: `hw.h`, `hw-ops.h`, `linux/export.h`.
- Detected declarations: `function Copyright`, `function ath9k_hw_gettxbuf`, `function ath9k_hw_puttxbuf`, `function ath9k_hw_txstart`, `function ath9k_hw_numtxpending`, `function ath9k_hw_updatetxtriglevel`, `function ath9k_hw_abort_tx_dma`, `function ath9k_hw_stop_dma_queue`, `function ath9k_hw_set_txq_props`, `function ath9k_hw_get_txq_props`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.