summaryrefslogtreecommitdiff
path: root/drivers/crypto/caam/qi.h
diff options
context:
space:
mode:
authorVakul Garg <vakul@freescale.com>2013-05-30 04:10:41 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-06-07 21:22:17 (GMT)
commit0438b27e56de4107f4582898f3bebfedfccd418c (patch)
treea9590d8fb66a363b752fe05334bdc65e7b4e41cf /drivers/crypto/caam/qi.h
parent0a72993663e41a4c2ddd52ef47f9f9a7deded926 (diff)
downloadlinux-fsl-qoriq-0438b27e56de4107f4582898f3bebfedfccd418c.tar.xz
crypto: caam - Implement QI driver context update
On a crypto transform, a setkey() operation can be performed multiple times e.g. when keys are changed. These requires updation of shared descriptor in caam_qi driver. The shared descriptor in case of QI driver is maintained inside driver context and it is prefixed with pre-header. When shared descriptor is updated by the driver application, it needs to be copied again into driver context and pre-header should also be updated. With this patch, the caam_qi driver provides new api caam_drv_ctx_update(). The caam_qi driver application has been updated to call this api when setkey() operation changes shared descriptor. Change-Id: Ice6065ac9461e2d7af2e19a8a8c6d2ad8b5394b8 Signed-off-by: Vakul Garg <vakul@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/2847 Reviewed-by: Varvara Andrei-B21317 <andrei.varvara@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/crypto/caam/qi.h')
-rw-r--r--drivers/crypto/caam/qi.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/crypto/caam/qi.h b/drivers/crypto/caam/qi.h
index e0d9920..109f890 100644
--- a/drivers/crypto/caam/qi.h
+++ b/drivers/crypto/caam/qi.h
@@ -129,6 +129,19 @@ extern int caam_qi_enqueue(struct device *qidev, struct caam_drv_req *req);
*/
extern bool caam_drv_ctx_busy(struct caam_drv_ctx *drv_ctx);
+/*
+ * caam_drv_ctx_update - Upate QI drv context.
+ *
+ * Invoked when shared descriptor is required to be change in driver context.
+ *
+ * drv_ctx - Driver context to be updated
+ *
+ * sh_desc - New shared descriptor pointer to be updated in QI driver
+ * context.
+ *
+ * Returns 0 on success or negative error code on failure.
+ */
+extern int caam_drv_ctx_update(struct caam_drv_ctx *drv_ctx, u32 *sh_desc);
/*
* caam_drv_ctx_rel - Release a QI driver context.