xref: /linux/rust/helpers/scatterlist.c (revision 07fdad3a93756b872da7b53647715c48d0f4a2d0)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/dma-direction.h>
4 
5 dma_addr_t rust_helper_sg_dma_address(struct scatterlist *sg)
6 {
7 	return sg_dma_address(sg);
8 }
9 
10 unsigned int rust_helper_sg_dma_len(struct scatterlist *sg)
11 {
12 	return sg_dma_len(sg);
13 }
14 
15 struct scatterlist *rust_helper_sg_next(struct scatterlist *sg)
16 {
17 	return sg_next(sg);
18 }
19 
20 void rust_helper_dma_unmap_sgtable(struct device *dev, struct sg_table *sgt,
21 				   enum dma_data_direction dir, unsigned long attrs)
22 {
23 	return dma_unmap_sgtable(dev, sgt, dir, attrs);
24 }
25