diff options
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 4470950892be..332030709623 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -60,6 +60,36 @@ static inline int is_device_dma_capable(struct device *dev) | |||
60 | 60 | ||
61 | extern u64 dma_get_required_mask(struct device *dev); | 61 | extern u64 dma_get_required_mask(struct device *dev); |
62 | 62 | ||
63 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | ||
64 | { | ||
65 | return dev->dma_parms ? dev->dma_parms->max_segment_size : 65536; | ||
66 | } | ||
67 | |||
68 | static inline unsigned int dma_set_max_seg_size(struct device *dev, | ||
69 | unsigned int size) | ||
70 | { | ||
71 | if (dev->dma_parms) { | ||
72 | dev->dma_parms->max_segment_size = size; | ||
73 | return 0; | ||
74 | } else | ||
75 | return -EIO; | ||
76 | } | ||
77 | |||
78 | static inline unsigned long dma_get_seg_boundary(struct device *dev) | ||
79 | { | ||
80 | return dev->dma_parms ? | ||
81 | dev->dma_parms->segment_boundary_mask : 0xffffffff; | ||
82 | } | ||
83 | |||
84 | static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask) | ||
85 | { | ||
86 | if (dev->dma_parms) { | ||
87 | dev->dma_parms->segment_boundary_mask = mask; | ||
88 | return 0; | ||
89 | } else | ||
90 | return -EIO; | ||
91 | } | ||
92 | |||
63 | /* flags for the coherent memory api */ | 93 | /* flags for the coherent memory api */ |
64 | #define DMA_MEMORY_MAP 0x01 | 94 | #define DMA_MEMORY_MAP 0x01 |
65 | #define DMA_MEMORY_IO 0x02 | 95 | #define DMA_MEMORY_IO 0x02 |