drivers/crypto/intel/qat/qat_common/adf_sysfs_anti_rb.c
Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_sysfs_anti_rb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/intel/qat/qat_common/adf_sysfs_anti_rb.c- Extension
.c- Size
- 2891 bytes
- Lines
- 134
- 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/sysfs.hlinux/types.hadf_anti_rb.hadf_common_drv.hadf_sysfs_anti_rb.h
Detected Declarations
function enforced_min_showfunction active_showfunction permanent_min_showfunction commit_storefunction adf_sysfs_start_arbfunction adf_sysfs_stop_arb
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright(c) 2026 Intel Corporation */
#include <linux/sysfs.h>
#include <linux/types.h>
#include "adf_anti_rb.h"
#include "adf_common_drv.h"
#include "adf_sysfs_anti_rb.h"
static ssize_t enforced_min_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct adf_accel_dev *accel_dev;
int err;
u8 svn;
accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
if (!accel_dev)
return -EINVAL;
err = adf_anti_rb_query(accel_dev, ARB_ENFORCED_MIN_SVN, &svn);
if (err)
return err;
return sysfs_emit(buf, "%u\n", svn);
}
static DEVICE_ATTR_RO(enforced_min);
static ssize_t active_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct adf_accel_dev *accel_dev;
int err;
u8 svn;
accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
if (!accel_dev)
return -EINVAL;
err = adf_anti_rb_query(accel_dev, ARB_ACTIVE_SVN, &svn);
if (err)
return err;
return sysfs_emit(buf, "%u\n", svn);
}
static DEVICE_ATTR_RO(active);
static ssize_t permanent_min_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct adf_accel_dev *accel_dev;
int err;
u8 svn;
accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
if (!accel_dev)
return -EINVAL;
err = adf_anti_rb_query(accel_dev, ARB_PERMANENT_MIN_SVN, &svn);
if (err)
return err;
return sysfs_emit(buf, "%u\n", svn);
}
static DEVICE_ATTR_RO(permanent_min);
static ssize_t commit_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
struct adf_accel_dev *accel_dev;
bool val;
int err;
accel_dev = adf_devmgr_pci_to_accel_dev(to_pci_dev(dev));
if (!accel_dev)
return -EINVAL;
err = kstrtobool(buf, &val);
if (err)
return err;
if (!val)
return -EINVAL;
err = adf_anti_rb_commit(accel_dev);
if (err)
return err;
return count;
}
Annotation
- Immediate include surface: `linux/sysfs.h`, `linux/types.h`, `adf_anti_rb.h`, `adf_common_drv.h`, `adf_sysfs_anti_rb.h`.
- Detected declarations: `function enforced_min_show`, `function active_show`, `function permanent_min_show`, `function commit_store`, `function adf_sysfs_start_arb`, `function adf_sysfs_stop_arb`.
- 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.