/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.3*/45#ifndef _CORE_H_6#define _CORE_H_78#include <linux/mutex.h>9#include <linux/workqueue.h>1011#include "dma.h"1213/**14* struct qce_device - crypto engine device structure15* @queue: crypto request queue16* @lock: the lock protects queue and req17* @done_work: workqueue context18* @req: current active request19* @result: result of current transform20* @base: virtual IO base21* @dev: pointer to device structure22* @core: core device clock23* @iface: interface clock24* @bus: bus clock25* @dma: pointer to dma data26* @burst_size: the crypto burst size27* @pipe_pair_id: which pipe pair id the device using28* @async_req_enqueue: invoked by every algorithm to enqueue a request29* @async_req_done: invoked by every algorithm to finish its request30*/31struct qce_device {32struct crypto_queue queue;33struct mutex lock;34struct work_struct done_work;35struct crypto_async_request *req;36int result;37void __iomem *base;38struct device *dev;39struct clk *core, *iface, *bus;40struct icc_path *mem_path;41struct qce_dma_data dma;42int burst_size;43unsigned int pipe_pair_id;44int (*async_req_enqueue)(struct qce_device *qce,45struct crypto_async_request *req);46void (*async_req_done)(struct qce_device *qce, int ret);47};4849/**50* struct qce_algo_ops - algorithm operations per crypto type51* @type: should be CRYPTO_ALG_TYPE_XXX52* @register_algs: invoked by core to register the algorithms53* @unregister_algs: invoked by core to unregister the algorithms54* @async_req_handle: invoked by core to handle enqueued request55*/56struct qce_algo_ops {57u32 type;58int (*register_algs)(struct qce_device *qce);59void (*unregister_algs)(struct qce_device *qce);60int (*async_req_handle)(struct crypto_async_request *async_req);61};6263#endif /* _CORE_H_ */646566