linux/drivers/crypto/intel/qat/qat_common/adf_fw_counters.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright(c) 2023 Intel Corporation */
#include <linux/bitops.h>
#include <linux/debugfs.h>
#include <linux/err.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/seq_file.h>
#include <linux/types.h>

#include "adf_accel_devices.h"
#include "adf_admin.h"
#include "adf_common_drv.h"
#include "adf_fw_counters.h"

#define ADF_FW_COUNTERS_MAX_PADDING

enum adf_fw_counters_types {};

static const char * const adf_fw_counter_names[] =;

static_assert();

struct adf_ae_counters {};

struct adf_fw_counters {};

static void adf_fw_counters_parse_ae_values(struct adf_ae_counters *ae_counters, u32 ae,
					    u64 req_count, u64 resp_count)
{}

static int adf_fw_counters_load_from_device(struct adf_accel_dev *accel_dev,
					    struct adf_fw_counters *fw_counters)
{}

static struct adf_fw_counters *adf_fw_counters_allocate(unsigned long ae_count)
{}

/**
 * adf_fw_counters_get() - Return FW counters for the provided device.
 * @accel_dev: Pointer to a QAT acceleration device
 *
 * Allocates and returns a table of counters containing execution statistics
 * for each non-admin AE available through the supplied acceleration device.
 * The caller becomes the owner of such memory and is responsible for
 * the deallocation through a call to kfree().
 *
 * Returns: a pointer to a dynamically allocated struct adf_fw_counters
 *          on success, or a negative value on error.
 */
static struct adf_fw_counters *adf_fw_counters_get(struct adf_accel_dev *accel_dev)
{}

static void *qat_fw_counters_seq_start(struct seq_file *sfile, loff_t *pos)
{}

static void *qat_fw_counters_seq_next(struct seq_file *sfile, void *v, loff_t *pos)
{}

static void qat_fw_counters_seq_stop(struct seq_file *sfile, void *v) {}

static int qat_fw_counters_seq_show(struct seq_file *sfile, void *v)
{}

static const struct seq_operations qat_fw_counters_sops =;

static int qat_fw_counters_file_open(struct inode *inode, struct file *file)
{}

static int qat_fw_counters_file_release(struct inode *inode, struct file *file)
{}

static const struct file_operations qat_fw_counters_fops =;

/**
 * adf_fw_counters_dbgfs_add() - Create a debugfs file containing FW
 * execution counters.
 * @accel_dev:  Pointer to a QAT acceleration device
 *
 * Function creates a file to display a table with statistics for the given
 * QAT acceleration device. The table stores device specific execution values
 * for each AE, such as the number of requests sent to the FW and responses
 * received from the FW.
 *
 * Return: void
 */
void adf_fw_counters_dbgfs_add(struct adf_accel_dev *accel_dev)
{}

/**
 * adf_fw_counters_dbgfs_rm() - Remove the debugfs file containing FW counters.
 * @accel_dev:  Pointer to a QAT acceleration device.
 *
 * Function removes the file providing the table of statistics for the given
 * QAT acceleration device.
 *
 * Return: void
 */
void adf_fw_counters_dbgfs_rm(struct adf_accel_dev *accel_dev)
{}