Lines Matching refs:actx

170 static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)  in mxs_dcp_start_dma()  argument
173 const int chan = actx->chan; in mxs_dcp_start_dma()
176 struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; in mxs_dcp_start_dma()
215 static int mxs_dcp_run_aes(struct dcp_async_ctx *actx, in mxs_dcp_run_aes() argument
219 struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; in mxs_dcp_run_aes()
231 if (actx->fill % AES_BLOCK_SIZE) { in mxs_dcp_run_aes()
260 desc->size = actx->fill; in mxs_dcp_run_aes()
264 ret = mxs_dcp_start_dma(actx); in mxs_dcp_run_aes()
280 struct dcp_async_ctx *actx = crypto_tfm_ctx(arq->tfm); in mxs_dcp_aes_block_crypt() local
303 actx->fill = 0; in mxs_dcp_aes_block_crypt()
306 memcpy(key, actx->key, actx->key_len); in mxs_dcp_aes_block_crypt()
327 if (actx->fill + len > out_off) in mxs_dcp_aes_block_crypt()
328 clen = out_off - actx->fill; in mxs_dcp_aes_block_crypt()
332 memcpy(in_buf + actx->fill, src_buf, clen); in mxs_dcp_aes_block_crypt()
335 actx->fill += clen; in mxs_dcp_aes_block_crypt()
341 if (actx->fill == out_off || sg_is_last(src) || in mxs_dcp_aes_block_crypt()
343 ret = mxs_dcp_run_aes(actx, req, init); in mxs_dcp_aes_block_crypt()
349 last_out_len = actx->fill; in mxs_dcp_aes_block_crypt()
350 while (dst && actx->fill) { in mxs_dcp_aes_block_crypt()
356 actx->fill); in mxs_dcp_aes_block_crypt()
361 actx->fill -= rem; in mxs_dcp_aes_block_crypt()
452 struct dcp_async_ctx *actx = crypto_tfm_ctx(arq->tfm); in mxs_dcp_aes_enqueue() local
456 if (unlikely(actx->key_len != AES_KEYSIZE_128)) in mxs_dcp_aes_enqueue()
461 actx->chan = DCP_CHAN_CRYPTO; in mxs_dcp_aes_enqueue()
463 spin_lock(&sdcp->lock[actx->chan]); in mxs_dcp_aes_enqueue()
464 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in mxs_dcp_aes_enqueue()
465 spin_unlock(&sdcp->lock[actx->chan]); in mxs_dcp_aes_enqueue()
467 wake_up_process(sdcp->thread[actx->chan]); in mxs_dcp_aes_enqueue()
495 struct dcp_async_ctx *actx = crypto_skcipher_ctx(tfm); in mxs_dcp_aes_setkey() local
502 actx->key_len = len; in mxs_dcp_aes_setkey()
504 memcpy(actx->key, key, len); in mxs_dcp_aes_setkey()
513 crypto_skcipher_clear_flags(actx->fallback, CRYPTO_TFM_REQ_MASK); in mxs_dcp_aes_setkey()
514 crypto_skcipher_set_flags(actx->fallback, in mxs_dcp_aes_setkey()
516 return crypto_skcipher_setkey(actx->fallback, key, len); in mxs_dcp_aes_setkey()
522 struct dcp_async_ctx *actx = crypto_skcipher_ctx(tfm); in mxs_dcp_aes_fallback_init_tfm() local
529 actx->fallback = blk; in mxs_dcp_aes_fallback_init_tfm()
537 struct dcp_async_ctx *actx = crypto_skcipher_ctx(tfm); in mxs_dcp_aes_fallback_exit_tfm() local
539 crypto_free_skcipher(actx->fallback); in mxs_dcp_aes_fallback_exit_tfm()
551 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in mxs_dcp_run_sha() local
553 struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; in mxs_dcp_run_sha()
566 desc->control1 = actx->alg; in mxs_dcp_run_sha()
570 desc->size = actx->fill; in mxs_dcp_run_sha()
580 (actx->alg == MXS_DCP_CONTROL1_HASH_SELECT_SHA1) ? in mxs_dcp_run_sha()
595 ret = mxs_dcp_start_dma(actx); in mxs_dcp_run_sha()
613 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_req_to_buf() local
633 if (actx->fill + len > DCP_BUF_SZ) in dcp_sha_req_to_buf()
634 clen = DCP_BUF_SZ - actx->fill; in dcp_sha_req_to_buf()
638 scatterwalk_map_and_copy(in_buf + actx->fill, src, oft, clen, in dcp_sha_req_to_buf()
643 actx->fill += clen; in dcp_sha_req_to_buf()
649 if (len && actx->fill == DCP_BUF_SZ) { in dcp_sha_req_to_buf()
653 actx->fill = 0; in dcp_sha_req_to_buf()
669 actx->fill = 0; in dcp_sha_req_to_buf()
718 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_init() local
726 memset(actx, 0, sizeof(*actx)); in dcp_sha_init()
729 actx->alg = MXS_DCP_CONTROL1_HASH_SELECT_SHA1; in dcp_sha_init()
731 actx->alg = MXS_DCP_CONTROL1_HASH_SELECT_SHA256; in dcp_sha_init()
733 actx->fill = 0; in dcp_sha_init()
734 actx->hot = 0; in dcp_sha_init()
735 actx->chan = DCP_CHAN_HASH_SHA; in dcp_sha_init()
737 mutex_init(&actx->mutex); in dcp_sha_init()
748 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_update_fx() local
759 mutex_lock(&actx->mutex); in dcp_sha_update_fx()
763 if (!actx->hot) { in dcp_sha_update_fx()
764 actx->hot = 1; in dcp_sha_update_fx()
768 spin_lock(&sdcp->lock[actx->chan]); in dcp_sha_update_fx()
769 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in dcp_sha_update_fx()
770 spin_unlock(&sdcp->lock[actx->chan]); in dcp_sha_update_fx()
772 wake_up_process(sdcp->thread[actx->chan]); in dcp_sha_update_fx()
773 mutex_unlock(&actx->mutex); in dcp_sha_update_fx()
810 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_import() local
814 memset(actx, 0, sizeof(struct dcp_async_ctx)); in dcp_sha_import()
816 memcpy(actx, &export->async_ctx, sizeof(struct dcp_async_ctx)); in dcp_sha_import()