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.

Dependency Surface

Detected Declarations

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

Implementation Notes