drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c- Extension
.c- Size
- 5406 bytes
- Lines
- 208
- 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/module.hlinux/debugfs.hdpaa2-eth.hdpaa2-eth-debugfs.h
Detected Declarations
function dpaa2_dbg_cpu_showfunction for_each_online_cpufunction dpaa2_dbg_fqs_showfunction dpaa2_dbg_ch_showfunction dpaa2_dbg_bp_showfunction dpaa2_dbg_addfunction dpaa2_dbg_removefunction dpaa2_eth_dbg_initfunction dpaa2_eth_dbg_exit
Annotated Snippet
if (err) {
netdev_warn(priv->net_dev, "Buffer count query error %d\n", err);
return err;
}
seq_printf(file, "%3s%d%10d%15d", "BP#", i, bp->bpid, buf_cnt);
for (j = 0; j < num_queues; j++) {
if (priv->channel[j]->bp == bp)
seq_printf(file, "%10s", "x");
else
seq_printf(file, "%10s", "");
}
seq_printf(file, "\n");
}
return 0;
}
DEFINE_SHOW_ATTRIBUTE(dpaa2_dbg_bp);
void dpaa2_dbg_add(struct dpaa2_eth_priv *priv)
{
struct fsl_mc_device *dpni_dev;
struct dentry *dir;
char name[10];
/* Create a directory for the interface */
dpni_dev = to_fsl_mc_device(priv->net_dev->dev.parent);
snprintf(name, 10, "dpni.%d", dpni_dev->obj_desc.id);
dir = debugfs_create_dir(name, dpaa2_dbg_root);
priv->dbg.dir = dir;
/* per-cpu stats file */
debugfs_create_file("cpu_stats", 0444, dir, priv, &dpaa2_dbg_cpu_fops);
/* per-fq stats file */
debugfs_create_file("fq_stats", 0444, dir, priv, &dpaa2_dbg_fqs_fops);
/* per-fq stats file */
debugfs_create_file("ch_stats", 0444, dir, priv, &dpaa2_dbg_ch_fops);
/* per buffer pool stats file */
debugfs_create_file("bp_stats", 0444, dir, priv, &dpaa2_dbg_bp_fops);
}
void dpaa2_dbg_remove(struct dpaa2_eth_priv *priv)
{
debugfs_remove_recursive(priv->dbg.dir);
}
void dpaa2_eth_dbg_init(void)
{
dpaa2_dbg_root = debugfs_create_dir(DPAA2_ETH_DBG_ROOT, NULL);
pr_debug("DPAA2-ETH: debugfs created\n");
}
void dpaa2_eth_dbg_exit(void)
{
debugfs_remove(dpaa2_dbg_root);
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/debugfs.h`, `dpaa2-eth.h`, `dpaa2-eth-debugfs.h`.
- Detected declarations: `function dpaa2_dbg_cpu_show`, `function for_each_online_cpu`, `function dpaa2_dbg_fqs_show`, `function dpaa2_dbg_ch_show`, `function dpaa2_dbg_bp_show`, `function dpaa2_dbg_add`, `function dpaa2_dbg_remove`, `function dpaa2_eth_dbg_init`, `function dpaa2_eth_dbg_exit`.
- 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.