drivers/crypto/intel/qat/qat_common/adf_fw_counters.c

Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_fw_counters.c

File Facts

System
Linux kernel
Corpus path
drivers/crypto/intel/qat/qat_common/adf_fw_counters.c
Extension
.c
Size
6971 bytes
Lines
266
Domain
Driver Families
Bucket
drivers/crypto
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 qat_fw_counters_fops = {
	.owner = THIS_MODULE,
	.open = qat_fw_counters_file_open,
	.read = seq_read,
	.llseek = seq_lseek,
	.release = qat_fw_counters_file_release,
};

/**
 * adf_fw_counters_dbgfs_add() - Create a debugfs file containing FW
 * execution counters.
 * @accel_dev:  Pointer to a QAT acceleration device
 *
 * Function creates a file to display a table with statistics for the given
 * QAT acceleration device. The table stores device specific execution values
 * for each AE, such as the number of requests sent to the FW and responses
 * received from the FW.
 *
 * Return: void
 */
void adf_fw_counters_dbgfs_add(struct adf_accel_dev *accel_dev)
{
	accel_dev->fw_cntr_dbgfile = debugfs_create_file("fw_counters", 0400,
							 accel_dev->debugfs_dir,
							 accel_dev,
							 &qat_fw_counters_fops);
}

/**
 * adf_fw_counters_dbgfs_rm() - Remove the debugfs file containing FW counters.
 * @accel_dev:  Pointer to a QAT acceleration device.
 *
 * Function removes the file providing the table of statistics for the given
 * QAT acceleration device.
 *
 * Return: void
 */
void adf_fw_counters_dbgfs_rm(struct adf_accel_dev *accel_dev)
{
	debugfs_remove(accel_dev->fw_cntr_dbgfile);
	accel_dev->fw_cntr_dbgfile = NULL;
}

Annotation

Implementation Notes