aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/dma.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ieee1394/dma.h')
-rw-r--r--drivers/ieee1394/dma.h22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/ieee1394/dma.h b/drivers/ieee1394/dma.h
index a1682aba71c..2727bcd2419 100644
--- a/drivers/ieee1394/dma.h
+++ b/drivers/ieee1394/dma.h
@@ -66,35 +66,23 @@ struct dma_region {
66 int direction; 66 int direction;
67}; 67};
68 68
69/* clear out all fields but do not allocate anything */
70void dma_region_init(struct dma_region *dma); 69void dma_region_init(struct dma_region *dma);
71
72/* allocate the buffer and map it to the IOMMU */
73int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes, 70int dma_region_alloc(struct dma_region *dma, unsigned long n_bytes,
74 struct pci_dev *dev, int direction); 71 struct pci_dev *dev, int direction);
75
76/* unmap and free the buffer */
77void dma_region_free(struct dma_region *dma); 72void dma_region_free(struct dma_region *dma);
78
79/* sync the CPU's view of the buffer */
80void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset, 73void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset,
81 unsigned long len); 74 unsigned long len);
82
83/* sync the IO bus' view of the buffer */
84void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset, 75void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
85 unsigned long len); 76 unsigned long len);
86
87/* map the buffer into a user space process */
88int dma_region_mmap(struct dma_region *dma, struct file *file, 77int dma_region_mmap(struct dma_region *dma, struct file *file,
89 struct vm_area_struct *vma); 78 struct vm_area_struct *vma);
79dma_addr_t dma_region_offset_to_bus(struct dma_region *dma,
80 unsigned long offset);
90 81
91/* macro to index into a DMA region (or dma_prog_region) */ 82/**
83 * dma_region_i - macro to index into a DMA region (or dma_prog_region)
84 */
92#define dma_region_i(_dma, _type, _index) \ 85#define dma_region_i(_dma, _type, _index) \
93 ( ((_type*) ((_dma)->kvirt)) + (_index) ) 86 ( ((_type*) ((_dma)->kvirt)) + (_index) )
94 87
95/* return the DMA bus address of the byte with the given offset
96 * relative to the beginning of the dma_region */
97dma_addr_t dma_region_offset_to_bus(struct dma_region *dma,
98 unsigned long offset);
99
100#endif /* IEEE1394_DMA_H */ 88#endif /* IEEE1394_DMA_H */