MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / linux / scatterlist.h
blob4efbd9c445f5b3828590478cca2a3dac9c023d75
1 #ifndef _LINUX_SCATTERLIST_H
2 #define _LINUX_SCATTERLIST_H
4 #include <asm/scatterlist.h>
5 #include <linux/mm.h>
6 #include <linux/string.h>
8 static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
9 unsigned int buflen)
11 sg->page = virt_to_page(buf);
12 sg->offset = offset_in_page(buf);
13 sg->length = buflen;
16 static inline void sg_init_one(struct scatterlist *sg, const void *buf,
17 unsigned int buflen)
19 memset(sg, 0, sizeof(*sg));
20 sg_set_buf(sg, buf, buflen);
23 #endif /* _LINUX_SCATTERLIST_H */