drivers/dma/ioat/dma.h
Source file repositories/reference/linux-study-clean/drivers/dma/ioat/dma.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/ioat/dma.h- Extension
.h- Size
- 12002 bytes
- Lines
- 401
- Domain
- Driver Families
- Bucket
- drivers/dma
- 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.
- 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/dmaengine.hlinux/init.hlinux/dmapool.hlinux/cache.hlinux/pci_ids.hlinux/circ_buf.hlinux/interrupt.hregisters.hhw.h
Detected Declarations
struct ioatdma_devicestruct ioat_descsstruct ioatdma_chanstruct ioat_sed_entstruct ioat_ring_entenum ioat_irq_modefunction __dump_desc_dbgfunction ioat_chan_by_indexfunction ioat_chanstsfunction ioat_chansts_to_addrfunction ioat_chanerrfunction ioat_suspendfunction ioat_resetfunction ioat_reset_pendingfunction is_ioat_activefunction is_ioat_idlefunction is_ioat_haltedfunction is_ioat_suspendedfunction is_ioat_bugfunction ioat_ring_sizefunction ioat_ring_activefunction ioat_ring_pendingfunction ioat_ring_spacefunction ioat_xferlen_to_descsfunction ioat_get_ring_entfunction ioat_set_chainaddr
Annotated Snippet
struct ioatdma_device {
struct pci_dev *pdev;
void __iomem *reg_base;
struct dma_pool *completion_pool;
#define MAX_SED_POOLS 5
struct dma_pool *sed_hw_pool[MAX_SED_POOLS];
struct dma_device dma_dev;
u8 version;
#define IOAT_MAX_CHANS 4
struct msix_entry msix_entries[IOAT_MAX_CHANS];
struct ioatdma_chan *idx[IOAT_MAX_CHANS];
struct dca_provider *dca;
enum ioat_irq_mode irq_mode;
u32 cap;
int chancnt;
/* shadow version for CB3.3 chan reset errata workaround */
u64 msixtba0;
u64 msixdata0;
u32 msixpba;
};
#define IOAT_MAX_ORDER 16
#define IOAT_MAX_DESCS (1 << IOAT_MAX_ORDER)
#define IOAT_CHUNK_SIZE (SZ_512K)
#define IOAT_DESCS_PER_CHUNK (IOAT_CHUNK_SIZE / IOAT_DESC_SZ)
struct ioat_descs {
void *virt;
dma_addr_t hw;
};
struct ioatdma_chan {
struct dma_chan dma_chan;
void __iomem *reg_base;
dma_addr_t last_completion;
spinlock_t cleanup_lock;
unsigned long state;
#define IOAT_CHAN_DOWN 0
#define IOAT_COMPLETION_ACK 1
#define IOAT_RESET_PENDING 2
#define IOAT_KOBJ_INIT_FAIL 3
#define IOAT_RUN 5
#define IOAT_CHAN_ACTIVE 6
struct timer_list timer;
#define RESET_DELAY msecs_to_jiffies(100)
struct ioatdma_device *ioat_dma;
dma_addr_t completion_dma;
u64 *completion;
struct tasklet_struct cleanup_task;
struct kobject kobj;
/* ioat v2 / v3 channel attributes
* @xfercap_log; log2 of channel max transfer length (for fast division)
* @head: allocated index
* @issued: hardware notification point
* @tail: cleanup index
* @dmacount: identical to 'head' except for occasionally resetting to zero
* @alloc_order: log2 of the number of allocated descriptors
* @produce: number of descriptors to produce at submit time
* @ring: software ring buffer implementation of hardware ring
* @prep_lock: serializes descriptor preparation (producers)
*/
size_t xfercap_log;
u16 head;
u16 issued;
u16 tail;
u16 dmacount;
u16 alloc_order;
u16 produce;
struct ioat_ring_ent **ring;
spinlock_t prep_lock;
struct ioat_descs descs[IOAT_MAX_DESCS / IOAT_DESCS_PER_CHUNK];
int desc_chunks;
int intr_coalesce;
int prev_intr_coalesce;
};
/**
* struct ioat_sed_ent - wrapper around super extended hardware descriptor
* @hw: hardware SED
* @dma: dma address for the SED
* @parent: point to the dma descriptor that's the parent
* @hw_pool: descriptor pool index
*/
struct ioat_sed_ent {
struct ioat_sed_raw_descriptor *hw;
dma_addr_t dma;
struct ioat_ring_ent *parent;
unsigned int hw_pool;
Annotation
- Immediate include surface: `linux/dmaengine.h`, `linux/init.h`, `linux/dmapool.h`, `linux/cache.h`, `linux/pci_ids.h`, `linux/circ_buf.h`, `linux/interrupt.h`, `registers.h`.
- Detected declarations: `struct ioatdma_device`, `struct ioat_descs`, `struct ioatdma_chan`, `struct ioat_sed_ent`, `struct ioat_ring_ent`, `enum ioat_irq_mode`, `function __dump_desc_dbg`, `function ioat_chan_by_index`, `function ioat_chansts`, `function ioat_chansts_to_addr`.
- Atlas domain: Driver Families / drivers/dma.
- Implementation status: source implementation candidate.
- 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.