1 /* SPDX-License-Identifier: BSD-3-Clause */ 2 /* Copyright(c) 2007-2022 Intel Corporation */ 3 #ifndef ADF_FW_COUNTERS_H_ 4 #define ADF_FW_COUNTERS_H_ 5 6 #include <linux/rwsem.h> 7 #include "adf_accel_devices.h" 8 9 #define FW_COUNTERS_MAX_STR_LEN 64 10 #define FW_COUNTERS_MAX_KEY_LEN_IN_BYTES FW_COUNTERS_MAX_STR_LEN 11 #define FW_COUNTERS_MAX_VAL_LEN_IN_BYTES FW_COUNTERS_MAX_STR_LEN 12 #define FW_COUNTERS_MAX_SECTION_LEN_IN_BYTES FW_COUNTERS_MAX_STR_LEN 13 #define ADF_FW_COUNTERS_NO_RESPONSE -1 14 15 struct adf_fw_counters_val { 16 char key[FW_COUNTERS_MAX_KEY_LEN_IN_BYTES]; 17 char val[FW_COUNTERS_MAX_VAL_LEN_IN_BYTES]; 18 struct list_head list; 19 }; 20 21 struct adf_fw_counters_section { 22 char name[FW_COUNTERS_MAX_SECTION_LEN_IN_BYTES]; 23 struct list_head list; 24 struct list_head param_head; 25 }; 26 27 struct adf_fw_counters_data { 28 struct list_head ae_sec_list; 29 struct sysctl_oid *debug; 30 struct rw_semaphore lock; 31 }; 32 33 int adf_fw_counters_add(struct adf_accel_dev *accel_dev); 34 void adf_fw_counters_remove(struct adf_accel_dev *accel_dev); 35 int adf_fw_count_ras_event(struct adf_accel_dev *accel_dev, 36 u32 *ras_event, 37 char *aeidstr); 38 39 #endif /* ADF_FW_COUNTERS_H_ */ 40