drivers/net/ethernet/intel/idpf/idpf_controlq_api.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/idpf/idpf_controlq_api.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/intel/idpf/idpf_controlq_api.h
Extension
.h
Size
4951 bytes
Lines
178
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 idpf_ctlq_reg {
	/* used for queue tracking */
	u32 head;
	u32 tail;
	/* Below applies only to default mb (if present) */
	u32 len;
	u32 bah;
	u32 bal;
	u32 len_mask;
	u32 len_ena_mask;
	u32 head_mask;
};

/* Generic queue msg structure */
struct idpf_ctlq_msg {
	u8 vmvf_type; /* represents the source of the message on recv */
#define IDPF_VMVF_TYPE_VF 0
#define IDPF_VMVF_TYPE_VM 1
#define IDPF_VMVF_TYPE_PF 2
	u8 host_id;
	/* 3b field used only when sending a message to CP - to be used in
	 * combination with target func_id to route the message
	 */
#define IDPF_HOST_ID_MASK 0x7

	u16 opcode;
	u16 data_len;	/* data_len = 0 when no payload is attached */
	union {
		u16 func_id;	/* when sending a message */
		u16 status;	/* when receiving a message */
	};
	union {
		struct {
			u32 chnl_opcode;
			u32 chnl_retval;
		} mbx;
	} cookie;
	union {
#define IDPF_DIRECT_CTX_SIZE	16
#define IDPF_INDIRECT_CTX_SIZE	8
		/* 16 bytes of context can be provided or 8 bytes of context
		 * plus the address of a DMA buffer
		 */
		u8 direct[IDPF_DIRECT_CTX_SIZE];
		struct {
			u8 context[IDPF_INDIRECT_CTX_SIZE];
			struct idpf_dma_mem *payload;
		} indirect;
		struct {
			u32 rsvd;
			u16 data;
			u16 flags;
		} sw_cookie;
	} ctx;
};

/* Generic queue info structures */
/* MB, CONFIG and EVENT q do not have extended info */
struct idpf_ctlq_create_info {
	enum idpf_ctlq_type type;
	int id; /* absolute queue offset passed as input
		 * -1 for default mailbox if present
		 */
	u16 len; /* Queue length passed as input */
	u16 buf_size; /* buffer size passed as input */
	u64 base_address; /* output, HPA of the Queue start  */
	struct idpf_ctlq_reg reg; /* registers accessed by ctlqs */

	int ext_info_size;
	void *ext_info; /* Specific to q type */
};

/* Control Queue information */
struct idpf_ctlq_info {
	struct list_head cq_list;

	enum idpf_ctlq_type cq_type;
	int q_id;
	spinlock_t cq_lock;		/* control queue lock */
	/* used for interrupt processing */
	u16 next_to_use;
	u16 next_to_clean;
	u16 next_to_post;		/* starting descriptor to post buffers
					 * to after recev
					 */

	struct idpf_dma_mem desc_ring;	/* descriptor ring memory
					 * idpf_dma_mem is defined in OSdep.h
					 */
	union {

Annotation

Implementation Notes