Lines Matching refs:sg

31 	struct scatterlist sg[0];  member
87 struct scatterlist *sg; in skcipher_free_async_sgls() local
97 for_each_sg(sgl, sg, n, i) in skcipher_free_async_sgls()
98 put_page(sg_page(sg)); in skcipher_free_async_sgls()
136 struct scatterlist *sg = NULL; in skcipher_alloc_sgl() local
140 sg = sgl->sg; in skcipher_alloc_sgl()
142 if (!sg || sgl->cur >= MAX_SGL_ENTS) { in skcipher_alloc_sgl()
144 sizeof(sgl->sg[0]) * (MAX_SGL_ENTS + 1), in skcipher_alloc_sgl()
149 sg_init_table(sgl->sg, MAX_SGL_ENTS + 1); in skcipher_alloc_sgl()
152 if (sg) in skcipher_alloc_sgl()
153 scatterwalk_sg_chain(sg, MAX_SGL_ENTS + 1, sgl->sg); in skcipher_alloc_sgl()
166 struct scatterlist *sg; in skcipher_pull_sgl() local
172 sg = sgl->sg; in skcipher_pull_sgl()
175 int plen = min_t(int, used, sg[i].length); in skcipher_pull_sgl()
177 if (!sg_page(sg + i)) in skcipher_pull_sgl()
180 sg[i].length -= plen; in skcipher_pull_sgl()
181 sg[i].offset += plen; in skcipher_pull_sgl()
186 if (sg[i].length) in skcipher_pull_sgl()
189 put_page(sg_page(sg + i)); in skcipher_pull_sgl()
190 sg_assign_page(sg + i, NULL); in skcipher_pull_sgl()
195 sizeof(*sgl) + sizeof(sgl->sg[0]) * in skcipher_pull_sgl()
354 struct scatterlist *sg; in skcipher_sendmsg() local
361 sg = sgl->sg + sgl->cur - 1; in skcipher_sendmsg()
363 PAGE_SIZE - sg->offset - sg->length); in skcipher_sendmsg()
365 err = memcpy_from_msg(page_address(sg_page(sg)) + in skcipher_sendmsg()
366 sg->offset + sg->length, in skcipher_sendmsg()
371 sg->length += len; in skcipher_sendmsg()
372 ctx->merge = (sg->offset + sg->length) & in skcipher_sendmsg()
394 sg = sgl->sg; in skcipher_sendmsg()
396 sg_unmark_end(sg + sgl->cur - 1); in skcipher_sendmsg()
401 sg_assign_page(sg + i, alloc_page(GFP_KERNEL)); in skcipher_sendmsg()
403 if (!sg_page(sg + i)) in skcipher_sendmsg()
406 err = memcpy_from_msg(page_address(sg_page(sg + i)), in skcipher_sendmsg()
409 __free_page(sg_page(sg + i)); in skcipher_sendmsg()
410 sg_assign_page(sg + i, NULL); in skcipher_sendmsg()
414 sg[i].length = plen; in skcipher_sendmsg()
423 sg_mark_end(sg + sgl->cur - 1); in skcipher_sendmsg()
472 sg_unmark_end(sgl->sg + sgl->cur - 1); in skcipher_sendpage()
474 sg_mark_end(sgl->sg + sgl->cur); in skcipher_sendpage()
476 sg_set_page(sgl->sg + sgl->cur, page, size, offset); in skcipher_sendpage()
493 struct scatterlist *sg; in skcipher_all_sg_nents() local
497 sg = sgl->sg; in skcipher_all_sg_nents()
499 while (!sg->length) in skcipher_all_sg_nents()
500 sg++; in skcipher_all_sg_nents()
502 nents += sg_nents(sg); in skcipher_all_sg_nents()
514 struct scatterlist *sg; in skcipher_recvmsg_async() local
533 sreq->tsg = kcalloc(tx_nents, sizeof(*sg), GFP_KERNEL); in skcipher_recvmsg_async()
555 sg = sgl->sg; in skcipher_recvmsg_async()
557 while (!sg->length) in skcipher_recvmsg_async()
558 sg++; in skcipher_recvmsg_async()
562 used = min_t(unsigned long, used, sg->length); in skcipher_recvmsg_async()
586 sg_set_page(sreq->tsg + txbufs++, sg_page(sg), sg->length, in skcipher_recvmsg_async()
587 sg->offset); in skcipher_recvmsg_async()
617 ablkcipher_request_set_crypt(req, sreq->tsg, sreq->first_sgl.sgl.sg, in skcipher_recvmsg_async()
644 struct scatterlist *sg; in skcipher_recvmsg_sync() local
653 sg = sgl->sg; in skcipher_recvmsg_sync()
655 while (!sg->length) in skcipher_recvmsg_sync()
656 sg++; in skcipher_recvmsg_sync()
678 ablkcipher_request_set_crypt(&ctx->req, sg, in skcipher_recvmsg_sync()
679 ctx->rsgl.sg, used, in skcipher_recvmsg_sync()