List of loose builds in the Linux kernel driver

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!

+4
source share
1 answer

Typically, a user allocates a buffer in their virtual memory and then calls the device driver. When the user issues a record, you get sglist for the buffer with the record data and use it in sg_copy_to_buffer (). When the user displays a message, you get the sglist for the data buffer to read and use it in sg_copy_from_buffer ().

sglist - . , 10 . x86 IOMMU .

sglist - , sglist, .

+1

All Articles