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.
- 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.
- 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/bitops.hlinux/debugfs.hlinux/err.hlinux/fs.hlinux/kernel.hlinux/seq_file.hlinux/types.hadf_accel_devices.hadf_admin.hadf_common_drv.hadf_fw_counters.h
Detected Declarations
struct adf_ae_countersstruct adf_fw_countersenum adf_fw_counters_typesfunction adf_fw_counters_parse_ae_valuesfunction adf_fw_counters_load_from_devicefunction adf_fw_counters_getfunction qat_fw_counters_seq_stopfunction qat_fw_counters_file_openfunction qat_fw_counters_file_releasefunction adf_fw_counters_dbgfs_addfunction adf_fw_counters_dbgfs_rm
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
- Immediate include surface: `linux/bitops.h`, `linux/debugfs.h`, `linux/err.h`, `linux/fs.h`, `linux/kernel.h`, `linux/seq_file.h`, `linux/types.h`, `adf_accel_devices.h`.
- Detected declarations: `struct adf_ae_counters`, `struct adf_fw_counters`, `enum adf_fw_counters_types`, `function adf_fw_counters_parse_ae_values`, `function adf_fw_counters_load_from_device`, `function adf_fw_counters_get`, `function qat_fw_counters_seq_stop`, `function qat_fw_counters_file_open`, `function qat_fw_counters_file_release`, `function adf_fw_counters_dbgfs_add`.
- Atlas domain: Driver Families / drivers/crypto.
- Implementation status: pattern implementation candidate.
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.