drivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.c- Extension
.c- Size
- 8039 bytes
- Lines
- 247
- 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.
- 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/debugfs.hlinux/if_ether.hlinux/if.hlinux/net.hlinux/netdevice.hlinux/ieee80211.hlinux/module.hnet/mac80211.hdefs.hbrcmu_wifi.hbrcmu_utils.htypes.hmain.hdebug.hbrcms_trace_events.hphy/phy_int.h
Detected Declarations
struct brcms_debugfs_entryfunction brcms_debugfs_initfunction brcms_debugfs_exitfunction brcms_debugfs_attachfunction brcms_debugfs_detachfunction brcms_debugfs_hardware_readfunction brcms_debugfs_macstat_readfunction brcms_debugfs_entry_openfunction brcms_debugfs_add_entryfunction brcms_debugfs_create_filesfunction __brcms_dbg
Annotated Snippet
static const struct file_operations brcms_debugfs_def_ops = {
.owner = THIS_MODULE,
.open = brcms_debugfs_entry_open,
.release = single_release,
.read = seq_read,
.llseek = seq_lseek
};
static void
brcms_debugfs_add_entry(struct brcms_pub *drvr, const char *fn,
int (*read_fn)(struct seq_file *seq, void *data))
{
struct device *dev = &drvr->wlc->hw->d11core->dev;
struct dentry *dentry = drvr->dbgfs_dir;
struct brcms_debugfs_entry *entry;
entry = devm_kzalloc(dev, sizeof(*entry), GFP_KERNEL);
if (!entry)
return;
entry->read = read_fn;
entry->drvr = drvr;
debugfs_create_file(fn, 0444, dentry, entry, &brcms_debugfs_def_ops);
}
void brcms_debugfs_create_files(struct brcms_pub *drvr)
{
brcms_debugfs_add_entry(drvr, "hardware", brcms_debugfs_hardware_read);
brcms_debugfs_add_entry(drvr, "macstat", brcms_debugfs_macstat_read);
}
#define __brcms_fn(fn) \
void __brcms_ ##fn(struct device *dev, const char *fmt, ...) \
{ \
struct va_format vaf = { \
.fmt = fmt, \
}; \
va_list args; \
\
va_start(args, fmt); \
vaf.va = &args; \
dev_ ##fn(dev, "%pV", &vaf); \
trace_brcms_ ##fn(&vaf); \
va_end(args); \
}
__brcms_fn(info)
__brcms_fn(warn)
__brcms_fn(err)
__brcms_fn(crit)
#if defined(CONFIG_BRCMDBG) || defined(CONFIG_BRCM_TRACING)
void __brcms_dbg(struct device *dev, u32 level, const char *func,
const char *fmt, ...)
{
struct va_format vaf = {
.fmt = fmt,
};
va_list args;
va_start(args, fmt);
vaf.va = &args;
#ifdef CONFIG_BRCMDBG
if ((brcm_msg_level & level) && net_ratelimit())
dev_err(dev, "%s %pV", func, &vaf);
#endif
trace_brcms_dbg(level, func, &vaf);
va_end(args);
}
#endif
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/if_ether.h`, `linux/if.h`, `linux/net.h`, `linux/netdevice.h`, `linux/ieee80211.h`, `linux/module.h`, `net/mac80211.h`.
- Detected declarations: `struct brcms_debugfs_entry`, `function brcms_debugfs_init`, `function brcms_debugfs_exit`, `function brcms_debugfs_attach`, `function brcms_debugfs_detach`, `function brcms_debugfs_hardware_read`, `function brcms_debugfs_macstat_read`, `function brcms_debugfs_entry_open`, `function brcms_debugfs_add_entry`, `function brcms_debugfs_create_files`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern 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.