Lines Matching refs:sg
17 struct scatterlist **sg, in omap_crypto_copy_sg_lists() argument
20 int n = sg_nents(*sg); in omap_crypto_copy_sg_lists()
24 new_sg = kmalloc_array(n, sizeof(*sg), GFP_KERNEL); in omap_crypto_copy_sg_lists()
33 while (*sg && total) { in omap_crypto_copy_sg_lists()
34 int len = (*sg)->length; in omap_crypto_copy_sg_lists()
41 sg_set_page(tmp, sg_page(*sg), len, (*sg)->offset); in omap_crypto_copy_sg_lists()
47 *sg = sg_next(*sg); in omap_crypto_copy_sg_lists()
50 *sg = new_sg; in omap_crypto_copy_sg_lists()
55 static int omap_crypto_copy_sgs(int total, int bs, struct scatterlist **sg, in omap_crypto_copy_sgs() argument
73 scatterwalk_map_and_copy(buf, *sg, 0, total, 0); in omap_crypto_copy_sgs()
83 *sg = new_sg; in omap_crypto_copy_sgs()
88 static int omap_crypto_check_sg(struct scatterlist *sg, int total, int bs, in omap_crypto_check_sg() argument
97 while (sg) { in omap_crypto_check_sg()
100 if (!IS_ALIGNED(sg->offset, 4)) in omap_crypto_check_sg()
102 if (!IS_ALIGNED(sg->length, bs)) in omap_crypto_check_sg()
105 if (page_zonenum(sg_page(sg)) != ZONE_DMA) in omap_crypto_check_sg()
109 len += sg->length; in omap_crypto_check_sg()
110 sg = sg_next(sg); in omap_crypto_check_sg()
125 int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs, in omap_crypto_align_sg() argument
136 ret = omap_crypto_check_sg(*sg, total, bs, flags); in omap_crypto_align_sg()
139 ret = omap_crypto_copy_sgs(total, bs, sg, new_sg, flags); in omap_crypto_align_sg()
144 ret = omap_crypto_copy_sg_lists(total, bs, sg, new_sg, flags); in omap_crypto_align_sg()
150 sg_set_buf(new_sg, sg_virt(*sg), (*sg)->length); in omap_crypto_align_sg()
197 void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig, in omap_crypto_cleanup() argument
210 buf = sg_virt(sg); in omap_crypto_cleanup()
214 omap_crypto_copy_data(sg, orig, offset, len); in omap_crypto_cleanup()
219 kfree(sg); in omap_crypto_cleanup()