Lines Matching refs:state
107 /* ahash state */
140 /* Map state->caam_ctx, and append seq_out_ptr command that points to it */
142 struct caam_hash_state *state,
145 state->ctx_dma_len = ctx_len;
146 state->ctx_dma = dma_map_single(jrdev, state->caam_ctx,
148 if (dma_mapping_error(jrdev, state->ctx_dma)) {
150 state->ctx_dma = 0;
154 append_seq_out_ptr(desc, state->ctx_dma, ctx_len, 0);
159 /* Map current buffer in state (if length > 0) and put it in link table */
162 struct caam_hash_state *state)
164 int buflen = state->buflen;
169 state->buf_dma = dma_map_single(jrdev, state->buf, buflen,
171 if (dma_mapping_error(jrdev, state->buf_dma)) {
173 state->buf_dma = 0;
177 dma_to_sec4_sg_one(sec4_sg, state->buf_dma, buflen, 0);
182 /* Map state->caam_ctx, and add it to link table */
184 struct caam_hash_state *state, int ctx_len,
187 state->ctx_dma_len = ctx_len;
188 state->ctx_dma = dma_map_single(jrdev, state->caam_ctx, ctx_len, flag);
189 if (dma_mapping_error(jrdev, state->ctx_dma)) {
191 state->ctx_dma = 0;
195 dma_to_sec4_sg_one(sec4_sg, state->ctx_dma, ctx_len, 0);
546 struct caam_hash_state *state = ahash_request_ctx(req);
555 if (state->buf_dma) {
556 dma_unmap_single(dev, state->buf_dma, state->buflen,
558 state->buf_dma = 0;
566 struct caam_hash_state *state = ahash_request_ctx(req);
568 if (state->ctx_dma) {
569 dma_unmap_single(dev, state->ctx_dma, state->ctx_dma_len, flag);
570 state->ctx_dma = 0;
583 struct caam_hash_state *state = ahash_request_ctx(req);
590 edesc = state->edesc;
597 memcpy(req->result, state->caam_ctx, digestsize);
601 DUMP_PREFIX_ADDRESS, 16, 4, state->caam_ctx,
634 struct caam_hash_state *state = ahash_request_ctx(req);
641 edesc = state->edesc;
649 scatterwalk_map_and_copy(state->buf, req->src,
650 req->nbytes - state->next_buflen,
651 state->next_buflen, 0);
652 state->buflen = state->next_buflen;
655 DUMP_PREFIX_ADDRESS, 16, 4, state->buf,
656 state->buflen, 1);
659 DUMP_PREFIX_ADDRESS, 16, 4, state->caam_ctx,
699 struct caam_hash_state *state = ahash_request_ctx(req);
711 state->edesc = edesc;
759 struct caam_hash_state *state = ahash_request_ctx(req);
761 u32 *desc = state->edesc->hw_desc;
764 state->edesc->bklog = true;
766 ret = caam_jr_enqueue(jrdev, desc, state->ahash_op_done, req);
769 ahash_unmap(jrdev, state->edesc, req, 0);
770 kfree(state->edesc);
785 struct caam_hash_state *state = ahash_request_ctx(req);
786 struct ahash_edesc *edesc = state->edesc;
790 state->ahash_op_done = cbk;
816 struct caam_hash_state *state = ahash_request_ctx(req);
818 u8 *buf = state->buf;
819 int *buflen = &state->buflen;
820 int *next_buflen = &state->next_buflen;
881 ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
886 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state);
912 append_seq_out_ptr(desc, state->ctx_dma, ctx->ctx_len, 0);
941 struct caam_hash_state *state = ahash_request_ctx(req);
943 int buflen = state->buflen;
963 ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
968 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state);
984 append_seq_out_ptr(desc, state->ctx_dma, digestsize, 0);
1002 struct caam_hash_state *state = ahash_request_ctx(req);
1004 int buflen = state->buflen;
1043 ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
1048 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state);
1058 append_seq_out_ptr(desc, state->ctx_dma, digestsize, 0);
1076 struct caam_hash_state *state = ahash_request_ctx(req);
1084 state->buf_dma = 0;
1123 ret = map_seq_out_ptr_ctx(desc, jrdev, state, digestsize);
1143 struct caam_hash_state *state = ahash_request_ctx(req);
1145 u8 *buf = state->buf;
1146 int buflen = state->buflen;
1161 state->buf_dma = dma_map_single(jrdev, buf, buflen,
1163 if (dma_mapping_error(jrdev, state->buf_dma)) {
1168 append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
1171 ret = map_seq_out_ptr_ctx(desc, jrdev, state, digestsize);
1192 struct caam_hash_state *state = ahash_request_ctx(req);
1194 u8 *buf = state->buf;
1195 int *buflen = &state->buflen;
1196 int *next_buflen = &state->next_buflen;
1257 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg, state);
1276 ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len);
1288 state->update = ahash_update_ctx;
1289 state->finup = ahash_finup_ctx;
1290 state->final = ahash_final_ctx;
1313 struct caam_hash_state *state = ahash_request_ctx(req);
1315 int buflen = state->buflen;
1356 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg, state);
1367 ret = map_seq_out_ptr_ctx(desc, jrdev, state, digestsize);
1389 struct caam_hash_state *state = ahash_request_ctx(req);
1391 u8 *buf = state->buf;
1392 int *buflen = &state->buflen;
1393 int *next_buflen = &state->next_buflen;
1456 ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len);
1468 state->update = ahash_update_ctx;
1469 state->finup = ahash_finup_ctx;
1470 state->final = ahash_final_ctx;
1472 state->update = ahash_update_no_ctx;
1473 state->finup = ahash_finup_no_ctx;
1474 state->final = ahash_final_no_ctx;
1498 struct caam_hash_state *state = ahash_request_ctx(req);
1500 state->update = ahash_update_first;
1501 state->finup = ahash_finup_first;
1502 state->final = ahash_final_no_ctx;
1504 state->ctx_dma = 0;
1505 state->ctx_dma_len = 0;
1506 state->buf_dma = 0;
1507 state->buflen = 0;
1508 state->next_buflen = 0;
1515 struct caam_hash_state *state = ahash_request_ctx(req);
1517 return state->update(req);
1522 struct caam_hash_state *state = ahash_request_ctx(req);
1524 return state->finup(req);
1529 struct caam_hash_state *state = ahash_request_ctx(req);
1531 return state->final(req);
1536 struct caam_hash_state *state = ahash_request_ctx(req);
1538 u8 *buf = state->buf;
1539 int len = state->buflen;
1542 memcpy(export->caam_ctx, state->caam_ctx, sizeof(export->caam_ctx));
1544 export->update = state->update;
1545 export->final = state->final;
1546 export->finup = state->finup;
1553 struct caam_hash_state *state = ahash_request_ctx(req);
1556 memset(state, 0, sizeof(*state));
1557 memcpy(state->buf, export->buf, export->buflen);
1558 memcpy(state->caam_ctx, export->caam_ctx, sizeof(state->caam_ctx));
1559 state->buflen = export->buflen;
1560 state->update = export->update;
1561 state->final = export->final;
1562 state->finup = export->finup;