drivers/net/ethernet/alibaba/eea/eea_adminq.c

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/alibaba/eea/eea_adminq.c

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/alibaba/eea/eea_adminq.c
Extension
.c
Size
12522 bytes
Lines
543
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 eea_aq_create {
	__le32 flags;
	/* queue index.
	 * rx: 0 == qidx % 2
	 * tx: 1 == qidx % 2
	 */
	__le16 qidx;
	/* the depth of the queue */
	__le16 depth;
	/*  0: without SPLIT HDR
	 *  1: 128B
	 *  2: 256B
	 *  3: 512B
	 */
	u8 hdr_buf_size;
	u8 sq_desc_size;
	u8 cq_desc_size;
	u8 reserve0;
	/* The vector for the irq. rx,tx share the same vector */
	__le16 msix_vector;
	__le16 reserve;
	/* sq ring cfg. */
	__le32 sq_addr_low;
	__le32 sq_addr_high;
	/* cq ring cfg. Just valid when flags include EEA_QUEUE_FLAGS_SQCQ. */
	__le32 cq_addr_low;
	__le32 cq_addr_high;
};

struct eea_aq_queue_drv_status {
	__le16 qidx;

	__le16 sq_head;
	__le16 cq_head;
	__le16 reserved;
};

#define EEA_OS_DISTRO		0
#define EEA_DRV_TYPE		0
#define EEA_OS_LINUX		1
#define EEA_SPEC_VER_MAJOR	1
#define EEA_SPEC_VER_MINOR	0

struct eea_aq_host_info_cfg {
	__le16	os_type;
	__le16	os_dist;
	__le16	drv_type;

	__le16	kern_ver_major;
	__le16	kern_ver_minor;
	__le16	kern_ver_sub_minor;

	__le16	drv_ver_major;
	__le16	drv_ver_minor;
	__le16	drv_ver_sub_minor;

	__le16	spec_ver_major;
	__le16	spec_ver_minor;
	__le16	pci_bdf;
	__le32	pci_domain;

	u8      os_ver_str[64];
	u8      isa_str[64];
};

#define EEA_HINFO_MAX_REP_LEN	1024
#define EEA_HINFO_REP_BAD	2

struct eea_aq_host_info_rep {
	u8	op_code;
	u8	has_reply;
	u8	reply_str[EEA_HINFO_MAX_REP_LEN];
};

static struct eea_ring *qid_to_ering(struct eea_net *enet, u32 qid)
{
	struct eea_ring *ering;

	if (qid % 2 == 0)
		ering = enet->rx[qid / 2]->ering;
	else
		ering = enet->tx[qid / 2].ering;

	return ering;
}

#define EEA_AQ_TIMEOUT_US (60 * 1000 * 1000)

static void eea_device_broken(struct eea_net *enet)
{

Annotation

Implementation Notes