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()
405 struct dcp_async_ctx *actx = crypto_tfm_ctx(arq->tfm); in mxs_dcp_aes_enqueue() local
409 if (unlikely(actx->key_len != AES_KEYSIZE_128)) in mxs_dcp_aes_enqueue()
414 actx->chan = DCP_CHAN_CRYPTO; in mxs_dcp_aes_enqueue()
416 spin_lock(&sdcp->lock[actx->chan]); in mxs_dcp_aes_enqueue()
417 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in mxs_dcp_aes_enqueue()
418 spin_unlock(&sdcp->lock[actx->chan]); in mxs_dcp_aes_enqueue()
420 wake_up_process(sdcp->thread[actx->chan]); in mxs_dcp_aes_enqueue()
448 struct dcp_async_ctx *actx = crypto_ablkcipher_ctx(tfm); in mxs_dcp_aes_setkey() local
456 actx->key_len = len; in mxs_dcp_aes_setkey()
458 memcpy(actx->key, key, len); in mxs_dcp_aes_setkey()
467 crypto_skcipher_clear_flags(actx->fallback, CRYPTO_TFM_REQ_MASK); in mxs_dcp_aes_setkey()
468 crypto_skcipher_set_flags(actx->fallback, in mxs_dcp_aes_setkey()
471 ret = crypto_skcipher_setkey(actx->fallback, key, len); in mxs_dcp_aes_setkey()
476 tfm->base.crt_flags |= crypto_skcipher_get_flags(actx->fallback) & 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_skcipher(actx->fallback); in mxs_dcp_aes_fallback_exit()
514 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in mxs_dcp_run_sha() local
518 struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; in mxs_dcp_run_sha()
531 desc->control1 = actx->alg; in mxs_dcp_run_sha()
535 desc->size = actx->fill; in mxs_dcp_run_sha()
547 ret = mxs_dcp_start_dma(actx); in mxs_dcp_run_sha()
564 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_req_to_buf() local
587 if (actx->fill + len > DCP_BUF_SZ) in dcp_sha_req_to_buf()
588 clen = DCP_BUF_SZ - actx->fill; in dcp_sha_req_to_buf()
592 memcpy(in_buf + actx->fill, src_buf, clen); in dcp_sha_req_to_buf()
595 actx->fill += clen; in dcp_sha_req_to_buf()
601 if (len && actx->fill == DCP_BUF_SZ) { in dcp_sha_req_to_buf()
605 actx->fill = 0; in dcp_sha_req_to_buf()
622 actx->fill = 0; in dcp_sha_req_to_buf()
681 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_init() local
689 memset(actx, 0, sizeof(*actx)); in dcp_sha_init()
692 actx->alg = MXS_DCP_CONTROL1_HASH_SELECT_SHA1; in dcp_sha_init()
694 actx->alg = MXS_DCP_CONTROL1_HASH_SELECT_SHA256; in dcp_sha_init()
696 actx->fill = 0; in dcp_sha_init()
697 actx->hot = 0; in dcp_sha_init()
698 actx->chan = DCP_CHAN_HASH_SHA; in dcp_sha_init()
700 mutex_init(&actx->mutex); in dcp_sha_init()
711 struct dcp_async_ctx *actx = crypto_ahash_ctx(tfm); in dcp_sha_update_fx() local
722 mutex_lock(&actx->mutex); in dcp_sha_update_fx()
726 if (!actx->hot) { in dcp_sha_update_fx()
727 actx->hot = 1; in dcp_sha_update_fx()
731 spin_lock(&sdcp->lock[actx->chan]); in dcp_sha_update_fx()
732 ret = crypto_enqueue_request(&sdcp->queue[actx->chan], &req->base); in dcp_sha_update_fx()
733 spin_unlock(&sdcp->lock[actx->chan]); in dcp_sha_update_fx()
735 wake_up_process(sdcp->thread[actx->chan]); in dcp_sha_update_fx()
736 mutex_unlock(&actx->mutex); in dcp_sha_update_fx()