drivers/net/ethernet/microchip/vcap/vcap_api.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/vcap/vcap_api.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/microchip/vcap/vcap_api.h
Extension
.h
Size
8719 bytes
Lines
281
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 vcap_statistics {
	char *name;
	int count;
	const char * const *keyfield_set_names;
	const char * const *actionfield_set_names;
	const char * const *keyfield_names;
	const char * const *actionfield_names;
};

/* VCAP key/action field type, position and width */
struct vcap_field {
	u16 type;
	u16 width;
	u16 offset;
};

/* VCAP keyset or actionset type and width */
struct vcap_set {
	u8 type_id;
	u8 sw_per_item;
	u8 sw_cnt;
};

/* VCAP typegroup position and bitvalue */
struct vcap_typegroup {
	u16 offset;
	u16 width;
	u16 value;
};

/* VCAP model data */
struct vcap_info {
	char *name; /* user-friendly name */
	u16 rows; /* number of row in instance */
	u16 sw_count; /* maximum subwords used per rule */
	u16 sw_width; /* bits per subword in a keyset */
	u16 sticky_width; /* sticky bits per rule */
	u16 act_width;  /* bits per subword in an actionset */
	u16 default_cnt; /* number of default rules */
	u16 require_cnt_dis; /* not used */
	u16 version; /* vcap rtl version */
	const struct vcap_set *keyfield_set; /* keysets */
	int keyfield_set_size; /* number of keysets */
	const struct vcap_set *actionfield_set; /* actionsets */
	int actionfield_set_size; /* number of actionsets */
	/* map of keys per keyset */
	const struct vcap_field **keyfield_set_map;
	/* number of entries in the above map */
	int *keyfield_set_map_size;
	/* map of actions per actionset */
	const struct vcap_field **actionfield_set_map;
	/* number of entries in the above map */
	int *actionfield_set_map_size;
	/* map of keyset typegroups per subword size */
	const struct vcap_typegroup **keyfield_set_typegroups;
	/* map of actionset typegroups per subword size */
	const struct vcap_typegroup **actionfield_set_typegroups;
};

enum vcap_field_type {
	VCAP_FIELD_BIT,
	VCAP_FIELD_U32,
	VCAP_FIELD_U48,
	VCAP_FIELD_U56,
	VCAP_FIELD_U64,
	VCAP_FIELD_U72,
	VCAP_FIELD_U112,
	VCAP_FIELD_U128,
};

/* VCAP rule data towards the VCAP cache */
struct vcap_cache_data {
	u32 *keystream;
	u32 *maskstream;
	u32 *actionstream;
	u32 counter;
	bool sticky;
};

/* Selects which part of the rule must be updated */
enum vcap_selection {
	VCAP_SEL_ENTRY = 0x01,
	VCAP_SEL_ACTION = 0x02,
	VCAP_SEL_COUNTER = 0x04,
	VCAP_SEL_ALL = 0xff,
};

/* Commands towards the VCAP cache */
enum vcap_command {
	VCAP_CMD_WRITE = 0,

Annotation

Implementation Notes