summaryrefslogtreecommitdiff
path: root/drivers/crypto/qat/qat_common/adf_pfvf_utils.h
blob: 7b73b5992d031c8815511c3d6187f648769c3dfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
/* Copyright(c) 2021 Intel Corporation */
#ifndef ADF_PFVF_UTILS_H
#define ADF_PFVF_UTILS_H

#include <linux/types.h>
#include "adf_pfvf_msg.h"

struct pfvf_field_format {
	u8  offset;
	u32 mask;
};

struct pfvf_csr_format {
	struct pfvf_field_format type;
	struct pfvf_field_format data;
};

u32 adf_pfvf_csr_msg_of(struct adf_accel_dev *accel_dev, struct pfvf_message msg,
			const struct pfvf_csr_format *fmt);
struct pfvf_message adf_pfvf_message_of(struct adf_accel_dev *accel_dev, u32 raw_msg,
					const struct pfvf_csr_format *fmt);

#endif /* ADF_PFVF_UTILS_H */