Lines Matching refs:actx
151 static int mxs_dcp_start_dma(struct dcp_async_ctx *actx) in mxs_dcp_start_dma() argument
154 const int chan = actx->chan; in mxs_dcp_start_dma()
157 struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; in mxs_dcp_start_dma()
196 static int mxs_dcp_run_aes(struct dcp_async_ctx *actx, in mxs_dcp_run_aes() argument
200 struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; in mxs_dcp_run_aes()
235 desc->size = actx->fill; in mxs_dcp_run_aes()
239 ret = mxs_dcp_start_dma(actx); in mxs_dcp_run_aes()
254 struct dcp_async_ctx *actx = crypto_tfm_ctx(arq->tfm); in mxs_dcp_aes_block_crypt() local
275 actx->fill = 0; in mxs_dcp_aes_block_crypt()
278 memcpy(key, actx->key, actx->key_len); in mxs_dcp_aes_block_crypt()
294 if (actx->fill + len > out_off) in mxs_dcp_aes_block_crypt()
295 clen = out_off - actx->fill; in mxs_dcp_aes_block_crypt()
299 memcpy(in_buf + actx->fill, src_buf, clen); in mxs_dcp_aes_block_crypt()
302 actx->fill += clen; in mxs_dcp_aes_block_crypt()
308 if (actx->fill == out_off || sg_is_last(src)) { in mxs_dcp_aes_block_crypt()
309 ret = mxs_dcp_run_aes(actx, req, init); in mxs_dcp_aes_block_crypt()
315 while (dst && actx->fill) { in mxs_dcp_aes_block_crypt()
321 actx->fill); in mxs_dcp_aes_block_crypt()
326 actx->fill -= rem; in mxs_dcp_aes_block_crypt()
399 struct dcp_async_ctx *actx = crypto_tfm_ctx(arq->tfm); in mxs_dcp_aes_enqueue() local
403 if (unlikely(actx->key_len != AES_KEYSIZE_128)) in mxs_dcp_aes_enqueue()
408 actx->chan = DCP_CHAN_CRYPTO; in mxs_dcp_aes_enqueue()
410 mutex_lock(&sdcp->mutex[actx->chan]); in mxs_dcp_aes_enqueue()
411 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in mxs_dcp_aes_enqueue()
412 mutex_unlock(&sdcp->mutex[actx->chan]); in mxs_dcp_aes_enqueue()
414 wake_up_process(sdcp->thread[actx->chan]); in mxs_dcp_aes_enqueue()
442 struct dcp_async_ctx *actx = crypto_ablkcipher_ctx(tfm); in mxs_dcp_aes_setkey() local
450 actx->key_len = len; in mxs_dcp_aes_setkey()
452 memcpy(actx->key, key, len); in mxs_dcp_aes_setkey()
467 actx->fallback->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; in mxs_dcp_aes_setkey()
468 actx->fallback->base.crt_flags |= in mxs_dcp_aes_setkey()
471 ret = crypto_ablkcipher_setkey(actx->fallback, key, len); in mxs_dcp_aes_setkey()
477 actx->fallback->base.crt_flags & CRYPTO_TFM_RES_MASK; in mxs_dcp_aes_setkey()
486 struct dcp_async_ctx *actx = crypto_tfm_ctx(tfm); in mxs_dcp_aes_fallback_init() local
493 actx->fallback = blk; in mxs_dcp_aes_fallback_init()
500 struct dcp_async_ctx *actx = crypto_tfm_ctx(tfm); in mxs_dcp_aes_fallback_exit() local
502 crypto_free_ablkcipher(actx->fallback); in mxs_dcp_aes_fallback_exit()
503 actx->fallback = NULL; in mxs_dcp_aes_fallback_exit()
515 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in mxs_dcp_run_sha() local
519 struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; in mxs_dcp_run_sha()
532 desc->control1 = actx->alg; in mxs_dcp_run_sha()
536 desc->size = actx->fill; in mxs_dcp_run_sha()
548 ret = mxs_dcp_start_dma(actx); in mxs_dcp_run_sha()
565 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_req_to_buf() local
588 if (actx->fill + len > DCP_BUF_SZ) in dcp_sha_req_to_buf()
589 clen = DCP_BUF_SZ - actx->fill; in dcp_sha_req_to_buf()
593 memcpy(in_buf + actx->fill, src_buf, clen); in dcp_sha_req_to_buf()
596 actx->fill += clen; in dcp_sha_req_to_buf()
602 if (len && actx->fill == DCP_BUF_SZ) { in dcp_sha_req_to_buf()
606 actx->fill = 0; in dcp_sha_req_to_buf()
623 actx->fill = 0; in dcp_sha_req_to_buf()
679 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_init() local
687 memset(actx, 0, sizeof(*actx)); in dcp_sha_init()
690 actx->alg = MXS_DCP_CONTROL1_HASH_SELECT_SHA1; in dcp_sha_init()
692 actx->alg = MXS_DCP_CONTROL1_HASH_SELECT_SHA256; in dcp_sha_init()
694 actx->fill = 0; in dcp_sha_init()
695 actx->hot = 0; in dcp_sha_init()
696 actx->chan = DCP_CHAN_HASH_SHA; in dcp_sha_init()
698 mutex_init(&actx->mutex); in dcp_sha_init()
709 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_update_fx() local
720 mutex_lock(&actx->mutex); in dcp_sha_update_fx()
724 if (!actx->hot) { in dcp_sha_update_fx()
725 actx->hot = 1; in dcp_sha_update_fx()
729 mutex_lock(&sdcp->mutex[actx->chan]); in dcp_sha_update_fx()
730 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in dcp_sha_update_fx()
731 mutex_unlock(&sdcp->mutex[actx->chan]); in dcp_sha_update_fx()
733 wake_up_process(sdcp->thread[actx->chan]); in dcp_sha_update_fx()
734 mutex_unlock(&actx->mutex); in dcp_sha_update_fx()