I am working on a device driver that has access to a distribution list (sg) item. I can extract data from it and save it in a dedicated buffer using sg_copy_to_buffer. Now my idea is to create a new scatter list and copy from this buffer to the new scatter list that I create (of course, this is done later) and return this new scatter list back to the kernel. (This refers to performance indicators, etc.) I tried searching the Internet for documentation to use a mailing list, etc., but to no avail. What I usually do:
char *buffer = kmalloc (***);
struct scatterlist *sglist = kmalloc (sizeof (struct scatterlist)...);
sg_init_one(sglist, buffer, BUFFER_SIZE);
sg_copy_to_buffer (inp_sglist, inp_sglist_len, buffer);
*** Later ***
sg_copy_from_buffer (sglist, 1, buffer);
Is there any good documentation that will help me map my scatter list to a virtual buffer? I tried to look at http://lwn.net/Articles/256368/
http://www.linuxjournal.com/article/7104
and others.
Any help or pointers would be appreciated!
source
share