drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_keys.h- Extension
.h- Size
- 7168 bytes
- Lines
- 236
- 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/bitmap.hitem.h
Detected Declarations
struct mlxsw_afk_element_infostruct mlxsw_afk_element_inststruct mlxsw_afk_blockstruct mlxsw_afk_element_usagestruct mlxsw_afkstruct mlxsw_afk_opsstruct mlxsw_afk_key_infostruct mlxsw_afk_element_valuesenum mlxsw_afk_elementenum mlxsw_afk_element_typefunction mlxsw_afk_element_usage_addfunction mlxsw_afk_element_usage_zerofunction mlxsw_afk_element_usage_fillfunction mlxsw_afk_element_usage_subset
Annotated Snippet
struct mlxsw_afk_element_info {
enum mlxsw_afk_element element; /* element ID */
enum mlxsw_afk_element_type type;
struct mlxsw_item item; /* element geometry in internal storage */
};
#define MLXSW_AFK_ELEMENT_INFO(_type, _element, _offset, _shift, _size) \
[MLXSW_AFK_ELEMENT_##_element] = { \
.element = MLXSW_AFK_ELEMENT_##_element, \
.type = _type, \
.item = { \
.offset = _offset, \
.shift = _shift, \
.size = {.bits = _size}, \
.name = #_element, \
}, \
}
#define MLXSW_AFK_ELEMENT_INFO_U32(_element, _offset, _shift, _size) \
MLXSW_AFK_ELEMENT_INFO(MLXSW_AFK_ELEMENT_TYPE_U32, \
_element, _offset, _shift, _size)
#define MLXSW_AFK_ELEMENT_INFO_BUF(_element, _offset, _size) \
MLXSW_AFK_ELEMENT_INFO(MLXSW_AFK_ELEMENT_TYPE_BUF, \
_element, _offset, 0, _size)
#define MLXSW_AFK_ELEMENT_STORAGE_SIZE 0x44
struct mlxsw_afk_element_inst { /* element instance in actual block */
enum mlxsw_afk_element element;
enum mlxsw_afk_element_type type;
struct mlxsw_item item; /* element geometry in block */
int u32_key_diff; /* in case value needs to be adjusted before write
* this diff is here to handle that
*/
bool avoid_size_check;
};
#define MLXSW_AFK_ELEMENT_INST(_type, _element, _offset, \
_shift, _size, _u32_key_diff, _avoid_size_check) \
{ \
.element = MLXSW_AFK_ELEMENT_##_element, \
.type = _type, \
.item = { \
.offset = _offset, \
.shift = _shift, \
.size = {.bits = _size}, \
.name = #_element, \
}, \
.u32_key_diff = _u32_key_diff, \
.avoid_size_check = _avoid_size_check, \
}
#define MLXSW_AFK_ELEMENT_INST_U32(_element, _offset, _shift, _size) \
MLXSW_AFK_ELEMENT_INST(MLXSW_AFK_ELEMENT_TYPE_U32, \
_element, _offset, _shift, _size, 0, false)
#define MLXSW_AFK_ELEMENT_INST_EXT_U32(_element, _offset, \
_shift, _size, _key_diff, \
_avoid_size_check) \
MLXSW_AFK_ELEMENT_INST(MLXSW_AFK_ELEMENT_TYPE_U32, \
_element, _offset, _shift, _size, \
_key_diff, _avoid_size_check)
#define MLXSW_AFK_ELEMENT_INST_BUF(_element, _offset, _size) \
MLXSW_AFK_ELEMENT_INST(MLXSW_AFK_ELEMENT_TYPE_BUF, \
_element, _offset, 0, _size, 0, false)
struct mlxsw_afk_block {
u16 encoding; /* block ID */
const struct mlxsw_afk_element_inst *instances;
unsigned int instances_count;
bool high_entropy;
};
#define MLXSW_AFK_BLOCK(_encoding, _instances) \
{ \
.encoding = _encoding, \
.instances = _instances, \
.instances_count = ARRAY_SIZE(_instances), \
}
#define MLXSW_AFK_BLOCK_HIGH_ENTROPY(_encoding, _instances) \
{ \
.encoding = _encoding, \
.instances = _instances, \
.instances_count = ARRAY_SIZE(_instances), \
.high_entropy = true, \
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/bitmap.h`, `item.h`.
- Detected declarations: `struct mlxsw_afk_element_info`, `struct mlxsw_afk_element_inst`, `struct mlxsw_afk_block`, `struct mlxsw_afk_element_usage`, `struct mlxsw_afk`, `struct mlxsw_afk_ops`, `struct mlxsw_afk_key_info`, `struct mlxsw_afk_element_values`, `enum mlxsw_afk_element`, `enum mlxsw_afk_element_type`.
- 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.