drivers/infiniband/hw/erdma/erdma.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/erdma/erdma.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/erdma/erdma.h- Extension
.h- Size
- 5531 bytes
- Lines
- 283
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- 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/bitfield.hlinux/netdevice.hlinux/pci.hlinux/xarray.hrdma/ib_verbs.herdma_hw.h
Detected Declarations
struct erdma_eqstruct erdma_cmdq_sqstruct erdma_cmdq_cqstruct erdma_comp_waitstruct erdma_cmdqstruct erdma_devattrstruct erdma_irqstruct erdma_eq_cbstruct erdma_resource_cbstruct erdma_devenum erdma_cc_algfunction erdma_reg_read32function erdma_reg_read64function erdma_reg_write32function erdma_reg_write64function erdma_reg_read32_filed
Annotated Snippet
struct erdma_eq {
void *qbuf;
dma_addr_t qbuf_dma_addr;
spinlock_t lock;
u32 depth;
u16 ci;
u16 rsvd;
atomic64_t event_num;
atomic64_t notify_num;
void __iomem *db;
u64 *dbrec;
dma_addr_t dbrec_dma;
};
struct erdma_cmdq_sq {
void *qbuf;
dma_addr_t qbuf_dma_addr;
spinlock_t lock;
u32 depth;
u16 ci;
u16 pi;
u16 wqebb_cnt;
u64 *dbrec;
dma_addr_t dbrec_dma;
};
struct erdma_cmdq_cq {
void *qbuf;
dma_addr_t qbuf_dma_addr;
spinlock_t lock;
u32 depth;
u32 ci;
u32 cmdsn;
u64 *dbrec;
dma_addr_t dbrec_dma;
atomic64_t armed_num;
};
enum {
ERDMA_CMD_STATUS_INIT,
ERDMA_CMD_STATUS_ISSUED,
ERDMA_CMD_STATUS_FINISHED,
ERDMA_CMD_STATUS_TIMEOUT
};
struct erdma_comp_wait {
struct completion wait_event;
u32 cmd_status;
u32 ctx_id;
u16 sq_pi;
u8 comp_status;
u8 rsvd;
u32 comp_data[4];
};
enum {
ERDMA_CMDQ_STATE_OK_BIT = 0,
ERDMA_CMDQ_STATE_TIMEOUT_BIT = 1,
ERDMA_CMDQ_STATE_CTX_ERR_BIT = 2,
};
#define ERDMA_CMDQ_TIMEOUT_MS 15000
#define ERDMA_REG_ACCESS_WAIT_MS 20
#define ERDMA_WAIT_DEV_DONE_CNT 500
struct erdma_cmdq {
unsigned long *comp_wait_bitmap;
struct erdma_comp_wait *wait_pool;
spinlock_t lock;
struct erdma_cmdq_sq sq;
struct erdma_cmdq_cq cq;
struct erdma_eq eq;
unsigned long state;
struct semaphore credits;
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/netdevice.h`, `linux/pci.h`, `linux/xarray.h`, `rdma/ib_verbs.h`, `erdma_hw.h`.
- Detected declarations: `struct erdma_eq`, `struct erdma_cmdq_sq`, `struct erdma_cmdq_cq`, `struct erdma_comp_wait`, `struct erdma_cmdq`, `struct erdma_devattr`, `struct erdma_irq`, `struct erdma_eq_cb`, `struct erdma_resource_cb`, `struct erdma_dev`.
- Atlas domain: Driver Families / drivers/infiniband.
- 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.