drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c- Extension
.c- Size
- 13092 bytes
- Lines
- 469
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
vcap_api_private.hvcap_api_debugfs.hvcap_api_debugfs_kunit.c
Detected Declarations
struct vcap_admin_debugfs_infostruct vcap_port_debugfs_infofunction vcap_debugfs_show_rule_keyfieldfunction vcap_debugfs_show_rule_actionfieldfunction vcap_debugfs_show_keysetsfunction vcap_debugfs_show_rule_keysetfunction list_for_each_entryfunction vcap_debugfs_show_rule_actionsetfunction list_for_each_entryfunction vcap_show_admin_rulefunction vcap_show_admin_infofunction vcap_show_adminfunction vcap_show_admin_rawfunction vcap_port_debugfs_showfunction list_for_each_entryfunction vcap_port_debugfsfunction vcap_debugfs_showfunction vcap_raw_debugfs_showexport vcap_port_debugfsexport vcap_debugfs
Annotated Snippet
struct vcap_admin_debugfs_info {
struct vcap_control *vctrl;
struct vcap_admin *admin;
};
struct vcap_port_debugfs_info {
struct vcap_control *vctrl;
struct net_device *ndev;
};
/* Dump the keyfields value and mask values */
static void vcap_debugfs_show_rule_keyfield(struct vcap_control *vctrl,
struct vcap_output_print *out,
enum vcap_key_field key,
const struct vcap_field *keyfield,
struct vcap_client_keyfield_data *data)
{
bool hex = false;
u8 *value, *mask;
int idx, bytes;
out->prf(out->dst, " %s: W%d: ", vcap_keyfield_name(vctrl, key),
keyfield[key].width);
switch (keyfield[key].type) {
case VCAP_FIELD_BIT:
out->prf(out->dst, "%d/%d", data->u1.value, data->u1.mask);
break;
case VCAP_FIELD_U32:
value = (u8 *)(&data->u32.value);
mask = (u8 *)(&data->u32.mask);
if (key == VCAP_KF_L3_IP4_SIP || key == VCAP_KF_L3_IP4_DIP) {
out->prf(out->dst, "%pI4h/%pI4h", &data->u32.value,
&data->u32.mask);
} else if (key == VCAP_KF_ETYPE ||
key == VCAP_KF_IF_IGR_PORT_MASK ||
key == VCAP_KF_IF_EGR_PORT_MASK) {
hex = true;
} else {
u32 fmsk = (1 << keyfield[key].width) - 1;
if (keyfield[key].width == 32)
fmsk = ~0;
out->prf(out->dst, "%u/%u", data->u32.value & fmsk,
data->u32.mask & fmsk);
}
break;
case VCAP_FIELD_U48:
value = data->u48.value;
mask = data->u48.mask;
if (key == VCAP_KF_L2_SMAC || key == VCAP_KF_L2_DMAC)
out->prf(out->dst, "%pMR/%pMR", data->u48.value,
data->u48.mask);
else
hex = true;
break;
case VCAP_FIELD_U56:
value = data->u56.value;
mask = data->u56.mask;
hex = true;
break;
case VCAP_FIELD_U64:
value = data->u64.value;
mask = data->u64.mask;
hex = true;
break;
case VCAP_FIELD_U72:
value = data->u72.value;
mask = data->u72.mask;
hex = true;
break;
case VCAP_FIELD_U112:
value = data->u112.value;
mask = data->u112.mask;
hex = true;
break;
case VCAP_FIELD_U128:
value = data->u128.value;
mask = data->u128.mask;
if (key == VCAP_KF_L3_IP6_SIP || key == VCAP_KF_L3_IP6_DIP) {
u8 nvalue[16], nmask[16];
vcap_netbytes_copy(nvalue, data->u128.value,
sizeof(nvalue));
vcap_netbytes_copy(nmask, data->u128.mask,
sizeof(nmask));
out->prf(out->dst, "%pI6/%pI6", nvalue, nmask);
} else {
hex = true;
Annotation
- Immediate include surface: `vcap_api_private.h`, `vcap_api_debugfs.h`, `vcap_api_debugfs_kunit.c`.
- Detected declarations: `struct vcap_admin_debugfs_info`, `struct vcap_port_debugfs_info`, `function vcap_debugfs_show_rule_keyfield`, `function vcap_debugfs_show_rule_actionfield`, `function vcap_debugfs_show_keysets`, `function vcap_debugfs_show_rule_keyset`, `function list_for_each_entry`, `function vcap_debugfs_show_rule_actionset`, `function list_for_each_entry`, `function vcap_show_admin_rule`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.