drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c- Extension
.c- Size
- 1247 bytes
- Lines
- 47
- Domain
- Driver Families
- Bucket
- drivers/crypto
- 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.
- 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/bitops.hlinux/sprintf.hlinux/string_helpers.hadf_pm_dbgfs_utils.h
Detected Declarations
function pm_scnprint_tablefunction adf_pm_scnprint_table_upper_keysfunction adf_pm_scnprint_table_lower_keys
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright(c) 2025 Intel Corporation */
#include <linux/bitfield.h>
#include <linux/bitops.h>
#include <linux/sprintf.h>
#include <linux/string_helpers.h>
#include "adf_pm_dbgfs_utils.h"
#define PM_INFO_MAX_KEY_LEN 21
static int pm_scnprint_table(char *buff, const struct pm_status_row *table,
u32 *pm_info_regs, size_t buff_size, int table_len,
bool lowercase)
{
char key[PM_INFO_MAX_KEY_LEN];
int wr = 0;
int i;
for (i = 0; i < table_len; i++) {
if (lowercase)
string_lower(key, table[i].key);
else
string_upper(key, table[i].key);
wr += scnprintf(&buff[wr], buff_size - wr, "%s: %#x\n", key,
field_get(table[i].field_mask,
pm_info_regs[table[i].reg_offset]));
}
return wr;
}
int adf_pm_scnprint_table_upper_keys(char *buff, const struct pm_status_row *table,
u32 *pm_info_regs, size_t buff_size, int table_len)
{
return pm_scnprint_table(buff, table, pm_info_regs, buff_size,
table_len, false);
}
int adf_pm_scnprint_table_lower_keys(char *buff, const struct pm_status_row *table,
u32 *pm_info_regs, size_t buff_size, int table_len)
{
return pm_scnprint_table(buff, table, pm_info_regs, buff_size,
table_len, true);
}
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bitops.h`, `linux/sprintf.h`, `linux/string_helpers.h`, `adf_pm_dbgfs_utils.h`.
- Detected declarations: `function pm_scnprint_table`, `function adf_pm_scnprint_table_upper_keys`, `function adf_pm_scnprint_table_lower_keys`.
- Atlas domain: Driver Families / drivers/crypto.
- Implementation status: source 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.