Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
dmaengine.h File Reference
#include <linux/device.h>
#include <linux/uio.h>
#include <linux/bug.h>
#include <linux/scatterlist.h>
#include <linux/bitmap.h>
#include <linux/types.h>
#include <asm/page.h>

Go to the source code of this file.

Data Structures

struct  data_chunk
 
struct  dma_interleaved_template
 
struct  dma_cap_mask_t
 
struct  dma_chan_percpu
 
struct  dma_chan
 
struct  dma_chan_dev
 
struct  dma_slave_config
 
struct  dma_async_tx_descriptor
 
struct  dma_tx_state
 
struct  dma_device
 
struct  dma_page_list
 
struct  dma_pinned_list
 

Macros

#define DMA_MIN_COOKIE   1
 
#define DMA_MAX_COOKIE   INT_MAX
 
#define dma_submit_error(cookie)   ((cookie) < 0 ? 1 : 0)
 
#define DMA_HAS_PQ_CONTINUE   (1 << 15)
 
#define first_dma_cap(mask)   __first_dma_cap(&(mask))
 
#define next_dma_cap(n, mask)   __next_dma_cap((n), &(mask))
 
#define dma_cap_set(tx, mask)   __dma_cap_set((tx), &(mask))
 
#define dma_cap_clear(tx, mask)   __dma_cap_clear((tx), &(mask))
 
#define dma_cap_zero(mask)   __dma_cap_zero(&(mask))
 
#define dma_has_cap(tx, mask)   __dma_has_cap((tx), &(mask))
 
#define for_each_dma_cap_mask(cap, mask)
 
#define dma_async_memcpy_issue_pending(chan)   dma_async_issue_pending(chan)
 
#define dma_async_memcpy_complete(chan, cookie, last, used)   dma_async_is_tx_complete(chan, cookie, last, used)
 
#define dma_request_channel(mask, x, y)   __dma_request_channel(&(mask), x, y)
 

Typedefs

typedef s32 dma_cookie_t
 
typedef bool(* dma_filter_fn )(struct dma_chan *chan, void *filter_param)
 
typedef void(* dma_async_tx_callback )(void *dma_async_param)
 

Enumerations

enum  dma_status { DMA_SUCCESS, DMA_IN_PROGRESS, DMA_PAUSED, DMA_ERROR }
 
enum  dma_transaction_type {
  DMA_MEMCPY, DMA_XOR, DMA_PQ, DMA_XOR_VAL,
  DMA_PQ_VAL, DMA_MEMSET, DMA_INTERRUPT, DMA_SG,
  DMA_PRIVATE, DMA_ASYNC_TX, DMA_SLAVE, DMA_CYCLIC,
  DMA_INTERLEAVE, DMA_TX_TYPE_END
}
 
enum  dma_transfer_direction {
  DMA_MEM_TO_MEM, DMA_MEM_TO_DEV, DMA_DEV_TO_MEM, DMA_DEV_TO_DEV,
  DMA_TRANS_NONE
}
 
enum  dma_ctrl_flags {
  DMA_PREP_INTERRUPT = (1 << 0), DMA_CTRL_ACK = (1 << 1), DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3),
  DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), DMA_PREP_PQ_DISABLE_P = (1 << 6), DMA_PREP_PQ_DISABLE_Q = (1 << 7),
  DMA_PREP_CONTINUE = (1 << 8), DMA_PREP_FENCE = (1 << 9)
}
 
enum  dma_ctrl_cmd {
  DMA_TERMINATE_ALL, DMA_PAUSE, DMA_RESUME, DMA_SLAVE_CONFIG,
  FSLDMA_EXTERNAL_START
}
 
enum  sum_check_bits { SUM_CHECK_P = 0, SUM_CHECK_Q = 1 }
 
enum  sum_check_flags { SUM_CHECK_P_RESULT = (1 << SUM_CHECK_P), SUM_CHECK_Q_RESULT = (1 << SUM_CHECK_Q) }
 
enum  dma_slave_buswidth {
  DMA_SLAVE_BUSWIDTH_UNDEFINED = 0, DMA_SLAVE_BUSWIDTH_1_BYTE = 1, DMA_SLAVE_BUSWIDTH_2_BYTES = 2, DMA_SLAVE_BUSWIDTH_4_BYTES = 4,
  DMA_SLAVE_BUSWIDTH_8_BYTES = 8
}
 

Functions

void dma_chan_cleanup (struct kref *kref)
 
dma_cookie_t dma_async_memcpy_buf_to_buf (struct dma_chan *chan, void *dest, void *src, size_t len)
 
dma_cookie_t dma_async_memcpy_buf_to_pg (struct dma_chan *chan, struct page *page, unsigned int offset, void *kdata, size_t len)
 
dma_cookie_t dma_async_memcpy_pg_to_pg (struct dma_chan *chan, struct page *dest_pg, unsigned int dest_off, struct page *src_pg, unsigned int src_off, size_t len)
 
void dma_async_tx_descriptor_init (struct dma_async_tx_descriptor *tx, struct dma_chan *chan)
 
enum dma_status dma_sync_wait (struct dma_chan *chan, dma_cookie_t cookie)
 
int dma_async_device_register (struct dma_device *device)
 
void dma_async_device_unregister (struct dma_device *device)
 
void dma_run_dependencies (struct dma_async_tx_descriptor *tx)
 
struct dma_chandma_find_channel (enum dma_transaction_type tx_type)
 
struct dma_channet_dma_find_channel (void)
 
struct dma_pinned_listdma_pin_iovec_pages (struct iovec *iov, size_t len)
 
void dma_unpin_iovec_pages (struct dma_pinned_list *pinned_list)
 
dma_cookie_t dma_memcpy_to_iovec (struct dma_chan *chan, struct iovec *iov, struct dma_pinned_list *pinned_list, unsigned char *kdata, size_t len)
 
dma_cookie_t dma_memcpy_pg_to_iovec (struct dma_chan *chan, struct iovec *iov, struct dma_pinned_list *pinned_list, struct page *page, unsigned int offset, size_t len)
 

Macro Definition Documentation

#define dma_async_memcpy_complete (   chan,
  cookie,
  last,
  used 
)    dma_async_is_tx_complete(chan, cookie, last, used)

Definition at line 937 of file dmaengine.h.

#define dma_async_memcpy_issue_pending (   chan)    dma_async_issue_pending(chan)

Definition at line 910 of file dmaengine.h.

#define dma_cap_clear (   tx,
  mask 
)    __dma_cap_clear((tx), &(mask))

Definition at line 873 of file dmaengine.h.

#define dma_cap_set (   tx,
  mask 
)    __dma_cap_set((tx), &(mask))

Definition at line 866 of file dmaengine.h.

#define dma_cap_zero (   mask)    __dma_cap_zero(&(mask))

Definition at line 880 of file dmaengine.h.

#define dma_has_cap (   tx,
  mask 
)    __dma_has_cap((tx), &(mask))

Definition at line 886 of file dmaengine.h.

#define DMA_HAS_PQ_CONTINUE   (1 << 15)

Definition at line 551 of file dmaengine.h.

#define DMA_MAX_COOKIE   INT_MAX

Definition at line 39 of file dmaengine.h.

#define DMA_MIN_COOKIE   1

Definition at line 38 of file dmaengine.h.

#define dma_request_channel (   mask,
  x,
  y 
)    __dma_request_channel(&(mask), x, y)

Definition at line 1003 of file dmaengine.h.

#define dma_submit_error (   cookie)    ((cookie) < 0 ? 1 : 0)

Definition at line 41 of file dmaengine.h.

#define first_dma_cap (   mask)    __first_dma_cap(&(mask))

Definition at line 852 of file dmaengine.h.

#define for_each_dma_cap_mask (   cap,
  mask 
)
Value:
for ((cap) = first_dma_cap(mask); \
(cap) = next_dma_cap((cap), (mask)))

Definition at line 893 of file dmaengine.h.

#define next_dma_cap (   n,
  mask 
)    __next_dma_cap((n), &(mask))

Definition at line 859 of file dmaengine.h.

Typedef Documentation

typedef void(* dma_async_tx_callback)(void *dma_async_param)

Definition at line 394 of file dmaengine.h.

typedef s32 dma_cookie_t

typedef dma_cookie_t - an opaque DMA cookie

if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code

Definition at line 37 of file dmaengine.h.

typedef bool(* dma_filter_fn)(struct dma_chan *chan, void *filter_param)

typedef dma_filter_fn - callback filter for dma_request_channel : channel to be reviewed : opaque parameter passed through dma_request_channel

When this optional parameter is specified in a call to dma_request_channel a suitable channel is passed to this routine for further dispositioning before being returned. Where 'suitable' indicates a non-busy channel that satisfies the given capability mask. It returns 'true' to indicate that the channel is suitable.

Definition at line 392 of file dmaengine.h.

Enumeration Type Documentation

enum dma_ctrl_cmd - DMA operations that can optionally be exercised on a running channel. : terminate all ongoing transfers : pause ongoing transfers : resume paused transfer : this command is only implemented by DMA controllers that need to runtime reconfigure the slave channels (as opposed to passing configuration data in statically from the platform). An additional argument of struct dma_slave_config must be passed in with this command. : this command will put the Freescale DMA controller into external start mode.

Enumerator:
DMA_TERMINATE_ALL 
DMA_PAUSE 
DMA_RESUME 
DMA_SLAVE_CONFIG 
FSLDMA_EXTERNAL_START 

Definition at line 213 of file dmaengine.h.

enum dma_ctrl_flags - DMA flags to augment operation preparation, control completion, and communicate status. - trigger an interrupt (callback) upon completion of this transaction - if clear, the descriptor cannot be reused until the client acknowledges receipt, i.e. has has a chance to establish any dependency chains - set to disable dma-unmapping the source buffer(s) - set to disable dma-unmapping the destination(s) - set to do the source dma-unmapping as single (if not set, do the source dma-unmapping as page) - set to do the destination dma-unmapping as single (if not set, do the destination dma-unmapping as page) - prevent generation of P while generating Q - prevent generation of Q while generating P - indicate to a driver that it is reusing buffers as sources that were the result of a previous operation, in the case of a PQ operation it continues the calculation with new sources - tell the driver that subsequent operations depend on the result of this operation

Enumerator:
DMA_PREP_INTERRUPT 
DMA_CTRL_ACK 
DMA_COMPL_SKIP_SRC_UNMAP 
DMA_COMPL_SKIP_DEST_UNMAP 
DMA_COMPL_SRC_UNMAP_SINGLE 
DMA_COMPL_DEST_UNMAP_SINGLE 
DMA_PREP_PQ_DISABLE_P 
DMA_PREP_PQ_DISABLE_Q 
DMA_PREP_CONTINUE 
DMA_PREP_FENCE 

Definition at line 186 of file dmaengine.h.

enum dma_slave_buswidth - defines bus with of the DMA slave device, source or target buses

Enumerator:
DMA_SLAVE_BUSWIDTH_UNDEFINED 
DMA_SLAVE_BUSWIDTH_1_BYTE 
DMA_SLAVE_BUSWIDTH_2_BYTES 
DMA_SLAVE_BUSWIDTH_4_BYTES 
DMA_SLAVE_BUSWIDTH_8_BYTES 

Definition at line 305 of file dmaengine.h.

enum dma_status

enum dma_status - DMA transaction status : transaction completed successfully : transaction not yet processed : transaction is paused : transaction failed

Enumerator:
DMA_SUCCESS 
DMA_IN_PROGRESS 
DMA_PAUSED 
DMA_ERROR 

Definition at line 50 of file dmaengine.h.

enum dma_transaction_type - DMA transaction types/indexes

Note: The DMA_ASYNC_TX capability is not to be set by drivers. It is automatically set as dma devices are registered.

Enumerator:
DMA_MEMCPY 
DMA_XOR 
DMA_PQ 
DMA_XOR_VAL 
DMA_PQ_VAL 
DMA_MEMSET 
DMA_INTERRUPT 
DMA_SG 
DMA_PRIVATE 
DMA_ASYNC_TX 
DMA_SLAVE 
DMA_CYCLIC 
DMA_INTERLEAVE 
DMA_TX_TYPE_END 

Definition at line 63 of file dmaengine.h.

enum dma_transfer_direction - dma transfer mode and direction indicator : Async/Memcpy mode : Slave mode & From Memory to Device : Slave mode & From Device to Memory : Slave mode & From Device to Device

Enumerator:
DMA_MEM_TO_MEM 
DMA_MEM_TO_DEV 
DMA_DEV_TO_MEM 
DMA_DEV_TO_DEV 
DMA_TRANS_NONE 

Definition at line 88 of file dmaengine.h.

enum sum_check_bits - bit position of pq_check_flags

Enumerator:
SUM_CHECK_P 
SUM_CHECK_Q 

Definition at line 224 of file dmaengine.h.

enum pq_check_flags - result of async_{xor,pq}_zero_sum operations - 1 if xor zero sum error, 0 otherwise - 1 if reed-solomon zero sum error, 0 otherwise

Enumerator:
SUM_CHECK_P_RESULT 
SUM_CHECK_Q_RESULT 

Definition at line 234 of file dmaengine.h.

Function Documentation

int dma_async_device_register ( struct dma_device device)

dma_async_device_register - registers DMA devices found : &dma_device

Definition at line 688 of file dmaengine.c.

void dma_async_device_unregister ( struct dma_device device)

dma_async_device_unregister - unregister a DMA device : &dma_device

This routine is called by dma driver exit routines, dmaengine holds module references to prevent it being called while channels are in use.

Definition at line 834 of file dmaengine.c.

dma_cookie_t dma_async_memcpy_buf_to_buf ( struct dma_chan chan,
void dest,
void src,
size_t  len 
)

dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses : DMA channel to offload copy to : destination address (virtual) : source address (virtual) : length

Both and must be mappable to a bus address according to the DMA mapping API rules for streaming mappings. Both and must stay memory resident (kernel memory or locked user space pages).

Definition at line 869 of file dmaengine.c.

dma_cookie_t dma_async_memcpy_buf_to_pg ( struct dma_chan chan,
struct page page,
unsigned int  offset,
void kdata,
size_t  len 
)

Definition at line 917 of file dmaengine.c.

dma_cookie_t dma_async_memcpy_pg_to_pg ( struct dma_chan chan,
struct page dest_pg,
unsigned int  dest_off,
struct page src_pg,
unsigned int  src_off,
size_t  len 
)

dma_async_memcpy_pg_to_pg - offloaded copy from page to page : DMA channel to offload copy to : destination page : offset in page to copy to : source page : offset in page to copy from : length

Both / and / must be mappable to a bus address according to the DMA mapping API rules for streaming mappings. Both / and / must stay memory resident (kernel memory or locked user space pages).

Definition at line 964 of file dmaengine.c.

void dma_async_tx_descriptor_init ( struct dma_async_tx_descriptor tx,
struct dma_chan chan 
)

Definition at line 998 of file dmaengine.c.

void dma_chan_cleanup ( struct kref kref)
struct dma_chan* dma_find_channel ( enum dma_transaction_type  tx_type)
read

dma_find_channel - find a channel to carry out the operation : transaction type

Definition at line 331 of file dmaengine.c.

dma_cookie_t dma_memcpy_pg_to_iovec ( struct dma_chan chan,
struct iovec iov,
struct dma_pinned_list pinned_list,
struct page page,
unsigned int  offset,
size_t  len 
)

Definition at line 212 of file iovlock.c.

dma_cookie_t dma_memcpy_to_iovec ( struct dma_chan chan,
struct iovec iov,
struct dma_pinned_list pinned_list,
unsigned char kdata,
size_t  len 
)

Definition at line 151 of file iovlock.c.

struct dma_pinned_list* dma_pin_iovec_pages ( struct iovec iov,
size_t  len 
)
read

Definition at line 50 of file iovlock.c.

void dma_run_dependencies ( struct dma_async_tx_descriptor tx)

Definition at line 1035 of file dmaengine.c.

enum dma_status dma_sync_wait ( struct dma_chan chan,
dma_cookie_t  cookie 
)

Definition at line 257 of file dmaengine.c.

void dma_unpin_iovec_pages ( struct dma_pinned_list pinned_list)

Definition at line 124 of file iovlock.c.

struct dma_chan* net_dma_find_channel ( void  )
read

Definition at line 341 of file dmaengine.c.