Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
dma_buf_ops Struct Reference

#include <dma-buf.h>

Data Fields

int(* attach )(struct dma_buf *, struct device *, struct dma_buf_attachment *)
 
void(* detach )(struct dma_buf *, struct dma_buf_attachment *)
 
struct sg_table *(* map_dma_buf )(struct dma_buf_attachment *, enum dma_data_direction)
 
void(* unmap_dma_buf )(struct dma_buf_attachment *, struct sg_table *, enum dma_data_direction)
 
void(* release )(struct dma_buf *)
 
int(* begin_cpu_access )(struct dma_buf *, size_t, size_t, enum dma_data_direction)
 
void(* end_cpu_access )(struct dma_buf *, size_t, size_t, enum dma_data_direction)
 
void *(* kmap_atomic )(struct dma_buf *, unsigned long)
 
void(* kunmap_atomic )(struct dma_buf *, unsigned long, void *)
 
void *(* kmap )(struct dma_buf *, unsigned long)
 
void(* kunmap )(struct dma_buf *, unsigned long, void *)
 
int(* mmap )(struct dma_buf *, struct vm_area_struct *vma)
 
void *(* vmap )(struct dma_buf *)
 
void(* vunmap )(struct dma_buf *, void *vaddr)
 

Detailed Description

struct dma_buf_ops - operations possible on struct dma_buf : [optional] allows different devices to 'attach' themselves to the given buffer. It might return -EBUSY to signal that backing storage is already allocated and incompatible with the requirements of requesting device. : [optional] detach a given device from this buffer. : returns list of scatter pages allocated, increases usecount of the buffer. Requires atleast one attach to be called before. Returned sg list should already be mapped into device address space. This call may sleep. May also return -EINTR. Should return -EINVAL if attach hasn't been called yet. : decreases usecount of buffer, might deallocate scatter pages. : release this buffer; to be called after the last dma_buf_put. : [optional] called before cpu access to invalidate cpu caches and allocate backing storage (if not yet done) respectively pin the objet into memory. : [optional] called after cpu access to flush cashes. : maps a page from the buffer into kernel address space, users may not block until the subsequent unmap call. This callback must not sleep. : [optional] unmaps a atomically mapped page from the buffer. This Callback must not sleep. : maps a page from the buffer into kernel address space. : [optional] unmaps a page from the buffer. : used to expose the backing storage to userspace. Note that the mapping needs to be coherent - if the exporter doesn't directly support this, it needs to fake coherency by shooting down any ptes when transitioning away from the cpu domain. : [optional] creates a virtual mapping for the buffer into kernel address space. Same restrictions as for vmap and friends apply. : [optional] unmaps a vmap from the buffer

Definition at line 72 of file dma-buf.h.

Field Documentation

Definition at line 73 of file dma-buf.h.

int(* begin_cpu_access)(struct dma_buf *, size_t, size_t, enum dma_data_direction)

Definition at line 94 of file dma-buf.h.

Definition at line 76 of file dma-buf.h.

void(* end_cpu_access)(struct dma_buf *, size_t, size_t, enum dma_data_direction)

Definition at line 96 of file dma-buf.h.

void*(* kmap)(struct dma_buf *, unsigned long)

Definition at line 100 of file dma-buf.h.

void*(* kmap_atomic)(struct dma_buf *, unsigned long)

Definition at line 98 of file dma-buf.h.

void(* kunmap)(struct dma_buf *, unsigned long, void *)

Definition at line 101 of file dma-buf.h.

void(* kunmap_atomic)(struct dma_buf *, unsigned long, void *)

Definition at line 99 of file dma-buf.h.

Definition at line 82 of file dma-buf.h.

Definition at line 103 of file dma-buf.h.

void(* release)(struct dma_buf *)

Definition at line 92 of file dma-buf.h.

Definition at line 84 of file dma-buf.h.

void*(* vmap)(struct dma_buf *)

Definition at line 105 of file dma-buf.h.

void(* vunmap)(struct dma_buf *, void *vaddr)

Definition at line 106 of file dma-buf.h.


The documentation for this struct was generated from the following file: