drivers/infiniband/hw/mthca/mthca_dev.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/mthca/mthca_dev.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/mthca/mthca_dev.h- Extension
.h- Size
- 18656 bytes
- Lines
- 586
- 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.
- 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/spinlock.hlinux/kernel.hlinux/pci.hlinux/dma-mapping.hlinux/timer.hlinux/mutex.hlinux/list.hlinux/semaphore.hmthca_provider.hmthca_doorbell.h
Detected Declarations
struct mthca_cmdstruct mthca_limitsstruct mthca_allocstruct mthca_arraystruct mthca_uar_tablestruct mthca_pd_tablestruct mthca_buddystruct mthca_mr_tablestruct mthca_eq_tablestruct mthca_cq_tablestruct mthca_srq_tablestruct mthca_qp_tablestruct mthca_av_tablestruct mthca_mcg_tablestruct mthca_catas_errstruct mthca_devfunction mthca_is_memfree
Annotated Snippet
struct mthca_cmd {
struct dma_pool *pool;
struct mutex hcr_mutex;
struct semaphore poll_sem;
struct semaphore event_sem;
int max_cmds;
spinlock_t context_lock;
int free_head;
struct mthca_cmd_context *context;
u16 token_mask;
u32 flags;
void __iomem *dbell_map;
u16 dbell_offsets[MTHCA_CMD_NUM_DBELL_DWORDS];
};
struct mthca_limits {
int num_ports;
int vl_cap;
int mtu_cap;
int gid_table_len;
int pkey_table_len;
int local_ca_ack_delay;
int num_uars;
int max_sg;
int num_qps;
int max_wqes;
int max_desc_sz;
int max_qp_init_rdma;
int reserved_qps;
int num_srqs;
int max_srq_wqes;
int max_srq_sge;
int reserved_srqs;
int num_eecs;
int reserved_eecs;
int num_cqs;
int max_cqes;
int reserved_cqs;
int num_eqs;
int reserved_eqs;
int num_mpts;
int num_mtt_segs;
int mtt_seg_size;
int fmr_reserved_mtts;
int reserved_mtts;
int reserved_mrws;
int reserved_uars;
int num_mgms;
int num_amgms;
int reserved_mcgs;
int num_pds;
int reserved_pds;
u32 page_size_cap;
u32 flags;
u16 stat_rate_support;
u8 port_width_cap;
};
struct mthca_alloc {
u32 last;
u32 top;
u32 max;
u32 mask;
spinlock_t lock;
unsigned long *table;
};
struct mthca_array {
struct {
void **page;
int used;
} *page_list;
};
struct mthca_uar_table {
struct mthca_alloc alloc;
u64 uarc_base;
int uarc_size;
};
struct mthca_pd_table {
struct mthca_alloc alloc;
};
struct mthca_buddy {
unsigned long **bits;
int *num_free;
int max_order;
spinlock_t lock;
};
Annotation
- Immediate include surface: `linux/spinlock.h`, `linux/kernel.h`, `linux/pci.h`, `linux/dma-mapping.h`, `linux/timer.h`, `linux/mutex.h`, `linux/list.h`, `linux/semaphore.h`.
- Detected declarations: `struct mthca_cmd`, `struct mthca_limits`, `struct mthca_alloc`, `struct mthca_array`, `struct mthca_uar_table`, `struct mthca_pd_table`, `struct mthca_buddy`, `struct mthca_mr_table`, `struct mthca_eq_table`, `struct mthca_cq_table`.
- Atlas domain: Driver Families / drivers/infiniband.
- 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.