Skip to contentSkip to conversation

How to DMA data from a pci device to a user buffer directly

DISCUSSION Pete Zaitcev 1 participant 1 message May 5, 2003 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
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 a memcpy() 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