xref: /freebsd/sys/dev/qat/include/adf_heartbeat.h (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 #ifndef ADF_HEARTBEAT_H_
4 #define ADF_HEARTBEAT_H_
5 
6 #include "adf_cfg_common.h"
7 
8 struct adf_accel_dev;
9 
10 struct qat_sysctl {
11 	unsigned int hb_sysctlvar;
12 	struct sysctl_oid *oid;
13 };
14 
15 struct adf_heartbeat {
16 	unsigned int hb_sent_counter;
17 	unsigned int hb_failed_counter;
18 	u64 last_hb_check_time;
19 	enum adf_device_heartbeat_status last_hb_status;
20 	struct qat_sysctl heartbeat;
21 	struct qat_sysctl *heartbeat_sent;
22 	struct qat_sysctl *heartbeat_failed;
23 };
24 
25 int adf_heartbeat_init(struct adf_accel_dev *accel_dev);
26 void adf_heartbeat_clean(struct adf_accel_dev *accel_dev);
27 
28 int adf_get_hb_timer(struct adf_accel_dev *accel_dev, unsigned int *value);
29 int adf_get_heartbeat_status(struct adf_accel_dev *accel_dev);
30 int adf_heartbeat_status(struct adf_accel_dev *accel_dev,
31 			 enum adf_device_heartbeat_status *hb_status);
32 #endif /* ADF_HEARTBEAT_H_ */
33