Streaming mapping has more constraints, and is different from coherent mapping for the following reasons:
- Mappings need to work with a buffer that has already been allocated.
- Mappings may accept several non-contiguous and scattered buffers.
- A mapped buffer belongs to the device and not to the CPU anymore. Before the CPU can use the buffer, it should be unmapped first (after dma_unmap_single() or dma_unmap_sg()). This is for caching purposes.
- For write transactions (CPU to device), the driver should place data in the buffer before the mapping.
- The direction the data should move has to be specified, and the data should only be used based on this direction.
One may wonder why one should not access the buffer until it ...