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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/list.hlinux/netdevice.hvcap_ag_api.h
Detected Declarations
struct vcap_statisticsstruct vcap_fieldstruct vcap_setstruct vcap_typegroupstruct vcap_infostruct vcap_cache_datastruct vcap_adminstruct vcap_rulestruct vcap_keyset_liststruct vcap_actionset_liststruct vcap_output_printstruct vcap_operationsstruct vcap_controlenum vcap_userenum vcap_field_typeenum vcap_selectionenum vcap_commandenum vcap_rule_error
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
- Immediate include surface: `linux/types.h`, `linux/list.h`, `linux/netdevice.h`, `vcap_ag_api.h`.
- Detected declarations: `struct vcap_statistics`, `struct vcap_field`, `struct vcap_set`, `struct vcap_typegroup`, `struct vcap_info`, `struct vcap_cache_data`, `struct vcap_admin`, `struct vcap_rule`, `struct vcap_keyset_list`, `struct vcap_actionset_list`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.