drivers/infiniband/hw/bng_re/bng_fw.h

Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/bng_re/bng_fw.h

File Facts

System
Linux kernel
Corpus path
drivers/infiniband/hw/bng_re/bng_fw.h
Extension
.h
Size
5054 bytes
Lines
212
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct bng_fw_cmdqe {
	u8	data[16];
};

#define BNG_FW_CMDQE_MAX_CNT		8192
#define BNG_FW_CMDQE_UNITS		sizeof(struct bng_fw_cmdqe)
#define BNG_FW_CMDQE_BYTES(depth)	((depth) * BNG_FW_CMDQE_UNITS)

#define BNG_FW_MAX_COOKIE_VALUE		(BNG_FW_CMDQE_MAX_CNT - 1)
#define BNG_FW_CMD_IS_BLOCKING		0x8000

/* Crsq buf is 1024-Byte */
struct bng_re_crsbe {
	u8			data[1024];
};


static inline u32 bng_fw_cmdqe_npages(u32 depth)
{
	u32 npages;

	npages = BNG_FW_CMDQE_BYTES(depth) / PAGE_SIZE;
	if (BNG_FW_CMDQE_BYTES(depth) % PAGE_SIZE)
		npages++;
	return npages;
}

static inline u32 bng_fw_cmdqe_page_size(u32 depth)
{
	return (bng_fw_cmdqe_npages(depth) * PAGE_SIZE);
}
struct bng_re_cmdq_mbox {
	struct bng_re_reg_desc		reg;
	void __iomem			*prod;
	void __iomem			*db;
};

/* HWQ */
struct bng_re_cmdq_ctx {
	struct bng_re_hwq		hwq;
	struct bng_re_cmdq_mbox		cmdq_mbox;
	unsigned long			flags;
#define FIRMWARE_INITIALIZED_FLAG	(0)
#define FIRMWARE_STALL_DETECTED		(3)
#define FIRMWARE_FIRST_FLAG		(31)
	wait_queue_head_t		waitq;
	u32				seq_num;
};

struct bng_re_creq_db {
	struct bng_re_reg_desc	reg;
	struct bng_re_db_info	dbinfo;
};

struct bng_re_creq_stat {
	u64	creq_qp_event_processed;
	u64	creq_func_event_processed;
};

struct bng_re_creq_ctx {
	struct bng_re_hwq		hwq;
	struct bng_re_creq_db		creq_db;
	struct bng_re_creq_stat		stats;
	struct tasklet_struct		creq_tasklet;
	u16				ring_id;
	int				msix_vec;
	bool				irq_handler_avail;
	char				*irq_name;
};

struct bng_re_crsqe {
	struct creq_qp_event	*resp;
	u32			req_size;
	/* Free slots at the time of submission */
	u32			free_slots;
	u8			opcode;
	bool			is_waiter_alive;
	bool			is_in_used;
};

struct bng_re_rcfw_sbuf {
	void *sb;
	dma_addr_t dma_addr;
	u32 size;
};

/* RoCE FW Communication Channels */
struct bng_re_rcfw {
	struct pci_dev		*pdev;
	struct bng_re_res	*res;

Annotation

Implementation Notes