summaryrefslogtreecommitdiff
path: root/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h
diff options
context:
space:
mode:
authorCorentin Labbe <clabbe@baylibre.com>2020-09-18 10:23:07 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2020-09-25 10:48:18 +0300
commit0605fa0f78266cc3cb84201020f0cb7b546d72cc (patch)
treee192092544c637acc9f7a0f063d07dd22dce9bc7 /drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h
parenta216f8d540cf13211227daf44996e8a530b92468 (diff)
downloadlinux-0605fa0f78266cc3cb84201020f0cb7b546d72cc.tar.xz
crypto: sun8i-ce - split into prepare/run/unprepare
This patch split the do_one_request into three. Prepare will handle all DMA mapping and initialisation of the task structure. Unprepare will clean all DMA mapping. And the do_one_request will be limited to just executing the task. Signed-off-by: Corentin Labbe <clabbe@baylibre.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h')
-rw-r--r--drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h
index f5555c4800e8..c3053326afe9 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h
@@ -182,6 +182,10 @@ struct sun8i_ce_dev {
* @backup_iv: buffer which contain the next IV to store
* @bounce_iv: buffer which contain the IV
* @ivlen: size of bounce_iv
+ * @nr_sgs: The number of source SG (as given by dma_map_sg())
+ * @nr_sgd: The number of destination SG (as given by dma_map_sg())
+ * @addr_iv: The IV addr returned by dma_map_single, need to unmap later
+ * @addr_key: The key addr returned by dma_map_single, need to unmap later
* @fallback_req: request struct for invoking the fallback skcipher TFM
*/
struct sun8i_cipher_req_ctx {
@@ -190,6 +194,10 @@ struct sun8i_cipher_req_ctx {
void *backup_iv;
void *bounce_iv;
unsigned int ivlen;
+ int nr_sgs;
+ int nr_sgd;
+ dma_addr_t addr_iv;
+ dma_addr_t addr_key;
struct skcipher_request fallback_req; // keep at the end
};