LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   dma_map_sg (https://www.linuxquestions.org/questions/linux-kernel-70/dma_map_sg-4175608759/)

zvivered 06-27-2017 10:12 PM

dma_map_sg
 
Hello,

According to DMA-API.txt (4.1.13):

Quote:

With scatterlists, you use the resulting mapping like this:

int i, count = dma_map_sg(dev, sglist, nents, direction);
struct scatterlist *sg;

for_each_sg(sglist, sg, count, i) {
hw_address[i] = sg_dma_address(sg);
hw_len[i] = sg_dma_len(sg);
}

where nents is the number of entries in the sglist.
I have to implement a "write" from application to device driver.

The buffer passed to the driver is constructed from pages.

What is the value of "nents" ? How can I find it ?

Thank you,
Zvika

pan64 06-28-2017 06:48 AM

probably this helps a bit: http://www.linuxjournal.com/node/7104/print

zvivered 06-30-2017 05:59 AM

Thank you !


All times are GMT -5. The time now is 08:03 AM.