~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/crypto/internal/engine.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * Crypto engine API
  4  *
  5  * Copyright (c) 2016 Baolin Wang <baolin.wang@linaro.org>
  6  * Copyright (c) 2023 Herbert Xu <herbert@gondor.apana.org.au>
  7  */
  8 #ifndef _CRYPTO_INTERNAL_ENGINE_H
  9 #define _CRYPTO_INTERNAL_ENGINE_H
 10 
 11 #include <crypto/algapi.h>
 12 #include <crypto/engine.h>
 13 #include <linux/kthread.h>
 14 #include <linux/spinlock_types.h>
 15 #include <linux/types.h>
 16 
 17 #define ENGINE_NAME_LEN 30
 18 
 19 struct device;
 20 
 21 /*
 22  * struct crypto_engine - crypto hardware engine
 23  * @name: the engine name
 24  * @idling: the engine is entering idle state
 25  * @busy: request pump is busy
 26  * @running: the engine is on working
 27  * @retry_support: indication that the hardware allows re-execution
 28  * of a failed backlog request
 29  * crypto-engine, in head position to keep order
 30  * @list: link with the global crypto engine list
 31  * @queue_lock: spinlock to synchronise access to request queue
 32  * @queue: the crypto queue of the engine
 33  * @rt: whether this queue is set to run as a realtime task
 34  * @prepare_crypt_hardware: a request will soon arrive from the queue
 35  * so the subsystem requests the driver to prepare the hardware
 36  * by issuing this call
 37  * @unprepare_crypt_hardware: there are currently no more requests on the
 38  * queue so the subsystem notifies the driver that it may relax the
 39  * hardware by issuing this call
 40  * @do_batch_requests: execute a batch of requests. Depends on multiple
 41  * requests support.
 42  * @kworker: kthread worker struct for request pump
 43  * @pump_requests: work struct for scheduling work to the request pump
 44  * @priv_data: the engine private data
 45  * @cur_req: the current request which is on processing
 46  */
 47 struct crypto_engine {
 48         char                    name[ENGINE_NAME_LEN];
 49         bool                    idling;
 50         bool                    busy;
 51         bool                    running;
 52 
 53         bool                    retry_support;
 54 
 55         struct list_head        list;
 56         spinlock_t              queue_lock;
 57         struct crypto_queue     queue;
 58         struct device           *dev;
 59 
 60         bool                    rt;
 61 
 62         int (*prepare_crypt_hardware)(struct crypto_engine *engine);
 63         int (*unprepare_crypt_hardware)(struct crypto_engine *engine);
 64         int (*do_batch_requests)(struct crypto_engine *engine);
 65 
 66 
 67         struct kthread_worker           *kworker;
 68         struct kthread_work             pump_requests;
 69 
 70         void                            *priv_data;
 71         struct crypto_async_request     *cur_req;
 72 };
 73 
 74 #endif
 75 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php