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

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

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/huawei/hinic3/hinic3_common.h
Extension
.h
Size
1343 bytes
Lines
56
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 hinic3_dma_addr_align {
	u32        real_size;

	void       *ori_vaddr;
	dma_addr_t ori_paddr;

	void       *align_vaddr;
	dma_addr_t align_paddr;
};

enum hinic3_wait_return {
	HINIC3_WAIT_PROCESS_CPL     = 0,
	HINIC3_WAIT_PROCESS_WAITING = 1,
	HINIC3_WAIT_PROCESS_ERR     = 2,
};

struct hinic3_sge {
	__le32 hi_addr;
	__le32 lo_addr;
	__le32 len;
	__le32 rsvd;
};

static inline void hinic3_set_sge(struct hinic3_sge *sge, dma_addr_t addr,
				  __le32 len)
{
	sge->hi_addr = cpu_to_le32(upper_32_bits(addr));
	sge->lo_addr = cpu_to_le32(lower_32_bits(addr));
	sge->len = len;
	sge->rsvd = 0;
}

int hinic3_dma_zalloc_coherent_align(struct device *dev, u32 size, u32 align,
				     gfp_t flag,
				     struct hinic3_dma_addr_align *mem_align);
void hinic3_dma_free_coherent_align(struct device *dev,
				    struct hinic3_dma_addr_align *mem_align);

typedef enum hinic3_wait_return (*wait_cpl_handler)(void *priv_data);
int hinic3_wait_for_timeout(void *priv_data, wait_cpl_handler handler,
			    u32 wait_total_ms, u32 wait_once_us);

void hinic3_cmdq_buf_swab32(void *data, int len);

#endif

Annotation

Implementation Notes