drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/huawei/hinic3/hinic3_cmdq.h
Extension
.h
Size
4199 bytes
Lines
172
Domain
Driver Families
Bucket
drivers/net
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 cmdq_db {
	__le32 db_head;
	__le32 db_info;
};

/* hw defined cmdq wqe header */
struct cmdq_header {
	__le32 header_info;
	__le32 saved_data;
};

struct cmdq_lcmd_bufdesc {
	struct hinic3_sge sge;
	__le64            rsvd2;
	__le64            rsvd3;
};

struct cmdq_status {
	__le32 status_info;
};

struct cmdq_ctrl {
	__le32 ctrl_info;
};

struct cmdq_direct_resp {
	__le64 val;
	__le64 rsvd;
};

struct cmdq_completion {
	union {
		struct hinic3_sge       sge;
		struct cmdq_direct_resp direct;
	} resp;
};

struct cmdq_wqe_scmd {
	struct cmdq_header     header;
	__le64                 rsvd3;
	struct cmdq_status     status;
	struct cmdq_ctrl       ctrl;
	struct cmdq_completion completion;
	__le32                 rsvd10[6];
};

struct cmdq_wqe_lcmd {
	struct cmdq_header       header;
	struct cmdq_status       status;
	struct cmdq_ctrl         ctrl;
	struct cmdq_completion   completion;
	struct cmdq_lcmd_bufdesc buf_desc;
};

struct cmdq_wqe {
	union {
		struct cmdq_wqe_scmd wqe_scmd;
		struct cmdq_wqe_lcmd wqe_lcmd;
	};
};

static_assert(sizeof(struct cmdq_wqe) == 64);

enum hinic3_cmdq_type {
	HINIC3_CMDQ_SYNC      = 0,
	HINIC3_MAX_CMDQ_TYPES = 4
};

enum hinic3_cmdq_status {
	HINIC3_CMDQ_ENABLE = BIT(0),
};

enum hinic3_cmdq_cmd_type {
	HINIC3_CMD_TYPE_NONE,
	HINIC3_CMD_TYPE_SET_ARM,
	HINIC3_CMD_TYPE_DIRECT_RESP,
	HINIC3_CMD_TYPE_SGE_RESP,
	HINIC3_CMD_TYPE_FAKE_TIMEOUT,
	HINIC3_CMD_TYPE_TIMEOUT,
	HINIC3_CMD_TYPE_FORCE_STOP,
};

struct hinic3_cmd_buf {
	void       *buf;
	dma_addr_t dma_addr;
	__le16     size;
	refcount_t ref_cnt;
};

struct hinic3_cmd_buf_pair {

Annotation

Implementation Notes