/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* Crypto engine API3*4* Copyright (c) 2016 Baolin Wang <[email protected]>5* Copyright (c) 2023 Herbert Xu <[email protected]>6*/7#ifndef _CRYPTO_INTERNAL_ENGINE_H8#define _CRYPTO_INTERNAL_ENGINE_H910#include <crypto/algapi.h>11#include <crypto/engine.h>12#include <linux/kthread.h>13#include <linux/spinlock_types.h>14#include <linux/types.h>1516#define ENGINE_NAME_LEN 301718struct device;1920/*21* struct crypto_engine - crypto hardware engine22* @name: the engine name23* @busy: request pump is busy24* @running: the engine is on working25* @retry_support: indication that the hardware allows re-execution26* of a failed backlog request27* crypto-engine, in head position to keep order28* @rt: whether this queue is set to run as a realtime task29* @list: link with the global crypto engine list30* @queue_lock: spinlock to synchronise access to request queue31* @queue: the crypto queue of the engine32* @kworker: kthread worker struct for request pump33* @pump_requests: work struct for scheduling work to the request pump34* @priv_data: the engine private data35* @cur_req: the current request which is on processing36*/37struct crypto_engine {38char name[ENGINE_NAME_LEN];39bool busy;40bool running;4142bool retry_support;43bool rt;4445struct list_head list;46spinlock_t queue_lock;47struct crypto_queue queue;48struct device *dev;4950struct kthread_worker *kworker;51struct kthread_work pump_requests;5253void *priv_data;54struct crypto_async_request *cur_req;55};5657#endif585960