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.

Dependency Surface

Detected Declarations

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

Implementation Notes