drivers/net/ethernet/airoha/airoha_ppe_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/airoha/airoha_ppe_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/airoha/airoha_ppe_debugfs.c- Extension
.c- Size
- 5110 bytes
- Lines
- 186
- 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
airoha_eth.h
Detected Declarations
function Copyrightfunction airoha_ppe_debugfs_foe_showfunction airoha_ppe_debugfs_foe_all_showfunction airoha_ppe_debugfs_foe_bind_showfunction airoha_ppe_debugfs_init
Annotated Snippet
switch (type) {
case PPE_PKT_TYPE_IPV4_HNAPT:
case PPE_PKT_TYPE_IPV4_DSLITE:
src_port = &hwe->ipv4.orig_tuple.src_port;
dest_port = &hwe->ipv4.orig_tuple.dest_port;
fallthrough;
case PPE_PKT_TYPE_IPV4_ROUTE:
src_addr = &hwe->ipv4.orig_tuple.src_ip;
dest_addr = &hwe->ipv4.orig_tuple.dest_ip;
break;
case PPE_PKT_TYPE_IPV6_ROUTE_5T:
src_port = &hwe->ipv6.src_port;
dest_port = &hwe->ipv6.dest_port;
fallthrough;
case PPE_PKT_TYPE_IPV6_ROUTE_3T:
case PPE_PKT_TYPE_IPV6_6RD:
src_addr = &hwe->ipv6.src_ip;
dest_addr = &hwe->ipv6.dest_ip;
ipv6 = true;
break;
default:
break;
}
if (src_addr && dest_addr) {
seq_puts(m, " orig=");
airoha_debugfs_ppe_print_tuple(m, src_addr, dest_addr,
src_port, dest_port, ipv6);
}
switch (type) {
case PPE_PKT_TYPE_IPV4_HNAPT:
case PPE_PKT_TYPE_IPV4_DSLITE:
src_port = &hwe->ipv4.new_tuple.src_port;
dest_port = &hwe->ipv4.new_tuple.dest_port;
src_addr = &hwe->ipv4.new_tuple.src_ip;
dest_addr = &hwe->ipv4.new_tuple.dest_ip;
seq_puts(m, " new=");
airoha_debugfs_ppe_print_tuple(m, src_addr, dest_addr,
src_port, dest_port,
ipv6);
break;
default:
break;
}
if (type >= PPE_PKT_TYPE_IPV6_ROUTE_3T) {
data = hwe->ipv6.data;
ib2 = hwe->ipv6.ib2;
l2 = &hwe->ipv6.l2;
} else {
data = hwe->ipv4.data;
ib2 = hwe->ipv4.ib2;
l2 = &hwe->ipv4.l2.common;
*((__be16 *)&h_source[4]) =
cpu_to_be16(hwe->ipv4.l2.src_mac_lo);
}
airoha_ppe_foe_entry_get_stats(ppe, i, &stats);
*((__be32 *)h_dest) = cpu_to_be32(l2->dest_mac_hi);
*((__be16 *)&h_dest[4]) = cpu_to_be16(l2->dest_mac_lo);
*((__be32 *)h_source) = cpu_to_be32(l2->src_mac_hi);
seq_printf(m, " eth=%pM->%pM etype=%04x data=%08x"
" vlan=%d,%d ib1=%08x ib2=%08x"
" packets=%llu bytes=%llu\n",
h_source, h_dest, l2->etype, data,
l2->vlan1, l2->vlan2, hwe->ib1, ib2,
stats.packets, stats.bytes);
}
return 0;
}
static int airoha_ppe_debugfs_foe_all_show(struct seq_file *m, void *private)
{
return airoha_ppe_debugfs_foe_show(m, private, false);
}
DEFINE_SHOW_ATTRIBUTE(airoha_ppe_debugfs_foe_all);
static int airoha_ppe_debugfs_foe_bind_show(struct seq_file *m, void *private)
{
return airoha_ppe_debugfs_foe_show(m, private, true);
}
DEFINE_SHOW_ATTRIBUTE(airoha_ppe_debugfs_foe_bind);
int airoha_ppe_debugfs_init(struct airoha_ppe *ppe)
{
ppe->debugfs_dir = debugfs_create_dir("ppe", NULL);
Annotation
- Immediate include surface: `airoha_eth.h`.
- Detected declarations: `function Copyright`, `function airoha_ppe_debugfs_foe_show`, `function airoha_ppe_debugfs_foe_all_show`, `function airoha_ppe_debugfs_foe_bind_show`, `function airoha_ppe_debugfs_init`.
- 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.