• Home
  • Raw
  • Download

Lines Matching refs:sg

366 	struct scatterlist	*sg;  member
438 const struct scatterlist *sg) in s5p_set_dma_indata() argument
440 SSS_WRITE(dev, FCBRDMAS, sg_dma_address(sg)); in s5p_set_dma_indata()
441 SSS_WRITE(dev, FCBRDMAL, sg_dma_len(sg)); in s5p_set_dma_indata()
445 const struct scatterlist *sg) in s5p_set_dma_outdata() argument
447 SSS_WRITE(dev, FCBTDMAS, sg_dma_address(sg)); in s5p_set_dma_outdata()
448 SSS_WRITE(dev, FCBTDMAL, sg_dma_len(sg)); in s5p_set_dma_outdata()
451 static void s5p_free_sg_cpy(struct s5p_aes_dev *dev, struct scatterlist **sg) in s5p_free_sg_cpy() argument
455 if (!*sg) in s5p_free_sg_cpy()
459 free_pages((unsigned long)sg_virt(*sg), get_order(len)); in s5p_free_sg_cpy()
461 kfree(*sg); in s5p_free_sg_cpy()
462 *sg = NULL; in s5p_free_sg_cpy()
465 static void s5p_sg_copy_buf(void *buf, struct scatterlist *sg, in s5p_sg_copy_buf() argument
473 scatterwalk_start(&walk, sg); in s5p_sg_copy_buf()
541 static int s5p_set_outdata(struct s5p_aes_dev *dev, struct scatterlist *sg) in s5p_set_outdata() argument
543 if (!sg->length) in s5p_set_outdata()
546 if (!dma_map_sg(dev->dev, sg, 1, DMA_FROM_DEVICE)) in s5p_set_outdata()
549 dev->sg_dst = sg; in s5p_set_outdata()
554 static int s5p_set_indata(struct s5p_aes_dev *dev, struct scatterlist *sg) in s5p_set_indata() argument
556 if (!sg->length) in s5p_set_indata()
559 if (!dma_map_sg(dev->dev, sg, 1, DMA_TO_DEVICE)) in s5p_set_indata()
562 dev->sg_src = sg; in s5p_set_indata()
628 const struct scatterlist *sg) in s5p_set_dma_hashdata() argument
631 SSS_WRITE(dev, FCHRDMAS, sg_dma_address(sg)); in s5p_set_dma_hashdata()
632 SSS_WRITE(dev, FCHRDMAL, sg_dma_len(sg)); /* DMA starts */ in s5p_set_dma_hashdata()
988 cnt = dma_map_sg(dd->dev, ctx->sg, ctx->sg_len, DMA_TO_DEVICE); in s5p_hash_xmit_dma()
996 dd->hash_sg_iter = ctx->sg; in s5p_hash_xmit_dma()
1024 struct scatterlist *sg, unsigned int new_len) in s5p_hash_copy_sgs() argument
1042 scatterwalk_map_and_copy(buf + ctx->bufcnt, sg, ctx->skip, in s5p_hash_copy_sgs()
1046 ctx->sg = ctx->sgl; in s5p_hash_copy_sgs()
1070 struct scatterlist *sg, unsigned int new_len) in s5p_hash_copy_sg_lists() argument
1072 unsigned int skip = ctx->skip, n = sg_nents(sg); in s5p_hash_copy_sg_lists()
1079 ctx->sg = kmalloc_array(n, sizeof(*sg), GFP_KERNEL); in s5p_hash_copy_sg_lists()
1080 if (!ctx->sg) { in s5p_hash_copy_sg_lists()
1085 sg_init_table(ctx->sg, n); in s5p_hash_copy_sg_lists()
1087 tmp = ctx->sg; in s5p_hash_copy_sg_lists()
1097 while (sg && skip >= sg->length) { in s5p_hash_copy_sg_lists()
1098 skip -= sg->length; in s5p_hash_copy_sg_lists()
1099 sg = sg_next(sg); in s5p_hash_copy_sg_lists()
1102 while (sg && new_len) { in s5p_hash_copy_sg_lists()
1103 len = sg->length - skip; in s5p_hash_copy_sg_lists()
1108 sg_set_page(tmp, sg_page(sg), len, sg->offset + skip); in s5p_hash_copy_sg_lists()
1115 sg = sg_next(sg); in s5p_hash_copy_sg_lists()
1140 struct scatterlist *sg, in s5p_hash_prepare_sgs() argument
1145 struct scatterlist *sg_tmp = sg; in s5p_hash_prepare_sgs()
1147 if (!sg || !sg->length || !new_len) in s5p_hash_prepare_sgs()
1180 return s5p_hash_copy_sgs(ctx, sg, new_len); in s5p_hash_prepare_sgs()
1182 return s5p_hash_copy_sg_lists(ctx, sg, new_len); in s5p_hash_prepare_sgs()
1192 sg_chain(ctx->sgl, 2, sg); in s5p_hash_prepare_sgs()
1193 ctx->sg = ctx->sgl; in s5p_hash_prepare_sgs()
1196 ctx->sg = sg; in s5p_hash_prepare_sgs()
1281 ctx->sg = ctx->sgl; in s5p_hash_prepare_request()
1302 dma_unmap_sg(dd->dev, ctx->sg, ctx->sg_len, DMA_TO_DEVICE); in s5p_hash_update_dma_stop()
1333 free_pages((unsigned long)sg_virt(ctx->sg), in s5p_hash_finish_req()
1334 get_order(ctx->sg->length)); in s5p_hash_finish_req()
1337 kfree(ctx->sg); in s5p_hash_finish_req()
1339 ctx->sg = NULL; in s5p_hash_finish_req()
1833 static bool s5p_is_sg_aligned(struct scatterlist *sg) in s5p_is_sg_aligned() argument
1835 while (sg) { in s5p_is_sg_aligned()
1836 if (!IS_ALIGNED(sg->length, AES_BLOCK_SIZE)) in s5p_is_sg_aligned()
1838 sg = sg_next(sg); in s5p_is_sg_aligned()
1847 struct scatterlist *sg; in s5p_set_indata_start() local
1851 sg = req->src; in s5p_set_indata_start()
1852 if (!s5p_is_sg_aligned(sg)) { in s5p_set_indata_start()
1855 err = s5p_make_sg_cpy(dev, sg, &dev->sg_src_cpy); in s5p_set_indata_start()
1859 sg = dev->sg_src_cpy; in s5p_set_indata_start()
1862 err = s5p_set_indata(dev, sg); in s5p_set_indata_start()
1874 struct scatterlist *sg; in s5p_set_outdata_start() local
1878 sg = req->dst; in s5p_set_outdata_start()
1879 if (!s5p_is_sg_aligned(sg)) { in s5p_set_outdata_start()
1882 err = s5p_make_sg_cpy(dev, sg, &dev->sg_dst_cpy); in s5p_set_outdata_start()
1886 sg = dev->sg_dst_cpy; in s5p_set_outdata_start()
1889 err = s5p_set_outdata(dev, sg); in s5p_set_outdata_start()