drivers/dma/idma64.h
Source file repositories/reference/linux-study-clean/drivers/dma/idma64.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/dma/idma64.h- Extension
.h- Size
- 6449 bytes
- Lines
- 230
- 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/device.hlinux/io.hlinux/spinlock.hlinux/types.hlinux/io-64-nonatomic-lo-hi.hvirt-dma.h
Detected Declarations
struct idma64_llistruct idma64_hw_descstruct idma64_descstruct idma64_chanstruct idma64struct idma64_chipfunction idma64c_readlfunction idma64c_writelfunction idma64c_readqfunction idma64c_writeqfunction idma64_readlfunction idma64_writel
Annotated Snippet
struct idma64_lli {
u64 sar;
u64 dar;
u64 llp;
u32 ctllo;
u32 ctlhi;
u32 sstat;
u32 dstat;
};
struct idma64_hw_desc {
struct idma64_lli *lli;
dma_addr_t llp;
dma_addr_t phys;
unsigned int len;
};
struct idma64_desc {
struct virt_dma_desc vdesc;
enum dma_transfer_direction direction;
struct idma64_hw_desc *hw;
unsigned int ndesc;
size_t length;
enum dma_status status;
};
static inline struct idma64_desc *to_idma64_desc(struct virt_dma_desc *vdesc)
{
return container_of(vdesc, struct idma64_desc, vdesc);
}
struct idma64_chan {
struct virt_dma_chan vchan;
void __iomem *regs;
/* hardware configuration */
enum dma_transfer_direction direction;
unsigned int mask;
struct dma_slave_config config;
void *pool;
struct idma64_desc *desc;
};
static inline struct idma64_chan *to_idma64_chan(struct dma_chan *chan)
{
return container_of(chan, struct idma64_chan, vchan.chan);
}
#define channel_set_bit(idma64, reg, mask) \
dma_writel(idma64, reg, ((mask) << 8) | (mask))
#define channel_clear_bit(idma64, reg, mask) \
dma_writel(idma64, reg, ((mask) << 8) | 0)
static inline u32 idma64c_readl(struct idma64_chan *idma64c, int offset)
{
return readl(idma64c->regs + offset);
}
static inline void idma64c_writel(struct idma64_chan *idma64c, int offset,
u32 value)
{
writel(value, idma64c->regs + offset);
}
#define channel_readl(idma64c, reg) \
idma64c_readl(idma64c, IDMA64_CH_##reg)
#define channel_writel(idma64c, reg, value) \
idma64c_writel(idma64c, IDMA64_CH_##reg, (value))
static inline u64 idma64c_readq(struct idma64_chan *idma64c, int offset)
{
return lo_hi_readq(idma64c->regs + offset);
}
static inline void idma64c_writeq(struct idma64_chan *idma64c, int offset,
u64 value)
{
lo_hi_writeq(value, idma64c->regs + offset);
}
#define channel_readq(idma64c, reg) \
idma64c_readq(idma64c, IDMA64_CH_##reg)
#define channel_writeq(idma64c, reg, value) \
idma64c_writeq(idma64c, IDMA64_CH_##reg, (value))
struct idma64 {
struct dma_device dma;
Annotation
- Immediate include surface: `linux/device.h`, `linux/io.h`, `linux/spinlock.h`, `linux/types.h`, `linux/io-64-nonatomic-lo-hi.h`, `virt-dma.h`.
- Detected declarations: `struct idma64_lli`, `struct idma64_hw_desc`, `struct idma64_desc`, `struct idma64_chan`, `struct idma64`, `struct idma64_chip`, `function idma64c_readl`, `function idma64c_writel`, `function idma64c_readq`, `function idma64c_writeq`.
- 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.