drivers/crypto/intel/qat/qat_common/adf_heartbeat.h
Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_heartbeat.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/crypto/intel/qat/qat_common/adf_heartbeat.h- Extension
.h- Size
- 2357 bytes
- Lines
- 101
- 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/types.h
Detected Declarations
struct adf_accel_devstruct dentrystruct hb_cnt_pairstruct adf_heartbeatstruct hb_dma_addrenum adf_device_heartbeat_statusfunction adf_heartbeat_inject_errorfunction adf_heartbeat_initfunction adf_heartbeat_startfunction adf_heartbeat_shutdownfunction adf_heartbeat_check_ctrs
Annotated Snippet
struct hb_cnt_pair {
__u16 resp_heartbeat_cnt;
__u16 req_heartbeat_cnt;
};
struct adf_heartbeat {
unsigned int hb_sent_counter;
unsigned int hb_failed_counter;
unsigned int hb_timer;
u64 last_hb_check_time;
u64 last_hb_reset_time;
bool ctrs_cnt_checked;
struct hb_dma_addr {
dma_addr_t phy_addr;
void *virt_addr;
} dma;
struct {
struct dentry *base_dir;
struct dentry *status;
struct dentry *cfg;
struct dentry *sent;
struct dentry *failed;
#ifdef CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION
struct dentry *inject_error;
#endif
} dbgfs;
};
#ifdef CONFIG_DEBUG_FS
int adf_heartbeat_init(struct adf_accel_dev *accel_dev);
int adf_heartbeat_start(struct adf_accel_dev *accel_dev);
void adf_heartbeat_shutdown(struct adf_accel_dev *accel_dev);
int adf_heartbeat_ms_to_ticks(struct adf_accel_dev *accel_dev, unsigned int time_ms,
uint32_t *value);
int adf_heartbeat_save_cfg_param(struct adf_accel_dev *accel_dev,
unsigned int timer_ms);
void adf_heartbeat_status(struct adf_accel_dev *accel_dev,
enum adf_device_heartbeat_status *hb_status);
void adf_heartbeat_check_ctrs(struct adf_accel_dev *accel_dev);
#ifdef CONFIG_CRYPTO_DEV_QAT_ERROR_INJECTION
int adf_heartbeat_inject_error(struct adf_accel_dev *accel_dev);
#else
static inline int adf_heartbeat_inject_error(struct adf_accel_dev *accel_dev)
{
return -EPERM;
}
#endif
#else
static inline int adf_heartbeat_init(struct adf_accel_dev *accel_dev)
{
return 0;
}
static inline int adf_heartbeat_start(struct adf_accel_dev *accel_dev)
{
return 0;
}
static inline void adf_heartbeat_shutdown(struct adf_accel_dev *accel_dev)
{
}
static inline int adf_heartbeat_save_cfg_param(struct adf_accel_dev *accel_dev,
unsigned int timer_ms)
{
return 0;
}
static inline void adf_heartbeat_check_ctrs(struct adf_accel_dev *accel_dev)
{
}
#endif
#endif /* ADF_HEARTBEAT_H_ */
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct adf_accel_dev`, `struct dentry`, `struct hb_cnt_pair`, `struct adf_heartbeat`, `struct hb_dma_addr`, `enum adf_device_heartbeat_status`, `function adf_heartbeat_inject_error`, `function adf_heartbeat_init`, `function adf_heartbeat_start`, `function adf_heartbeat_shutdown`.
- 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.