include/linux/dmaengine.h
Source file repositories/reference/linux-study-clean/include/linux/dmaengine.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/dmaengine.h- Extension
.h- Size
- 56584 bytes
- Lines
- 1682
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- 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
linux/device.hlinux/err.hlinux/uio.hlinux/bug.hlinux/scatterlist.hlinux/bitmap.hlinux/types.hasm/page.h
Detected Declarations
struct data_chunkstruct dma_interleaved_templatestruct dma_vecstruct dma_chan_percpustruct dma_routerstruct dma_chanstruct dma_chan_devstruct dma_slave_configstruct dma_slave_capsstruct dmaengine_resultstruct dmaengine_unmap_datastruct dma_async_tx_descriptorstruct dma_descriptor_metadata_opsstruct dma_async_tx_descriptorstruct dma_tx_statestruct dma_slave_mapstruct dma_filterstruct dma_devicestruct rio_dma_extenum dma_statusenum dma_transaction_typeenum dma_transfer_directionenum dma_ctrl_flagsenum sum_check_bitsenum sum_check_flagsenum dma_desc_metadata_modeenum dma_slave_buswidthenum dma_residue_granularityenum dmaengine_tx_resultenum dmaengine_alignmentfunction dma_submit_errorfunction dma_set_unmapfunction dma_set_unmapfunction dmaengine_unmap_putfunction txd_lockfunction txd_clear_parentfunction txd_lockfunction txd_unlockfunction txd_chainfunction txd_clear_parentfunction txd_clear_nextfunction dmaengine_slave_configfunction is_slave_directionfunction dmaengine_prep_peripheral_dma_vecfunction dmaengine_prep_dma_memsetfunction dmaengine_is_metadata_mode_supportedfunction dmaengine_desc_attach_metadatafunction dmaengine_desc_set_metadata_len
Annotated Snippet
struct data_chunk {
size_t size;
size_t icg;
size_t dst_icg;
size_t src_icg;
};
/**
* struct dma_interleaved_template - Template to convey DMAC the transfer pattern
* and attributes.
* @src_start: Bus address of source for the first chunk.
* @dst_start: Bus address of destination for the first chunk.
* @dir: Specifies the type of Source and Destination.
* @src_inc: If the source address increments after reading from it.
* @dst_inc: If the destination address increments after writing to it.
* @src_sgl: If the 'icg' of sgl[] applies to Source (scattered read).
* Otherwise, source is read contiguously (icg ignored).
* Ignored if src_inc is false.
* @dst_sgl: If the 'icg' of sgl[] applies to Destination (scattered write).
* Otherwise, destination is filled contiguously (icg ignored).
* Ignored if dst_inc is false.
* @numf: Number of frames in this template.
* @frame_size: Number of chunks in a frame i.e, size of sgl[].
* @sgl: Array of {chunk,icg} pairs that make up a frame.
*/
struct dma_interleaved_template {
dma_addr_t src_start;
dma_addr_t dst_start;
enum dma_transfer_direction dir;
bool src_inc;
bool dst_inc;
bool src_sgl;
bool dst_sgl;
size_t numf;
size_t frame_size;
struct data_chunk sgl[];
};
/**
* struct dma_vec - DMA vector
* @addr: Bus address of the start of the vector
* @len: Length in bytes of the DMA vector
*/
struct dma_vec {
dma_addr_t addr;
size_t len;
};
/**
* enum dma_ctrl_flags - DMA flags to augment operation preparation,
* control completion, and communicate status.
* @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
* this transaction
* @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client
* acknowledges receipt, i.e. has a chance to establish any dependency
* chains
* @DMA_PREP_PQ_DISABLE_P - prevent generation of P while generating Q
* @DMA_PREP_PQ_DISABLE_Q - prevent generation of Q while generating P
* @DMA_PREP_CONTINUE - indicate to a driver that it is reusing buffers as
* sources that were the result of a previous operation, in the case of a PQ
* operation it continues the calculation with new sources
* @DMA_PREP_FENCE - tell the driver that subsequent operations depend
* on the result of this operation
* @DMA_CTRL_REUSE: client can reuse the descriptor and submit again till
* cleared or freed
* @DMA_PREP_CMD: tell the driver that the data passed to DMA API is command
* data and the descriptor should be in different format from normal
* data descriptors.
* @DMA_PREP_REPEAT: tell the driver that the transaction shall be automatically
* repeated when it ends until a transaction is issued on the same channel
* with the DMA_PREP_LOAD_EOT flag set. This flag is only applicable to
* interleaved transactions and is ignored for all other transaction types.
* @DMA_PREP_LOAD_EOT: tell the driver that the transaction shall replace any
* active repeated (as indicated by DMA_PREP_REPEAT) transaction when the
* repeated transaction ends. Not setting this flag when the previously queued
* transaction is marked with DMA_PREP_REPEAT will cause the new transaction
* to never be processed and stay in the issued queue forever. The flag is
* ignored if the previous transaction is not a repeated transaction.
*/
enum dma_ctrl_flags {
DMA_PREP_INTERRUPT = (1 << 0),
DMA_CTRL_ACK = (1 << 1),
DMA_PREP_PQ_DISABLE_P = (1 << 2),
DMA_PREP_PQ_DISABLE_Q = (1 << 3),
DMA_PREP_CONTINUE = (1 << 4),
DMA_PREP_FENCE = (1 << 5),
DMA_CTRL_REUSE = (1 << 6),
DMA_PREP_CMD = (1 << 7),
DMA_PREP_REPEAT = (1 << 8),
DMA_PREP_LOAD_EOT = (1 << 9),
Annotation
- Immediate include surface: `linux/device.h`, `linux/err.h`, `linux/uio.h`, `linux/bug.h`, `linux/scatterlist.h`, `linux/bitmap.h`, `linux/types.h`, `asm/page.h`.
- Detected declarations: `struct data_chunk`, `struct dma_interleaved_template`, `struct dma_vec`, `struct dma_chan_percpu`, `struct dma_router`, `struct dma_chan`, `struct dma_chan_dev`, `struct dma_slave_config`, `struct dma_slave_caps`, `struct dmaengine_result`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.