Lines Matching refs:state

112 /* ahash state */
145 /* Map state->caam_ctx, and append seq_out_ptr command that points to it */
147 struct caam_hash_state *state,
150 state->ctx_dma_len = ctx_len;
151 state->ctx_dma = dma_map_single(jrdev, state->caam_ctx,
153 if (dma_mapping_error(jrdev, state->ctx_dma)) {
155 state->ctx_dma = 0;
159 append_seq_out_ptr(desc, state->ctx_dma, ctx_len, 0);
164 /* Map current buffer in state (if length > 0) and put it in link table */
167 struct caam_hash_state *state)
169 int buflen = state->buflen;
174 state->buf_dma = dma_map_single(jrdev, state->buf, buflen,
176 if (dma_mapping_error(jrdev, state->buf_dma)) {
178 state->buf_dma = 0;
182 dma_to_sec4_sg_one(sec4_sg, state->buf_dma, buflen, 0);
187 /* Map state->caam_ctx, and add it to link table */
189 struct caam_hash_state *state, int ctx_len,
192 state->ctx_dma_len = ctx_len;
193 state->ctx_dma = dma_map_single(jrdev, state->caam_ctx, ctx_len, flag);
194 if (dma_mapping_error(jrdev, state->ctx_dma)) {
196 state->ctx_dma = 0;
200 dma_to_sec4_sg_one(sec4_sg, state->ctx_dma, ctx_len, 0);
555 struct caam_hash_state *state = ahash_request_ctx_dma(req);
564 if (state->buf_dma) {
565 dma_unmap_single(dev, state->buf_dma, state->buflen,
567 state->buf_dma = 0;
575 struct caam_hash_state *state = ahash_request_ctx_dma(req);
577 if (state->ctx_dma) {
578 dma_unmap_single(dev, state->ctx_dma, state->ctx_dma_len, flag);
579 state->ctx_dma = 0;
592 struct caam_hash_state *state = ahash_request_ctx_dma(req);
599 edesc = state->edesc;
606 memcpy(req->result, state->caam_ctx, digestsize);
610 DUMP_PREFIX_ADDRESS, 16, 4, state->caam_ctx,
643 struct caam_hash_state *state = ahash_request_ctx_dma(req);
650 edesc = state->edesc;
658 scatterwalk_map_and_copy(state->buf, req->src,
659 req->nbytes - state->next_buflen,
660 state->next_buflen, 0);
661 state->buflen = state->next_buflen;
664 DUMP_PREFIX_ADDRESS, 16, 4, state->buf,
665 state->buflen, 1);
668 DUMP_PREFIX_ADDRESS, 16, 4, state->caam_ctx,
706 struct caam_hash_state *state = ahash_request_ctx_dma(req);
715 state->edesc = edesc;
763 struct caam_hash_state *state = ahash_request_ctx_dma(req);
765 u32 *desc = state->edesc->hw_desc;
768 state->edesc->bklog = true;
770 ret = caam_jr_enqueue(jrdev, desc, state->ahash_op_done, req);
776 ahash_unmap(jrdev, state->edesc, req, 0);
777 kfree(state->edesc);
792 struct caam_hash_state *state = ahash_request_ctx_dma(req);
793 struct ahash_edesc *edesc = state->edesc;
797 state->ahash_op_done = cbk;
823 struct caam_hash_state *state = ahash_request_ctx_dma(req);
825 u8 *buf = state->buf;
826 int *buflen = &state->buflen;
827 int *next_buflen = &state->next_buflen;
888 ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
893 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state);
919 append_seq_out_ptr(desc, state->ctx_dma, ctx->ctx_len, 0);
948 struct caam_hash_state *state = ahash_request_ctx_dma(req);
950 int buflen = state->buflen;
970 ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
975 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state);
991 append_seq_out_ptr(desc, state->ctx_dma, digestsize, 0);
1009 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1011 int buflen = state->buflen;
1050 ret = ctx_map_to_sec4_sg(jrdev, state, ctx->ctx_len,
1055 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg + 1, state);
1065 append_seq_out_ptr(desc, state->ctx_dma, digestsize, 0);
1083 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1091 state->buf_dma = 0;
1130 ret = map_seq_out_ptr_ctx(desc, jrdev, state, digestsize);
1150 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1152 u8 *buf = state->buf;
1153 int buflen = state->buflen;
1168 state->buf_dma = dma_map_single(jrdev, buf, buflen,
1170 if (dma_mapping_error(jrdev, state->buf_dma)) {
1175 append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
1178 ret = map_seq_out_ptr_ctx(desc, jrdev, state, digestsize);
1199 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1201 u8 *buf = state->buf;
1202 int *buflen = &state->buflen;
1203 int *next_buflen = &state->next_buflen;
1264 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg, state);
1283 ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len);
1295 state->update = ahash_update_ctx;
1296 state->finup = ahash_finup_ctx;
1297 state->final = ahash_final_ctx;
1320 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1322 int buflen = state->buflen;
1363 ret = buf_map_to_sec4_sg(jrdev, edesc->sec4_sg, state);
1374 ret = map_seq_out_ptr_ctx(desc, jrdev, state, digestsize);
1396 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1398 u8 *buf = state->buf;
1399 int *buflen = &state->buflen;
1400 int *next_buflen = &state->next_buflen;
1463 ret = map_seq_out_ptr_ctx(desc, jrdev, state, ctx->ctx_len);
1475 state->update = ahash_update_ctx;
1476 state->finup = ahash_finup_ctx;
1477 state->final = ahash_final_ctx;
1479 state->update = ahash_update_no_ctx;
1480 state->finup = ahash_finup_no_ctx;
1481 state->final = ahash_final_no_ctx;
1505 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1507 state->update = ahash_update_first;
1508 state->finup = ahash_finup_first;
1509 state->final = ahash_final_no_ctx;
1511 state->ctx_dma = 0;
1512 state->ctx_dma_len = 0;
1513 state->buf_dma = 0;
1514 state->buflen = 0;
1515 state->next_buflen = 0;
1522 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1524 return state->update(req);
1529 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1531 return state->finup(req);
1536 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1538 return state->final(req);
1543 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1545 u8 *buf = state->buf;
1546 int len = state->buflen;
1549 memcpy(export->caam_ctx, state->caam_ctx, sizeof(export->caam_ctx));
1551 export->update = state->update;
1552 export->final = state->final;
1553 export->finup = state->finup;
1560 struct caam_hash_state *state = ahash_request_ctx_dma(req);
1563 memset(state, 0, sizeof(*state));
1564 memcpy(state->buf, export->buf, export->buflen);
1565 memcpy(state->caam_ctx, export->caam_ctx, sizeof(state->caam_ctx));
1566 state->buflen = export->buflen;
1567 state->update = export->update;
1568 state->final = export->final;
1569 state->finup = export->finup;