diff options
author | Ryder Lee <ryder.lee@mediatek.com> | 2017-01-20 08:41:10 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-01-23 17:50:30 +0300 |
commit | 382ae57d5e52a62e77d62e60e5be9a6526d40da0 (patch) | |
tree | 4c8ac242488e0d9aebd72eb21093775da08783e5 /drivers/crypto/mediatek/mtk-platform.h | |
parent | 4432861fb9747fce52f94bc13da0d9b41292ef69 (diff) | |
download | linux-382ae57d5e52a62e77d62e60e5be9a6526d40da0.tar.xz |
crypto: mediatek - make crypto request queue management more generic
This patch changes mtk_aes_handle_queue() to make it more generic.
The function argument is now a pointer to struct crypto_async_request,
which is the common base of struct ablkcipher_request and
struct aead_request.
Also this patch introduces struct mtk_aes_base_ctx which will be the
common base of all the transformation contexts.
Hence the very same queue will be used to manage both block cipher and
AEAD requests (such as gcm and authenc implemented in further patches).
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/mediatek/mtk-platform.h')
-rw-r--r-- | drivers/crypto/mediatek/mtk-platform.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/crypto/mediatek/mtk-platform.h b/drivers/crypto/mediatek/mtk-platform.h index 8c50b74788ff..9f5210c7f1db 100644 --- a/drivers/crypto/mediatek/mtk-platform.h +++ b/drivers/crypto/mediatek/mtk-platform.h @@ -115,12 +115,16 @@ struct mtk_aes_dma { u32 sg_len; }; -struct mtk_aes_ctx; +struct mtk_aes_base_ctx; +struct mtk_aes_rec; +struct mtk_cryp; + +typedef int (*mtk_aes_fn)(struct mtk_cryp *cryp, struct mtk_aes_rec *aes); /** * struct mtk_aes_rec - AES operation record * @queue: crypto request queue - * @req: pointer to ablkcipher request + * @req: pointer to async request * @task: the tasklet is use in AES interrupt * @ctx: pointer to current context * @src: the structure that holds source sg list info @@ -131,15 +135,15 @@ struct mtk_aes_ctx; * @buf: pointer to page buffer * @id: record identification * @flags: it's describing AES operation state - * @lock: the ablkcipher queue lock + * @lock: the async queue lock * * Structure used to record AES execution state. */ struct mtk_aes_rec { struct crypto_queue queue; - struct ablkcipher_request *req; + struct crypto_async_request *areq; struct tasklet_struct task; - struct mtk_aes_ctx *ctx; + struct mtk_aes_base_ctx *ctx; struct mtk_aes_dma src; struct mtk_aes_dma dst; |