Lines Matching refs:sg
20 struct scatterlist **sg, in omap_crypto_copy_sg_lists() argument
23 int n = sg_nents(*sg); in omap_crypto_copy_sg_lists()
27 new_sg = kmalloc_array(n, sizeof(*sg), GFP_KERNEL); in omap_crypto_copy_sg_lists()
36 while (*sg && total) { in omap_crypto_copy_sg_lists()
37 int len = (*sg)->length; in omap_crypto_copy_sg_lists()
44 sg_set_page(tmp, sg_page(*sg), len, (*sg)->offset); in omap_crypto_copy_sg_lists()
50 *sg = sg_next(*sg); in omap_crypto_copy_sg_lists()
53 *sg = new_sg; in omap_crypto_copy_sg_lists()
58 static int omap_crypto_copy_sgs(int total, int bs, struct scatterlist **sg, in omap_crypto_copy_sgs() argument
76 scatterwalk_map_and_copy(buf, *sg, 0, total, 0); in omap_crypto_copy_sgs()
86 *sg = new_sg; in omap_crypto_copy_sgs()
91 static int omap_crypto_check_sg(struct scatterlist *sg, int total, int bs, in omap_crypto_check_sg() argument
100 while (sg) { in omap_crypto_check_sg()
103 if (!IS_ALIGNED(sg->offset, 4)) in omap_crypto_check_sg()
105 if (!IS_ALIGNED(sg->length, bs)) in omap_crypto_check_sg()
108 len += sg->length; in omap_crypto_check_sg()
109 sg = sg_next(sg); in omap_crypto_check_sg()
124 int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs, in omap_crypto_align_sg() argument
135 ret = omap_crypto_check_sg(*sg, total, bs, flags); in omap_crypto_align_sg()
138 ret = omap_crypto_copy_sgs(total, bs, sg, new_sg, flags); in omap_crypto_align_sg()
143 ret = omap_crypto_copy_sg_lists(total, bs, sg, new_sg, flags); in omap_crypto_align_sg()
149 sg_set_buf(new_sg, sg_virt(*sg), (*sg)->length); in omap_crypto_align_sg()
156 void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig, in omap_crypto_cleanup() argument
169 buf = sg_virt(sg); in omap_crypto_cleanup()
178 kfree(sg); in omap_crypto_cleanup()