How to DMA data from a pci device to a user buffer directly
Quoted 5 lines
5) My DMA controller has unlimited scatter-gather capability.
By the way, I have tested the rest of my code by DMA the image data to a kernel buffer allocated using
kmalloc()first, then do amemcpy()to copy the image data to a user buffer. This alternative seems to work fine.
Use mmap to make the kmalloc-ed buffer available to user application without the overhead of memcpy().
It is very wonderful that you can do s/g, so on the next stage you can kmalloc a bunch of blocks with small order (1) and use those instead of relying on bootmem allocation and Pauline's bigphysarea patch. Most older controllers cannot do it.
-- Pete