drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/broadcom/bnxt/bnxt_debugfs.c- Extension
.c- Size
- 2333 bytes
- Lines
- 108
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/module.hlinux/pci.hlinux/bnxt/hsi.hlinux/dim.hbnxt.hbnxt_debugfs.h
Detected Declarations
function debugfs_dim_readfunction debugfs_dim_ring_initfunction bnxt_debug_dev_initfunction bnxt_debug_dev_exitfunction bnxt_debug_initfunction bnxt_debug_exit
Annotated Snippet
static const struct file_operations debugfs_dim_fops = {
.owner = THIS_MODULE,
.open = simple_open,
.read = debugfs_dim_read,
};
static void debugfs_dim_ring_init(struct dim *dim, int ring_idx,
struct dentry *dd)
{
static char qname[12];
snprintf(qname, sizeof(qname), "%d", ring_idx);
debugfs_create_file(qname, 0600, dd, dim, &debugfs_dim_fops);
}
void bnxt_debug_dev_init(struct bnxt *bp)
{
const char *pname = pci_name(bp->pdev);
struct dentry *dir;
int i;
bp->debugfs_pdev = debugfs_create_dir(pname, bnxt_debug_mnt);
dir = debugfs_create_dir("dim", bp->debugfs_pdev);
/* create files for each rx ring */
for (i = 0; i < bp->cp_nr_rings; i++) {
struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring;
if (cpr && bp->bnapi[i]->rx_ring)
debugfs_dim_ring_init(&cpr->dim, i, dir);
}
}
void bnxt_debug_dev_exit(struct bnxt *bp)
{
if (bp) {
debugfs_remove_recursive(bp->debugfs_pdev);
bp->debugfs_pdev = NULL;
}
}
void bnxt_debug_init(void)
{
bnxt_debug_mnt = debugfs_create_dir("bnxt_en", NULL);
}
void bnxt_debug_exit(void)
{
debugfs_remove_recursive(bnxt_debug_mnt);
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/module.h`, `linux/pci.h`, `linux/bnxt/hsi.h`, `linux/dim.h`, `bnxt.h`, `bnxt_debugfs.h`.
- Detected declarations: `function debugfs_dim_read`, `function debugfs_dim_ring_init`, `function bnxt_debug_dev_init`, `function bnxt_debug_dev_exit`, `function bnxt_debug_init`, `function bnxt_debug_exit`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern 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.