drivers/net/wireless/st/cw1200/debug.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/st/cw1200/debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/st/cw1200/debug.c- Extension
.c- Size
- 11071 bytes
- Lines
- 389
- 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.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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
linux/module.hlinux/debugfs.hlinux/seq_file.hcw1200.hdebug.hfwio.h
Detected Declarations
function cw1200_queue_status_showfunction cw1200_debug_print_mapfunction cw1200_status_showfunction cw1200_counters_showfunction cw1200_wsm_dumpsfunction cw1200_debug_initfunction cw1200_debug_release
Annotated Snippet
static const struct file_operations fops_wsm_dumps = {
.open = simple_open,
.write = cw1200_wsm_dumps,
.llseek = default_llseek,
};
int cw1200_debug_init(struct cw1200_common *priv)
{
int ret = -ENOMEM;
struct cw1200_debug_priv *d = kzalloc_obj(struct cw1200_debug_priv);
priv->debug = d;
if (!d)
return ret;
d->debugfs_phy = debugfs_create_dir("cw1200",
priv->hw->wiphy->debugfsdir);
debugfs_create_file("status", 0400, d->debugfs_phy, priv,
&cw1200_status_fops);
debugfs_create_file("counters", 0400, d->debugfs_phy, priv,
&cw1200_counters_fops);
debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy, priv,
&fops_wsm_dumps);
return 0;
}
void cw1200_debug_release(struct cw1200_common *priv)
{
struct cw1200_debug_priv *d = priv->debug;
if (d) {
debugfs_remove_recursive(d->debugfs_phy);
priv->debug = NULL;
kfree(d);
}
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/debugfs.h`, `linux/seq_file.h`, `cw1200.h`, `debug.h`, `fwio.h`.
- Detected declarations: `function cw1200_queue_status_show`, `function cw1200_debug_print_map`, `function cw1200_status_show`, `function cw1200_counters_show`, `function cw1200_wsm_dumps`, `function cw1200_debug_init`, `function cw1200_debug_release`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.