linux/drivers/crypto/intel/qat/qat_common/adf_mstate_mgr.h

/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright(c) 2024 Intel Corporation */

#ifndef ADF_MSTATE_MGR_H
#define ADF_MSTATE_MGR_H

#define ADF_MSTATE_ID_LEN

#define ADF_MSTATE_ETRB_IDS
#define ADF_MSTATE_MISCB_IDS
#define ADF_MSTATE_EXTB_IDS
#define ADF_MSTATE_GEN_IDS
#define ADF_MSTATE_CONFIG_IDS
#define ADF_MSTATE_SECTION_NUM

#define ADF_MSTATE_BANK_IDX_IDS

#define ADF_MSTATE_ETR_REGS_IDS
#define ADF_MSTATE_VINTSRC_IDS
#define ADF_MSTATE_VINTMSK_IDS
#define ADF_MSTATE_SLA_IDS
#define ADF_MSTATE_IOV_INIT_IDS
#define ADF_MSTATE_COMPAT_VER_IDS
#define ADF_MSTATE_GEN_CAP_IDS
#define ADF_MSTATE_GEN_SVCMAP_IDS
#define ADF_MSTATE_GEN_EXTDC_IDS
#define ADF_MSTATE_VINTSRC_PF2VM_IDS
#define ADF_MSTATE_VINTMSK_PF2VM_IDS
#define ADF_MSTATE_VM2PF_IDS
#define ADF_MSTATE_PF2VM_IDS

struct adf_mstate_mgr {};

struct adf_mstate_preh {};

struct adf_mstate_vreginfo {};

struct adf_mstate_sect_h;

adf_mstate_preamble_checker;
adf_mstate_populate;
adf_mstate_action;

struct adf_mstate_mgr *adf_mstate_mgr_new(u8 *buf, u32 size);
void adf_mstate_mgr_destroy(struct adf_mstate_mgr *mgr);
void adf_mstate_mgr_init(struct adf_mstate_mgr *mgr, u8 *buf, u32 size);
void adf_mstate_mgr_init_from_parent(struct adf_mstate_mgr *mgr,
				     struct adf_mstate_mgr *p_mgr);
void adf_mstate_mgr_init_from_psect(struct adf_mstate_mgr *mgr,
				    struct adf_mstate_sect_h *p_sect);
int adf_mstate_mgr_init_from_remote(struct adf_mstate_mgr *mgr,
				    u8 *buf, u32 size,
				    adf_mstate_preamble_checker checker,
				    void *opaque);
struct adf_mstate_preh *adf_mstate_preamble_add(struct adf_mstate_mgr *mgr);
int adf_mstate_preamble_update(struct adf_mstate_mgr *mgr);
u32 adf_mstate_state_size(struct adf_mstate_mgr *mgr);
u32 adf_mstate_state_size_from_remote(struct adf_mstate_mgr *mgr);
void adf_mstate_sect_update(struct adf_mstate_mgr *p_mgr,
			    struct adf_mstate_mgr *curr_mgr,
			    struct adf_mstate_sect_h *sect);
struct adf_mstate_sect_h *adf_mstate_sect_add_vreg(struct adf_mstate_mgr *mgr,
						   const char *id,
						   struct adf_mstate_vreginfo *info);
struct adf_mstate_sect_h *adf_mstate_sect_add(struct adf_mstate_mgr *mgr,
					      const char *id,
					      adf_mstate_populate populate,
					      void *opaque);
struct adf_mstate_sect_h *adf_mstate_sect_lookup(struct adf_mstate_mgr *mgr,
						 const char *id,
						 adf_mstate_action action,
						 void *opaque);
#endif