summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/mediatek/mtk-platform.h
diff options
context:
space:
mode:
authorRyder Lee <ryder.lee@mediatek.com>2017-01-20 13:41:08 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2017-01-23 22:50:29 +0800
commita873996238e4019c54c49b56fcc1fef35a93da41 (patch)
tree959aac5506e3e641aa8c3b684b88ba59e6b06ebf /drivers/crypto/mediatek/mtk-platform.h
parente183914af00e15eb41ae666d44e323bfa154be13 (diff)
downloadlinux-a873996238e4019c54c49b56fcc1fef35a93da41.tar.bz2
crypto: mediatek - move HW control data to transformation context
This patch moves hardware control block members from mtk_*_rec to transformation context and refines related definition. This makes operational context to manage its own control information easily for each DMA transfer. 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.h26
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/crypto/mediatek/mtk-platform.h b/drivers/crypto/mediatek/mtk-platform.h
index 4d4309a007da..1516786b7a02 100644
--- a/drivers/crypto/mediatek/mtk-platform.h
+++ b/drivers/crypto/mediatek/mtk-platform.h
@@ -113,22 +113,20 @@ struct mtk_aes_dma {
u32 sg_len;
};
+struct mtk_aes_ctx;
+
/**
* struct mtk_aes_rec - AES operation record
* @queue: crypto request queue
* @req: pointer to ablkcipher request
* @task: the tasklet is use in AES interrupt
+ * @ctx: pointer to current context
* @src: the structure that holds source sg list info
* @dst: the structure that holds destination sg list info
* @aligned_sg: the scatter list is use to alignment
* @real_dst: pointer to the destination sg list
* @total: request buffer length
* @buf: pointer to page buffer
- * @info: pointer to AES transform state and command token
- * @ct_hdr: AES command token control field
- * @ct_size: size of AES command token
- * @ct_dma: DMA address of AES command token
- * @tfm_dma: DMA address of AES transform state
* @id: record identification
* @flags: it's describing AES operation state
* @lock: the ablkcipher queue lock
@@ -139,6 +137,7 @@ struct mtk_aes_rec {
struct crypto_queue queue;
struct ablkcipher_request *req;
struct tasklet_struct task;
+ struct mtk_aes_ctx *ctx;
struct mtk_aes_dma src;
struct mtk_aes_dma dst;
@@ -148,12 +147,6 @@ struct mtk_aes_rec {
size_t total;
void *buf;
- void *info;
- __le32 ct_hdr;
- u32 ct_size;
- dma_addr_t ct_dma;
- dma_addr_t tfm_dma;
-
u8 id;
unsigned long flags;
/* queue lock */
@@ -165,11 +158,6 @@ struct mtk_aes_rec {
* @queue: crypto request queue
* @req: pointer to ahash request
* @task: the tasklet is use in SHA interrupt
- * @info: pointer to SHA transform state and command token
- * @ct_hdr: SHA command token control field
- * @ct_size: size of SHA command token
- * @ct_dma: DMA address of SHA command token
- * @tfm_dma: DMA address of SHA transform state
* @id: record identification
* @flags: it's describing SHA operation state
* @lock: the ablkcipher queue lock
@@ -181,12 +169,6 @@ struct mtk_sha_rec {
struct ahash_request *req;
struct tasklet_struct task;
- void *info;
- __le32 ct_hdr;
- u32 ct_size;
- dma_addr_t ct_dma;
- dma_addr_t tfm_dma;
-
u8 id;
unsigned long flags;
/* queue lock */