drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
Extension
.c
Size
8994 bytes
Lines
304
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

hlist_for_each_entry_safe(f, tmp, head, by_id) {
			switch (le16_to_cpu(f->cmd.match)) {
			case IONIC_RX_FILTER_MATCH_VLAN:
				seq_printf(seq, "0x%04x  0x%08x  0x%02x  vlan  0x%04x\n",
					   f->filter_id, f->flow_id, f->state,
					   le16_to_cpu(f->cmd.vlan.vlan));
				break;
			case IONIC_RX_FILTER_MATCH_MAC:
				seq_printf(seq, "0x%04x  0x%08x  0x%02x  mac   %pM\n",
					   f->filter_id, f->flow_id, f->state,
					   f->cmd.mac.addr);
				break;
			case IONIC_RX_FILTER_MATCH_MAC_VLAN:
				seq_printf(seq, "0x%04x  0x%08x  0x%02x  macvl 0x%04x %pM\n",
					   f->filter_id, f->flow_id, f->state,
					   le16_to_cpu(f->cmd.vlan.vlan),
					   f->cmd.mac.addr);
				break;
			case IONIC_RX_FILTER_STEER_PKTCLASS:
				seq_printf(seq, "0x%04x  0x%08x  0x%02x  rxstr 0x%llx\n",
					   f->filter_id, f->flow_id, f->state,
					   le64_to_cpu(f->cmd.pkt_class));
				break;
			}
		}
	}
	spin_unlock_bh(&lif->rx_filters.lock);

	return 0;
}
DEFINE_SHOW_ATTRIBUTE(lif_filters);

void ionic_debugfs_add_lif(struct ionic_lif *lif)
{
	struct dentry *lif_dentry;

	lif_dentry = debugfs_create_dir(lif->name, lif->ionic->dentry);
	if (IS_ERR_OR_NULL(lif_dentry))
		return;
	lif->dentry = lif_dentry;

	debugfs_create_file("netdev", 0400, lif->dentry,
			    lif->netdev, &netdev_fops);
	debugfs_create_file("filters", 0400, lif->dentry,
			    lif, &lif_filters_fops);
}

void ionic_debugfs_del_lif(struct ionic_lif *lif)
{
	if (!lif->dentry)
		return;

	debugfs_remove_recursive(lif->dentry);
	lif->dentry = NULL;
}

void ionic_debugfs_del_qcq(struct ionic_qcq *qcq)
{
	debugfs_remove_recursive(qcq->dentry);
	qcq->dentry = NULL;
}

#endif

Annotation

Implementation Notes