dmaengine_prep_slave_sg

The interface has the following parameters.
  • Synopsis:
    static inline struct dma_async_tx_descriptor *
            dmaengine_prep_slave_sg(struct dma_chan *chan, 
                                    struct scatterlist *sgl,
                                    unsigned int sg_len,
                                    enum dma_transfer_direction dir,
                                    unsigned long flags)
    
  • Description: The interface is used to prepare a DMA transmission for the scattered buffer.
  • Parameter:
    • chan: The relevant DMA channel.
    • sgl: The address of the scattered transmission list. The list should be created before a scattered transmission.
    • dir: Transmission direction. For example:
      • DMA_MEM_TO_DEV: From memory to device.
      • DMA_DEV_TO_MEM: From device to memory.
    • flags: The macro definitions started with "DMA_PREP_", which provides additional information for the DMA Controller (DMAC) driver. For example:
      • DMA_PREP_INTERRUPT: The flag is used to inform DMAC that an interrupt will be generated after the transmission, so that DMAC will use the callback function from the client.
      • DMA_PREP_FENCE: The flag is used to inform DMAC that all the later transmissions rely on the success of the current transmission, so that DMAC will prioritize the DMA transmissions accordingly.
  • Return:
    • Success: A pointer to the transmission descriptor.
    • Failure: NULL.